claude-symphony 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -12
- package/assets/claude_symphony.webp +0 -0
- package/assets/claude_symphony_ascii.txt +8 -0
- package/bin/create.js +80 -69
- package/package.json +3 -2
- package/template/.claude/commands/benchmark.md +32 -32
- package/template/.claude/commands/brainstorm.md +33 -33
- package/template/.claude/commands/checkpoint.md +42 -42
- package/template/.claude/commands/codex.md +52 -52
- package/template/.claude/commands/collaborate.md +47 -47
- package/template/.claude/commands/context.md +77 -77
- package/template/.claude/commands/deploy.md +50 -50
- package/template/.claude/commands/fork.md +46 -46
- package/template/.claude/commands/gemini.md +43 -43
- package/template/.claude/commands/handoff.md +42 -42
- package/template/.claude/commands/implement.md +42 -42
- package/template/.claude/commands/init-project.md +25 -25
- package/template/.claude/commands/next.md +67 -67
- package/template/.claude/commands/planning.md +38 -38
- package/template/.claude/commands/qa.md +47 -47
- package/template/.claude/commands/refactor.md +50 -50
- package/template/.claude/commands/research.md +31 -31
- package/template/.claude/commands/restore.md +53 -53
- package/template/.claude/commands/run-stage.md +45 -45
- package/template/.claude/commands/stages.md +49 -49
- package/template/.claude/commands/status.md +41 -41
- package/template/.claude/commands/tasks.md +33 -33
- package/template/.claude/commands/test.md +45 -45
- package/template/.claude/commands/ui-ux.md +31 -31
- package/template/.claude/commands/validate.md +81 -81
- package/template/.claude/hooks/ai-selector.sh +39 -39
- package/template/.claude/hooks/auto-checkpoint.sh +30 -30
- package/template/.claude/hooks/output-validator.sh +45 -45
- package/template/.claude/hooks/post-stage.sh +28 -28
- package/template/.claude/hooks/pre-stage.sh +47 -47
- package/template/.claude/hooks/session-start.sh +27 -27
- package/template/.claude/hooks/statusline.sh +24 -24
- package/template/.claude/hooks/stop.sh +26 -26
- package/template/.claude/settings.json +32 -32
- package/template/.claude/skills/ai-collaboration/README.md +31 -31
- package/template/.claude/skills/ai-collaboration/debate.md +66 -66
- package/template/.claude/skills/ai-collaboration/parallel.md +34 -34
- package/template/.claude/skills/ai-collaboration/prompts/CLAUDE.md +59 -63
- package/template/.claude/skills/auto-checkpoint/README.md +46 -46
- package/template/.claude/skills/auto-checkpoint/prompts/CLAUDE.md +68 -72
- package/template/.claude/skills/auto-checkpoint/rollback.md +95 -95
- package/template/.claude/skills/auto-checkpoint/trigger.md +37 -37
- package/template/.claude/skills/context-compression/README.md +69 -69
- package/template/.claude/skills/context-compression/analyze.md +74 -74
- package/template/.claude/skills/context-compression/compress.md +103 -103
- package/template/.claude/skills/context-compression/prompts/compression.md +78 -78
- package/template/.claude/skills/output-validator/README.md +33 -33
- package/template/.claude/skills/output-validator/prompts/CLAUDE.md +74 -78
- package/template/.claude/skills/output-validator/validate.md +76 -76
- package/template/.claude/skills/smart-handoff/README.md +35 -35
- package/template/.claude/skills/smart-handoff/extract.md +42 -42
- package/template/.claude/skills/smart-handoff/prompts/CLAUDE.md +52 -54
- package/template/.claude/skills/smart-handoff/summarize.md +55 -55
- package/template/.claude/skills/stage-transition/README.md +50 -50
- package/template/.claude/skills/stage-transition/handoff-gen.md +89 -89
- package/template/.claude/skills/stage-transition/prompts/transition.md +74 -74
- package/template/.claude/skills/stage-transition/validate.md +41 -41
- package/template/CLAUDE.md +334 -335
- package/template/config/ai_benchmarking.yaml +22 -22
- package/template/config/ai_collaboration.yaml +18 -18
- package/template/config/ai_logging.yaml +50 -50
- package/template/config/auto_checkpoint.yaml +32 -32
- package/template/config/context.yaml +20 -20
- package/template/config/git.yaml +51 -51
- package/template/config/handoff_intelligence.yaml +23 -23
- package/template/config/mcp_fallbacks.yaml +71 -71
- package/template/config/memory_integration.yaml +23 -23
- package/template/config/model_enforcement.yaml +53 -53
- package/template/config/models.yaml +24 -24
- package/template/config/output_validation.yaml +44 -44
- package/template/config/pipeline.yaml +25 -25
- package/template/config/pipeline_forking.yaml +40 -40
- package/template/config/qa_logging.yaml +67 -67
- package/template/config/smart_rollback.yaml +48 -48
- package/template/config/stage_personas.yaml +154 -154
- package/template/config/workflow.yaml +16 -16
- package/template/scripts/ai-benchmark.sh +41 -41
- package/template/scripts/codex-wrapper.sh +32 -32
- package/template/scripts/context-manager.sh +136 -136
- package/template/scripts/create-checkpoint.sh +34 -34
- package/template/scripts/gemini-wrapper.sh +31 -31
- package/template/scripts/init-project.sh +40 -40
- package/template/scripts/list-stages.sh +30 -30
- package/template/scripts/next-stage.sh +67 -67
- package/template/scripts/output-validate.sh +2 -2
- package/template/scripts/pipeline-fork.sh +68 -68
- package/template/scripts/pre-run-check.sh +84 -84
- package/template/scripts/restore-checkpoint.sh +50 -50
- package/template/scripts/run-stage.sh +44 -44
- package/template/scripts/show-status.sh +30 -30
- package/template/scripts/smart-handoff.sh +70 -70
- package/template/stages/01-brainstorm/CLAUDE.md +70 -74
- package/template/stages/01-brainstorm/README.md +54 -54
- package/template/stages/01-brainstorm/config.yaml +18 -18
- package/template/stages/01-brainstorm/prompts/collaboration.md +24 -24
- package/template/stages/01-brainstorm/prompts/ideation.md +41 -41
- package/template/stages/01-brainstorm/prompts/persona.md +50 -50
- package/template/stages/01-brainstorm/prompts/requirements.md +55 -55
- package/template/stages/01-brainstorm/prompts/validation.md +28 -28
- package/template/stages/01-brainstorm/templates/ideas.md +47 -47
- package/template/stages/01-brainstorm/templates/requirements_analysis.md +61 -61
- package/template/stages/02-research/CLAUDE.md +72 -76
- package/template/stages/02-research/config.yaml +12 -12
- package/template/stages/02-research/prompts/collaboration.md +29 -29
- package/template/stages/02-research/prompts/feasibility.md +38 -38
- package/template/stages/02-research/prompts/market_analysis.md +29 -29
- package/template/stages/02-research/prompts/tech_stack.md +34 -34
- package/template/stages/02-research/prompts/validation.md +29 -29
- package/template/stages/03-planning/CLAUDE.md +88 -92
- package/template/stages/03-planning/config.yaml +10 -10
- package/template/stages/03-planning/prompts/architecture.md +43 -43
- package/template/stages/03-planning/prompts/collaboration.md +34 -34
- package/template/stages/03-planning/prompts/validation.md +34 -34
- package/template/stages/04-ui-ux/CLAUDE.md +68 -72
- package/template/stages/04-ui-ux/config.yaml +5 -5
- package/template/stages/04-ui-ux/prompts/collaboration.md +35 -35
- package/template/stages/04-ui-ux/prompts/validation.md +30 -30
- package/template/stages/05-task-management/CLAUDE.md +81 -85
- package/template/stages/05-task-management/config.yaml +17 -17
- package/template/stages/05-task-management/prompts/collaboration.md +30 -30
- package/template/stages/05-task-management/prompts/validation.md +33 -33
- package/template/stages/05-task-management/templates/notion_integration.md +70 -70
- package/template/stages/05-task-management/templates/parallel_groups.yaml +64 -64
- package/template/stages/05-task-management/templates/task_schema.yaml +33 -33
- package/template/stages/06-implementation/CLAUDE.md +117 -121
- package/template/stages/06-implementation/config.yaml +10 -10
- package/template/stages/06-implementation/prompts/collaboration.md +29 -29
- package/template/stages/06-implementation/prompts/validation.md +36 -36
- package/template/stages/07-refactoring/CLAUDE.md +120 -124
- package/template/stages/07-refactoring/config.yaml +11 -11
- package/template/stages/07-refactoring/prompts/collaboration.md +36 -36
- package/template/stages/07-refactoring/prompts/validation.md +40 -40
- package/template/stages/08-qa/CLAUDE.md +80 -84
- package/template/stages/08-qa/config.yaml +7 -7
- package/template/stages/08-qa/prompts/collaboration.md +34 -34
- package/template/stages/08-qa/prompts/validation.md +41 -41
- package/template/stages/09-testing/CLAUDE.md +86 -90
- package/template/stages/09-testing/config.yaml +10 -10
- package/template/stages/09-testing/prompts/collaboration.md +38 -38
- package/template/stages/09-testing/prompts/validation.md +41 -41
- package/template/stages/10-deployment/CLAUDE.md +86 -90
- package/template/stages/10-deployment/config.yaml +11 -11
- package/template/stages/10-deployment/prompts/collaboration.md +37 -37
- package/template/stages/10-deployment/prompts/validation.md +54 -54
- package/template/stages/10-deployment/templates/github-actions-cd.yaml +1 -1
|
@@ -1,114 +1,114 @@
|
|
|
1
1
|
# Context Compression Skill
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A skill for monitoring token usage and compressing context.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Trigger Conditions
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This skill auto-activates under these conditions:
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
- 50,000
|
|
11
|
-
- 80,000
|
|
9
|
+
1. **Token threshold reached**
|
|
10
|
+
- 50,000 tokens (warning_threshold): Warning
|
|
11
|
+
- 80,000 tokens (limit_threshold): Compression required
|
|
12
12
|
|
|
13
|
-
2.
|
|
14
|
-
-
|
|
15
|
-
-
|
|
13
|
+
2. **On stage transition**
|
|
14
|
+
- Clean up previous stage context
|
|
15
|
+
- Keep only essential information
|
|
16
16
|
|
|
17
|
-
3.
|
|
18
|
-
- `/context --compress`
|
|
17
|
+
3. **Explicit call**
|
|
18
|
+
- `/context --compress` command
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Features
|
|
21
21
|
|
|
22
|
-
### 1.
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
22
|
+
### 1. Context Analysis (analyze.md)
|
|
23
|
+
- Estimate current token usage
|
|
24
|
+
- Categorize by type
|
|
25
|
+
- Identify compressible areas
|
|
26
26
|
|
|
27
|
-
### 2.
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
- state.md
|
|
27
|
+
### 2. Compression Execution (compress.md)
|
|
28
|
+
- Importance-based filtering
|
|
29
|
+
- Summary generation
|
|
30
|
+
- Save to state.md
|
|
31
31
|
|
|
32
|
-
### 3.
|
|
33
|
-
-
|
|
34
|
-
-
|
|
32
|
+
### 3. Recovery Support (prompts/compression.md)
|
|
33
|
+
- Load saved context
|
|
34
|
+
- Restore work state
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Skill File Structure
|
|
37
37
|
|
|
38
38
|
```
|
|
39
39
|
context-compression/
|
|
40
|
-
├── README.md #
|
|
41
|
-
├── analyze.md #
|
|
42
|
-
├── compress.md #
|
|
40
|
+
├── README.md # This file
|
|
41
|
+
├── analyze.md # Context analysis logic
|
|
42
|
+
├── compress.md # Compression logic
|
|
43
43
|
└── prompts/
|
|
44
|
-
└── compression.md #
|
|
44
|
+
└── compression.md # Compression prompts
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## Compression Strategy
|
|
48
48
|
|
|
49
|
-
###
|
|
50
|
-
- ✅
|
|
51
|
-
- ✅
|
|
52
|
-
- ✅
|
|
53
|
-
- ✅
|
|
54
|
-
- ✅
|
|
49
|
+
### Keep
|
|
50
|
+
- ✅ Decisions and rationale
|
|
51
|
+
- ✅ Requirements specification
|
|
52
|
+
- ✅ Architecture choices
|
|
53
|
+
- ✅ Current work state
|
|
54
|
+
- ✅ Error solutions (final)
|
|
55
55
|
|
|
56
|
-
###
|
|
57
|
-
- 📝
|
|
58
|
-
- 📝
|
|
59
|
-
- 📝
|
|
56
|
+
### Summarize
|
|
57
|
+
- 📝 Long discussion processes
|
|
58
|
+
- 📝 Exploration/investigation processes
|
|
59
|
+
- 📝 Multiple alternative comparisons
|
|
60
60
|
|
|
61
|
-
###
|
|
62
|
-
- ❌
|
|
63
|
-
- ❌
|
|
64
|
-
- ❌
|
|
65
|
-
- ❌
|
|
61
|
+
### Remove
|
|
62
|
+
- ❌ Error trial and error processes
|
|
63
|
+
- ❌ Repeated attempts
|
|
64
|
+
- ❌ Temporary output/logs
|
|
65
|
+
- ❌ Already applied code diffs
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## Usage Examples
|
|
68
68
|
|
|
69
|
-
###
|
|
69
|
+
### Auto Warning
|
|
70
70
|
|
|
71
71
|
```
|
|
72
|
-
⚠️
|
|
72
|
+
⚠️ Token Usage Warning
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
Current: ~52,000 tokens (exceeded 50,000)
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
1. /context --compress
|
|
78
|
-
2.
|
|
76
|
+
Recommended actions:
|
|
77
|
+
1. Run /context --compress
|
|
78
|
+
2. Or /clear then recover state.md
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Continuing will auto-save at 80,000.
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
###
|
|
83
|
+
### Manual Compression
|
|
84
84
|
|
|
85
85
|
```
|
|
86
86
|
/context --compress
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Compressing context...
|
|
89
89
|
|
|
90
|
-
[
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
90
|
+
[Analysis]
|
|
91
|
+
- Total tokens: ~65,000
|
|
92
|
+
- Decisions: ~5,000 (keep)
|
|
93
|
+
- Discussions: ~40,000 (summarize → 8,000)
|
|
94
|
+
- Error logs: ~20,000 (remove)
|
|
95
95
|
|
|
96
|
-
[
|
|
97
|
-
-
|
|
98
|
-
-
|
|
96
|
+
[Result]
|
|
97
|
+
- After compression: ~13,000 tokens
|
|
98
|
+
- Reduction: 80%
|
|
99
99
|
|
|
100
|
-
state/context/state.md
|
|
100
|
+
Saved to state/context/state.md
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
##
|
|
103
|
+
## Related Commands
|
|
104
104
|
|
|
105
|
-
- `/context` -
|
|
106
|
-
- `/context --compress` -
|
|
107
|
-
- `/context --save` -
|
|
105
|
+
- `/context` - Check context state
|
|
106
|
+
- `/context --compress` - Execute compression
|
|
107
|
+
- `/context --save` - Save snapshot
|
|
108
108
|
|
|
109
|
-
##
|
|
109
|
+
## Configuration
|
|
110
110
|
|
|
111
|
-
settings.json
|
|
111
|
+
Adjust thresholds in settings.json:
|
|
112
112
|
|
|
113
113
|
```json
|
|
114
114
|
{
|
|
@@ -1,114 +1,114 @@
|
|
|
1
1
|
# Context Analysis Logic
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Analyze current context to identify compression targets.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Analysis Process
|
|
6
6
|
|
|
7
|
-
### 1.
|
|
7
|
+
### 1. Token Estimation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Classify conversation content by category and estimate tokens:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
12
|
+
Token estimation formula:
|
|
13
|
+
- English: word count × 1.3
|
|
14
|
+
- Korean: character count × 0.5
|
|
15
|
+
- Code: line count × 10
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
### 2.
|
|
18
|
+
### 2. Category Classification
|
|
19
19
|
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
20
|
+
| Category | Importance | Handling |
|
|
21
|
+
|----------|-----------|----------|
|
|
22
|
+
| Decisions | High | Keep |
|
|
23
|
+
| Requirements | High | Keep |
|
|
24
|
+
| Architecture | High | Keep |
|
|
25
|
+
| Current work | High | Keep |
|
|
26
|
+
| Discussion/Exploration | Medium | Summarize |
|
|
27
|
+
| Code review | Medium | Summarize |
|
|
28
|
+
| Error logs | Low | Remove |
|
|
29
|
+
| Trial and error | Low | Remove |
|
|
30
30
|
|
|
31
|
-
### 3.
|
|
31
|
+
### 3. Identification Patterns
|
|
32
32
|
|
|
33
|
-
####
|
|
33
|
+
#### Decisions (Keep)
|
|
34
34
|
```
|
|
35
|
-
|
|
36
|
-
- "
|
|
37
|
-
- "
|
|
38
|
-
- "A
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
35
|
+
Keywords:
|
|
36
|
+
- "decided", "selected", "confirmed"
|
|
37
|
+
- "let's go with", "would be good"
|
|
38
|
+
- "A instead of B"
|
|
39
|
+
|
|
40
|
+
Structure:
|
|
41
|
+
- Decision content
|
|
42
|
+
- Selection reason
|
|
43
|
+
- Alternatives (briefly)
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
####
|
|
46
|
+
#### Discussion/Exploration (Summarize)
|
|
47
47
|
```
|
|
48
|
-
|
|
49
|
-
- "
|
|
50
|
-
- "
|
|
51
|
-
- "
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
48
|
+
Keywords:
|
|
49
|
+
- "let's look at", "review", "analyze"
|
|
50
|
+
- "option 1", "option 2"
|
|
51
|
+
- "what do you think?"
|
|
52
|
+
|
|
53
|
+
Compression:
|
|
54
|
+
- Keep only main points
|
|
55
|
+
- Emphasize final conclusion
|
|
56
|
+
- Omit intermediate process
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
####
|
|
59
|
+
#### Error/Trial and Error (Remove)
|
|
60
60
|
```
|
|
61
|
-
|
|
62
|
-
- "
|
|
63
|
-
- "
|
|
61
|
+
Keywords:
|
|
62
|
+
- "error", "failed", "fix"
|
|
63
|
+
- "try again"
|
|
64
64
|
- "TypeError", "SyntaxError"
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
66
|
+
Exceptions (Keep):
|
|
67
|
+
- Final solution
|
|
68
|
+
- Recurring issues
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
### 4.
|
|
71
|
+
### 4. Analysis Result Format
|
|
72
72
|
|
|
73
73
|
```
|
|
74
74
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
75
|
-
📊
|
|
75
|
+
📊 Context Analysis Results
|
|
76
76
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Estimated total tokens: ~65,000
|
|
79
79
|
|
|
80
|
-
[
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
[Distribution by Category]
|
|
81
|
+
Decisions ████░░░░░░░░░░░░ 5,000 (keep)
|
|
82
|
+
Requirements ██░░░░░░░░░░░░░░ 2,000 (keep)
|
|
83
|
+
Current work ███░░░░░░░░░░░░░ 3,000 (keep)
|
|
84
|
+
Discussion ████████████░░░░ 40,000 (→ 8,000 summarize)
|
|
85
|
+
Error logs █████░░░░░░░░░░░ 15,000 (remove)
|
|
86
86
|
|
|
87
|
-
[
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
87
|
+
[Compression Estimate]
|
|
88
|
+
- Before compression: 65,000 tokens
|
|
89
|
+
- After compression: 18,000 tokens
|
|
90
|
+
- Reduction: 72%
|
|
91
91
|
|
|
92
92
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
93
|
-
|
|
93
|
+
Compress? [Y/n]
|
|
94
94
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
##
|
|
97
|
+
## Auto Analysis Triggers
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
Auto analysis runs in these situations:
|
|
100
100
|
|
|
101
|
-
1.
|
|
102
|
-
2.
|
|
103
|
-
3.
|
|
101
|
+
1. **Token warning threshold reached** (50,000)
|
|
102
|
+
2. **Before stage transition**
|
|
103
|
+
3. **After long conversation** (20+ messages)
|
|
104
104
|
|
|
105
|
-
##
|
|
105
|
+
## Analysis Priorities
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Priority adjustment by stage:
|
|
108
108
|
|
|
109
|
-
|
|
|
110
|
-
|
|
111
|
-
| 01-03 |
|
|
112
|
-
| 04-05 |
|
|
113
|
-
| 06-07 |
|
|
114
|
-
| 08-10 |
|
|
109
|
+
| Stage | Keep Priority |
|
|
110
|
+
|-------|--------------|
|
|
111
|
+
| 01-03 | Decisions, Requirements |
|
|
112
|
+
| 04-05 | Design content, Tasks |
|
|
113
|
+
| 06-07 | Implementation decisions, Code patterns |
|
|
114
|
+
| 08-10 | Issues, Solutions |
|
|
@@ -1,175 +1,175 @@
|
|
|
1
1
|
# Context Compression Logic
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Compress context based on analysis results.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Compression Process
|
|
6
6
|
|
|
7
|
-
### 1.
|
|
7
|
+
### 1. Extract Content to Keep
|
|
8
8
|
|
|
9
9
|
```markdown
|
|
10
|
-
#
|
|
10
|
+
# Keep Items
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
12
|
+
## Decisions
|
|
13
|
+
- [Decision 1]: [Content] - [Reason]
|
|
14
|
+
- [Decision 2]: [Content] - [Reason]
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
- [
|
|
16
|
+
## Requirements
|
|
17
|
+
- [Requirements list]
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
- [
|
|
19
|
+
## Architecture
|
|
20
|
+
- [Major architecture choices]
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
22
|
+
## Current Work State
|
|
23
|
+
- Stage: [Current stage]
|
|
24
|
+
- Progress: [Completed/In progress/Pending]
|
|
25
|
+
- Next: [Next task]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
### 2.
|
|
28
|
+
### 2. Process Content to Summarize
|
|
29
29
|
|
|
30
|
-
####
|
|
30
|
+
#### Discussion Summary Strategy
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
AI: React
|
|
36
|
-
|
|
37
|
-
AI:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
Original:
|
|
34
|
+
User: Should we go with React or Vue?
|
|
35
|
+
AI: React's advantages are... Vue's advantages are... Comparing them...
|
|
36
|
+
User: The team has more React experience
|
|
37
|
+
AI: Then React would be better. The reason is...
|
|
38
|
+
User: Let's go with React
|
|
39
|
+
|
|
40
|
+
Compressed:
|
|
41
|
+
Tech stack discussion → React selected (based on team experience)
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
####
|
|
44
|
+
#### Code Review Summary
|
|
45
45
|
|
|
46
46
|
```
|
|
47
|
-
|
|
48
|
-
[
|
|
49
|
-
AI:
|
|
50
|
-
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
47
|
+
Original:
|
|
48
|
+
[Long code diff]
|
|
49
|
+
AI: This part needs optimization... [Detailed explanation]
|
|
50
|
+
[Modified code]
|
|
51
|
+
|
|
52
|
+
Compressed:
|
|
53
|
+
Code review complete: [filename] optimization applied
|
|
54
|
+
- Change: [Core changes]
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
### 3.
|
|
57
|
+
### 3. Content to Remove
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Items completely removed:
|
|
60
60
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
61
|
+
- Full error messages (keep only solutions)
|
|
62
|
+
- Failed attempt processes
|
|
63
|
+
- Temporary debugging output
|
|
64
|
+
- Duplicate code displays
|
|
65
65
|
|
|
66
|
-
### 4. state.md
|
|
66
|
+
### 4. Generate state.md
|
|
67
67
|
|
|
68
68
|
```markdown
|
|
69
|
-
#
|
|
69
|
+
# Work State Save - {{TIMESTAMP}}
|
|
70
70
|
|
|
71
|
-
##
|
|
71
|
+
## Current Stage
|
|
72
72
|
{{STAGE_ID}}: {{STAGE_NAME}}
|
|
73
73
|
|
|
74
|
-
##
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
74
|
+
## Progress
|
|
75
|
+
- Completed: {{COMPLETED_ITEMS}}
|
|
76
|
+
- In progress: {{CURRENT_ITEM}}
|
|
77
|
+
- Pending: {{PENDING_ITEMS}}
|
|
78
78
|
|
|
79
|
-
##
|
|
79
|
+
## Key Decisions
|
|
80
80
|
|
|
81
|
-
###
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
81
|
+
### Tech Stack
|
|
82
|
+
- Frontend: React + TypeScript
|
|
83
|
+
- Styling: Tailwind CSS
|
|
84
|
+
- State management: Zustand
|
|
85
85
|
|
|
86
|
-
###
|
|
87
|
-
-
|
|
88
|
-
-
|
|
86
|
+
### Architecture
|
|
87
|
+
- Component-based structure
|
|
88
|
+
- Feature-based folder organization
|
|
89
89
|
|
|
90
|
-
##
|
|
90
|
+
## Main Context
|
|
91
91
|
|
|
92
|
-
###
|
|
93
|
-
[
|
|
92
|
+
### Requirements Summary
|
|
93
|
+
[3-5 core requirements]
|
|
94
94
|
|
|
95
|
-
###
|
|
96
|
-
[
|
|
95
|
+
### Discussion Results Summary
|
|
96
|
+
[Key discussion results]
|
|
97
97
|
|
|
98
|
-
##
|
|
99
|
-
1.
|
|
100
|
-
2. stages/{{STAGE_ID}}/CLAUDE.md
|
|
101
|
-
3. {{CURRENT_TASK}}
|
|
98
|
+
## Recovery Instructions
|
|
99
|
+
1. Read this file
|
|
100
|
+
2. Reference stages/{{STAGE_ID}}/CLAUDE.md
|
|
101
|
+
3. Resume from {{CURRENT_TASK}}
|
|
102
102
|
|
|
103
|
-
##
|
|
103
|
+
## Reference Files
|
|
104
104
|
- progress.json
|
|
105
105
|
- stages/{{STAGE_ID}}/outputs/
|
|
106
|
-
-
|
|
106
|
+
- Latest HANDOFF.md
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
##
|
|
109
|
+
## Compression Execution
|
|
110
110
|
|
|
111
|
-
###
|
|
111
|
+
### Auto Compression (at 80k)
|
|
112
112
|
|
|
113
113
|
```
|
|
114
|
-
⚠️
|
|
114
|
+
⚠️ Token limit reached (80,000)
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
Executing auto compression...
|
|
117
117
|
|
|
118
|
-
[
|
|
119
|
-
✓
|
|
120
|
-
✓
|
|
121
|
-
✓ state.md
|
|
118
|
+
[Saving]
|
|
119
|
+
✓ Decisions extracted
|
|
120
|
+
✓ Current state saved
|
|
121
|
+
✓ state.md generated
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
Save complete: state/context/state.md
|
|
124
124
|
|
|
125
|
-
/clear
|
|
126
|
-
1. state/context/state.md
|
|
127
|
-
2.
|
|
125
|
+
To recover after /clear:
|
|
126
|
+
1. Read state/context/state.md
|
|
127
|
+
2. Resume work
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
###
|
|
130
|
+
### Manual Compression
|
|
131
131
|
|
|
132
132
|
```
|
|
133
133
|
/context --compress
|
|
134
134
|
|
|
135
|
-
[
|
|
135
|
+
[Analysis]
|
|
136
136
|
...
|
|
137
137
|
|
|
138
|
-
[
|
|
139
|
-
✓
|
|
140
|
-
✓
|
|
141
|
-
✓
|
|
138
|
+
[Compression Execution]
|
|
139
|
+
✓ Keep items extracted: 10,000 tokens
|
|
140
|
+
✓ Summaries generated: 5,000 tokens
|
|
141
|
+
✓ Unnecessary items removed: 50,000 tokens
|
|
142
142
|
|
|
143
|
-
[
|
|
144
|
-
-
|
|
145
|
-
-
|
|
143
|
+
[Result]
|
|
144
|
+
- Before compression: 65,000 tokens
|
|
145
|
+
- After compression: 15,000 tokens
|
|
146
146
|
|
|
147
|
-
state/context/state.md
|
|
147
|
+
Saved to state/context/state.md
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
##
|
|
150
|
+
## Recovery Process
|
|
151
151
|
|
|
152
|
-
### /clear
|
|
152
|
+
### Recovery After /clear
|
|
153
153
|
|
|
154
154
|
```
|
|
155
|
-
|
|
155
|
+
New session.
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
Would you like to recover previous context?
|
|
158
|
+
Saved state: state/context/state.md
|
|
159
159
|
|
|
160
|
-
[Y]
|
|
160
|
+
[Y] Recover / [N] Start fresh
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
###
|
|
163
|
+
### Load on Recovery
|
|
164
164
|
|
|
165
165
|
```
|
|
166
|
-
|
|
166
|
+
Recovering context...
|
|
167
167
|
|
|
168
|
-
[
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
168
|
+
[Loaded Information]
|
|
169
|
+
- Stage: 06-implementation
|
|
170
|
+
- Progress: Sprint 1 (3/5 tasks completed)
|
|
171
|
+
- Decisions: 5
|
|
172
|
+
- Next task: T004 User authentication implementation
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
Recovery complete. Continue working?
|
|
175
175
|
```
|