skills/compact-guard/SKILL.md
Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction, restores after. Use before manual compact or when auto-compact triggers.
npx skillsauth add rohitg00/pro-workflow compact-guardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Protect important context through compaction cycles. Based on Claude Code internals: compaction restores max 5 files with 5K tokens each, within a 50K total budget.
Use before /compact or when auto-compact warning appears.
POST_COMPACT_MAX_FILES_TO_RESTORE = 5 — only 5 files survivePOST_COMPACT_TOKEN_BUDGET = 50K — total restore budgetPOST_COMPACT_MAX_TOKENS_PER_FILE = 5K — per-file limitcontext_window - 13K bufferBefore compacting, save these to memory or a scratch file:
Before full compaction, try microcompact:
After compaction, immediately:
| Strategy | Token Savings | When |
|----------|--------------|------|
| Delegate grep/search to subagent | 30-60% per search | Always for broad searches |
| Read only needed lines (offset/limit) | 50-90% per read | Large files |
| Compact at task boundaries | Preserves coherence | Between logical steps |
| Use /resume for fresh start | 100% | Unrelated new task |
After running compact-guard:
COMPACT GUARD
Files to preserve: [list top 5]
Task state: [one sentence]
Decisions: [key choices]
Next step: [immediate action after compact]
Ready to compact. Run /compact now.
devops
SkillOpt-flavored offline training loop for any SKILL.md. Treats accumulated learn-rule corrections as training trajectories, proposes bounded patches via an optimizer LLM, gates each candidate against a held-out validation set built from the user's own past corrections, and ships only candidates that demonstrably improve the score. Inspired by Microsoft SkillOpt's ReflACT pipeline (rollout → reflect → aggregate → select → update → evaluate) adapted to pro-workflow's SQLite store. Use when a skill has accumulated 8+ learn-rule rows and the user wants the skill itself to get better, not just longer.
tools
Prevent destructive operations using Claude Code hooks. Three modes — cautious (warn on dangerous commands), lockdown (restrict edits to one directory), and clear (remove restrictions). Uses PreToolUse matchers for Bash, Edit, and Write.
development
Complete AI coding workflow system. Orchestration patterns, 18 hook events, 5 agents, cross-agent support, reference guides, and searchable learnings. Works with Claude Code, Cursor, and 32+ agents.
data-ai
Analyze permission denial patterns and generate optimized alwaysAllow and alwaysDeny rules. Use when permission prompts are slowing you down or after sessions with many denials.