84 lines
2.6 KiB
Markdown
84 lines
2.6 KiB
Markdown
---
|
|
name: strategic-compact
|
|
description: Systematic context compaction for AI agents — reduce conversation history while preserving critical information. Use when conversation is long, context window is tight, or before handing off to another agent.
|
|
---
|
|
|
|
# Strategic Compaction
|
|
|
|
Based on ECC strategic-compact skill.
|
|
|
|
## When to Compact
|
|
|
|
- Conversation history exceeds 50% of context window
|
|
- Handing off to another agent (need condensed context)
|
|
- Long debugging session with many iterations
|
|
- Starting a new phase of work after long exploration
|
|
- Before spawning sub-agents (they get context via handoff)
|
|
|
|
## Compaction Strategy
|
|
|
|
### What to KEEP (high priority)
|
|
- User instructions and requirements
|
|
- Key decisions made and why
|
|
- Architecture/design choices
|
|
- Current state of work (what's done, what's next)
|
|
- Open questions and blockers
|
|
- File paths and code snippets that are actively being worked on
|
|
|
|
### What to REMOVE (low priority)
|
|
- Intermediate debugging steps that led nowhere
|
|
- Multiple attempts that were superseded
|
|
- Raw tool output that's been summarized
|
|
- Conversational filler
|
|
- Explored alternatives that were rejected (keep only the final decision)
|
|
- Old scratch work
|
|
|
|
### What to SUMMARIZE (medium priority, replace with brief summary)
|
|
- Long chain of reasoning → "Investigated X, found Y, decided Z because..."
|
|
- Multiple file reads → "Read 15 files in src/, key ones are A, B, C"
|
|
- Test output iterations → "Fixed 3 test failures: details in git log"
|
|
- API exploration → "Researched 3 libraries, chose X because..."
|
|
|
|
## Compaction Output Format
|
|
|
|
```
|
|
## Context Summary — [date/time]
|
|
|
|
### Project: [name]
|
|
**Current goal**: [what are we working on right now]
|
|
**Status**: [where we are]
|
|
|
|
### Key decisions:
|
|
1. [Decision] because [reason]
|
|
2. [Decision] because [reason]
|
|
|
|
### Current state:
|
|
- Done: [completed items]
|
|
- In progress: [what's being worked on]
|
|
- Next: [what comes after]
|
|
- Blocked by: [if any]
|
|
|
|
### Relevant files:
|
|
- [path/to/file]: [brief description of role]
|
|
- [path/to/file]: [brief description of role]
|
|
|
|
### Open questions:
|
|
- [question]? — [status: answered/pending/needs-input]
|
|
|
|
### Code context (brief snippets if critical):
|
|
- [key function signature or interface definition]
|
|
```
|
|
|
|
## Techniques
|
|
|
|
### Before Compacting
|
|
1. Write down everything important in a summary file
|
|
2. Commit if possible (git provides history)
|
|
3. Update any tracking files (MEMORY.md, memory/daily)
|
|
|
|
### After Compacting
|
|
1. Verify the summary has all key info
|
|
2. Check that the next step is clear
|
|
3. Ensure file paths and key names are preserved
|
|
4. Test if you can continue work from the summary alone
|