all-for-claudecode 2.9.1 → 2.11.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/MIGRATION.md +1 -1
- package/README.md +4 -0
- package/package.json +2 -2
- package/schemas/plugin.schema.json +2 -2
- package/scripts/afc-consistency-check.sh +25 -23
- package/scripts/afc-doctor.sh +10 -10
- package/scripts/afc-qa-audit.sh +1 -1
- package/scripts/afc-sync-cache.sh +1 -1
- package/{commands/analyze.md → skills/analyze/SKILL.md} +10 -8
- package/{commands/architect.md → skills/architect/SKILL.md} +3 -3
- package/skills/auto/SKILL.md +1156 -0
- package/{commands/clarify.md → skills/clarify/SKILL.md} +4 -3
- package/{commands/clean.md → skills/clean/SKILL.md} +14 -13
- package/{commands/consult.md → skills/consult/SKILL.md} +19 -18
- package/{commands/implement.md → skills/implement/SKILL.md} +28 -15
- package/{commands/init.md → skills/init/SKILL.md} +5 -1
- package/{commands/learner.md → skills/learner/SKILL.md} +4 -4
- package/{commands/plan.md → skills/plan/SKILL.md} +1 -122
- package/skills/plan/plan-template.md +118 -0
- package/{commands/pr-comment.md → skills/pr-comment/SKILL.md} +4 -4
- package/{commands/principles.md → skills/principles/SKILL.md} +1 -1
- package/{commands/qa.md → skills/qa/SKILL.md} +2 -2
- package/{commands/release-notes.md → skills/release-notes/SKILL.md} +8 -4
- package/{commands/review.md → skills/review/SKILL.md} +11 -11
- package/{commands/security.md → skills/security/SKILL.md} +19 -4
- package/{commands/spec.md → skills/spec/SKILL.md} +2 -77
- package/skills/spec/spec-template.md +72 -0
- package/{commands/triage.md → skills/triage/SKILL.md} +6 -7
- package/commands/auto.md +0 -585
- /package/{commands/checkpoint.md → skills/checkpoint/SKILL.md} +0 -0
- /package/{commands/debug.md → skills/debug/SKILL.md} +0 -0
- /package/{commands/doctor.md → skills/doctor/SKILL.md} +0 -0
- /package/{commands/ideate.md → skills/ideate/SKILL.md} +0 -0
- /package/{commands/launch.md → skills/launch/SKILL.md} +0 -0
- /package/{commands/research.md → skills/research/SKILL.md} +0 -0
- /package/{commands/resume.md → skills/resume/SKILL.md} +0 -0
- /package/{docs → skills/spec}/nfr-templates.md +0 -0
- /package/{commands/tasks.md → skills/tasks/SKILL.md} +0 -0
- /package/{commands/test.md → skills/test/SKILL.md} +0 -0
- /package/{commands/validate.md → skills/validate/SKILL.md} +0 -0
package/commands/auto.md
DELETED
|
@@ -1,585 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: afc:auto
|
|
3
|
-
description: "Full auto pipeline — use when the user asks to run the full afc pipeline automatically or automate the spec-to-clean cycle"
|
|
4
|
-
argument-hint: "[feature description in natural language]"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /afc:auto — Full Auto Pipeline
|
|
8
|
-
|
|
9
|
-
> Runs clarify? → spec → plan → 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.
|
|
13
|
-
|
|
14
|
-
## Arguments
|
|
15
|
-
|
|
16
|
-
- `$ARGUMENTS` — (required) Feature description in natural language
|
|
17
|
-
|
|
18
|
-
## Project Config (auto-loaded)
|
|
19
|
-
|
|
20
|
-
!`cat .claude/afc.config.md 2>/dev/null || echo "[CONFIG NOT FOUND] .claude/afc.config.md not found. Create it with /afc:init."`
|
|
21
|
-
|
|
22
|
-
## Config Load
|
|
23
|
-
|
|
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.*}`:
|
|
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
|
-
|
|
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**
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Critic Loop Rules (common to all phases)
|
|
39
|
-
|
|
40
|
-
> **Always** read `${CLAUDE_PLUGIN_ROOT}/docs/critic-loop-rules.md` first and follow it.
|
|
41
|
-
> Core: minimum 1 concern per criterion + mandatory Adversarial failure scenario each pass + quantitative evidence required. "PASS" as a single word is prohibited. Uses convergence-based termination with 4 verdicts (PASS/FAIL/ESCALATE/DEFER). On ESCALATE: pause and present options to user even in auto mode.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Execution Steps
|
|
46
|
-
|
|
47
|
-
### Phase 0: Preparation
|
|
48
|
-
|
|
49
|
-
1. If `$ARGUMENTS` is empty → print "Please enter a feature description." and abort
|
|
50
|
-
2. Check current branch → `BRANCH_NAME`
|
|
51
|
-
3. Determine feature name (2-3 keywords → kebab-case)
|
|
52
|
-
3.5. **Preflight Check**:
|
|
53
|
-
```bash
|
|
54
|
-
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-preflight-check.sh"
|
|
55
|
-
```
|
|
56
|
-
- If exit 1 (hard failure) → print error and **abort**
|
|
57
|
-
- If warnings only (exit 0) → print warnings and continue
|
|
58
|
-
4. **Activate Pipeline Flag** (hook integration):
|
|
59
|
-
```bash
|
|
60
|
-
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" start {feature}
|
|
61
|
-
```
|
|
62
|
-
- Safety Snapshot created automatically (`afc/pre-auto` git tag)
|
|
63
|
-
- Stop Gate Hook activated (blocks response termination on CI failure)
|
|
64
|
-
- File change tracking started
|
|
65
|
-
- Timeline log: `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" log pipeline-start "Auto pipeline: {feature}"`
|
|
66
|
-
5. Create `.claude/afc/specs/{feature}/` directory → **record path as `PIPELINE_ARTIFACT_DIR`** (for Clean scope)
|
|
67
|
-
6. Start notification:
|
|
68
|
-
```
|
|
69
|
-
Auto pipeline started: {feature}
|
|
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)
|
|
72
|
-
```
|
|
73
|
-
|
|
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: **rollback fast-path changes** (`git reset --hard afc/pre-auto`), then restart with full pipeline: `⚠ Fast-path aborted — change is more complex than expected. Rolling back and running full pipeline.`
|
|
115
|
-
3. If change touches > 2 files OR modifies any `.sh` script: **rollback fast-path changes** (`git reset --hard afc/pre-auto`), then 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)
|
|
156
|
-
|
|
157
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase spec`
|
|
158
|
-
|
|
159
|
-
Execute `/afc:spec` logic inline:
|
|
160
|
-
|
|
161
|
-
1. Explore codebase for related code (Glob, Grep) — explore by `{config.architecture}` layer
|
|
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 the **most recent 10 files** (sorted by filename descending) and check:
|
|
174
|
-
- Were there previous `[AUTO-RESOLVED]` items that turned out wrong? Flag similar patterns.
|
|
175
|
-
- Were there scope-related issues in past specs? Warn about similar ambiguities.
|
|
176
|
-
6. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
|
|
177
|
-
- COMPLETENESS: does every User Story have acceptance scenarios? Any missing requirements?
|
|
178
|
-
- MEASURABILITY: are success criteria measurable, not subjective? **Is quantitative evidence provided for numerical targets?**
|
|
179
|
-
- INDEPENDENCE: are implementation details (code, library names) absent from the spec?
|
|
180
|
-
- EDGE_CASES: are at least 2 identified? Any missing boundary conditions?
|
|
181
|
-
- FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
|
|
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))`
|
|
184
|
-
|
|
185
|
-
### Phase 2: Plan (2/5)
|
|
186
|
-
|
|
187
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase plan`
|
|
188
|
-
|
|
189
|
-
Execute `/afc:plan` logic inline:
|
|
190
|
-
|
|
191
|
-
1. Load spec.md
|
|
192
|
-
2. If technical uncertainties exist → auto-resolve via WebSearch/code exploration → create research.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 the **most recent 10 files** (sorted by filename descending) 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 the **most recent 30 files** (sorted by filename descending) and check for conflicts with the current feature's design direction. Flag any contradictions.
|
|
196
|
-
- **Reviews**: if `.claude/afc/memory/reviews/` exists, load the **most recent 15 files** (sorted by filename descending) and 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`
|
|
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")
|
|
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
|
|
207
|
-
- **RISK criterion mandatory checks**:
|
|
208
|
-
- Enumerate **at least 3** `{config.ci}` failure scenarios and describe mitigation
|
|
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.)
|
|
211
|
-
- **ARCHITECTURE criterion**: explicitly describe import paths for moved/created files and pre-validate against `{config.architecture}` rules
|
|
212
|
-
- Each pass must **explicitly explore what was missed in the previous pass** ("Pass 2: {X} was missed in pass 1. Further review: ...")
|
|
213
|
-
- FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
|
|
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**: Write key decisions to `.claude/afc/specs/{feature}/context.md` for compaction resilience:
|
|
235
|
-
```markdown
|
|
236
|
-
# Session Context: {feature}
|
|
237
|
-
## Goal
|
|
238
|
-
- Original request: $ARGUMENTS
|
|
239
|
-
- Current objective: Implement {feature}
|
|
240
|
-
## Acceptance Criteria (from spec.md)
|
|
241
|
-
{copy ALL FR-*, NFR-*, SC-* items and GWT acceptance scenarios from spec.md verbatim}
|
|
242
|
-
## Key Decisions
|
|
243
|
-
- {what}: {rationale}
|
|
244
|
-
## Discoveries
|
|
245
|
-
- {file path}: {finding}
|
|
246
|
-
```
|
|
247
|
-
This file is read at Implement start to restore context after compaction. The full AC section ensures Review phase (Phase 4) can verify spec compliance even after spec.md is compacted.
|
|
248
|
-
9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase plan` at phase start
|
|
249
|
-
10. Progress: `✓ 2/5 Plan complete (Critic: converged ({N} passes, {M} fixes, {E} escalations), files: {N}, ADR: {N} recorded, Implementation Context: {W} words)`
|
|
250
|
-
|
|
251
|
-
### Phase 3: Implement (3/5)
|
|
252
|
-
|
|
253
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase implement`
|
|
254
|
-
|
|
255
|
-
**Session context reload**: At implement start, read `.claude/afc/specs/{feature}/context.md` if it exists. This restores key decisions and constraints from Plan phase (resilient to context compaction).
|
|
256
|
-
|
|
257
|
-
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.
|
|
258
|
-
|
|
259
|
-
**Auto-specific additions** (beyond implement.md):
|
|
260
|
-
|
|
261
|
-
#### Step 3.1: Task Generation + Validation
|
|
262
|
-
|
|
263
|
-
1. Generate tasks.md from plan.md File Change Map (as defined in implement.md Step 1.3)
|
|
264
|
-
2. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load the **most recent 10 files** (sorted by filename descending) and check:
|
|
265
|
-
- Were there previous parallel conflict issues ([P] file overlaps)? Flag similar file patterns.
|
|
266
|
-
- Were there tasks that were over-decomposed or under-decomposed? Adjust granularity.
|
|
267
|
-
3. Script validation (DAG + parallel overlap) — no critic loop, script-based only
|
|
268
|
-
4. Progress: ` ├─ Tasks generated: {N} ({P} parallelizable)`
|
|
269
|
-
|
|
270
|
-
#### Step 3.2: TDD Pre-Generation (conditional)
|
|
271
|
-
|
|
272
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase test-pre-gen`
|
|
273
|
-
|
|
274
|
-
**Trigger condition**: tasks.md contains at least 1 task targeting a `.sh` file in `scripts/`.
|
|
275
|
-
|
|
276
|
-
**If triggered**:
|
|
277
|
-
1. Run the test pre-generation script:
|
|
278
|
-
```bash
|
|
279
|
-
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-test-pre-gen.sh" ".claude/afc/specs/{feature}/tasks.md" "spec/"
|
|
280
|
-
```
|
|
281
|
-
2. Review generated skeleton files — verify they are parseable:
|
|
282
|
-
```bash
|
|
283
|
-
{config.test} # should show Pending examples, not errors
|
|
284
|
-
```
|
|
285
|
-
3. Create `.claude/afc/specs/{feature}/tests-pre.md` listing generated test expectations per task
|
|
286
|
-
4. Progress: ` ├─ TDD pre-gen: {N} skeletons generated`
|
|
287
|
-
|
|
288
|
-
**If not triggered** (no `.sh` tasks): skip silently.
|
|
289
|
-
|
|
290
|
-
**Note**: Generated tests contain `Pending` examples — implementation agents replace these with real assertions during implementation.
|
|
291
|
-
|
|
292
|
-
#### Step 3.3: Blast Radius Analysis (conditional)
|
|
293
|
-
|
|
294
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase blast-radius`
|
|
295
|
-
|
|
296
|
-
**Trigger condition**: plan.md File Change Map lists >= 3 files to change.
|
|
297
|
-
|
|
298
|
-
**If triggered**:
|
|
299
|
-
1. Run the blast radius analysis:
|
|
300
|
-
```bash
|
|
301
|
-
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-blast-radius.sh" ".claude/afc/specs/{feature}/plan.md" "${CLAUDE_PROJECT_DIR}"
|
|
302
|
-
```
|
|
303
|
-
2. If exit 1 (cycle detected): **ESCALATE** — present the cycle to user with options:
|
|
304
|
-
- Option 1: Refactor plan to break the cycle
|
|
305
|
-
- Option 2: Acknowledge the cycle and proceed (mark as [DEFERRED])
|
|
306
|
-
3. If high fan-out files detected (>5 dependents): emit warning, add as RISK note in plan.md
|
|
307
|
-
4. Save output to `.claude/afc/specs/{feature}/impact.md`
|
|
308
|
-
5. Progress: ` ├─ Blast radius: {N} planned, {M} dependents`
|
|
309
|
-
|
|
310
|
-
**If not triggered** (< 3 files): skip silently (small changes have bounded blast radius).
|
|
311
|
-
|
|
312
|
-
#### Step 3.4: Execution
|
|
313
|
-
|
|
314
|
-
0. **Baseline test** (follows implement.md Step 1, item 5): if `{config.test}` is non-empty, run `{config.test}` before starting task execution. On failure, report pre-existing test failures to user and ask: "(1) Proceed anyway (2) Fix first (3) Abort". On pass or empty config, continue.
|
|
315
|
-
1. Execute tasks phase by phase using implement.md orchestration rules (sequential/batch/swarm based on [P] count)
|
|
316
|
-
2. **Implementation Context injection**: Every sub-agent prompt includes the `## Implementation Context` section from plan.md **and relevant FR/AC items from spec.md** (ensures spec intent propagates to workers)
|
|
317
|
-
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.
|
|
318
|
-
- On gate pass: create phase rollback point `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase-tag {phase_number}`
|
|
319
|
-
4. Real-time `[x]` updates in tasks.md
|
|
320
|
-
5. After full completion, run `{config.ci}` final verification
|
|
321
|
-
- On pass: `"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" ci-pass` (releases Stop Gate)
|
|
322
|
-
- **On fail: Debug-based RCA** (replaces blind retry):
|
|
323
|
-
1. Execute `/afc:debug` logic inline with the CI error output as input
|
|
324
|
-
2. Debug performs RCA: error trace → data flow → hypothesis → targeted fix
|
|
325
|
-
3. Re-run `{config.ci}` after fix
|
|
326
|
-
4. If debug-fix cycle fails 3 times → **abort** (not a simple fix — requires user intervention)
|
|
327
|
-
5. This replaces the previous "retry max 3 attempts" pattern with intelligent diagnosis
|
|
328
|
-
|
|
329
|
-
#### Step 3.5: Acceptance Test Generation (conditional)
|
|
330
|
-
|
|
331
|
-
**Trigger condition**: spec.md contains acceptance scenarios (Given/When/Then blocks) AND `{config.test}` is configured (non-empty).
|
|
332
|
-
|
|
333
|
-
**If triggered**:
|
|
334
|
-
1. Extract all GWT (Given/When/Then) acceptance scenarios from spec.md
|
|
335
|
-
2. Execute `/afc:test` logic inline — generate test cases from acceptance scenarios:
|
|
336
|
-
```
|
|
337
|
-
For each acceptance scenario in spec.md:
|
|
338
|
-
- Map GWT to a test case: Given → Arrange, When → Act, Then → Assert
|
|
339
|
-
- Target file: determined by the component/module referenced in the scenario
|
|
340
|
-
- Test file location: follows project convention (test framework from Project Context)
|
|
341
|
-
```
|
|
342
|
-
3. Run `{config.test}` to verify tests pass against the implementation
|
|
343
|
-
- If tests fail → this reveals a gap between spec and implementation:
|
|
344
|
-
- Fixable implementation issue → apply targeted fix
|
|
345
|
-
- Spec-implementation mismatch → record as SC shortfall for Review phase
|
|
346
|
-
4. Progress: ` ├─ Acceptance tests: {N} generated, {M} passing`
|
|
347
|
-
|
|
348
|
-
**If not triggered** (no GWT scenarios or no test framework configured): skip silently.
|
|
349
|
-
|
|
350
|
-
#### Step 3.6: Implement Critic Loop
|
|
351
|
-
|
|
352
|
-
> **Always** read `${CLAUDE_PLUGIN_ROOT}/docs/critic-loop-rules.md` first and follow it.
|
|
353
|
-
|
|
354
|
-
**Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
|
|
355
|
-
- **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.
|
|
356
|
-
- **ARCHITECTURE**: Validate changed files against `{config.architecture}` rules (layer boundaries, naming conventions, import paths). Provide "N of M rules checked" count.
|
|
357
|
-
- **CORRECTNESS**: Cross-check implemented changes against spec.md acceptance criteria (AC). Verify each AC has corresponding code. Provide "N of M AC verified" count.
|
|
358
|
-
- **SIDE_EFFECT_SAFETY**: For tasks that changed call order, error handling, or state flow: verify that callee behavior is compatible with the new usage. Read callee implementations when uncertain (do not rely on function names alone).
|
|
359
|
-
- **Adversarial 3-perspective** (mandatory each pass):
|
|
360
|
-
- Skeptic: "Which implementation assumption is most likely wrong?"
|
|
361
|
-
- Devil's Advocate: "How could this implementation be misused or fail unexpectedly?"
|
|
362
|
-
- Edge-case Hunter: "What input would cause this implementation to fail silently?"
|
|
363
|
-
- State one failure scenario per perspective. If realistic → FAIL + fix. If unrealistic → state quantitative rationale.
|
|
364
|
-
- FAIL → auto-fix, re-run `{config.ci}`, and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
|
|
365
|
-
|
|
366
|
-
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)
|
|
367
|
-
7. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase implement` at phase start
|
|
368
|
-
8. Progress: `✓ 3/5 Implement complete ({completed}/{total} tasks, CI: ✓, Critic: converged ({N} passes, {M} fixes, {E} escalations))`
|
|
369
|
-
|
|
370
|
-
### Phase 4: Review (4/5)
|
|
371
|
-
|
|
372
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase review`
|
|
373
|
-
|
|
374
|
-
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.
|
|
375
|
-
|
|
376
|
-
**Context reload**: Re-read `.claude/afc/specs/{feature}/context.md` (contains full AC) and `.claude/afc/specs/{feature}/spec.md` to ensure spec context is available for SPEC_ALIGNMENT validation (these may have been compacted since Phase 1).
|
|
377
|
-
|
|
378
|
-
1. Review implemented changed files (`git diff HEAD`)
|
|
379
|
-
2. **Specialist agent delegation** (parallel, perspectives B and C):
|
|
380
|
-
Launch architect and security agents in a **single message** to leverage their persistent memory:
|
|
381
|
-
```
|
|
382
|
-
Task("Architecture Review: {feature}", subagent_type: "afc:afc-architect",
|
|
383
|
-
prompt: "Review the following changed files for architecture compliance.
|
|
384
|
-
|
|
385
|
-
## Changed Files
|
|
386
|
-
{list of changed files from git diff}
|
|
387
|
-
|
|
388
|
-
## Architecture Rules
|
|
389
|
-
{config.architecture}
|
|
390
|
-
|
|
391
|
-
## Instructions
|
|
392
|
-
1. Read your MEMORY.md for prior architecture patterns and ADRs
|
|
393
|
-
2. Check each file against architecture rules (layer boundaries, naming, placement)
|
|
394
|
-
3. Cross-reference with ADRs recorded during Plan phase — any violations?
|
|
395
|
-
4. Return findings as: severity (Critical/Warning/Info), file:line, issue, suggested fix
|
|
396
|
-
5. Update your MEMORY.md with any new architecture patterns discovered")
|
|
397
|
-
|
|
398
|
-
Task("Security Review: {feature}", subagent_type: "afc:afc-security",
|
|
399
|
-
prompt: "Scan the following changed files for security vulnerabilities.
|
|
400
|
-
|
|
401
|
-
## Changed Files
|
|
402
|
-
{list of changed files from git diff}
|
|
403
|
-
|
|
404
|
-
## Instructions
|
|
405
|
-
1. Read your MEMORY.md for known vulnerability patterns and false positives
|
|
406
|
-
2. Check for: command injection, path traversal, unvalidated input, sensitive data exposure
|
|
407
|
-
3. Skip patterns recorded as false positives in your memory
|
|
408
|
-
4. Return findings as: severity (Critical/Warning/Info), file:line, issue, suggested fix
|
|
409
|
-
5. Update your MEMORY.md with new patterns or confirmed false positives")
|
|
410
|
-
```
|
|
411
|
-
- Collect agent outputs and merge into the consolidated review
|
|
412
|
-
- Agent findings inherit their severity classification directly
|
|
413
|
-
3. Check across **8 perspectives** (A-H as defined in review.md):
|
|
414
|
-
- A. Code Quality — `{config.code_style}` compliance (direct review)
|
|
415
|
-
- B. Architecture — **delegated to afc-architect agent** (persistent memory, ADR-aware)
|
|
416
|
-
- C. Security — **delegated to afc-security agent** (persistent memory, false-positive-aware)
|
|
417
|
-
- D. Performance — framework-specific patterns from Project Context (direct review)
|
|
418
|
-
- E. Project Pattern Compliance — conventions and idioms (direct review)
|
|
419
|
-
- **F. Reusability** — DRY, shared utilities, abstraction level (direct review)
|
|
420
|
-
- **G. Maintainability** — AI/human comprehension, naming clarity, self-contained files (direct review)
|
|
421
|
-
- **H. Extensibility** — extension points, OCP, future modification cost (direct review)
|
|
422
|
-
4. **Auto-resolved validation**: Check all `[AUTO-RESOLVED]` items from spec phase — does the implementation match the guess? Flag mismatches as Critical.
|
|
423
|
-
5. **Past reviews check**: if `.claude/afc/memory/reviews/` exists, load the **most recent 15 files** (sorted by filename descending) and scan for recurring finding patterns across past review reports. Prioritize those areas.
|
|
424
|
-
6. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load the **most recent 10 files** (sorted by filename descending) and check:
|
|
425
|
-
- Were there recurring Critical finding categories in past reviews? Prioritize those perspectives.
|
|
426
|
-
- Were there false positives that wasted effort? Reduce sensitivity for those patterns.
|
|
427
|
-
7. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
|
|
428
|
-
- COMPLETENESS: were all changed files reviewed across all 8 perspectives (A-H)?
|
|
429
|
-
- 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
|
|
430
|
-
- PRECISION: are there unnecessary changes? Are there out-of-scope modifications?
|
|
431
|
-
- FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
|
|
432
|
-
8. **Handling SC shortfalls**:
|
|
433
|
-
- Fixable → attempt auto-fix → re-run `{config.ci}` verification
|
|
434
|
-
- Not fixable → state in final report with reason (no post-hoc rationalization; record as Plan-phase target-setting error)
|
|
435
|
-
9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase review` at phase start
|
|
436
|
-
10. Progress: `✓ 4/5 Review complete (Critical:{N} Warning:{N} Info:{N}, SC shortfalls: {N})`
|
|
437
|
-
|
|
438
|
-
### Phase 5: Clean (5/5)
|
|
439
|
-
|
|
440
|
-
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase clean`
|
|
441
|
-
|
|
442
|
-
Artifact cleanup and codebase hygiene check after implementation and review:
|
|
443
|
-
|
|
444
|
-
1. **Artifact cleanup** (scope-limited):
|
|
445
|
-
- **Delete only the `.claude/afc/specs/{feature}/` directory created by the current pipeline**
|
|
446
|
-
- If other `.claude/afc/specs/` subdirectories exist, **do not delete them** (only inform the user of their existence)
|
|
447
|
-
- Do not leave pipeline intermediate artifacts in the codebase
|
|
448
|
-
2. **Dead code scan** (prefer external tooling over LLM judgment):
|
|
449
|
-
- Run `{config.gate}` / `{config.ci}` — most linters detect unused imports/variables automatically
|
|
450
|
-
- If the project has dedicated dead code tools (e.g., `eslint --rule 'no-unused-vars'`, `ts-prune`, `knip`), use them first
|
|
451
|
-
- Only fall back to LLM-based scan for detection that static tools cannot cover
|
|
452
|
-
- Remove empty directories from moved/deleted files
|
|
453
|
-
- Detect unused exports (re-exports of moved code from original locations etc.)
|
|
454
|
-
3. **Final CI gate**:
|
|
455
|
-
- Run `{config.ci}` final execution
|
|
456
|
-
- Auto-fix on failure (max 2 attempts)
|
|
457
|
-
4. **Memory update** (if applicable):
|
|
458
|
-
- Reusable patterns found during pipeline → record in `.claude/afc/memory/`
|
|
459
|
-
- If there were `[AUTO-RESOLVED]` items → record decisions in `.claude/afc/memory/decisions/`
|
|
460
|
-
- **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)
|
|
461
|
-
- **If review-report.md exists** → copy to `.claude/afc/memory/reviews/{feature}-{date}.md` before .claude/afc/specs/ deletion
|
|
462
|
-
- **If research.md exists** and was not already persisted in Plan phase → copy to `.claude/afc/memory/research/{feature}.md`
|
|
463
|
-
- **Agent memory consolidation**: architect and security agents have already updated their persistent MEMORY.md during Review phase. **Size enforcement**: check each agent's MEMORY.md line count — if either exceeds 100 lines, invoke the respective agent to self-prune:
|
|
464
|
-
```
|
|
465
|
-
Task("Memory cleanup: afc-architect", subagent_type: "afc:afc-architect",
|
|
466
|
-
prompt: "Your MEMORY.md exceeds 100 lines. Read it, prune old/redundant entries, and rewrite to under 100 lines following your size limit rules.")
|
|
467
|
-
```
|
|
468
|
-
(Same pattern for afc-security if needed. Skip if both are under 100 lines.)
|
|
469
|
-
- **Memory rotation**: for each memory subdirectory, check file count and prune oldest files if over threshold:
|
|
470
|
-
| Directory | Threshold | Action |
|
|
471
|
-
|-----------|-----------|--------|
|
|
472
|
-
| `quality-history/` | 30 files | Delete oldest files beyond threshold |
|
|
473
|
-
| `reviews/` | 40 files | Delete oldest files beyond threshold |
|
|
474
|
-
| `retrospectives/` | 30 files | Delete oldest files beyond threshold |
|
|
475
|
-
| `research/` | 50 files | Delete oldest files beyond threshold |
|
|
476
|
-
| `decisions/` | 60 files | Delete oldest files beyond threshold |
|
|
477
|
-
- Sort by filename ascending (oldest first), delete excess
|
|
478
|
-
- Log: `"Memory rotation: {dir} pruned {N} files"`
|
|
479
|
-
- Skip directories that do not exist or are under threshold
|
|
480
|
-
5. **Quality report** (structured pipeline metrics):
|
|
481
|
-
- Generate `.claude/afc/memory/quality-history/{feature}-{date}.json` with the following structure:
|
|
482
|
-
```json
|
|
483
|
-
{
|
|
484
|
-
"feature": "{feature}",
|
|
485
|
-
"date": "{YYYY-MM-DD}",
|
|
486
|
-
"phases": {
|
|
487
|
-
"clarify": { "triggered": true/false, "questions": N, "auto_resolved": N },
|
|
488
|
-
"spec": { "user_stories": N, "requirements": { "FR": N, "NFR": N }, "researched": N, "auto_resolved": N, "critic_passes": N, "critic_fixes": N, "escalations": N },
|
|
489
|
-
"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 },
|
|
490
|
-
"implement": {
|
|
491
|
-
"tasks": { "total": N, "parallel": N, "phases": N },
|
|
492
|
-
"test_pre_gen": { "triggered": true/false, "skeletons": N },
|
|
493
|
-
"blast_radius": { "triggered": true/false, "dependents": N, "high_fan_out": N },
|
|
494
|
-
"completed": N, "total": N, "ci_passes": N, "ci_failures": N,
|
|
495
|
-
"acceptance_tests": { "triggered": true/false, "generated": N, "passing": N },
|
|
496
|
-
"debug_rca": { "triggered": true/false, "cycles": N },
|
|
497
|
-
"critic_passes": N, "critic_fixes": N, "escalations": N
|
|
498
|
-
},
|
|
499
|
-
"review": { "critical": N, "warning": N, "info": N, "sc_shortfalls": N, "auto_resolved_mismatches": N,
|
|
500
|
-
"architect_agent": { "invoked": true/false, "findings": N },
|
|
501
|
-
"security_agent": { "invoked": true/false, "findings": N },
|
|
502
|
-
"critic_passes": N, "critic_fixes": N, "escalations": N }
|
|
503
|
-
},
|
|
504
|
-
"totals": { "changed_files": N, "auto_resolved": N, "escalations": N, "totalPromptCount": N }
|
|
505
|
-
}
|
|
506
|
-
```
|
|
507
|
-
- Create `.claude/afc/memory/quality-history/` directory if it does not exist
|
|
508
|
-
6. **Checkpoint reset**:
|
|
509
|
-
- Clear `.claude/afc/memory/checkpoint.md` **and** `~/.claude/projects/{ENCODED_PATH}/memory/checkpoint.md` (pipeline complete = session goal achieved, dual-delete prevents stale checkpoint in either location; `ENCODED_PATH` = project path with `/` replaced by `-`)
|
|
510
|
-
7. **Timeline finalize**:
|
|
511
|
-
```bash
|
|
512
|
-
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" log pipeline-end "Pipeline complete: {feature}"
|
|
513
|
-
```
|
|
514
|
-
8. **Release Pipeline Flag** (hook integration):
|
|
515
|
-
```bash
|
|
516
|
-
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" end
|
|
517
|
-
```
|
|
518
|
-
- Stop Gate Hook deactivated
|
|
519
|
-
- Change tracking log deleted
|
|
520
|
-
- Safety tag removed (successful completion)
|
|
521
|
-
- Phase rollback tags removed (handled automatically by pipeline end)
|
|
522
|
-
9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase clean` at phase start
|
|
523
|
-
10. Progress: `✓ 5/5 Clean complete (deleted: {N}, dead code: {N}, CI: ✓)`
|
|
524
|
-
|
|
525
|
-
### Final Output
|
|
526
|
-
|
|
527
|
-
```
|
|
528
|
-
Auto pipeline complete: {feature}
|
|
529
|
-
├─ 1/5 Spec: US {N}, FR {N}, researched {N}
|
|
530
|
-
├─ 2/5 Plan: Critic converged ({N} passes), ADR {N} recorded, Implementation Context {W} words
|
|
531
|
-
├─ 3/5 Implement: {completed}/{total} tasks ({P} parallel), CI ✓
|
|
532
|
-
│ ├─ TDD: {triggered/skipped}, Blast Radius: {triggered/skipped}
|
|
533
|
-
│ ├─ Acceptance Tests: {N} generated ({M} passing) / skipped
|
|
534
|
-
│ └─ Critic: converged ({N} passes, {M} fixes, {E} escalations)
|
|
535
|
-
├─ 4/5 Review: Critical:{N} Warning:{N} Info:{N}
|
|
536
|
-
│ ├─ Perspectives: Quality, Architecture*, Security*, Performance, Patterns, Reusability, Maintainability, Extensibility
|
|
537
|
-
│ └─ (* = delegated to persistent-memory agent)
|
|
538
|
-
├─ 5/5 Clean: {N} artifacts deleted, {N} dead code removed
|
|
539
|
-
├─ Changed files: {N}
|
|
540
|
-
├─ Auto-resolved: {N} ({M} validated in review)
|
|
541
|
-
├─ Agent memory: architect {updated/skipped}, security {updated/skipped}
|
|
542
|
-
├─ Retrospective: {present/absent}
|
|
543
|
-
└─ .claude/afc/specs/{feature}/ cleaned up
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
## Abort Conditions
|
|
547
|
-
|
|
548
|
-
**Abort** the pipeline and report to user in these situations:
|
|
549
|
-
|
|
550
|
-
1. `{config.ci}` fails 3 consecutive times
|
|
551
|
-
2. File conflict during implementation (overlaps with changes from another branch)
|
|
552
|
-
3. Critical security issue found (cannot auto-fix)
|
|
553
|
-
|
|
554
|
-
On abort:
|
|
555
|
-
```
|
|
556
|
-
Pipeline aborted (Phase {N}/5)
|
|
557
|
-
├─ Reason: {abort cause}
|
|
558
|
-
├─ Completed phases: {completed list}
|
|
559
|
-
├─ Rollback: git reset --hard afc/pre-auto (restores state before implementation)
|
|
560
|
-
├─ Checkpoint: .claude/afc/memory/checkpoint.md (last phase gate passed)
|
|
561
|
-
├─ Artifacts: .claude/afc/specs/{feature}/ (partial completion, manual deletion needed if Clean did not run)
|
|
562
|
-
└─ Resume: /afc:resume → /afc:implement (checkpoint-based)
|
|
563
|
-
```
|
|
564
|
-
|
|
565
|
-
## Notes
|
|
566
|
-
|
|
567
|
-
- **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.
|
|
568
|
-
- **Full auto**: runs to completion without intermediate confirmation. Fast but direction cannot be changed mid-run.
|
|
569
|
-
- **Review auto-resolved items**: items tagged `[AUTO-RESOLVED]` are estimates; review after the fact is recommended.
|
|
570
|
-
- **Large feature warning**: warn before starting if more than 5 User Stories are expected.
|
|
571
|
-
- **Read existing code first**: always read existing files before modifying. Do not blindly generate code.
|
|
572
|
-
- **Follow project rules**: project rules in `afc.config.md` and `CLAUDE.md` take priority.
|
|
573
|
-
- **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.
|
|
574
|
-
- **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.
|
|
575
|
-
- **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).
|
|
576
|
-
- **[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.
|
|
577
|
-
- **Swarm mode is automatic**: when a phase has 6+ [P] tasks, the orchestrator pre-assigns tasks to swarm workers. Do not manually batch.
|
|
578
|
-
- **Implementation Context travels with workers**: every sub-agent prompt includes the Implementation Context section from plan.md, ensuring spec intent propagates to parallel workers.
|
|
579
|
-
- **Session context resilience**: key decisions are written to `.claude/afc/specs/{feature}/context.md` at Plan completion and read at Implement start, surviving context compaction.
|
|
580
|
-
- **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.
|
|
581
|
-
- **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.
|
|
582
|
-
- **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.
|
|
583
|
-
- **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.
|
|
584
|
-
- **No out-of-scope deletion**: do not delete files/directories in Clean that were not created by the current pipeline.
|
|
585
|
-
- **NEVER use `run_in_background: true` on Task calls**: agents must run in foreground so results are returned before the next step.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|