compound-agent 1.2.2 → 1.2.4

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 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.1...HEAD
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": `$ARGUMENTS
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
 
@@ -2889,7 +2894,7 @@ var WORKFLOW_COMMANDS = {
2889
2894
  Explore requirements through collaborative dialogue before committing to a plan.
2890
2895
 
2891
2896
  ## Workflow
2892
- 1. Parse the topic from \`$ARGUMENTS\`. If empty, ask the user what to brainstorm.
2897
+ 1. Parse the topic from the arguments above. If empty, ask the user what to brainstorm.
2893
2898
  2. Call \`memory_search\` with the topic to surface relevant past lessons. Display retrieved items and incorporate them into exploration.
2894
2899
  3. Create a research team and spawn explorers in parallel:
2895
2900
  \`\`\`
@@ -2906,12 +2911,10 @@ Explore requirements through collaborative dialogue before committing to a plan.
2906
2911
  7. Run \`bd ready\` to check if related tasks already exist.
2907
2912
  8. Output a clear problem definition, chosen approach, and open questions.
2908
2913
  9. Create a beads epic from conclusions:
2909
- \`\`\`bash
2910
- bd create --title="<epic title>" --type=feature --description="<problem definition + approach + scope>"
2911
- \`\`\`
2914
+ bd create --title="(epic title)" --type=feature --description="(problem definition + approach + scope)"
2912
2915
  10. For each significant decision, auto-create an ADR in \`docs/decisions/\`:
2913
2916
  - Scan \`docs/decisions/\` for the highest existing number, increment by 1
2914
- - Write \`docs/decisions/NNN-<kebab-title>.md\` using this template:
2917
+ - Write docs/decisions/NNN-(kebab-title).md using this template:
2915
2918
  \`\`\`markdown
2916
2919
  # NNN. <Title>
2917
2920
  Status: accepted
@@ -2941,7 +2944,12 @@ Explore requirements through collaborative dialogue before committing to a plan.
2941
2944
  - Create a beads epic from brainstorm conclusions with \`bd create --type=feature\`.
2942
2945
  - If the brainstorm identifies sub-tasks, suggest creating them with \`bd create\`.
2943
2946
  `,
2944
- "plan.md": `$ARGUMENTS
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
2945
2953
 
2946
2954
  # Plan
2947
2955
 
@@ -2949,7 +2957,7 @@ Explore requirements through collaborative dialogue before committing to a plan.
2949
2957
  Create a structured implementation plan enriched by semantic memory and existing documentation, with concrete tasks and dependencies.
2950
2958
 
2951
2959
  ## Workflow
2952
- 1. Parse the goal from \`$ARGUMENTS\`. If empty, ask the user what to plan.
2960
+ 1. Parse the goal from the arguments above. If empty, ask the user what to plan.
2953
2961
  2. Check for brainstorm output: run \`bd list\` to find a related brainstorm epic. If one exists, read its description for decisions and open questions.
2954
2962
  3. Call \`memory_search\` with the goal to retrieve relevant past lessons. Display retrieved memory items and incorporate them into planning context.
2955
2963
  4. Create a research team and spawn analysts in parallel:
@@ -2967,26 +2975,20 @@ Create a structured implementation plan enriched by semantic memory and existing
2967
2975
  6. Use \`AskUserQuestion\` to resolve ambiguities: unclear requirements, conflicting ADRs, or priority trade-offs that need user input before decomposing.
2968
2976
  7. Break the goal into concrete, ordered tasks with clear acceptance criteria.
2969
2977
  8. **Create review and compound blocking tasks** so they survive compaction:
2970
- \`\`\`bash
2971
- bd create --title="Review: /compound:review" --type=task --priority=1
2972
- bd create --title="Compound: /compound:compound" --type=task --priority=1
2973
- bd dep add <review-id> <last-work-task> # review depends on work
2974
- bd dep add <compound-id> <review-id> # compound depends on review
2975
- \`\`\`
2978
+ - bd create --title="Review: /compound:review" --type=task --priority=1
2979
+ - bd create --title="Compound: /compound:compound" --type=task --priority=1
2980
+ - bd dep add (review-id) (last-work-task) -- review depends on work
2981
+ - bd dep add (compound-id) (review-id) -- compound depends on review
2976
2982
  These tasks surface via \`bd ready\` after work completes, ensuring review and compound phases are never skipped \u2014 even after context compaction.
2977
2983
  9. Create beads issues and map dependencies:
2978
- \`\`\`bash
2979
- bd create --title="<task>" --type=task --priority=<1-4>
2980
- bd dep add <dependent-task> <blocking-task>
2981
- \`\`\`
2984
+ - bd create --title="(task)" --type=task --priority=(1-4)
2985
+ - bd dep add (dependent-task) (blocking-task)
2982
2986
  10. Output the plan as a structured list with task IDs and dependency graph.
2983
2987
 
2984
2988
  ## POST-PLAN VERIFICATION -- MANDATORY
2985
2989
  After creating all tasks, verify review and compound tasks exist:
2986
- \`\`\`bash
2987
- bd list --status=open | grep 'Review:' # Must show a result
2988
- bd list --status=open | grep 'Compound:' # Must show a result
2989
- \`\`\`
2990
+ - Run bd list --status=open and check for a "Review:" task
2991
+ - Run bd list --status=open and check for a "Compound:" task
2990
2992
  If either is missing, CREATE THEM NOW. The plan is NOT complete without these gates.
2991
2993
 
2992
2994
  ## Memory Integration
@@ -3002,10 +3004,15 @@ If either is missing, CREATE THEM NOW. The plan is NOT complete without these ga
3002
3004
  ## Beads Integration
3003
3005
  - Create one \`bd\` issue per task with \`bd create\`.
3004
3006
  - Set priority (1=critical, 4=low) based on dependency order.
3005
- - Map dependencies with \`bd dep add <dependent> <blocker>\`.
3007
+ - Map dependencies with bd dep add (dependent) (blocker).
3006
3008
  - Each task should include acceptance criteria in its description.
3007
3009
  `,
3008
- "work.md": `$ARGUMENTS
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
3009
3016
 
3010
3017
  # Work
3011
3018
 
@@ -3013,8 +3020,8 @@ If either is missing, CREATE THEM NOW. The plan is NOT complete without these ga
3013
3020
  Execute implementation by delegating to an agent team. The lead coordinates and does not code directly.
3014
3021
 
3015
3022
  ## Workflow
3016
- 1. Parse task from \`$ARGUMENTS\`. If empty, run \`bd ready\` to find available tasks.
3017
- 2. Mark task in progress: \`bd update <id> --status=in_progress\`.
3023
+ 1. Parse task from the arguments above. If empty, run \`bd ready\` to find available tasks.
3024
+ 2. Mark task in progress: bd update (id) --status=in_progress.
3018
3025
  3. Call \`memory_search\` with the task description to retrieve relevant lessons. Run \`memory_search\` per agent/subtask so each gets targeted context. Display retrieved lessons in your response. Do not silently discard memory results.
3019
3026
  4. Assess complexity to determine team strategy.
3020
3027
  5. If **trivial** (config changes, typos, one-line fixes): handle directly with a single subagent. No AgentTeam needed. Proceed to step 10.
@@ -3040,11 +3047,11 @@ Execute implementation by delegating to an agent team. The lead coordinates and
3040
3047
  12. Shut down the team when done: send \`shutdown_request\` to all teammates.
3041
3048
  13. Commit incrementally as tests pass \u2014 do not batch all commits to the end.
3042
3049
  14. Run the full test suite to check for regressions.
3043
- 15. Close the task: \`bd close <id>\`.
3050
+ 15. Close the task: bd close (id).
3044
3051
 
3045
3052
  ## MANDATORY VERIFICATION -- DO NOT CLOSE TASK WITHOUT THIS
3046
3053
  STOP. Before running \`bd close\`, you MUST:
3047
- 1. Run \`pnpm test && pnpm lint\` (quality gates)
3054
+ 1. Run pnpm test, then pnpm lint (quality gates)
3048
3055
  2. Run /implementation-reviewer on the changed code
3049
3056
  3. Wait for APPROVED status
3050
3057
  If /implementation-reviewer returns REJECTED: fix ALL issues, re-run tests, resubmit.
@@ -3060,10 +3067,21 @@ for complex changes. For all changes, /implementation-reviewer is the minimum re
3060
3067
 
3061
3068
  ## Beads Integration
3062
3069
  - Start with \`bd ready\` to pick work.
3063
- - Update status with \`bd update <id> --status=in_progress\`.
3064
- - Close with \`bd close <id>\` when all tests pass.
3070
+ - Update status with bd update (id) --status=in_progress.
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.
3065
3078
  `,
3066
- "review.md": `$ARGUMENTS
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
3067
3085
 
3068
3086
  # Review
3069
3087
 
@@ -3071,8 +3089,8 @@ for complex changes. For all changes, /implementation-reviewer is the minimum re
3071
3089
  Multi-agent code review with severity classification and a mandatory \`/implementation-reviewer\` gate.
3072
3090
 
3073
3091
  ## Workflow
3074
- 1. Run quality gates first: \`pnpm test && pnpm lint\`.
3075
- 2. Identify scope from \`$ARGUMENTS\` or \`git diff\`. Count changed lines.
3092
+ 1. Run quality gates first: pnpm test, then pnpm lint.
3093
+ 2. Identify scope from the arguments above or \`git diff\`. Count changed lines.
3076
3094
  3. Call \`memory_search\` with changed areas to surface past lessons.
3077
3095
  4. **Select reviewer tier based on diff size:**
3078
3096
  - **Small** (<100 lines): 4 core reviewers \u2014 security, test-coverage, simplicity, cct-reviewer.
@@ -3096,7 +3114,7 @@ Multi-agent code review with severity classification and a mandatory \`/implemen
3096
3114
  6. Reviewers communicate cross-cutting findings via SendMessage.
3097
3115
  7. Classify findings: **P1** (security, data loss, correctness \u2014 blocks completion), **P2** (architecture, performance), **P3** (style, minor).
3098
3116
  8. Deduplicate and prioritize. Use \`AskUserQuestion\` for ambiguous severity.
3099
- 9. For P1/P2 findings: \`bd create --title="P1: <finding>" --type=bug --priority=1\`
3117
+ 9. For P1/P2 findings: bd create --title="P1: (finding)" --type=bug --priority=1
3100
3118
  10. Submit to **\`/implementation-reviewer\`** \u2014 mandatory gate, final authority. All P1s must be resolved.
3101
3119
  11. **External reviewers (optional)**: Check \`.claude/compound-agent.json\` for \`"externalReviewers"\`. Spawn configured reviewers. Advisory only, never blocks.
3102
3120
  12. Output review summary with severity breakdown and external findings (if any).
@@ -3106,6 +3124,7 @@ Multi-agent code review with severity classification and a mandatory \`/implemen
3106
3124
  - **pattern-matcher** auto-reinforces recurring findings via \`memory_capture\`.
3107
3125
  - **cct-reviewer** reads \`.claude/lessons/cct-patterns.jsonl\` for known Claude mistakes.
3108
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.
3109
3128
 
3110
3129
  ## Docs Integration
3111
3130
  - **docs-reviewer** checks code changes align with \`docs/\` and existing ADRs.
@@ -3114,16 +3133,29 @@ Multi-agent code review with severity classification and a mandatory \`/implemen
3114
3133
  ## Beads Integration
3115
3134
  - Create \`bd\` issues for P1 and P2 findings with \`bd create\`.
3116
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
3117
3141
  `,
3118
- "compound.md": `$ARGUMENTS
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
3119
3148
 
3120
3149
  # Compound
3121
3150
 
3122
3151
  ## Purpose
3123
3152
  Multi-agent analysis to capture high-quality lessons from completed work into the memory system and update project documentation.
3124
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
+
3125
3157
  ## Workflow
3126
- 1. Parse what was done from \`$ARGUMENTS\` or recent git history (\`git diff\`, \`git log\`).
3158
+ 1. Parse what was done from the arguments above or recent git history (\`git diff\`, \`git log\`).
3127
3159
  2. Call \`memory_search\` with the topic to check what is already known (avoid duplicates).
3128
3160
  3. Create a compound team and spawn the 6 analysis agents in parallel:
3129
3161
  \`\`\`
@@ -3170,118 +3202,53 @@ Multi-agent analysis to capture high-quality lessons from completed work into th
3170
3202
  ## Beads Integration
3171
3203
  - Check \`bd ready\` for related open issues.
3172
3204
  - Close resolved issues with \`bd close\`.
3173
- `,
3174
- "lfg.md": `$ARGUMENTS
3175
-
3176
- # LFG (Full Cycle)
3177
-
3178
- ## Purpose
3179
- Chain all phases: brainstorm, plan, work, review, compound. End-to-end delivery.
3180
-
3181
- ## Workflow
3182
- 1. **Brainstorm phase**: Explore the goal from \`$ARGUMENTS\`.
3183
- - 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."
3184
- - Call \`memory_search\` with the goal.
3185
- - \`TeamCreate\` team "brainstorm-<slug>", spawn docs-explorer + code-explorer as parallel teammates.
3186
- - Ask clarifying questions via \`AskUserQuestion\`, explore alternatives.
3187
- - Auto-create ADRs for significant decisions in \`docs/decisions/\`.
3188
- - Create a beads epic from conclusions with \`bd create --type=feature\`.
3189
- - Shut down brainstorm team before next phase.
3190
- - Update epic phase state: \`bd update <epic-id> --notes="Phase: brainstorm COMPLETE | Next: plan"\`
3191
-
3192
- 2. **Plan phase**: Structure the work.
3193
- - 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."
3194
- - Check for brainstorm epic via \`bd list\`.
3195
- - \`TeamCreate\` team "plan-<slug>", spawn docs-analyst + repo-analyst + memory-analyst as parallel teammates.
3196
- - Break into tasks with dependencies and acceptance criteria.
3197
- - Create beads issues with \`bd create\` and map dependencies with \`bd dep add\`.
3198
- - Create review and compound blocking tasks (\`bd create\` + \`bd dep add\`) so they survive compaction and surface via \`bd ready\` after work completes.
3199
- - Shut down plan team before next phase.
3200
- - Update epic phase state: \`bd update <epic-id> --notes="Phase: plan COMPLETE | Next: work"\`
3201
-
3202
- 3. **Work phase**: Implement with adaptive TDD.
3203
- - 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."
3204
- - Assess complexity (trivial/simple/complex) to choose strategy.
3205
- - Trivial: single subagent, no team. Simple/complex: \`TeamCreate\` team "work-<task-id>".
3206
- - Spawn test-analyst first, then test-writer + implementer as teammates.
3207
- - Call \`memory_search\` per subtask; \`memory_capture\` after corrections.
3208
- - Commit incrementally. Close tasks as they complete.
3209
- - Run verification gate before marking complete. Shut down work team.
3210
- - Update epic phase state: \`bd update <epic-id> --notes="Phase: work COMPLETE | Next: review"\`
3211
-
3212
- ## PHASE GATE 3->4 -- MANDATORY
3213
- Before starting Review, verify ALL work tasks are closed:
3214
- - Run \`bd list --status=in_progress\` \u2014 must return empty
3215
- - Run \`bd list --status=open\` \u2014 only Review and Compound tasks should remain
3216
- If any work tasks remain open, DO NOT proceed. Complete them first.
3217
- Update epic phase: \`bd update <epic-id> --notes="Phase: work COMPLETE | Next: review"\`
3218
-
3219
- 4. **Review phase**: 11-agent review with severity classification.
3220
- - 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."
3221
- - Run quality gates first: \`pnpm test && pnpm lint\`.
3222
- - \`TeamCreate\` team "review-<slug>", spawn all 11 reviewers as parallel teammates.
3223
- - Classify findings as P1 (critical/blocking), P2 (important), P3 (minor).
3224
- - P1 findings must be fixed before proceeding \u2014 they block completion.
3225
- - Submit to \`/implementation-reviewer\` as the mandatory gate. Shut down review team.
3226
- - Update epic phase state: \`bd update <epic-id> --notes="Phase: review COMPLETE | Next: compound"\`
3227
-
3228
- ## PHASE GATE 4->5 -- MANDATORY
3229
- Before starting Compound, verify review is complete:
3230
- - /implementation-reviewer must have returned APPROVED
3231
- - All P1 findings must be resolved
3232
- Update epic phase: \`bd update <epic-id> --notes="Phase: review COMPLETE | Next: compound"\`
3233
-
3234
- 5. **Compound phase**: Capture learnings.
3235
- - 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."
3236
- - \`TeamCreate\` team "compound-<slug>", spawn 6 analysis agents as parallel teammates.
3237
- - Search first with \`memory_search\` to avoid duplicates. Apply quality filters (novelty + specificity).
3238
- - Store novel insights via \`memory_capture\` with supersedes/related links.
3239
- - Update outdated docs and deprecate superseded ADRs.
3240
- - Use \`AskUserQuestion\` to confirm high-severity items. Shut down compound team.
3241
- - Update epic phase state: \`bd update <epic-id> --notes="Phase: compound COMPLETE | Next: close"\`
3242
3205
 
3243
3206
  ## FINAL GATE -- EPIC CLOSURE
3244
3207
  Before closing the epic:
3245
- - Run \`ca verify-gates <epic-id>\` \u2014 must return PASS for both gates
3246
- - Run \`pnpm test\` \u2014 must pass
3247
- - Run \`pnpm lint\` \u2014 must pass
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
3248
3211
  If verify-gates fails, the missing phase was SKIPPED. Go back and complete it.
3249
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
3250
3221
 
3251
- ## Agent Team Pattern
3252
- 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.
3253
-
3254
- ## Phase Control
3255
- - **Skip phases**: Parse \`$ARGUMENTS\` for "from <phase>" (e.g., "from plan"). Skip all phases before the named one.
3256
- - **Progress**: Announce the current phase before starting it (e.g., "[Phase 2/5] Plan").
3257
- - **Retry**: If a phase fails, report the failure and ask the user whether to retry, skip, or abort.
3258
- - **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)
3259
3223
 
3260
- ## Stop Conditions
3261
- - Stop if brainstorm reveals the goal is unclear (ask user).
3262
- - Stop if any test phase produces failures that cannot be resolved.
3263
- - Stop if review finds critical security issues.
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"
3264
3230
 
3265
- ## Memory Integration
3266
- - \`memory_search\` is called in brainstorm, work, and compound phases.
3267
- - \`memory_capture\` is called in work and compound phases.
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.
3268
3235
 
3269
3236
  ## SESSION CLOSE -- INVIOLABLE
3270
- Before saying "done" or "complete", ALL of these must pass:
3271
- 1. \`ca verify-gates <epic-id>\` -- All workflow gates satisfied
3272
- 2. \`pnpm test && pnpm lint\` -- Quality gates green
3273
- 3. \`git status\` -- Review changes
3274
- 4. \`git add <specific-files>\` -- Stage (never git add .)
3275
- 5. \`bd sync\` -- Sync beads
3276
- 6. \`git commit -m "..."\` -- Commit
3277
- 7. \`bd sync\` -- Post-commit sync
3278
- 8. \`git push\` -- Push to remote
3279
- 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.
3280
3242
  `,
3281
3243
  // =========================================================================
3282
3244
  // Utility commands (CLI wrappers)
3283
3245
  // =========================================================================
3284
- "learn.md": `Capture a lesson from this session.
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.
3285
3252
 
3286
3253
  Usage: /compound learn <insight>
3287
3254
 
@@ -3293,7 +3260,12 @@ Examples:
3293
3260
  npx ca learn "$ARGUMENTS"
3294
3261
  \`\`\`
3295
3262
  `,
3296
- "search.md": `Search lessons for relevant context.
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.
3297
3269
 
3298
3270
  Usage: /compound search <query>
3299
3271
 
@@ -3307,19 +3279,32 @@ npx ca search "$ARGUMENTS"
3307
3279
 
3308
3280
  Note: You can also use the \`memory_search\` MCP tool directly.
3309
3281
  `,
3310
- "list.md": `Show all stored lessons.
3282
+ "list.md": `---
3283
+ name: compound:list
3284
+ description: Show all stored lessons
3285
+ ---
3286
+ Show all stored lessons.
3311
3287
 
3312
3288
  \`\`\`bash
3313
3289
  npx ca list
3314
3290
  \`\`\`
3315
3291
  `,
3316
- "prime.md": `Load compound-agent workflow context after compaction or context loss.
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.
3317
3297
 
3318
3298
  \`\`\`bash
3319
3299
  npx ca prime
3320
3300
  \`\`\`
3321
3301
  `,
3322
- "show.md": `Show details of a specific lesson.
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.
3323
3308
 
3324
3309
  Usage: /compound show <lesson-id>
3325
3310
 
@@ -3327,7 +3312,12 @@ Usage: /compound show <lesson-id>
3327
3312
  npx ca show "$ARGUMENTS"
3328
3313
  \`\`\`
3329
3314
  `,
3330
- "wrong.md": `Mark a lesson as incorrect or invalid.
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.
3331
3321
 
3332
3322
  Usage: /compound wrong <lesson-id>
3333
3323
 
@@ -3335,7 +3325,11 @@ Usage: /compound wrong <lesson-id>
3335
3325
  npx ca wrong "$ARGUMENTS"
3336
3326
  \`\`\`
3337
3327
  `,
3338
- "stats.md": `Show compound-agent database statistics and health.
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.
3339
3333
 
3340
3334
  \`\`\`bash
3341
3335
  npx ca stats