all-for-claudecode 2.1.0 → 2.2.1
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 +1 -1
- package/README.md +131 -113
- package/agents/afc-architect.md +2 -0
- package/commands/analyze.md +5 -6
- package/commands/architect.md +6 -8
- package/commands/auto.md +31 -25
- package/commands/checkpoint.md +0 -1
- package/commands/debug.md +1 -1
- package/commands/doctor.md +1 -2
- package/commands/ideate.md +191 -0
- package/commands/implement.md +5 -5
- package/commands/init.md +60 -49
- package/commands/launch.md +181 -0
- package/commands/plan.md +1 -7
- package/commands/principles.md +0 -1
- package/commands/resume.md +6 -4
- package/commands/review.md +2 -2
- package/commands/security.md +10 -13
- package/commands/spec.md +2 -1
- package/commands/test.md +4 -4
- package/docs/phase-gate-protocol.md +18 -6
- package/hooks/hooks.json +2 -4
- package/package.json +15 -9
- package/scripts/afc-consistency-check.sh +286 -0
- package/scripts/afc-dag-validate.sh +3 -2
- package/scripts/afc-notify.sh +5 -6
- package/scripts/afc-parallel-validate.sh +3 -5
- package/scripts/afc-permission-request.sh +27 -3
- package/scripts/afc-pipeline-manage.sh +24 -11
- package/scripts/afc-state.sh +42 -26
- package/scripts/afc-stop-gate.sh +4 -6
- package/scripts/afc-stop-todo-check.sh +83 -0
- package/scripts/afc-subagent-context.sh +7 -0
- package/scripts/afc-task-completed-gate.sh +4 -6
- package/scripts/pre-compact-checkpoint.sh +19 -4
- package/scripts/session-start-context.sh +11 -3
- package/templates/afc.config.template.md +12 -76
- package/templates/afc.config.express-api.md +0 -99
- package/templates/afc.config.monorepo.md +0 -98
- package/templates/afc.config.nextjs-fsd.md +0 -107
- package/templates/afc.config.react-spa.md +0 -96
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Automated pipeline for Claude Code — spec → plan → implement → review → clean",
|
|
9
|
-
"version": "2.1
|
|
9
|
+
"version": "2.2.1"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "afc",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Automated pipeline for Claude Code. Automates the full development cycle: spec → plan → implement → review → clean.",
|
|
16
|
-
"version": "2.1
|
|
16
|
+
"version": "2.2.1",
|
|
17
17
|
"category": "automation",
|
|
18
18
|
"tags": ["pipeline", "automation", "spec", "plan", "implement", "review", "critic-loop"]
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "afc",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Automated pipeline for Claude Code. Automates the full development cycle: spec → plan → implement → review → clean.",
|
|
5
5
|
"author": { "name": "jhlee0409", "email": "relee6203@gmail.com" },
|
|
6
6
|
"homepage": "https://github.com/jhlee0409/all-for-claudecode",
|
package/README.md
CHANGED
|
@@ -1,82 +1,103 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://github.com/user-attachments/assets/9e23029e-e326-4cfa-b329-3bdd1006aecd" alt="all-for-claudecode" width="640" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
1
5
|
# all-for-claudecode
|
|
2
6
|
|
|
3
7
|
**Claude Code plugin that automates the full development cycle — spec → plan → implement → review → clean.**
|
|
4
8
|
|
|
5
9
|
[](https://www.npmjs.com/package/all-for-claudecode)
|
|
10
|
+
[](https://www.npmjs.com/package/all-for-claudecode)
|
|
6
11
|
[](./LICENSE)
|
|
7
|
-
[](#15-hook-events)
|
|
9
|
-
[](#18-slash-commands)
|
|
10
|
-
|
|
11
|
-
> Zero-dependency automation pipeline for Claude Code. One command (`/afc:auto`) runs the entire cycle: write specs, design plans, implement code, review quality, and clean up — all with built-in CI gates and critic loops.
|
|
12
|
-
|
|
13
|
-
## What is all-for-claudecode?
|
|
14
|
-
|
|
15
|
-
all-for-claudecode is a **Claude Code plugin** that transforms your development workflow into a fully automated pipeline. Instead of manually prompting Claude through each development phase, you run a single command and the pipeline handles everything — from writing feature specifications to final code review.
|
|
12
|
+
[](#how-it-works)
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
- **15 hook events** with 3 handler types (shell scripts, LLM prompts, subagents)
|
|
19
|
-
- **5 project presets** for popular stacks (Next.js, React SPA, Express API, Monorepo)
|
|
20
|
-
- **Persistent memory agents** that learn across sessions
|
|
21
|
-
- **Built-in CI gates** that physically prevent skipping quality checks
|
|
14
|
+
> One command (`/afc:auto`) runs the entire cycle. Zero runtime dependencies — pure markdown commands + bash hook scripts.
|
|
22
15
|
|
|
23
16
|
## Quick Start
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
18
|
+
```bash
|
|
19
|
+
# Option A: Inside Claude Code
|
|
28
20
|
/plugin marketplace add jhlee0409/all-for-claudecode
|
|
29
21
|
/plugin install afc@all-for-claudecode
|
|
30
|
-
```
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Option B: One-line install (via npx)
|
|
35
|
-
|
|
36
|
-
```bash
|
|
23
|
+
# Option B: npx
|
|
37
24
|
npx all-for-claudecode
|
|
38
25
|
```
|
|
39
26
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### Option C: Claude Code CLI
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
claude plugin marketplace add jhlee0409/all-for-claudecode
|
|
46
|
-
claude plugin install afc@all-for-claudecode --scope user
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Then, inside Claude Code:
|
|
27
|
+
Then:
|
|
50
28
|
|
|
51
29
|
```
|
|
52
30
|
/afc:init # Detect your stack, generate config
|
|
53
31
|
/afc:auto "Add user authentication" # Run the full pipeline
|
|
54
32
|
```
|
|
55
33
|
|
|
56
|
-
|
|
34
|
+
The pipeline will:
|
|
57
35
|
1. Write a feature spec with acceptance criteria
|
|
58
|
-
2. Design an implementation plan with file change map
|
|
59
|
-
3. Implement
|
|
60
|
-
4. Run
|
|
36
|
+
2. Design an implementation plan with file change map
|
|
37
|
+
3. Implement tasks with CI gates (auto task decomposition + parallel execution)
|
|
38
|
+
4. Run code review with architecture/security agent analysis
|
|
61
39
|
5. Clean up artifacts and prepare for commit
|
|
62
40
|
|
|
63
|
-
##
|
|
41
|
+
## How It Works
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/afc:auto "Add feature X"
|
|
45
|
+
|
|
46
|
+
Spec (1/5) → Plan (2/5) → Implement (3/5) → Review (4/5) → Clean (5/5)
|
|
47
|
+
│ │ │ │ │
|
|
48
|
+
│ │ │ │ └─ Artifact cleanup
|
|
49
|
+
│ │ │ └─ 8 perspectives + agent review
|
|
50
|
+
│ │ └─ Auto task decomposition, parallel execution, CI gates
|
|
51
|
+
│ └─ File change map, ADR recording, research persistence
|
|
52
|
+
└─ Acceptance criteria, pre-implementation gates
|
|
53
|
+
|
|
54
|
+
Hooks run automatically at each step.
|
|
55
|
+
CI failure → debug-based RCA (not blind retry).
|
|
56
|
+
Critic Loops verify quality at each gate until convergence.
|
|
57
|
+
```
|
|
64
58
|
|
|
65
|
-
|
|
59
|
+
## Walkthrough: What a Pipeline Run Looks Like
|
|
66
60
|
|
|
61
|
+
Running `/afc:auto "Add password reset flow"` produces this (abbreviated):
|
|
62
|
+
|
|
63
|
+
**Spec (1/5)** — Generates `spec.md` with requirements and acceptance criteria:
|
|
67
64
|
```
|
|
68
|
-
|
|
65
|
+
FR-001: POST /auth/reset sends email with token
|
|
66
|
+
FR-002: GET /auth/reset/:token validates and shows form
|
|
67
|
+
FR-003: Token expires after 1 hour
|
|
68
|
+
Acceptance: Given expired token, When user submits, Then show error
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
**Plan (2/5)** — Creates `plan.md` with file change map and architecture decisions:
|
|
72
|
+
```
|
|
73
|
+
File Change Map:
|
|
74
|
+
src/routes/auth.ts — ADD reset endpoint handlers
|
|
75
|
+
src/services/email.ts — ADD sendResetEmail()
|
|
76
|
+
src/middleware/validate.ts — MODIFY add token validation
|
|
77
|
+
tests/auth.test.ts — ADD reset flow tests
|
|
78
|
+
```
|
|
72
79
|
|
|
80
|
+
**Implement (3/5)** — Auto-decomposes into tasks, executes with CI gates:
|
|
73
81
|
```
|
|
74
|
-
|
|
82
|
+
Tasks: 4 total (2 parallel)
|
|
83
|
+
[1] Add reset endpoint ✓
|
|
84
|
+
[2] Add email service ✓ ← parallel with [1]
|
|
85
|
+
[3] Add token validation ✓ ← depends on [1]
|
|
86
|
+
[4] Add tests ✓
|
|
87
|
+
CI: npm test → passed
|
|
75
88
|
```
|
|
76
89
|
|
|
77
|
-
|
|
90
|
+
**Review (4/5)** — 8-perspective review + specialist agent analysis:
|
|
91
|
+
```
|
|
92
|
+
Architecture (afc-architect): ✓ layer boundaries respected
|
|
93
|
+
Security (afc-security): ⚠ rate-limit reset endpoint
|
|
94
|
+
Performance: ✓ no N+1 queries
|
|
95
|
+
→ Auto-fixed: added rate limiter middleware
|
|
96
|
+
```
|
|
78
97
|
|
|
79
|
-
**
|
|
98
|
+
**Clean (5/5)** — Removes pipeline artifacts, final CI check.
|
|
99
|
+
|
|
100
|
+
## Slash Commands
|
|
80
101
|
|
|
81
102
|
| Command | Description |
|
|
82
103
|
|---|---|
|
|
@@ -85,14 +106,9 @@ Spec (1/5) → Plan (2/5) → Implement (3/5) → Review (4/5) → Clean (5/5)
|
|
|
85
106
|
| `/afc:plan` | Design implementation plan with file change map |
|
|
86
107
|
| `/afc:implement` | Execute code implementation with CI gates |
|
|
87
108
|
| `/afc:test` | Test strategy planning and test writing |
|
|
88
|
-
| `/afc:review` | Code review with security scanning |
|
|
109
|
+
| `/afc:review` | Code review with architecture/security scanning |
|
|
89
110
|
| `/afc:research` | Technical research with persistent storage |
|
|
90
111
|
| `/afc:debug` | Bug diagnosis and fix |
|
|
91
|
-
|
|
92
|
-
**User-only** (`disable-model-invocation: true`):
|
|
93
|
-
|
|
94
|
-
| Command | Description |
|
|
95
|
-
|---|---|
|
|
96
112
|
| `/afc:init` | Project setup — detects stack and generates config |
|
|
97
113
|
| `/afc:doctor` | Diagnose project health and plugin setup |
|
|
98
114
|
| `/afc:architect` | Architecture analysis (persistent memory) |
|
|
@@ -100,16 +116,32 @@ Spec (1/5) → Plan (2/5) → Implement (3/5) → Review (4/5) → Clean (5/5)
|
|
|
100
116
|
| `/afc:principles` | Project principles management |
|
|
101
117
|
| `/afc:checkpoint` | Save session state |
|
|
102
118
|
| `/afc:resume` | Restore session state |
|
|
103
|
-
|
|
104
|
-
**Model-only** (`user-invocable: false`):
|
|
105
|
-
|
|
106
|
-
| Command | Description |
|
|
107
|
-
|---|---|
|
|
108
119
|
| `/afc:tasks` | Task decomposition (auto-generated by implement) |
|
|
120
|
+
| `/afc:ideate` | Explore and structure a product idea |
|
|
121
|
+
| `/afc:launch` | Generate release artifacts (changelog, tag, publish) |
|
|
109
122
|
| `/afc:analyze` | Verify artifact consistency |
|
|
110
123
|
| `/afc:clarify` | Resolve spec ambiguities |
|
|
111
124
|
|
|
112
|
-
###
|
|
125
|
+
### Individual Command Examples
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Write a spec for a specific feature
|
|
129
|
+
/afc:spec "Add dark mode toggle"
|
|
130
|
+
|
|
131
|
+
# Design a plan from an existing spec
|
|
132
|
+
/afc:plan
|
|
133
|
+
|
|
134
|
+
# Debug a specific error
|
|
135
|
+
/afc:debug "TypeError: Cannot read property 'user' of undefined"
|
|
136
|
+
|
|
137
|
+
# Run code review on current changes
|
|
138
|
+
/afc:review
|
|
139
|
+
|
|
140
|
+
# Explore and structure a product idea
|
|
141
|
+
/afc:ideate "real-time collaboration feature"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Hook Events
|
|
113
145
|
|
|
114
146
|
Every hook fires automatically — no configuration needed after install.
|
|
115
147
|
|
|
@@ -120,7 +152,7 @@ Every hook fires automatically — no configuration needed after install.
|
|
|
120
152
|
| `PreToolUse` | Blocks dangerous commands (`push --force`, `reset --hard`) |
|
|
121
153
|
| `PostToolUse` | Tracks file changes + auto-formats code |
|
|
122
154
|
| `SubagentStart` | Injects pipeline context into subagents |
|
|
123
|
-
| `Stop` | CI gate (shell) + code completeness check (
|
|
155
|
+
| `Stop` | CI gate (shell) + code completeness check (agent) |
|
|
124
156
|
| `SessionEnd` | Warns about unfinished pipeline |
|
|
125
157
|
| `PostToolUseFailure` | Diagnostic hints for known error patterns |
|
|
126
158
|
| `Notification` | Desktop alerts (macOS/Linux) |
|
|
@@ -130,84 +162,70 @@ Every hook fires automatically — no configuration needed after install.
|
|
|
130
162
|
| `PermissionRequest` | Auto-allows CI commands during implement/review |
|
|
131
163
|
| `ConfigChange` | Audits/blocks settings changes during active pipeline |
|
|
132
164
|
| `TeammateIdle` | Prevents Agent Teams idle during implement/review |
|
|
165
|
+
| `WorktreeCreate` | Sets up worktree isolation for parallel workers |
|
|
166
|
+
| `WorktreeRemove` | Cleans up worktree after worker completion |
|
|
133
167
|
|
|
134
|
-
|
|
168
|
+
Handler types: `command` (shell scripts, all events), `prompt` (LLM single-turn, TaskCompleted), `agent` (subagent with tools, Stop).
|
|
135
169
|
|
|
136
|
-
|
|
137
|
-
|---|---|---|
|
|
138
|
-
| `command` | Shell script execution (deterministic) | All 15 events |
|
|
139
|
-
| `prompt` | LLM single-turn evaluation (haiku) | TaskCompleted |
|
|
140
|
-
| `agent` | Subagent with file access tools | Stop |
|
|
170
|
+
## Persistent Memory Agents
|
|
141
171
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
172
|
+
| Agent | Role |
|
|
173
|
+
|---|---|
|
|
174
|
+
| `afc-architect` | Remembers ADR decisions and architecture patterns across sessions. Auto-invoked during Plan (ADR recording) and Review (architecture compliance). |
|
|
175
|
+
| `afc-security` | Remembers vulnerability patterns and false positives across sessions. Auto-invoked during Review (security scanning). Runs in isolated worktree. |
|
|
176
|
+
| `afc-impl-worker` | Parallel implementation worker. Receives pre-assigned tasks from orchestrator. Ephemeral (no memory). |
|
|
145
177
|
|
|
146
|
-
|
|
147
|
-
|---|---|---|
|
|
148
|
-
| `afc-architect` | Architecture analysis — remembers ADR decisions and patterns | `.claude/agent-memory/afc-architect/` |
|
|
149
|
-
| `afc-security` | Security scan — remembers vulnerability patterns and false positives | `.claude/agent-memory/afc-security/` |
|
|
178
|
+
## Task Orchestration
|
|
150
179
|
|
|
151
|
-
|
|
180
|
+
The implement phase automatically selects execution strategy:
|
|
152
181
|
|
|
153
|
-
|
|
|
182
|
+
| Parallel tasks in phase | Mode |
|
|
154
183
|
|---|---|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
| `express-api` | Express + TypeScript + Prisma + Jest |
|
|
159
|
-
| `monorepo` | Turborepo + pnpm workspace |
|
|
184
|
+
| 0 | Sequential — one task at a time |
|
|
185
|
+
| 1–5 | Parallel Batch — concurrent Task() calls |
|
|
186
|
+
| 6+ | Swarm — orchestrator pre-assigns tasks to worker agents (max 5) |
|
|
160
187
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
┌─────────────────────────────────────────────┐
|
|
165
|
-
│ /afc:auto "Add feature X" │
|
|
166
|
-
├─────────────────────────────────────────────┤
|
|
167
|
-
│ Phase 1: Spec → Critic Loop → Gate ✓ │
|
|
168
|
-
│ Phase 2: Plan → Critic Loop → Gate ✓ │
|
|
169
|
-
│ Phase 3: Implement → Tasks auto-gen → CI ✓ │
|
|
170
|
-
│ Phase 4: Review → 8 perspectives → Gate ✓│
|
|
171
|
-
│ Phase 5: Clean → Artifacts removed │
|
|
172
|
-
├─────────────────────────────────────────────┤
|
|
173
|
-
│ 15 hooks run automatically at each step │
|
|
174
|
-
│ Stop/TaskCompleted gates block if CI fails │
|
|
175
|
-
└─────────────────────────────────────────────┘
|
|
176
|
-
```
|
|
188
|
+
Dependencies are tracked via DAG. CI gate + Mini-Review + Auto-Checkpoint run at each phase boundary.
|
|
177
189
|
|
|
178
190
|
## Configuration
|
|
179
191
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
```bash
|
|
192
|
+
```
|
|
183
193
|
/afc:init
|
|
184
194
|
```
|
|
185
195
|
|
|
186
|
-
|
|
187
|
-
- CI/lint/test commands
|
|
188
|
-
- Architecture style and layers
|
|
189
|
-
- Framework-specific settings
|
|
190
|
-
- Code style conventions
|
|
196
|
+
Auto-detects your tech stack (package manager, framework, architecture, testing, linting) and generates `.claude/afc.config.md` with CI commands, architecture rules, and code style conventions. No manual preset selection needed — the init command analyzes your project structure directly.
|
|
191
197
|
|
|
192
198
|
## FAQ
|
|
193
199
|
|
|
194
|
-
### What is all-for-claudecode?
|
|
195
|
-
A Claude Code plugin that automates the entire development cycle (spec → plan → implement → review → clean) through 18 slash commands and 15 hook events.
|
|
196
|
-
|
|
197
|
-
### How does it compare to manual Claude Code workflows?
|
|
198
|
-
Instead of manually prompting each step, all-for-claudecode orchestrates the full cycle with built-in quality gates that physically prevent skipping CI or security checks.
|
|
199
|
-
|
|
200
200
|
### Does it work with any project?
|
|
201
|
-
Yes. Run `/afc:init` to auto-detect your stack
|
|
201
|
+
Yes. Run `/afc:init` to auto-detect your stack. Works with JavaScript/TypeScript, Python, Rust, Go, and any project with a CI command.
|
|
202
202
|
|
|
203
203
|
### Does it require any dependencies?
|
|
204
|
-
No.
|
|
204
|
+
No. Pure markdown commands + bash hook scripts. No npm packages are imported at runtime.
|
|
205
|
+
|
|
206
|
+
### What happens if CI fails during the pipeline?
|
|
207
|
+
Debug-based RCA: traces the error, forms a hypothesis, applies a targeted fix. Halts after 3 failed attempts with full diagnosis.
|
|
208
|
+
|
|
209
|
+
### Can I run individual phases?
|
|
210
|
+
Yes. Each phase has its own command (`/afc:spec`, `/afc:plan`, `/afc:implement`, `/afc:review`). `/afc:auto` runs them all.
|
|
211
|
+
|
|
212
|
+
### What are Critic Loops?
|
|
213
|
+
Convergence-based quality checks after each phase. They evaluate output against criteria and auto-fix issues until stable. 4 verdicts: PASS, FAIL, ESCALATE (asks user), DEFER.
|
|
214
|
+
|
|
215
|
+
### How many tokens does a pipeline run use?
|
|
216
|
+
Depends on project size and feature complexity. A typical `/afc:auto` run for a medium feature uses roughly the same as a detailed manual implementation session — the pipeline adds structure, not overhead.
|
|
217
|
+
|
|
218
|
+
### Can I customize the pipeline behavior?
|
|
219
|
+
Yes. Edit `.claude/afc.config.md` to change CI commands, architecture rules, and code style conventions. The pipeline reads this config at every phase.
|
|
220
|
+
|
|
221
|
+
### Does it work with monorepos?
|
|
222
|
+
Yes. Run `/afc:init` in the monorepo root. The init command detects workspace structure and configures accordingly.
|
|
205
223
|
|
|
206
|
-
###
|
|
207
|
-
|
|
224
|
+
### Can multiple team members use it on the same repo?
|
|
225
|
+
Yes. Each developer runs their own pipeline independently. The `.claude/afc.config.md` config is shared (commit it to the repo), but pipeline state is local and session-scoped.
|
|
208
226
|
|
|
209
|
-
###
|
|
210
|
-
|
|
227
|
+
### How is this different from Cursor / Copilot / other AI tools?
|
|
228
|
+
All-for-claudecode is not a code completion tool — it is a structured development pipeline. It enforces spec → plan → implement → review flow with quality gates, persistent memory agents, and CI verification at every step.
|
|
211
229
|
|
|
212
230
|
## License
|
|
213
231
|
|
package/agents/afc-architect.md
CHANGED
|
@@ -11,6 +11,8 @@ tools:
|
|
|
11
11
|
- WebSearch
|
|
12
12
|
model: sonnet
|
|
13
13
|
memory: project
|
|
14
|
+
# Note: no `isolation: worktree` — architect writes ADR files to project memory
|
|
15
|
+
# which must persist in the main worktree (unlike afc-security which is read-only)
|
|
14
16
|
skills:
|
|
15
17
|
- docs/critic-loop-rules.md
|
|
16
18
|
- docs/phase-gate-protocol.md
|
package/commands/analyze.md
CHANGED
|
@@ -22,13 +22,12 @@ model: haiku
|
|
|
22
22
|
|
|
23
23
|
## Config Load
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
**Always** read `.claude/afc.config.md` first. This file contains free-form markdown sections:
|
|
26
|
+
- `## Architecture` — architecture pattern, layers, import rules (primary reference for this command)
|
|
27
|
+
- `## Code Style` — language, naming conventions, lint rules
|
|
28
|
+
- `## Project Context` — framework, state management, testing, etc.
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
config.architecture = the architecture pattern used in the project
|
|
29
|
-
(e.g., "FSD", "Clean Architecture", "Layered", "Modular Monolith")
|
|
30
|
-
→ Architecture standard specified in CLAUDE.md. Assume "Layered Architecture" if not present.
|
|
31
|
-
```
|
|
30
|
+
If config file is missing: read `CLAUDE.md` for architecture info. Assume "Layered Architecture" if neither source has it.
|
|
32
31
|
|
|
33
32
|
## Execution Steps
|
|
34
33
|
|
package/commands/architect.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
name: afc:architect
|
|
3
3
|
description: "Architecture analysis and design advice"
|
|
4
4
|
argument-hint: "[analysis target or design question]"
|
|
5
|
-
disable-model-invocation: true
|
|
6
5
|
context: fork
|
|
7
6
|
agent: afc-architect
|
|
8
7
|
allowed-tools:
|
|
@@ -27,13 +26,12 @@ model: sonnet
|
|
|
27
26
|
|
|
28
27
|
## Config Load
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
**Always** read `.claude/afc.config.md` first. This file contains free-form markdown sections:
|
|
30
|
+
- `## Architecture` — architecture pattern, layers, import rules (primary reference for this command)
|
|
31
|
+
- `## Code Style` — language, naming conventions, lint rules
|
|
32
|
+
- `## Project Context` — framework, state management, testing, etc.
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
config.architecture = the architecture pattern used in the project
|
|
34
|
-
(e.g., "FSD", "Clean Architecture", "Layered", "Modular Monolith")
|
|
35
|
-
→ Architecture standard specified in CLAUDE.md. Assume "Layered Architecture" if not present.
|
|
36
|
-
```
|
|
34
|
+
If config file is missing: read `CLAUDE.md` for architecture info. Assume "Layered Architecture" if neither source has it.
|
|
37
35
|
|
|
38
36
|
## Execution Steps
|
|
39
37
|
|
|
@@ -94,7 +92,7 @@ Structure analysis results and **print to console**:
|
|
|
94
92
|
|
|
95
93
|
> **Always** read `${CLAUDE_PLUGIN_ROOT}/docs/critic-loop-rules.md` first and follow it.
|
|
96
94
|
|
|
97
|
-
Run the critic loop until convergence. Safety cap: 7 passes.
|
|
95
|
+
Run the critic loop until convergence. Safety cap: 7 passes (higher than the standard 5 because architecture analysis involves broader exploration across modules and layers).
|
|
98
96
|
|
|
99
97
|
| Criterion | Validation |
|
|
100
98
|
|-----------|------------|
|
package/commands/auto.md
CHANGED
|
@@ -22,13 +22,11 @@ argument-hint: "[feature description in natural language]"
|
|
|
22
22
|
## Config Load
|
|
23
23
|
|
|
24
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
|
|
26
|
-
- `{config.gate}` — phase gate command
|
|
27
|
-
- `{config.
|
|
28
|
-
- `{config.
|
|
29
|
-
- `{config.code_style}` — code style rules
|
|
30
|
-
- `{config.risks}` — project-specific risk patterns
|
|
31
|
-
- `{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)
|
|
32
30
|
|
|
33
31
|
If config file is missing:
|
|
34
32
|
1. Ask the user: "`.claude/afc.config.md` not found. Run `/afc:init` to set up the project?"
|
|
@@ -115,7 +113,11 @@ If all checks pass, proceed to Phase 0.8.
|
|
|
115
113
|
2. Run `{config.ci}` verification
|
|
116
114
|
- On fail: **abort fast-path**, restart with full pipeline: `⚠ Fast-path aborted — change is more complex than expected. Running full pipeline.`
|
|
117
115
|
3. If change touches > 2 files OR modifies any `.sh` script: **abort fast-path**, restart with full pipeline
|
|
118
|
-
4. **Checkpoint**:
|
|
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
|
+
```
|
|
119
121
|
5. Run `/afc:review` logic inline (mini-review only — single Critic pass)
|
|
120
122
|
6. Run Phase 5 Clean logic (artifact cleanup, CI gate, pipeline flag release)
|
|
121
123
|
7. Final output:
|
|
@@ -204,8 +206,8 @@ Execute `/afc:plan` logic inline:
|
|
|
204
206
|
5. Acceptance anchor alignment: Implementation Context Acceptance Anchors faithfully reflect spec acceptance scenarios
|
|
205
207
|
- **RISK criterion mandatory checks**:
|
|
206
208
|
- Enumerate **at least 3** `{config.ci}` failure scenarios and describe mitigation
|
|
207
|
-
- Check each pattern in
|
|
208
|
-
- Consider
|
|
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.)
|
|
209
211
|
- **ARCHITECTURE criterion**: explicitly describe import paths for moved/created files and pre-validate against `{config.architecture}` rules
|
|
210
212
|
- Each pass must **explicitly explore what was missed in the previous pass** ("Pass 2: {X} was missed in pass 1. Further review: ...")
|
|
211
213
|
- FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
|
|
@@ -229,14 +231,18 @@ Execute `/afc:plan` logic inline:
|
|
|
229
231
|
```
|
|
230
232
|
- If architect returns conflicts → **ESCALATE** to user with conflict details
|
|
231
233
|
- If no conflicts → proceed (ADR recorded for future reference)
|
|
232
|
-
8. **Session context preservation**:
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
+
## Key Decisions
|
|
241
|
+
- {what}: {rationale}
|
|
242
|
+
## Discoveries
|
|
243
|
+
- {file path}: {finding}
|
|
239
244
|
```
|
|
245
|
+
This file is read at Implement start to restore context after compaction.
|
|
240
246
|
9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase plan` at phase start
|
|
241
247
|
10. Progress: `✓ 2/5 Plan complete (Critic: converged ({N} passes, {M} fixes, {E} escalations), files: {N}, ADR: {N} recorded, Implementation Context: {W} words)`
|
|
242
248
|
|
|
@@ -244,7 +250,7 @@ Execute `/afc:plan` logic inline:
|
|
|
244
250
|
|
|
245
251
|
`"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" phase implement`
|
|
246
252
|
|
|
247
|
-
**Session context reload**: At implement start,
|
|
253
|
+
**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).
|
|
248
254
|
|
|
249
255
|
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.
|
|
250
256
|
|
|
@@ -328,7 +334,7 @@ Execute `/afc:implement` logic inline — **follow all orchestration rules defin
|
|
|
328
334
|
For each acceptance scenario in spec.md:
|
|
329
335
|
- Map GWT to a test case: Given → Arrange, When → Act, Then → Assert
|
|
330
336
|
- Target file: determined by the component/module referenced in the scenario
|
|
331
|
-
- Test file location: follows project convention (
|
|
337
|
+
- Test file location: follows project convention (test framework from Project Context)
|
|
332
338
|
```
|
|
333
339
|
3. Run `{config.test}` to verify tests pass against the implementation
|
|
334
340
|
- If tests fail → this reveals a gap between spec and implementation:
|
|
@@ -402,7 +408,7 @@ Execute `/afc:review` logic inline — **follow all review perspectives defined
|
|
|
402
408
|
- A. Code Quality — `{config.code_style}` compliance (direct review)
|
|
403
409
|
- B. Architecture — **delegated to afc-architect agent** (persistent memory, ADR-aware)
|
|
404
410
|
- C. Security — **delegated to afc-security agent** (persistent memory, false-positive-aware)
|
|
405
|
-
- D. Performance —
|
|
411
|
+
- D. Performance — framework-specific patterns from Project Context (direct review)
|
|
406
412
|
- E. Project Pattern Compliance — conventions and idioms (direct review)
|
|
407
413
|
- **F. Reusability** — DRY, shared utilities, abstraction level (direct review)
|
|
408
414
|
- **G. Maintainability** — AI/human comprehension, naming clarity, self-contained files (direct review)
|
|
@@ -412,16 +418,16 @@ Execute `/afc:review` logic inline — **follow all review perspectives defined
|
|
|
412
418
|
6. **Retrospective check**: if `.claude/afc/memory/retrospectives/` exists, load and check:
|
|
413
419
|
- Were there recurring Critical finding categories in past reviews? Prioritize those perspectives.
|
|
414
420
|
- Were there false positives that wasted effort? Reduce sensitivity for those patterns.
|
|
415
|
-
|
|
421
|
+
7. **Critic Loop until convergence** (safety cap: 5, follow Critic Loop rules):
|
|
416
422
|
- COMPLETENESS: were all changed files reviewed across all 8 perspectives (A-H)?
|
|
417
423
|
- 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
|
|
418
424
|
- PRECISION: are there unnecessary changes? Are there out-of-scope modifications?
|
|
419
425
|
- FAIL → auto-fix and continue. ESCALATE → pause, present options, resume after response. DEFER → record reason, mark clean.
|
|
420
|
-
|
|
426
|
+
8. **Handling SC shortfalls**:
|
|
421
427
|
- Fixable → attempt auto-fix → re-run `{config.ci}` verification
|
|
422
428
|
- Not fixable → state in final report with reason (no post-hoc rationalization; record as Plan-phase target-setting error)
|
|
423
|
-
|
|
424
|
-
|
|
429
|
+
9. **Checkpoint**: phase transition already recorded by `afc-pipeline-manage.sh phase review` at phase start
|
|
430
|
+
10. Progress: `✓ 4/5 Review complete (Critical:{N} Warning:{N} Info:{N}, SC shortfalls: {N})`
|
|
425
431
|
|
|
426
432
|
### Phase 5: Clean (5/5)
|
|
427
433
|
|
|
@@ -546,7 +552,7 @@ Pipeline aborted (Phase {N}/5)
|
|
|
546
552
|
- **[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.
|
|
547
553
|
- **Swarm mode is automatic**: when a phase has 6+ [P] tasks, the orchestrator pre-assigns tasks to swarm workers. Do not manually batch.
|
|
548
554
|
- **Implementation Context travels with workers**: every sub-agent prompt includes the Implementation Context section from plan.md, ensuring spec intent propagates to parallel workers.
|
|
549
|
-
- **Session context resilience**: key decisions are
|
|
555
|
+
- **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.
|
|
550
556
|
- **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.
|
|
551
557
|
- **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.
|
|
552
558
|
- **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.
|
package/commands/checkpoint.md
CHANGED
package/commands/debug.md
CHANGED
|
@@ -48,7 +48,7 @@ Proceed in order:
|
|
|
48
48
|
|
|
49
49
|
1. **Error trace**: extract file:line from error message/stack trace → read that code
|
|
50
50
|
2. **Data flow**: trace backwards from the problem point (where did the bad data come in?)
|
|
51
|
-
3. **State analysis**: check relevant
|
|
51
|
+
3. **State analysis**: check relevant state management cache state (from Project Context)
|
|
52
52
|
4. **Recent changes**: check recent changes with `git log --oneline -10 -- {related files}`
|
|
53
53
|
5. **Race conditions**: check for timing issues between async operations
|
|
54
54
|
|
package/commands/doctor.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
name: afc:doctor
|
|
3
3
|
description: "Diagnose project health and plugin setup"
|
|
4
4
|
argument-hint: "[--verbose]"
|
|
5
|
-
disable-model-invocation: true
|
|
6
5
|
allowed-tools:
|
|
7
6
|
- Read
|
|
8
7
|
- Grep
|
|
@@ -49,7 +48,7 @@ Run ALL checks regardless of earlier failures. Do not short-circuit.
|
|
|
49
48
|
| Check | How | Pass | Fail |
|
|
50
49
|
|-------|-----|------|------|
|
|
51
50
|
| Config file exists | Read `.claude/afc.config.md` | File exists | Fix: run `/afc:init` |
|
|
52
|
-
| Required sections present | Grep for `## CI Commands`, `## Architecture`, `## Code Style
|
|
51
|
+
| Required sections present | Grep for `## CI Commands`, `## Architecture`, `## Code Style` | All 3 sections found | Fix: add missing section to `.claude/afc.config.md` or re-run `/afc:init` |
|
|
53
52
|
| Gate command defined | Grep for `gate:` inside `## CI Commands` section | `gate:` field found | Fix: add `gate:` field to `## CI Commands` section |
|
|
54
53
|
| CI command runnable | Extract CI command from config, run it | Exits 0 | ⚠ Warning: CI command failed. Check `{config.ci}` in afc.config.md |
|
|
55
54
|
| Gate command runnable | Extract gate command from config, run it | Exits 0 | ⚠ Warning: gate command failed. Check `{config.gate}` in afc.config.md |
|