compound-agent 1.2.3 → 1.2.5
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/CHANGELOG.md +16 -1
- package/dist/cli.js +160 -124
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [1.2.4] - 2026-02-15
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **lfg.md delegates phases to slash commands**: Instead of inlining all 5 phase workflows (~80 lines), lfg.md now invokes `/compound:{brainstorm,plan,work,review,compound}`. This prevents phase instructions from being compacted away by late phases.
|
|
17
|
+
- **lfg.md slimmed to thin orchestrator**: Reduced from ~2200 to ~1324 characters. Removed inlined Purpose, Stop Conditions, and Memory Integration sections.
|
|
18
|
+
- **Phase gates relocated to individual commands**: PHASE GATE 3 moved to work.md, PHASE GATE 4 to review.md, FINAL GATE to compound.md — gates now survive compaction.
|
|
19
|
+
- **YAML frontmatter on all 13 command templates**: Each template now has name, description, and argument-hint metadata. lfg.md additionally uses `disable-model-invocation: true`.
|
|
20
|
+
- **Anti-MEMORY.md guardrails**: compound.md and review.md now explicitly warn against using MEMORY.md for lesson storage, directing Claude to use `memory_capture` MCP tool instead.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **Phase 5 context drift**: Claude no longer falls back to MEMORY.md during compound phase because each phase loads fresh instructions from its dedicated slash command.
|
|
25
|
+
|
|
12
26
|
## [1.2.1] - 2026-02-15
|
|
13
27
|
|
|
14
28
|
### Added
|
|
@@ -456,7 +470,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
456
470
|
- Vitest test suite
|
|
457
471
|
- tsup build configuration
|
|
458
472
|
|
|
459
|
-
[Unreleased]: https://github.com/Nathandela/learning_agent/compare/v1.2.
|
|
473
|
+
[Unreleased]: https://github.com/Nathandela/learning_agent/compare/v1.2.4...HEAD
|
|
474
|
+
[1.2.4]: https://github.com/Nathandela/learning_agent/compare/v1.2.1...v1.2.4
|
|
460
475
|
[1.2.1]: https://github.com/Nathandela/learning_agent/compare/v1.2.0...v1.2.1
|
|
461
476
|
[1.2.0]: https://github.com/Nathandela/learning_agent/compare/v1.1.0...v1.2.0
|
|
462
477
|
[1.1.0]: https://github.com/Nathandela/learning_agent/compare/v1.0.0...v1.1.0
|
package/dist/cli.js
CHANGED
|
@@ -2881,7 +2881,12 @@ var AGENT_TEMPLATES = {
|
|
|
2881
2881
|
|
|
2882
2882
|
// src/setup/templates/commands.ts
|
|
2883
2883
|
var WORKFLOW_COMMANDS = {
|
|
2884
|
-
"brainstorm.md":
|
|
2884
|
+
"brainstorm.md": `---
|
|
2885
|
+
name: compound:brainstorm
|
|
2886
|
+
description: Explore requirements through collaborative dialogue before committing to a plan
|
|
2887
|
+
argument-hint: "<goal or topic to brainstorm>"
|
|
2888
|
+
---
|
|
2889
|
+
$ARGUMENTS
|
|
2885
2890
|
|
|
2886
2891
|
# Brainstorm
|
|
2887
2892
|
|
|
@@ -2939,7 +2944,12 @@ Explore requirements through collaborative dialogue before committing to a plan.
|
|
|
2939
2944
|
- Create a beads epic from brainstorm conclusions with \`bd create --type=feature\`.
|
|
2940
2945
|
- If the brainstorm identifies sub-tasks, suggest creating them with \`bd create\`.
|
|
2941
2946
|
`,
|
|
2942
|
-
"plan.md":
|
|
2947
|
+
"plan.md": `---
|
|
2948
|
+
name: compound:plan
|
|
2949
|
+
description: Create a structured implementation plan with concrete tasks and dependencies
|
|
2950
|
+
argument-hint: "<goal or epic to plan>"
|
|
2951
|
+
---
|
|
2952
|
+
$ARGUMENTS
|
|
2943
2953
|
|
|
2944
2954
|
# Plan
|
|
2945
2955
|
|
|
@@ -2997,7 +3007,12 @@ If either is missing, CREATE THEM NOW. The plan is NOT complete without these ga
|
|
|
2997
3007
|
- Map dependencies with bd dep add (dependent) (blocker).
|
|
2998
3008
|
- Each task should include acceptance criteria in its description.
|
|
2999
3009
|
`,
|
|
3000
|
-
"work.md":
|
|
3010
|
+
"work.md": `---
|
|
3011
|
+
name: compound:work
|
|
3012
|
+
description: Execute implementation by delegating to an agent team
|
|
3013
|
+
argument-hint: "<task ID or description>"
|
|
3014
|
+
---
|
|
3015
|
+
$ARGUMENTS
|
|
3001
3016
|
|
|
3002
3017
|
# Work
|
|
3003
3018
|
|
|
@@ -3054,8 +3069,19 @@ for complex changes. For all changes, /implementation-reviewer is the minimum re
|
|
|
3054
3069
|
- Start with \`bd ready\` to pick work.
|
|
3055
3070
|
- Update status with bd update (id) --status=in_progress.
|
|
3056
3071
|
- Close with bd close (id) when all tests pass.
|
|
3072
|
+
|
|
3073
|
+
## PHASE GATE 3 -- MANDATORY
|
|
3074
|
+
Before starting Review, verify ALL work tasks are closed:
|
|
3075
|
+
- Run bd list with status in_progress -- must return empty
|
|
3076
|
+
- Run bd list with status open -- only Review and Compound tasks should remain
|
|
3077
|
+
If any work tasks remain open, DO NOT proceed. Complete them first.
|
|
3057
3078
|
`,
|
|
3058
|
-
"review.md":
|
|
3079
|
+
"review.md": `---
|
|
3080
|
+
name: compound:review
|
|
3081
|
+
description: Multi-agent code review with severity classification and mandatory gate
|
|
3082
|
+
argument-hint: "<scope or git diff range>"
|
|
3083
|
+
---
|
|
3084
|
+
$ARGUMENTS
|
|
3059
3085
|
|
|
3060
3086
|
# Review
|
|
3061
3087
|
|
|
@@ -3098,6 +3124,7 @@ Multi-agent code review with severity classification and a mandatory \`/implemen
|
|
|
3098
3124
|
- **pattern-matcher** auto-reinforces recurring findings via \`memory_capture\`.
|
|
3099
3125
|
- **cct-reviewer** reads \`.claude/lessons/cct-patterns.jsonl\` for known Claude mistakes.
|
|
3100
3126
|
- After review, call \`memory_capture\` with \`type=solution\` to store the review report.
|
|
3127
|
+
- **CRITICAL**: Use \`memory_capture\` MCP tool for ALL lesson storage -- NOT MEMORY.md.
|
|
3101
3128
|
|
|
3102
3129
|
## Docs Integration
|
|
3103
3130
|
- **docs-reviewer** checks code changes align with \`docs/\` and existing ADRs.
|
|
@@ -3106,14 +3133,27 @@ Multi-agent code review with severity classification and a mandatory \`/implemen
|
|
|
3106
3133
|
## Beads Integration
|
|
3107
3134
|
- Create \`bd\` issues for P1 and P2 findings with \`bd create\`.
|
|
3108
3135
|
- Close related issues with \`bd close\` when findings are resolved.
|
|
3136
|
+
|
|
3137
|
+
## PHASE GATE 4 -- MANDATORY
|
|
3138
|
+
Before starting Compound, verify review is complete:
|
|
3139
|
+
- /implementation-reviewer must have returned APPROVED
|
|
3140
|
+
- All P1 findings must be resolved
|
|
3109
3141
|
`,
|
|
3110
|
-
"compound.md":
|
|
3142
|
+
"compound.md": `---
|
|
3143
|
+
name: compound:compound
|
|
3144
|
+
description: Capture high-quality lessons from completed work into the memory system
|
|
3145
|
+
argument-hint: "<topic or epic context>"
|
|
3146
|
+
---
|
|
3147
|
+
$ARGUMENTS
|
|
3111
3148
|
|
|
3112
3149
|
# Compound
|
|
3113
3150
|
|
|
3114
3151
|
## Purpose
|
|
3115
3152
|
Multi-agent analysis to capture high-quality lessons from completed work into the memory system and update project documentation.
|
|
3116
3153
|
|
|
3154
|
+
**CRITICAL**: Store all lessons via \`memory_capture\` MCP tool -- NOT via MEMORY.md, NOT via markdown files.
|
|
3155
|
+
Lessons go to \`.claude/lessons/index.jsonl\` through the MCP tool. MEMORY.md is a different system and MUST NOT be used for compounding.
|
|
3156
|
+
|
|
3117
3157
|
## Workflow
|
|
3118
3158
|
1. Parse what was done from the arguments above or recent git history (\`git diff\`, \`git log\`).
|
|
3119
3159
|
2. Call \`memory_search\` with the topic to check what is already known (avoid duplicates).
|
|
@@ -3162,118 +3202,53 @@ Multi-agent analysis to capture high-quality lessons from completed work into th
|
|
|
3162
3202
|
## Beads Integration
|
|
3163
3203
|
- Check \`bd ready\` for related open issues.
|
|
3164
3204
|
- Close resolved issues with \`bd close\`.
|
|
3165
|
-
`,
|
|
3166
|
-
"lfg.md": `$ARGUMENTS
|
|
3167
|
-
|
|
3168
|
-
# LFG (Full Cycle)
|
|
3169
|
-
|
|
3170
|
-
## Purpose
|
|
3171
|
-
Chain all phases: brainstorm, plan, work, review, compound. End-to-end delivery.
|
|
3172
|
-
|
|
3173
|
-
## Workflow
|
|
3174
|
-
1. **Brainstorm phase**: Explore the goal stated above.
|
|
3175
|
-
- MEMORY CHECK: Call \`memory_search\` with the current goal/task. Display results to user. If relevant items found, state which ones apply and why. If none found, state "No relevant lessons found."
|
|
3176
|
-
- Call \`memory_search\` with the goal.
|
|
3177
|
-
- \`TeamCreate\` team "brainstorm-<slug>", spawn docs-explorer + code-explorer as parallel teammates.
|
|
3178
|
-
- Ask clarifying questions via \`AskUserQuestion\`, explore alternatives.
|
|
3179
|
-
- Auto-create ADRs for significant decisions in \`docs/decisions/\`.
|
|
3180
|
-
- Create a beads epic from conclusions with \`bd create --type=feature\`.
|
|
3181
|
-
- Shut down brainstorm team before next phase.
|
|
3182
|
-
- Update epic phase state: bd update (epic-id) --notes="Phase: brainstorm COMPLETE, Next: plan"
|
|
3183
|
-
|
|
3184
|
-
2. **Plan phase**: Structure the work.
|
|
3185
|
-
- MEMORY CHECK: Call \`memory_search\` with the current goal/task. Display results to user. If relevant items found, state which ones apply and why. If none found, state "No relevant lessons found."
|
|
3186
|
-
- Check for brainstorm epic via \`bd list\`.
|
|
3187
|
-
- \`TeamCreate\` team "plan-<slug>", spawn docs-analyst + repo-analyst + memory-analyst as parallel teammates.
|
|
3188
|
-
- Break into tasks with dependencies and acceptance criteria.
|
|
3189
|
-
- Create beads issues with \`bd create\` and map dependencies with \`bd dep add\`.
|
|
3190
|
-
- Create review and compound blocking tasks (\`bd create\` + \`bd dep add\`) so they survive compaction and surface via \`bd ready\` after work completes.
|
|
3191
|
-
- Shut down plan team before next phase.
|
|
3192
|
-
- Update epic phase state: bd update (epic-id) --notes="Phase: plan COMPLETE, Next: work"
|
|
3193
|
-
|
|
3194
|
-
3. **Work phase**: Implement with adaptive TDD.
|
|
3195
|
-
- MEMORY CHECK: Call \`memory_search\` with the current goal/task. Display results to user. If relevant items found, state which ones apply and why. If none found, state "No relevant lessons found."
|
|
3196
|
-
- Assess complexity (trivial/simple/complex) to choose strategy.
|
|
3197
|
-
- Trivial: single subagent, no team. Simple/complex: \`TeamCreate\` team "work-<task-id>".
|
|
3198
|
-
- Spawn test-analyst first, then test-writer + implementer as teammates.
|
|
3199
|
-
- Call \`memory_search\` per subtask; \`memory_capture\` after corrections.
|
|
3200
|
-
- Commit incrementally. Close tasks as they complete.
|
|
3201
|
-
- Run verification gate before marking complete. Shut down work team.
|
|
3202
|
-
- Update epic phase state: bd update (epic-id) --notes="Phase: work COMPLETE, Next: review"
|
|
3203
|
-
|
|
3204
|
-
## PHASE GATE 3->4 -- MANDATORY
|
|
3205
|
-
Before starting Review, verify ALL work tasks are closed:
|
|
3206
|
-
- Run \`bd list --status=in_progress\` \u2014 must return empty
|
|
3207
|
-
- Run \`bd list --status=open\` \u2014 only Review and Compound tasks should remain
|
|
3208
|
-
If any work tasks remain open, DO NOT proceed. Complete them first.
|
|
3209
|
-
Update epic phase: bd update (epic-id) --notes="Phase: work COMPLETE, Next: review"
|
|
3210
|
-
|
|
3211
|
-
4. **Review phase**: 11-agent review with severity classification.
|
|
3212
|
-
- MEMORY CHECK: Call \`memory_search\` with the current goal/task. Display results to user. If relevant items found, state which ones apply and why. If none found, state "No relevant lessons found."
|
|
3213
|
-
- Run quality gates first: pnpm test, then pnpm lint.
|
|
3214
|
-
- \`TeamCreate\` team "review-<slug>", spawn all 11 reviewers as parallel teammates.
|
|
3215
|
-
- Classify findings as P1 (critical/blocking), P2 (important), P3 (minor).
|
|
3216
|
-
- P1 findings must be fixed before proceeding \u2014 they block completion.
|
|
3217
|
-
- Submit to \`/implementation-reviewer\` as the mandatory gate. Shut down review team.
|
|
3218
|
-
- Update epic phase state: bd update (epic-id) --notes="Phase: review COMPLETE, Next: compound"
|
|
3219
|
-
|
|
3220
|
-
## PHASE GATE 4->5 -- MANDATORY
|
|
3221
|
-
Before starting Compound, verify review is complete:
|
|
3222
|
-
- /implementation-reviewer must have returned APPROVED
|
|
3223
|
-
- All P1 findings must be resolved
|
|
3224
|
-
Update epic phase: bd update (epic-id) --notes="Phase: review COMPLETE, Next: compound"
|
|
3225
|
-
|
|
3226
|
-
5. **Compound phase**: Capture learnings.
|
|
3227
|
-
- MEMORY CHECK: Call \`memory_search\` with the current goal/task. Display results to user. If relevant items found, state which ones apply and why. If none found, state "No relevant lessons found."
|
|
3228
|
-
- \`TeamCreate\` team "compound-<slug>", spawn 6 analysis agents as parallel teammates.
|
|
3229
|
-
- Search first with \`memory_search\` to avoid duplicates. Apply quality filters (novelty + specificity).
|
|
3230
|
-
- Store novel insights via \`memory_capture\` with supersedes/related links.
|
|
3231
|
-
- Update outdated docs and deprecate superseded ADRs.
|
|
3232
|
-
- Use \`AskUserQuestion\` to confirm high-severity items. Shut down compound team.
|
|
3233
|
-
- Update epic phase state: bd update (epic-id) --notes="Phase: compound COMPLETE, Next: close"
|
|
3234
3205
|
|
|
3235
3206
|
## FINAL GATE -- EPIC CLOSURE
|
|
3236
3207
|
Before closing the epic:
|
|
3237
|
-
- Run ca verify-gates (epic-id)
|
|
3238
|
-
- Run
|
|
3239
|
-
- Run
|
|
3208
|
+
- Run ca verify-gates (epic-id) -- must return PASS for both gates
|
|
3209
|
+
- Run pnpm test -- must pass
|
|
3210
|
+
- Run pnpm lint -- must pass
|
|
3240
3211
|
If verify-gates fails, the missing phase was SKIPPED. Go back and complete it.
|
|
3241
3212
|
CRITICAL: 3/5 phases is NOT success. All 5 phases are required.
|
|
3213
|
+
`,
|
|
3214
|
+
"lfg.md": `---
|
|
3215
|
+
name: compound:lfg
|
|
3216
|
+
description: Full workflow cycle chaining brainstorm, plan, work, review, and compound phases
|
|
3217
|
+
argument-hint: "<goal>"
|
|
3218
|
+
disable-model-invocation: true
|
|
3219
|
+
---
|
|
3220
|
+
$ARGUMENTS
|
|
3242
3221
|
|
|
3243
|
-
|
|
3244
|
-
Each phase creates its own AgentTeam via \`TeamCreate\`, spawns teammates via \`Task\` tool with \`team_name\`, coordinates via \`SendMessage\`, and shuts down with \`shutdown_request\` before the next phase starts. Use subagents (Task without team_name) only for quick lookups like \`memory_search\` or \`bd\` commands.
|
|
3245
|
-
|
|
3246
|
-
## Phase Control
|
|
3247
|
-
- **Skip phases**: If the arguments above contain "from <phase>" (e.g., "from plan"), skip all phases before the named one.
|
|
3248
|
-
- **Progress**: Announce the current phase before starting it (e.g., "[Phase 2/5] Plan").
|
|
3249
|
-
- **Retry**: If a phase fails, report the failure and ask the user whether to retry, skip, or abort.
|
|
3250
|
-
- **Resume**: After interruption, run bd show (epic-id) and read the notes field for current phase state. Resume from that phase. If no phase state, check \`bd list --status=in_progress\` to infer.
|
|
3222
|
+
# LFG (Full Cycle)
|
|
3251
3223
|
|
|
3252
|
-
##
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3224
|
+
## Workflow
|
|
3225
|
+
1. **Brainstorm**: /compound:brainstorm with the goal. Update: bd update (epic-id) --notes="Phase: brainstorm COMPLETE, Next: plan"
|
|
3226
|
+
2. **Plan**: /compound:plan with conclusions. Update: bd update (epic-id) --notes="Phase: plan COMPLETE, Next: work"
|
|
3227
|
+
3. **Work**: /compound:work (finds tasks via bd ready). Update: bd update (epic-id) --notes="Phase: work COMPLETE, Next: review"
|
|
3228
|
+
4. **Review**: /compound:review on changed code. Update: bd update (epic-id) --notes="Phase: review COMPLETE, Next: compound"
|
|
3229
|
+
5. **Compound**: /compound:compound to capture learnings (via memory_capture, NOT MEMORY.md). Update: bd update (epic-id) --notes="Phase: compound COMPLETE, Next: close"
|
|
3256
3230
|
|
|
3257
|
-
##
|
|
3258
|
-
-
|
|
3259
|
-
-
|
|
3231
|
+
## Phase Control
|
|
3232
|
+
- Skip: "from <phase>" in arguments skips earlier phases.
|
|
3233
|
+
- Resume: bd show (epic-id), read notes field for phase state.
|
|
3234
|
+
- Progress: announce "[Phase N/5] Name" before each phase.
|
|
3260
3235
|
|
|
3261
3236
|
## SESSION CLOSE -- INVIOLABLE
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
5. git add (specific files) -- Stage (never git add .)
|
|
3268
|
-
6. bd sync -- Sync beads
|
|
3269
|
-
7. git commit -- Commit with descriptive message
|
|
3270
|
-
8. git push -- Push to remote
|
|
3271
|
-
If ANY step fails, fix it. Work is NOT done until git push succeeds.
|
|
3237
|
+
1. ca verify-gates (epic-id)
|
|
3238
|
+
2. pnpm test -- all green
|
|
3239
|
+
3. pnpm lint -- zero violations
|
|
3240
|
+
4. git status, git add (specific files), bd sync, git commit, git push
|
|
3241
|
+
Work is NOT done until git push succeeds.
|
|
3272
3242
|
`,
|
|
3273
3243
|
// =========================================================================
|
|
3274
3244
|
// Utility commands (CLI wrappers)
|
|
3275
3245
|
// =========================================================================
|
|
3276
|
-
"learn.md":
|
|
3246
|
+
"learn.md": `---
|
|
3247
|
+
name: compound:learn
|
|
3248
|
+
description: Capture a lesson from this session into the memory system
|
|
3249
|
+
argument-hint: "<insight to remember>"
|
|
3250
|
+
---
|
|
3251
|
+
Capture a lesson from this session.
|
|
3277
3252
|
|
|
3278
3253
|
Usage: /compound learn <insight>
|
|
3279
3254
|
|
|
@@ -3285,7 +3260,12 @@ Examples:
|
|
|
3285
3260
|
npx ca learn "$ARGUMENTS"
|
|
3286
3261
|
\`\`\`
|
|
3287
3262
|
`,
|
|
3288
|
-
"search.md":
|
|
3263
|
+
"search.md": `---
|
|
3264
|
+
name: compound:search
|
|
3265
|
+
description: Search stored lessons for relevant context
|
|
3266
|
+
argument-hint: "<search query>"
|
|
3267
|
+
---
|
|
3268
|
+
Search lessons for relevant context.
|
|
3289
3269
|
|
|
3290
3270
|
Usage: /compound search <query>
|
|
3291
3271
|
|
|
@@ -3299,19 +3279,32 @@ npx ca search "$ARGUMENTS"
|
|
|
3299
3279
|
|
|
3300
3280
|
Note: You can also use the \`memory_search\` MCP tool directly.
|
|
3301
3281
|
`,
|
|
3302
|
-
"list.md":
|
|
3282
|
+
"list.md": `---
|
|
3283
|
+
name: compound:list
|
|
3284
|
+
description: Show all stored lessons
|
|
3285
|
+
---
|
|
3286
|
+
Show all stored lessons.
|
|
3303
3287
|
|
|
3304
3288
|
\`\`\`bash
|
|
3305
3289
|
npx ca list
|
|
3306
3290
|
\`\`\`
|
|
3307
3291
|
`,
|
|
3308
|
-
"prime.md":
|
|
3292
|
+
"prime.md": `---
|
|
3293
|
+
name: compound:prime
|
|
3294
|
+
description: Load compound-agent workflow context after compaction or context loss
|
|
3295
|
+
---
|
|
3296
|
+
Load compound-agent workflow context after compaction or context loss.
|
|
3309
3297
|
|
|
3310
3298
|
\`\`\`bash
|
|
3311
3299
|
npx ca prime
|
|
3312
3300
|
\`\`\`
|
|
3313
3301
|
`,
|
|
3314
|
-
"show.md":
|
|
3302
|
+
"show.md": `---
|
|
3303
|
+
name: compound:show
|
|
3304
|
+
description: Show details of a specific lesson
|
|
3305
|
+
argument-hint: "<lesson-id>"
|
|
3306
|
+
---
|
|
3307
|
+
Show details of a specific lesson.
|
|
3315
3308
|
|
|
3316
3309
|
Usage: /compound show <lesson-id>
|
|
3317
3310
|
|
|
@@ -3319,7 +3312,12 @@ Usage: /compound show <lesson-id>
|
|
|
3319
3312
|
npx ca show "$ARGUMENTS"
|
|
3320
3313
|
\`\`\`
|
|
3321
3314
|
`,
|
|
3322
|
-
"wrong.md":
|
|
3315
|
+
"wrong.md": `---
|
|
3316
|
+
name: compound:wrong
|
|
3317
|
+
description: Mark a lesson as incorrect or invalid
|
|
3318
|
+
argument-hint: "<lesson-id>"
|
|
3319
|
+
---
|
|
3320
|
+
Mark a lesson as incorrect or invalid.
|
|
3323
3321
|
|
|
3324
3322
|
Usage: /compound wrong <lesson-id>
|
|
3325
3323
|
|
|
@@ -3327,7 +3325,11 @@ Usage: /compound wrong <lesson-id>
|
|
|
3327
3325
|
npx ca wrong "$ARGUMENTS"
|
|
3328
3326
|
\`\`\`
|
|
3329
3327
|
`,
|
|
3330
|
-
"stats.md":
|
|
3328
|
+
"stats.md": `---
|
|
3329
|
+
name: compound:stats
|
|
3330
|
+
description: Show compound-agent database statistics and health
|
|
3331
|
+
---
|
|
3332
|
+
Show compound-agent database statistics and health.
|
|
3331
3333
|
|
|
3332
3334
|
\`\`\`bash
|
|
3333
3335
|
npx ca stats
|
|
@@ -3436,6 +3438,11 @@ Create a concrete implementation plan by decomposing work into small, testable t
|
|
|
3436
3438
|
- Existing docs and ADRs were checked for constraints
|
|
3437
3439
|
- Ambiguities resolved via \`AskUserQuestion\` before decomposing
|
|
3438
3440
|
- Complexity estimates are realistic (no "should be quick")
|
|
3441
|
+
|
|
3442
|
+
## POST-PLAN VERIFICATION -- MANDATORY
|
|
3443
|
+
After creating all tasks, verify review and compound tasks exist:
|
|
3444
|
+
- Run \`bd list --status=open\` and check for a "Review:" task and a "Compound:" task
|
|
3445
|
+
- If either is missing, CREATE THEM NOW. The plan is NOT complete without these gates.
|
|
3439
3446
|
`,
|
|
3440
3447
|
work: `---
|
|
3441
3448
|
name: Work
|
|
@@ -3473,9 +3480,14 @@ Spawn teammates via \`Task\` with \`team_name\`, coordinate via \`SendMessage\`,
|
|
|
3473
3480
|
- Each agent receives memory items tailored to their assigned task, not a shared blob
|
|
3474
3481
|
- Call \`memory_capture\` after corrections or novel discoveries
|
|
3475
3482
|
|
|
3476
|
-
##
|
|
3477
|
-
Before
|
|
3478
|
-
1.
|
|
3483
|
+
## MANDATORY VERIFICATION -- DO NOT CLOSE TASK WITHOUT THIS
|
|
3484
|
+
Before \`bd close\`, you MUST:
|
|
3485
|
+
1. Run \`pnpm test\` then \`pnpm lint\` (quality gates)
|
|
3486
|
+
2. Run \`/implementation-reviewer\` on changed code -- wait for APPROVED
|
|
3487
|
+
If REJECTED: fix ALL issues, re-run tests, resubmit. INVIOLABLE per CLAUDE.md.
|
|
3488
|
+
|
|
3489
|
+
The full 8-step pipeline (invariant-designer through implementation-reviewer) is recommended
|
|
3490
|
+
for complex changes. For all changes, \`/implementation-reviewer\` is the minimum required gate.
|
|
3479
3491
|
|
|
3480
3492
|
## Beads Lifecycle
|
|
3481
3493
|
- \`bd ready\` to find available tasks
|
|
@@ -3499,6 +3511,12 @@ Before marking work complete, run the 8-step TDD verification pipeline:
|
|
|
3499
3511
|
- Incremental commits made as tests pass
|
|
3500
3512
|
- All tests pass after refactoring
|
|
3501
3513
|
- Task lifecycle tracked via beads (\`bd\`)
|
|
3514
|
+
|
|
3515
|
+
## PHASE GATE 3 -- MANDATORY
|
|
3516
|
+
Before starting Review, verify ALL work tasks are closed:
|
|
3517
|
+
- \`bd list --status=in_progress\` must return empty
|
|
3518
|
+
- \`bd list --status=open\` should only have Review and Compound tasks remaining
|
|
3519
|
+
If any work tasks remain open, DO NOT proceed. Complete them first.
|
|
3502
3520
|
`,
|
|
3503
3521
|
review: `---
|
|
3504
3522
|
name: Review
|
|
@@ -3513,18 +3531,19 @@ Perform thorough code review by spawning specialized reviewers in parallel, cons
|
|
|
3513
3531
|
## Methodology
|
|
3514
3532
|
1. Run quality gates first: \`pnpm test && pnpm lint\`
|
|
3515
3533
|
2. Search memory with \`memory_search\` for known patterns and recurring issues
|
|
3516
|
-
3.
|
|
3517
|
-
- **
|
|
3518
|
-
- **
|
|
3519
|
-
- **
|
|
3520
|
-
4.
|
|
3521
|
-
5.
|
|
3522
|
-
6.
|
|
3523
|
-
7.
|
|
3524
|
-
8.
|
|
3525
|
-
9.
|
|
3526
|
-
10.
|
|
3527
|
-
11.
|
|
3534
|
+
3. Select reviewer tier based on diff size:
|
|
3535
|
+
- **Small** (<100 lines): 4 core -- security, test-coverage, simplicity, cct-reviewer
|
|
3536
|
+
- **Medium** (100-500): add architecture, performance, edge-case (7 total)
|
|
3537
|
+
- **Large** (500+): all 11 reviewers including docs, consistency, error-handling, pattern-matcher
|
|
3538
|
+
4. Create an AgentTeam (\`TeamCreate\`) and spawn selected reviewers as parallel teammates via \`Task\` tool with \`team_name\`
|
|
3539
|
+
5. Reviewers communicate findings to each other via \`SendMessage\`
|
|
3540
|
+
6. Collect, consolidate, and deduplicate all findings
|
|
3541
|
+
7. Classify by severity: P1 (critical/blocking), P2 (important), P3 (minor)
|
|
3542
|
+
8. Use \`AskUserQuestion\` when severity is ambiguous or fix has multiple valid options
|
|
3543
|
+
9. Create beads issues for P1 findings: \`bd create --title="P1: ..."\`
|
|
3544
|
+
10. Fix all P1 findings before proceeding
|
|
3545
|
+
11. Run \`/implementation-reviewer\` as mandatory gate
|
|
3546
|
+
12. Capture novel findings with \`memory_capture\`; pattern-matcher auto-reinforces recurring issues
|
|
3528
3547
|
|
|
3529
3548
|
## Memory Integration
|
|
3530
3549
|
- Call \`memory_search\` before review for known recurring issues
|
|
@@ -3554,6 +3573,13 @@ Perform thorough code review by spawning specialized reviewers in parallel, cons
|
|
|
3554
3573
|
- docs-reviewer confirmed docs/ADR alignment
|
|
3555
3574
|
- All P1 findings fixed before \`/implementation-reviewer\` approval
|
|
3556
3575
|
- \`/implementation-reviewer\` approved as mandatory gate
|
|
3576
|
+
|
|
3577
|
+
## PHASE GATE 4 -- MANDATORY
|
|
3578
|
+
Before starting Compound, verify review is complete:
|
|
3579
|
+
- \`/implementation-reviewer\` must have returned APPROVED
|
|
3580
|
+
- All P1 findings must be resolved
|
|
3581
|
+
|
|
3582
|
+
**CRITICAL**: Use \`memory_capture\` MCP tool for ALL lesson storage -- NOT MEMORY.md.
|
|
3557
3583
|
`,
|
|
3558
3584
|
compound: `---
|
|
3559
3585
|
name: Compound
|
|
@@ -3565,6 +3591,9 @@ description: Reflect on the cycle and capture high-quality lessons for future se
|
|
|
3565
3591
|
## Overview
|
|
3566
3592
|
Extract and store lessons learned during the cycle, and update project documentation. This is what makes the system compound -- each session leaves the next one better equipped.
|
|
3567
3593
|
|
|
3594
|
+
**CRITICAL**: Store all lessons via \`memory_capture\` MCP tool -- NOT via MEMORY.md, NOT via markdown files.
|
|
3595
|
+
Lessons go to \`.claude/lessons/index.jsonl\` through the MCP tool. MEMORY.md is a different system and MUST NOT be used for compounding.
|
|
3596
|
+
|
|
3568
3597
|
## Methodology
|
|
3569
3598
|
1. Review what happened during this cycle (git diff, test results, plan context)
|
|
3570
3599
|
2. Create an AgentTeam (\`TeamCreate\`) and spawn the 6 analysis agents as parallel teammates via \`Task\` tool with \`team_name\`:
|
|
@@ -3607,6 +3636,13 @@ Extract and store lessons learned during the cycle, and update project documenta
|
|
|
3607
3636
|
- User confirmed high-severity items
|
|
3608
3637
|
- Beads checked for related issues (\`bd\`)
|
|
3609
3638
|
- Each item gives clear, concrete guidance for future sessions
|
|
3639
|
+
|
|
3640
|
+
## FINAL GATE -- EPIC CLOSURE
|
|
3641
|
+
Before closing the epic:
|
|
3642
|
+
- Run \`ca verify-gates <epic-id>\` -- must return PASS for both gates
|
|
3643
|
+
- Run \`pnpm test\` and \`pnpm lint\` -- must pass
|
|
3644
|
+
If verify-gates fails, the missing phase was SKIPPED. Go back and complete it.
|
|
3645
|
+
CRITICAL: 3/5 phases is NOT success. All 5 phases are required.
|
|
3610
3646
|
`
|
|
3611
3647
|
};
|
|
3612
3648
|
|