all-for-claudecode 2.0.0 → 2.2.0

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.
Files changed (67) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/.claude-plugin/plugin.json +3 -4
  3. package/MIGRATION.md +10 -7
  4. package/README.md +68 -119
  5. package/agents/afc-architect.md +16 -0
  6. package/agents/afc-impl-worker.md +40 -0
  7. package/agents/afc-security.md +11 -0
  8. package/bin/cli.mjs +1 -1
  9. package/commands/analyze.md +6 -7
  10. package/commands/architect.md +5 -7
  11. package/commands/auto.md +355 -102
  12. package/commands/checkpoint.md +3 -4
  13. package/commands/clarify.md +8 -1
  14. package/commands/debug.md +40 -3
  15. package/commands/doctor.md +12 -13
  16. package/commands/ideate.md +191 -0
  17. package/commands/implement.md +211 -66
  18. package/commands/init.md +76 -61
  19. package/commands/launch.md +181 -0
  20. package/commands/plan.md +86 -22
  21. package/commands/principles.md +6 -2
  22. package/commands/resume.md +1 -2
  23. package/commands/review.md +68 -18
  24. package/commands/security.md +10 -13
  25. package/commands/spec.md +60 -3
  26. package/commands/tasks.md +19 -4
  27. package/commands/test.md +24 -6
  28. package/docs/phase-gate-protocol.md +6 -6
  29. package/hooks/hooks.json +29 -3
  30. package/package.json +19 -11
  31. package/schemas/hooks.schema.json +75 -0
  32. package/schemas/marketplace.schema.json +52 -0
  33. package/schemas/plugin.schema.json +53 -0
  34. package/scripts/afc-bash-guard.sh +6 -6
  35. package/scripts/afc-blast-radius.sh +418 -0
  36. package/scripts/afc-config-change.sh +6 -4
  37. package/scripts/afc-consistency-check.sh +261 -0
  38. package/scripts/afc-dag-validate.mjs +94 -0
  39. package/scripts/afc-dag-validate.sh +142 -0
  40. package/scripts/afc-failure-hint.sh +6 -4
  41. package/scripts/afc-parallel-validate.mjs +81 -0
  42. package/scripts/afc-parallel-validate.sh +33 -45
  43. package/scripts/afc-permission-request.sh +56 -11
  44. package/scripts/afc-pipeline-manage.sh +46 -46
  45. package/scripts/afc-preflight-check.sh +6 -3
  46. package/scripts/afc-schema-validate.sh +225 -0
  47. package/scripts/afc-session-end.sh +5 -5
  48. package/scripts/afc-state.sh +256 -0
  49. package/scripts/afc-stop-gate.sh +32 -24
  50. package/scripts/afc-subagent-context.sh +15 -6
  51. package/scripts/afc-subagent-stop.sh +4 -2
  52. package/scripts/afc-task-completed-gate.sh +19 -25
  53. package/scripts/afc-teammate-idle.sh +9 -14
  54. package/scripts/afc-test-pre-gen.sh +141 -0
  55. package/scripts/afc-timeline-log.sh +9 -6
  56. package/scripts/afc-user-prompt-submit.sh +8 -10
  57. package/scripts/afc-worktree-create.sh +56 -0
  58. package/scripts/afc-worktree-remove.sh +47 -0
  59. package/scripts/install-shellspec.sh +38 -0
  60. package/scripts/pre-compact-checkpoint.sh +6 -4
  61. package/scripts/session-start-context.sh +9 -8
  62. package/scripts/track-afc-changes.sh +6 -9
  63. package/templates/afc.config.template.md +12 -76
  64. package/templates/afc.config.express-api.md +0 -99
  65. package/templates/afc.config.monorepo.md +0 -98
  66. package/templates/afc.config.nextjs-fsd.md +0 -107
  67. package/templates/afc.config.react-spa.md +0 -96
package/commands/auto.md CHANGED
@@ -6,8 +6,10 @@ argument-hint: "[feature description in natural language]"
6
6
 
7
7
  # /afc:auto — Full Auto Pipeline
8
8
 
9
- > Runs specplantasks → implement → review → clean fully automatically from a single feature description.
10
- > No intermediate confirmation. clarify/analyze are skipped. Critic Loop is performed automatically at each phase.
9
+ > Runs clarify?specplan → implement → review → clean fully automatically from a single feature description.
10
+ > Tasks are generated automatically at implement start (no separate tasks phase).
11
+ > Critic Loop runs at each phase with unified safety cap (5). Convergence terminates early when quality is sufficient.
12
+ > Pre-implementation gates (clarify, TDD pre-gen, blast-radius) run conditionally within the implement phase.
11
13
 
12
14
  ## Arguments
13
15
 
@@ -20,15 +22,16 @@ argument-hint: "[feature description in natural language]"
20
22
  ## Config Load
21
23
 
22
24
  **Always** read `.claude/afc.config.md` first (read manually if not auto-loaded above). Values defined in this file are referenced below as `{config.*}`:
23
- - `{config.ci}` — full CI command
24
- - `{config.gate}` — phase gate command
25
- - `{config.architecture}` — architecture style and rules
26
- - `{config.framework}` — framework characteristics (server/client boundary etc.)
27
- - `{config.code_style}` — code style rules
28
- - `{config.risks}` — project-specific risk patterns
29
- - `{config.mini_review}` — Mini-Review checklist items
25
+ - `{config.ci}` — full CI command (from `## CI Commands` YAML)
26
+ - `{config.gate}` — phase gate command (from `## CI Commands` YAML)
27
+ - `{config.test}` — test command (from `## CI Commands` YAML)
28
+ - `{config.architecture}` — architecture style and rules (from `## Architecture` section)
29
+ - `{config.code_style}` — code style rules (from `## Code Style` section)
30
30
 
31
- If config file is missing: print "`.claude/afc.config.md` not found. Create project config with `/afc:init`." then **abort**.
31
+ If config file is missing:
32
+ 1. Ask the user: "`.claude/afc.config.md` not found. Run `/afc:init` to set up the project?"
33
+ 2. If user accepts → run `/afc:init`, then **restart this command** with the original `$ARGUMENTS`
34
+ 3. If user declines → **abort**
32
35
 
33
36
  ---
34
37
 
@@ -64,32 +67,122 @@ If config file is missing: print "`.claude/afc.config.md` not found. Create proj
64
67
  6. Start notification:
65
68
  ```
66
69
  Auto pipeline started: {feature}
67
- ├─ 1/6 Spec → 2/6 Plan → 3/6 Tasks → 4/6 Implement → 5/6 Review → 6/6 Clean
68
- └─ Running fully automatically (no intermediate confirmation)
70
+ ├─ Clarify? → 1/5 Spec → 2/5 Plan → 3/5 Implement → 4/5 Review → 5/5 Clean
71
+ └─ Running fully automatically (tasks auto-generated, pre-implementation gates conditional)
69
72
  ```
70
73
 
71
- ### Phase 1: Spec (1/6)
74
+ ### Phase 0.3: Request Triage
75
+
76
+ Before investing pipeline resources, evaluate whether the request warrants execution:
77
+
78
+ 1. **Necessity check**: Explore codebase for existing implementations related to `$ARGUMENTS`.
79
+ - If the feature substantially exists → ask user via AskUserQuestion:
80
+ - "This feature appears to already exist at {path}. (1) Enhance existing (2) Replace entirely (3) Abort"
81
+ - If user chooses abort → release pipeline flag (`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" end`), end with: `"Pipeline aborted — feature already exists."`
82
+
83
+ 2. **Scope check**: Estimate the scope of `$ARGUMENTS`:
84
+ - If description implies 10+ files or multiple unrelated concerns → warn:
85
+ - "This request spans multiple concerns: {list}. Recommended: split into {N} separate pipeline runs."
86
+ - Ask: "(1) Proceed as single pipeline (2) Reduce scope to {suggestion} (3) Abort"
87
+
88
+ 3. **Proportionality check**: If the request is trivially small (single file, single-line change, config edit):
89
+ - Suggest: "This change is small enough to implement directly. Skip full pipeline?"
90
+ - If user agrees → execute fast-path directly, skip spec/plan/tasks
91
+
92
+ If all checks pass, proceed to Phase 0.8.
93
+
94
+ ### Phase 0.8: Size-Based Fast-Path Detection (conditional)
95
+
96
+ **Trigger condition**: Evaluate `$ARGUMENTS` against ALL 3 criteria. Fast-path activates only when ALL are met:
97
+
98
+ | Criterion | Check | Example |
99
+ |-----------|-------|---------|
100
+ | Trivial scope | Description explicitly mentions 1-2 specific files or a single-line fix | "fix typo in README", "update version in package.json" |
101
+ | No script impact | Description does not reference `.sh` scripts, hooks, or pipeline logic | NOT: "fix the hook script" |
102
+ | Low ambiguity | Clarify gate score < 2 (very clear, specific request) | "change 'foo' to 'bar' in config.md" |
103
+
104
+ **If ALL 3 criteria met** (fast-path):
105
+ 1. Print: `⚡ Fast path detected — skipping spec/plan phases`
106
+ 2. Jump directly to **Fast-Path Execution** (see below)
107
+ 3. Skip Phases 0.5 through 3.3 entirely
108
+
109
+ **If ANY criterion fails**: proceed to Phase 0.5 (full pipeline).
110
+
111
+ **Fast-Path Execution** (implement → review → clean):
112
+ 1. Implement the change directly (no tasks.md, no plan.md)
113
+ 2. Run `{config.ci}` verification
114
+ - On fail: **abort fast-path**, restart with full pipeline: `⚠ Fast-path aborted — change is more complex than expected. Running full pipeline.`
115
+ 3. If change touches > 2 files OR modifies any `.sh` script: **abort fast-path**, restart with full pipeline
116
+ 4. **Checkpoint**:
117
+ ```bash
118
+ "${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase fast-path
119
+ "${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" ci-pass
120
+ ```
121
+ 5. Run `/afc:review` logic inline (mini-review only — single Critic pass)
122
+ 6. Run Phase 5 Clean logic (artifact cleanup, CI gate, pipeline flag release)
123
+ 7. Final output:
124
+ ```
125
+ Fast path complete: {feature}
126
+ ├─ Mode: ⚡ Fast path (spec/plan skipped)
127
+ ├─ Changed files: {N}
128
+ ├─ CI: ✓
129
+ └─ Review: mini-review passed
130
+ ```
131
+
132
+ ### Phase 0.5: Auto-Clarify Gate (conditional)
133
+
134
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase clarify`
135
+
136
+ **Trigger condition**: Score `$ARGUMENTS` on 5 ambiguity signals. If score >= 3, trigger clarification.
137
+
138
+ | Signal | Detection | Example |
139
+ |--------|-----------|---------|
140
+ | Vague scope | No specific file, component, or module mentioned | "add caching" |
141
+ | Missing quantifiers | No numbers, sizes, limits, or thresholds | "improve performance" |
142
+ | Undefined entities | References to concepts not in the codebase | "integrate the new service" |
143
+ | Unclear boundaries | No start/end conditions or scope limits | "refactor the system" |
144
+ | Multiple interpretations | Ambiguous verbs or overloaded terms | "fix the pipeline" (which one?) |
145
+
146
+ **If score >= 3** (ambiguous):
147
+ 1. Generate at most 3 clarification questions targeting the highest-signal areas
148
+ 2. Present via AskUserQuestion with multiple-choice options
149
+ 3. Apply answers to refine `$ARGUMENTS` before proceeding to Spec
150
+ 4. If in full-auto mode and user prefers no interruption: auto-resolve with best-guess, tag with `[AUTO-RESOLVED: clarify]`, emit warning
151
+ 5. Progress: `✓ Clarify gate triggered ({N} questions, {M} auto-resolved)`
152
+
153
+ **If score < 3** (clear): skip silently, proceed to Phase 1.
154
+
155
+ ### Phase 1: Spec (1/5)
72
156
 
73
157
  `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase spec`
74
158
 
75
159
  Execute `/afc:spec` logic inline:
76
160
 
77
161
  1. Explore codebase for related code (Glob, Grep) — explore by `{config.architecture}` layer
78
- 2. Create `.claude/afc/specs/{feature}/spec.md`
79
- 3. `[NEEDS CLARIFICATION]` items are **auto-resolved with best-guess** (clarify skipped)
80
- - Tag auto-resolved items with `[AUTO-RESOLVED]`
81
- 4. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
162
+ 2. **Research Gate** (conditional):
163
+ - Scan `$ARGUMENTS` for external library/API/technology references not present in the codebase
164
+ - If external references found: run focused WebSearch for each (latest stable version, key constraints, compatibility)
165
+ - Optionally use Context7 for library-specific documentation
166
+ - Use research findings to inform spec writing (accurate requirements instead of guesses)
167
+ - Tag researched items with `[RESEARCHED]` in spec
168
+ - If no external references: skip (all internal → no research needed)
169
+ 3. Create `.claude/afc/specs/{feature}/spec.md`
170
+ 4. `[NEEDS CLARIFICATION]` items: **research first, then auto-resolve remaining** (clarify skipped if Phase 0.5 already ran)
171
+ - Items answerable via research → resolve with researched facts, tag `[RESEARCHED]`
172
+ - Items requiring user judgment → auto-resolve with best-guess, tag `[AUTO-RESOLVED]`
173
+ 5. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
82
174
  - Were there previous `[AUTO-RESOLVED]` items that turned out wrong? Flag similar patterns.
83
175
  - Were there scope-related issues in past specs? Warn about similar ambiguities.
84
- 5. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
176
+ 6. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
85
177
  - COMPLETENESS: does every User Story have acceptance scenarios? Any missing requirements?
86
178
  - MEASURABILITY: are success criteria measurable, not subjective? **Is quantitative evidence provided for numerical targets?**
87
179
  - INDEPENDENCE: are implementation details (code, library names) absent from the spec?
88
180
  - EDGE_CASES: are at least 2 identified? Any missing boundary conditions?
89
181
  - FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
90
- 6. Progress: `✓ 1/6 Spec complete (US: {N}, FR: {N}, Critic: converged ({N} passes, {M} fixes, {E} escalations))`
182
+ 7. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase spec` at phase start
183
+ 8. Progress: `✓ 1/5 Spec complete (US: {N}, FR: {N}, researched: {N}, Critic: converged ({N} passes, {M} fixes, {E} escalations))`
91
184
 
92
- ### Phase 2: Plan (2/6)
185
+ ### Phase 2: Plan (2/5)
93
186
 
94
187
  `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase plan`
95
188
 
@@ -97,109 +190,242 @@ Execute `/afc:plan` logic inline:
97
190
 
98
191
  1. Load spec.md
99
192
  2. If technical uncertainties exist → auto-resolve via WebSearch/code exploration → create research.md
100
- 3. Create `.claude/afc/specs/{feature}/plan.md`
193
+ 3. **Memory loading** (skip gracefully if directories are empty or absent):
194
+ - **Quality history**: if `.claude/afc/memory/quality-history/*.json` exists, load recent entries and display trend summary: "Last {N} pipelines: avg critic_fixes {X}, avg ci_failures {Y}, avg escalations {Z}". Use trends to inform plan risk assessment.
195
+ - **Decisions**: if `.claude/afc/memory/decisions/` exists, load ADR entries and check for conflicts with the current feature's design direction. Flag any contradictions.
196
+ - **Reviews**: if `.claude/afc/memory/reviews/` exists, scan for recurring finding patterns (same file/category appearing in 2+ reviews). Flag as known risk areas.
197
+ 4. Create `.claude/afc/specs/{feature}/plan.md`
101
198
  - **If setting numerical targets (line counts etc.), include structure-analysis-based estimates** (e.g., "function A ~50 lines, component B ~80 lines → total ~130 lines")
102
- 4. **Critic Loop until convergence** (safety cap: 7, follow Critic Loop rules):
103
- - Criteria: COMPLETENESS, FEASIBILITY, ARCHITECTURE, RISK, PRINCIPLES
199
+ 5. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
200
+ - Criteria: COMPLETENESS, FEASIBILITY, ARCHITECTURE, **CROSS_CONSISTENCY**, RISK, PRINCIPLES
201
+ - **CROSS_CONSISTENCY criterion** (spec↔plan cross-validation, check all 5):
202
+ 1. Entity coverage: every spec Key Entity → File Change Map row. `{M}/{N} entities covered`
203
+ 2. NFR traceability: every NFR-* → Architecture Decision or Risk mitigation. `{M}/{N} NFRs traced`
204
+ 3. Terminology consistency: same concept = same name across spec and plan
205
+ 4. Constraint propagation: every spec Constraint → Risk & Mitigation or Implementation Context Must NOT. `{M}/{N} constraints propagated`
206
+ 5. Acceptance anchor alignment: Implementation Context Acceptance Anchors faithfully reflect spec acceptance scenarios
104
207
  - **RISK criterion mandatory checks**:
105
208
  - Enumerate **at least 3** `{config.ci}` failure scenarios and describe mitigation
106
- - Check each pattern in `{config.risks}` one by one
107
- - Consider `{config.framework}` characteristics (server/client boundary etc.)
209
+ - Check each risk pattern described in config's Project Context section one by one
210
+ - Consider framework characteristics from config's Project Context (server/client boundary etc.)
108
211
  - **ARCHITECTURE criterion**: explicitly describe import paths for moved/created files and pre-validate against `{config.architecture}` rules
109
212
  - Each pass must **explicitly explore what was missed in the previous pass** ("Pass 2: {X} was missed in pass 1. Further review: ...")
110
213
  - FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
111
- 5. Progress: `✓ 2/6 Plan complete (Critic: converged ({N} passes, {M} fixes, {E} escalations), files: {N})`
214
+ 6. **Research persistence**: If research.md was created in step 2, persist a copy to long-term memory:
215
+ - Copy research findings to `.claude/afc/memory/research/{feature}.md`
216
+ - This enables future pipelines to reference prior research decisions
217
+ 7. **ADR recording via architect agent**: After plan.md is written, invoke the architect agent to record architectural decisions:
218
+ ```
219
+ Task("ADR: Record architecture decisions for {feature}", subagent_type: "afc:afc-architect",
220
+ prompt: "Review the following plan and record key architecture decisions to your persistent memory.
221
+
222
+ ## Plan Summary
223
+ {paste Architecture Decision + File Change Map sections from plan.md}
224
+
225
+ ## Instructions
226
+ 1. Read your MEMORY.md for prior ADR history
227
+ 2. Check for conflicts between new decisions and existing ADRs
228
+ 3. If conflicts found: return CONFLICT with details (orchestrator will ESCALATE)
229
+ 4. If no conflicts: record new ADRs to your MEMORY.md
230
+ 5. Return: { decisions_recorded: N, conflicts: [] }")
231
+ ```
232
+ - If architect returns conflicts → **ESCALATE** to user with conflict details
233
+ - If no conflicts → proceed (ADR recorded for future reference)
234
+ 8. **Session context preservation**: Save key decisions and constraints for context compaction resilience:
235
+ ```
236
+ save_session_context({
237
+ goal: { original_request: "$ARGUMENTS", current_objective: "Implement {feature}" },
238
+ decisions: [{ what: "{key design decision}", why: "{rationale}" }],
239
+ discoveries: [{ file: "{path}", insight: "{finding}" }]
240
+ })
241
+ ```
242
+ 9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase plan` at phase start
243
+ 10. Progress: `✓ 2/5 Plan complete (Critic: converged ({N} passes, {M} fixes, {E} escalations), files: {N}, ADR: {N} recorded, Implementation Context: {W} words)`
112
244
 
113
- ### Phase 3: Tasks (3/6)
245
+ ### Phase 3: Implement (3/5)
114
246
 
115
- `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase tasks`
247
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase implement`
116
248
 
117
- Execute `/afc:tasks` logic inline:
249
+ **Session context reload**: At implement start, call `load_session_context()` to restore key decisions and constraints from Plan phase (resilient to context compaction).
118
250
 
119
- 1. Load plan.md
120
- 2. Decompose tasks by phase (T001, T002, ...)
121
- 3. **[P] marker and dependency rules**:
122
- - Assign `[P]` marker to independent tasks with no overlapping file paths
123
- - Use explicit `depends: [TXXX]` for cross-task dependencies (replaces informal `(after TXXX)`)
124
- - Validate dependency graph is a DAG (no circular references)
125
- - [P] tasks **must be executed in parallel** in Phase 4 (declaring [P] then running sequentially is prohibited)
126
- 4. Coverage mapping (FR → Task)
127
- 5. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
128
- - Were there previous parallel conflict issues ([P] file overlaps)? Flag similar file patterns.
129
- - Were there tasks that were over-decomposed or under-decomposed? Adjust granularity.
130
- 6. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
131
- - COVERAGE: is every FR/NFR mapped to at least 1 task?
132
- - DEPENDENCIES: is the dependency graph a valid DAG? Do [P] tasks have no file overlaps?
133
- - FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
134
- 7. Create `.claude/afc/specs/{feature}/tasks.md`
135
- 8. Progress: `✓ 3/6 Tasks complete (tasks: {N}, parallel: {N}, Critic: converged ({N} passes, {M} fixes, {E} escalations))`
251
+ Execute `/afc:implement` logic inline — **follow all orchestration rules defined in `commands/implement.md`** (task generation, mode selection, batch/swarm execution, failure recovery, task execution pattern). The implement command is the single source of truth for orchestration details.
136
252
 
137
- ### Phase 4: Implement (4/6)
253
+ **Auto-specific additions** (beyond implement.md):
138
254
 
139
- `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase implement`
255
+ #### Step 3.1: Task Generation + Validation
140
256
 
141
- Execute `/afc:implement` logic inline with **dependency-aware orchestration**:
257
+ 1. Generate tasks.md from plan.md File Change Map (as defined in implement.md Step 1.3)
258
+ 2. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
259
+ - Were there previous parallel conflict issues ([P] file overlaps)? Flag similar file patterns.
260
+ - Were there tasks that were over-decomposed or under-decomposed? Adjust granularity.
261
+ 3. Script validation (DAG + parallel overlap) — no critic loop, script-based only
262
+ 4. Progress: ` ├─ Tasks generated: {N} ({P} parallelizable)`
142
263
 
143
- 1. Parse tasks.md extract task IDs, [P] markers, `depends:` lists, file paths
144
- 2. Build dependency graph per phase (validate DAG)
145
- 3. **Orchestration mode selection** (per phase, automatic):
264
+ #### Step 3.2: TDD Pre-Generation (conditional)
146
265
 
147
- | [P] tasks in phase | Mode | Strategy |
148
- |---------------------|------|----------|
149
- | 0 | Sequential | Execute tasks one by one |
150
- | 1–5 | Parallel Batch | Register tasks → set dependencies → launch Task() calls |
151
- | 6+ | Swarm | Task pool + self-organizing worker agents (max 5 workers) |
266
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase test-pre-gen`
152
267
 
153
- 4. **Parallel Batch mode** (1–5 [P] tasks):
268
+ **Trigger condition**: tasks.md contains at least 1 task targeting a `.sh` file in `scripts/`.
269
+
270
+ **If triggered**:
271
+ 1. Run the test pre-generation script:
272
+ ```bash
273
+ "${CLAUDE_PLUGIN_ROOT}/scripts/afc-test-pre-gen.sh" ".claude/afc/specs/{feature}/tasks.md" "spec/"
154
274
  ```
155
- TaskCreate({ subject: "T012: Move AudioFadeControl", ... })
156
- TaskCreate({ subject: "T013: Move AudioVolumeControl", ... })
157
- TaskUpdate({ taskId: "T013", addBlockedBy: ["T011"] }) // if dependency exists
158
- → launch unblocked tasks as parallel Task() calls in a single message
159
- → read results → launch newly-unblocked → repeat until phase complete
275
+ 2. Review generated skeleton files verify they are parseable:
276
+ ```bash
277
+ {config.test} # should show Pending examples, not errors
160
278
  ```
279
+ 3. Create `.claude/afc/specs/{feature}/tests-pre.md` listing generated test expectations per task
280
+ 4. Progress: ` ├─ TDD pre-gen: {N} skeletons generated`
161
281
 
162
- 5. **Swarm mode** (6+ [P] tasks):
163
- ```
164
- // 1. Register all phase tasks via TaskCreate
165
- // 2. Set up dependencies via TaskUpdate(addBlockedBy)
166
- // 3. Spawn N worker agents (N = min(5, unblocked count))
167
- Task("Swarm Worker 1", subagent_type: "general-purpose",
168
- prompt: "Self-organizing worker: TaskList → claim → implement → complete → repeat until empty")
169
- Task("Swarm Worker 2", ...)
170
- // 4. Workers self-balance fast workers claim more tasks
171
- // 5. Read all worker results before proceeding to gate
282
+ **If not triggered** (no `.sh` tasks): skip silently.
283
+
284
+ **Note**: Generated tests contain `Pending` examples implementation agents replace these with real assertions during implementation.
285
+
286
+ #### Step 3.3: Blast Radius Analysis (conditional)
287
+
288
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase blast-radius`
289
+
290
+ **Trigger condition**: plan.md File Change Map lists >= 3 files to change.
291
+
292
+ **If triggered**:
293
+ 1. Run the blast radius analysis:
294
+ ```bash
295
+ "${CLAUDE_PLUGIN_ROOT}/scripts/afc-blast-radius.sh" ".claude/afc/specs/{feature}/plan.md" "${CLAUDE_PROJECT_DIR}"
172
296
  ```
297
+ 2. If exit 1 (cycle detected): **ESCALATE** — present the cycle to user with options:
298
+ - Option 1: Refactor plan to break the cycle
299
+ - Option 2: Acknowledge the cycle and proceed (mark as [DEFERRED])
300
+ 3. If high fan-out files detected (>5 dependents): emit warning, add as RISK note in plan.md
301
+ 4. Save output to `.claude/afc/specs/{feature}/impact.md`
302
+ 5. Progress: ` ├─ Blast radius: {N} planned, {M} dependents`
173
303
 
174
- 6. Perform **3-step gate** on each Implementation Phase completion — **always** read `${CLAUDE_PLUGIN_ROOT}/docs/phase-gate-protocol.md` first. Cannot advance to next phase without passing the gate.
304
+ **If not triggered** (< 3 files): skip silently (small changes have bounded blast radius).
305
+
306
+ #### Step 3.4: Execution
307
+
308
+ 1. Execute tasks phase by phase using implement.md orchestration rules (sequential/batch/swarm based on [P] count)
309
+ 2. **Implementation Context injection**: Every sub-agent prompt includes the `## Implementation Context` section from plan.md (ensures spec intent propagates to workers)
310
+ 3. Perform **3-step gate** on each Implementation Phase completion — **always** read `${CLAUDE_PLUGIN_ROOT}/docs/phase-gate-protocol.md` first. Cannot advance to next phase without passing the gate.
175
311
  - On gate pass: create phase rollback point `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase-tag {phase_number}`
176
- 7. Real-time `[x]` updates in tasks.md
177
- 8. After full completion, run `{config.ci}` final verification
312
+ 4. Real-time `[x]` updates in tasks.md
313
+ 5. After full completion, run `{config.ci}` final verification
178
314
  - On pass: `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" ci-pass` (releases Stop Gate)
179
- 9. **Implement retrospective**: if unexpected problems arose that weren't predicted in Plan, record in `.claude/afc/specs/{feature}/retrospective.md` (for memory update in Clean)
180
- 10. Progress: `✓ 4/6 Implement complete ({completed}/{total} tasks, CI: ✓, Mini-Review: ✓, Checkpoint: ✓)`
315
+ - **On fail: Debug-based RCA** (replaces blind retry):
316
+ 1. Execute `/afc:debug` logic inline with the CI error output as input
317
+ 2. Debug performs RCA: error trace → data flow → hypothesis → targeted fix
318
+ 3. Re-run `{config.ci}` after fix
319
+ 4. If debug-fix cycle fails 3 times → **abort** (not a simple fix — requires user intervention)
320
+ 5. This replaces the previous "retry max 3 attempts" pattern with intelligent diagnosis
321
+
322
+ #### Step 3.5: Acceptance Test Generation (conditional)
323
+
324
+ **Trigger condition**: spec.md contains acceptance scenarios (Given/When/Then blocks) AND `{config.test}` is configured (non-empty).
325
+
326
+ **If triggered**:
327
+ 1. Extract all GWT (Given/When/Then) acceptance scenarios from spec.md
328
+ 2. Execute `/afc:test` logic inline — generate test cases from acceptance scenarios:
329
+ ```
330
+ For each acceptance scenario in spec.md:
331
+ - Map GWT to a test case: Given → Arrange, When → Act, Then → Assert
332
+ - Target file: determined by the component/module referenced in the scenario
333
+ - Test file location: follows project convention (test framework from Project Context)
334
+ ```
335
+ 3. Run `{config.test}` to verify tests pass against the implementation
336
+ - If tests fail → this reveals a gap between spec and implementation:
337
+ - Fixable implementation issue → apply targeted fix
338
+ - Spec-implementation mismatch → record as SC shortfall for Review phase
339
+ 4. Progress: ` ├─ Acceptance tests: {N} generated, {M} passing`
340
+
341
+ **If not triggered** (no GWT scenarios or no test framework configured): skip silently.
181
342
 
182
- ### Phase 5: Review (5/6)
343
+ #### Step 3.6: Implement Critic Loop
344
+
345
+ > **Always** read `${CLAUDE_PLUGIN_ROOT}/docs/critic-loop-rules.md` first and follow it.
346
+
347
+ **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
348
+ - **SCOPE_ADHERENCE**: Compare `git diff` changed files against plan.md File Change Map. Flag any file modified that is NOT in the plan. Flag any planned file NOT modified. Provide "M of N files match" count.
349
+ - **ARCHITECTURE**: Validate changed files against `{config.architecture}` rules (layer boundaries, naming conventions, import paths). Provide "N of M rules checked" count.
350
+ - **CORRECTNESS**: Cross-check implemented changes against spec.md acceptance criteria (AC). Verify each AC has corresponding code. Provide "N of M AC verified" count.
351
+ - **Adversarial 3-perspective** (mandatory each pass):
352
+ - Skeptic: "Which implementation assumption is most likely wrong?"
353
+ - Devil's Advocate: "How could this implementation be misused or fail unexpectedly?"
354
+ - Edge-case Hunter: "What input would cause this implementation to fail silently?"
355
+ - State one failure scenario per perspective. If realistic → FAIL + fix. If unrealistic → state quantitative rationale.
356
+ - FAIL → auto-fix, re-run `{config.ci}`, and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
357
+
358
+ 6. **Implement retrospective**: if unexpected problems arose that weren't predicted in Plan, record in `.claude/afc/specs/{feature}/retrospective.md` (for memory update in Clean)
359
+ 7. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase implement` at phase start
360
+ 8. Progress: `✓ 3/5 Implement complete ({completed}/{total} tasks, CI: ✓, Critic: converged ({N} passes, {M} fixes, {E} escalations))`
361
+
362
+ ### Phase 4: Review (4/5)
183
363
 
184
364
  `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase review`
185
365
 
186
- Execute `/afc:review` logic inline:
366
+ Execute `/afc:review` logic inline — **follow all review perspectives defined in `commands/review.md`** (A through H). The review command is the single source of truth for review criteria.
187
367
 
188
368
  1. Review implemented changed files (`git diff HEAD`)
189
- 2. Check code quality, `{config.architecture}` rules, security, performance, `{config.code_style}` pattern compliance
190
- 3. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
369
+ 2. **Specialist agent delegation** (parallel, perspectives B and C):
370
+ Launch architect and security agents in a **single message** to leverage their persistent memory:
371
+ ```
372
+ Task("Architecture Review: {feature}", subagent_type: "afc:afc-architect",
373
+ prompt: "Review the following changed files for architecture compliance.
374
+
375
+ ## Changed Files
376
+ {list of changed files from git diff}
377
+
378
+ ## Architecture Rules
379
+ {config.architecture}
380
+
381
+ ## Instructions
382
+ 1. Read your MEMORY.md for prior architecture patterns and ADRs
383
+ 2. Check each file against architecture rules (layer boundaries, naming, placement)
384
+ 3. Cross-reference with ADRs recorded during Plan phase — any violations?
385
+ 4. Return findings as: severity (Critical/Warning/Info), file:line, issue, suggested fix
386
+ 5. Update your MEMORY.md with any new architecture patterns discovered")
387
+
388
+ Task("Security Review: {feature}", subagent_type: "afc:afc-security",
389
+ prompt: "Scan the following changed files for security vulnerabilities.
390
+
391
+ ## Changed Files
392
+ {list of changed files from git diff}
393
+
394
+ ## Instructions
395
+ 1. Read your MEMORY.md for known vulnerability patterns and false positives
396
+ 2. Check for: command injection, path traversal, unvalidated input, sensitive data exposure
397
+ 3. Skip patterns recorded as false positives in your memory
398
+ 4. Return findings as: severity (Critical/Warning/Info), file:line, issue, suggested fix
399
+ 5. Update your MEMORY.md with new patterns or confirmed false positives")
400
+ ```
401
+ - Collect agent outputs and merge into the consolidated review
402
+ - Agent findings inherit their severity classification directly
403
+ 3. Check across **8 perspectives** (A-H as defined in review.md):
404
+ - A. Code Quality — `{config.code_style}` compliance (direct review)
405
+ - B. Architecture — **delegated to afc-architect agent** (persistent memory, ADR-aware)
406
+ - C. Security — **delegated to afc-security agent** (persistent memory, false-positive-aware)
407
+ - D. Performance — framework-specific patterns from Project Context (direct review)
408
+ - E. Project Pattern Compliance — conventions and idioms (direct review)
409
+ - **F. Reusability** — DRY, shared utilities, abstraction level (direct review)
410
+ - **G. Maintainability** — AI/human comprehension, naming clarity, self-contained files (direct review)
411
+ - **H. Extensibility** — extension points, OCP, future modification cost (direct review)
412
+ 4. **Auto-resolved validation**: Check all `[AUTO-RESOLVED]` items from spec phase — does the implementation match the guess? Flag mismatches as Critical.
413
+ 5. **Past reviews check**: if `.claude/afc/memory/reviews/` exists, scan for recurring finding patterns across past review reports. Prioritize those areas.
414
+ 6. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
191
415
  - Were there recurring Critical finding categories in past reviews? Prioritize those perspectives.
192
416
  - Were there false positives that wasted effort? Reduce sensitivity for those patterns.
193
- 4. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
194
- - COMPLETENESS: cross-check every SC (success criterion) from spec.md one by one. Provide specific metrics if falling short.
417
+ 6. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
418
+ - COMPLETENESS: were all changed files reviewed across all 8 perspectives (A-H)?
419
+ - SPEC_ALIGNMENT: cross-check implementation against spec.md — (1) every SC verified with `{M}/{N}` count, (2) every acceptance scenario (GWT) has corresponding code path, (3) no spec constraint is violated
195
420
  - PRECISION: are there unnecessary changes? Are there out-of-scope modifications?
196
421
  - FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
197
- 5. **Handling SC shortfalls**:
422
+ 7. **Handling SC shortfalls**:
198
423
  - Fixable → attempt auto-fix → re-run `{config.ci}` verification
199
424
  - Not fixable → state in final report with reason (no post-hoc rationalization; record as Plan-phase target-setting error)
200
- 6. Progress: `✓ 5/6 Review complete (Critical:{N} Warning:{N} Info:{N}, SC shortfalls: {N})`
425
+ 8. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase review` at phase start
426
+ 9. Progress: `✓ 4/5 Review complete (Critical:{N} Warning:{N} Info:{N}, SC shortfalls: {N})`
201
427
 
202
- ### Phase 6: Clean (6/6)
428
+ ### Phase 5: Clean (5/5)
203
429
 
204
430
  `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase clean`
205
431
 
@@ -221,6 +447,8 @@ Artifact cleanup and codebase hygiene check after implementation and review:
221
447
  - If there were `[AUTO-RESOLVED]` items → record decisions in `.claude/afc/memory/decisions/`
222
448
  - **If retrospective.md exists** → record as patterns missed by the Plan phase Critic Loop in `.claude/afc/memory/retrospectives/` (reuse as RISK checklist items in future runs)
223
449
  - **If review-report.md exists** → copy to `.claude/afc/memory/reviews/{feature}-{date}.md` before .claude/afc/specs/ deletion
450
+ - **If research.md exists** and was not already persisted in Plan phase → copy to `.claude/afc/memory/research/{feature}.md`
451
+ - **Agent memory consolidation**: architect and security agents have already updated their persistent MEMORY.md during Review phase — no additional action needed (agent memory survives across sessions independently)
224
452
  5. **Quality report** (structured pipeline metrics):
225
453
  - Generate `.claude/afc/memory/quality-history/{feature}-{date}.json` with the following structure:
226
454
  ```json
@@ -228,11 +456,22 @@ Artifact cleanup and codebase hygiene check after implementation and review:
228
456
  "feature": "{feature}",
229
457
  "date": "{YYYY-MM-DD}",
230
458
  "phases": {
231
- "spec": { "user_stories": N, "requirements": { "FR": N, "NFR": N }, "auto_resolved": N, "critic_passes": N, "critic_fixes": N, "escalations": N },
232
- "plan": { "files_planned": N, "critic_passes": N, "critic_fixes": N, "escalations": N },
233
- "tasks": { "total": N, "parallel": N, "phases": N, "critic_passes": N, "critic_fixes": N, "escalations": N },
234
- "implement": { "completed": N, "total": N, "ci_passes": N, "ci_failures": N },
235
- "review": { "critical": N, "warning": N, "info": N, "sc_shortfalls": N, "critic_passes": N, "critic_fixes": N, "escalations": N }
459
+ "clarify": { "triggered": true/false, "questions": N, "auto_resolved": N },
460
+ "spec": { "user_stories": N, "requirements": { "FR": N, "NFR": N }, "researched": N, "auto_resolved": N, "critic_passes": N, "critic_fixes": N, "escalations": N },
461
+ "plan": { "files_planned": N, "implementation_context_words": N, "adr_recorded": N, "adr_conflicts": N, "research_persisted": true/false, "critic_passes": N, "critic_fixes": N, "escalations": N },
462
+ "implement": {
463
+ "tasks": { "total": N, "parallel": N, "phases": N },
464
+ "test_pre_gen": { "triggered": true/false, "skeletons": N },
465
+ "blast_radius": { "triggered": true/false, "dependents": N, "high_fan_out": N },
466
+ "completed": N, "total": N, "ci_passes": N, "ci_failures": N,
467
+ "acceptance_tests": { "triggered": true/false, "generated": N, "passing": N },
468
+ "debug_rca": { "triggered": true/false, "cycles": N },
469
+ "critic_passes": N, "critic_fixes": N, "escalations": N
470
+ },
471
+ "review": { "critical": N, "warning": N, "info": N, "sc_shortfalls": N, "auto_resolved_mismatches": N,
472
+ "architect_agent": { "invoked": true/false, "findings": N },
473
+ "security_agent": { "invoked": true/false, "findings": N },
474
+ "critic_passes": N, "critic_fixes": N, "escalations": N }
236
475
  },
237
476
  "totals": { "changed_files": N, "auto_resolved": N, "escalations": N }
238
477
  }
@@ -252,20 +491,26 @@ Artifact cleanup and codebase hygiene check after implementation and review:
252
491
  - Change tracking log deleted
253
492
  - Safety tag removed (successful completion)
254
493
  - Phase rollback tags removed (handled automatically by pipeline end)
255
- 9. Progress: `✓ 6/6 Clean complete (deleted: {N}, dead code: {N}, CI: ✓)`
494
+ 9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase clean` at phase start
495
+ 10. Progress: `✓ 5/5 Clean complete (deleted: {N}, dead code: {N}, CI: ✓)`
256
496
 
257
497
  ### Final Output
258
498
 
259
499
  ```
260
500
  Auto pipeline complete: {feature}
261
- ├─ Spec: US {N}, FR {N}
262
- ├─ Plan: Critic converged ({N} passes, {M} fixes, {E} escalations), research {present/absent}
263
- ├─ Tasks: {total} (parallel {N})
264
- ├─ Implement: {completed}/{total} tasks, CI ✓, Checkpoint ✓
265
- ├─ Review: Critical:{N} Warning:{N} Info:{N}, SC shortfalls: {N}
266
- ├─ Clean: {N} artifacts deleted, {N} dead code removed
501
+ ├─ 1/5 Spec: US {N}, FR {N}, researched {N}
502
+ ├─ 2/5 Plan: Critic converged ({N} passes), ADR {N} recorded, Implementation Context {W} words
503
+ ├─ 3/5 Implement: {completed}/{total} tasks ({P} parallel), CI ✓
504
+ ├─ TDD: {triggered/skipped}, Blast Radius: {triggered/skipped}
505
+ ├─ Acceptance Tests: {N} generated ({M} passing) / skipped
506
+ │ └─ Critic: converged ({N} passes, {M} fixes, {E} escalations)
507
+ ├─ 4/5 Review: Critical:{N} Warning:{N} Info:{N}
508
+ │ ├─ Perspectives: Quality, Architecture*, Security*, Performance, Patterns, Reusability, Maintainability, Extensibility
509
+ │ └─ (* = delegated to persistent-memory agent)
510
+ ├─ 5/5 Clean: {N} artifacts deleted, {N} dead code removed
267
511
  ├─ Changed files: {N}
268
- ├─ Auto-resolved: {N} (review recommended)
512
+ ├─ Auto-resolved: {N} ({M} validated in review)
513
+ ├─ Agent memory: architect {updated/skipped}, security {updated/skipped}
269
514
  ├─ Retrospective: {present/absent}
270
515
  └─ .claude/afc/specs/{feature}/ cleaned up
271
516
  ```
@@ -280,7 +525,7 @@ Auto pipeline complete: {feature}
280
525
 
281
526
  On abort:
282
527
  ```
283
- Pipeline aborted (Phase {N}/6)
528
+ Pipeline aborted (Phase {N}/5)
284
529
  ├─ Reason: {abort cause}
285
530
  ├─ Completed phases: {completed list}
286
531
  ├─ Rollback: git reset --hard afc/pre-auto (restores state before implementation)
@@ -291,6 +536,7 @@ Pipeline aborted (Phase {N}/6)
291
536
 
292
537
  ## Notes
293
538
 
539
+ - **Full auto does not mean uncritical**: Phase 0.3 Request Triage may reject, reduce, or redirect requests before the pipeline invests resources. "Auto" automates execution, not judgment.
294
540
  - **Full auto**: runs to completion without intermediate confirmation. Fast but direction cannot be changed mid-run.
295
541
  - **Review auto-resolved items**: items tagged `[AUTO-RESOLVED]` are estimates; review after the fact is recommended.
296
542
  - **Large feature warning**: warn before starting if more than 5 User Stories are expected.
@@ -298,7 +544,14 @@ Pipeline aborted (Phase {N}/6)
298
544
  - **Follow project rules**: project rules in `afc.config.md` and `CLAUDE.md` take priority.
299
545
  - **Critic Loop is not a ritual**: a single "PASS" line is equivalent to not running Critic at all. Always follow the format in the Critic Loop rules section. Critic uses convergence-based termination — it may finish in 1 pass or take several, depending on the output quality.
300
546
  - **ESCALATE pauses auto mode**: when a Critic finds an ambiguous issue requiring user judgment, the pipeline pauses and presents options via AskUserQuestion. Auto mode automates clear decisions but escalates ambiguous ones.
547
+ - **Tasks phase is absorbed**: tasks.md is generated automatically at implement start from plan.md's File Change Map. No separate tasks phase or tasks critic loop. Validation is script-based (DAG + parallel overlap checks).
301
548
  - **[P] parallel is mandatory**: if a [P] marker is assigned in tasks.md, it must be executed in parallel. Orchestration mode (batch vs swarm) is selected automatically based on task count. Sequential substitution is prohibited.
302
- - **Swarm mode is automatic**: when a phase has 6+ [P] tasks, swarm workers self-organize via TaskList/TaskUpdate. Do not manually batch.
549
+ - **Swarm mode is automatic**: when a phase has 6+ [P] tasks, the orchestrator pre-assigns tasks to swarm workers. Do not manually batch.
550
+ - **Implementation Context travels with workers**: every sub-agent prompt includes the Implementation Context section from plan.md, ensuring spec intent propagates to parallel workers.
551
+ - **Session context resilience**: key decisions are saved via `save_session_context` at Plan completion and restored at Implement start, surviving context compaction.
552
+ - **Specialist agents enhance review**: afc-architect and afc-security agents are invoked during Review to provide persistent-memory-aware analysis. Their findings are merged into the consolidated review. Agent memory updates happen automatically during the agent call.
553
+ - **Debug-based RCA replaces blind retry**: CI failures trigger `/afc:debug` logic (hypothesis → targeted fix) instead of generic "retry 3 times". This produces better fixes and records patterns via retrospective.
554
+ - **Acceptance tests close the spec-to-code gap**: When spec contains GWT scenarios and a test framework is configured, acceptance tests are auto-generated after implementation, verifying spec intent is met.
555
+ - **Research and ADR persist across sessions**: Research findings are saved to `.claude/afc/memory/research/`, ADRs to architect agent memory. Future pipelines can reference these to avoid re-research and detect conflicts.
303
556
  - **No out-of-scope deletion**: do not delete files/directories in Clean that were not created by the current pipeline.
304
557
  - **NEVER use `run_in_background: true` on Task calls**: agents must run in foreground so results are returned before the next step.
@@ -2,7 +2,6 @@
2
2
  name: afc:checkpoint
3
3
  description: "Save session state"
4
4
  argument-hint: "[checkpoint message]"
5
- disable-model-invocation: true
6
5
  model: haiku
7
6
  allowed-tools:
8
7
  - Read
@@ -31,8 +30,8 @@ Collect automatically:
31
30
  - Last commit hash + message
32
31
  - List of changed files (`git status --short`)
33
32
  2. **Active Features**:
34
- - Check subdirectories under `specs/`
35
- - Progress state of each feature (spec only? through plan? through tasks? implementing?)
33
+ - Check subdirectories under `.claude/afc/specs/`
34
+ - Progress state of each feature (spec only? through plan? implementing?)
36
35
  3. **Tasks Progress**:
37
36
  - If tasks.md exists, count `[x]`/`[ ]` items
38
37
  4. **Current Work Context**:
@@ -56,7 +55,7 @@ Collect automatically:
56
55
  ## Active Features
57
56
  | Feature | Status | Progress |
58
57
  |---------|--------|----------|
59
- | {name} | {spec/plan/tasks/implementing/done} | {N/M tasks} |
58
+ | {name} | {spec/plan/implementing/done} | {N/M tasks} |
60
59
 
61
60
  ## Incomplete Work
62
61
  {concrete next steps}