all-for-claudecode 2.9.1 → 2.10.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 (40) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/MIGRATION.md +1 -1
  4. package/package.json +2 -2
  5. package/schemas/plugin.schema.json +2 -2
  6. package/scripts/afc-consistency-check.sh +23 -23
  7. package/scripts/afc-doctor.sh +10 -10
  8. package/scripts/afc-qa-audit.sh +1 -1
  9. package/scripts/afc-sync-cache.sh +1 -1
  10. package/{commands/plan.md → skills/plan/SKILL.md} +1 -122
  11. package/skills/plan/plan-template.md +118 -0
  12. package/{commands/spec.md → skills/spec/SKILL.md} +1 -76
  13. package/skills/spec/spec-template.md +72 -0
  14. /package/{commands/analyze.md → skills/analyze/SKILL.md} +0 -0
  15. /package/{commands/architect.md → skills/architect/SKILL.md} +0 -0
  16. /package/{commands/auto.md → skills/auto/SKILL.md} +0 -0
  17. /package/{commands/checkpoint.md → skills/checkpoint/SKILL.md} +0 -0
  18. /package/{commands/clarify.md → skills/clarify/SKILL.md} +0 -0
  19. /package/{commands/clean.md → skills/clean/SKILL.md} +0 -0
  20. /package/{commands/consult.md → skills/consult/SKILL.md} +0 -0
  21. /package/{commands/debug.md → skills/debug/SKILL.md} +0 -0
  22. /package/{commands/doctor.md → skills/doctor/SKILL.md} +0 -0
  23. /package/{commands/ideate.md → skills/ideate/SKILL.md} +0 -0
  24. /package/{commands/implement.md → skills/implement/SKILL.md} +0 -0
  25. /package/{commands/init.md → skills/init/SKILL.md} +0 -0
  26. /package/{commands/launch.md → skills/launch/SKILL.md} +0 -0
  27. /package/{commands/learner.md → skills/learner/SKILL.md} +0 -0
  28. /package/{commands/pr-comment.md → skills/pr-comment/SKILL.md} +0 -0
  29. /package/{commands/principles.md → skills/principles/SKILL.md} +0 -0
  30. /package/{commands/qa.md → skills/qa/SKILL.md} +0 -0
  31. /package/{commands/release-notes.md → skills/release-notes/SKILL.md} +0 -0
  32. /package/{commands/research.md → skills/research/SKILL.md} +0 -0
  33. /package/{commands/resume.md → skills/resume/SKILL.md} +0 -0
  34. /package/{commands/review.md → skills/review/SKILL.md} +0 -0
  35. /package/{commands/security.md → skills/security/SKILL.md} +0 -0
  36. /package/{docs → skills/spec}/nfr-templates.md +0 -0
  37. /package/{commands/tasks.md → skills/tasks/SKILL.md} +0 -0
  38. /package/{commands/test.md → skills/test/SKILL.md} +0 -0
  39. /package/{commands/triage.md → skills/triage/SKILL.md} +0 -0
  40. /package/{commands/validate.md → skills/validate/SKILL.md} +0 -0
@@ -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.9.1"
9
+ "version": "2.10.0"
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.9.1",
16
+ "version": "2.10.0",
17
17
  "category": "automation",
18
18
  "tags": ["pipeline", "automation", "spec", "plan", "implement", "review", "critic-loop"]
19
19
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "afc",
3
- "version": "2.9.1",
3
+ "version": "2.10.0",
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",
7
7
  "repository": "https://github.com/jhlee0409/all-for-claudecode",
8
8
  "license": "MIT",
9
9
  "keywords": ["pipeline", "automation", "spec", "plan", "implement", "review", "critic-loop"],
10
- "commands": "./commands/"
10
+ "skills": "./skills/"
11
11
  }
package/MIGRATION.md CHANGED
@@ -112,7 +112,7 @@ git tag -d selfish/pre-auto 2>/dev/null
112
112
  |------|--------|-------|
113
113
  | Installation | `git clone` + `./install.sh` | `/plugin install <url>` |
114
114
  | Command separator | `.` (`/afc-legacy.spec`) | `:` (`/afc:spec`) |
115
- | Command location | `~/.claude/commands/afc-legacy.*.md` | `commands/*.md` inside the plugin |
115
+ | Command location | `~/.claude/commands/afc-legacy.*.md` | `skills/*/SKILL.md` inside the plugin |
116
116
  | Hook scripts | `<project>/.claude/hooks/*.sh` | `scripts/*.sh` inside the plugin |
117
117
  | Hook config | `<project>/.claude/settings.json` | `hooks/hooks.json` inside the plugin |
118
118
  | Config file | `.claude/afc.config.md` (unchanged) | `.claude/afc.config.md` (unchanged) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "all-for-claudecode",
3
- "version": "2.9.1",
3
+ "version": "2.10.0",
4
4
  "description": "Claude Code plugin that automates the full dev cycle — spec, plan, implement, review, clean.",
5
5
  "bin": {
6
6
  "all-for-claudecode": "bin/cli.mjs"
@@ -9,7 +9,7 @@
9
9
  "files": [
10
10
  "agents/",
11
11
  "bin/",
12
- "commands/",
12
+ "skills/",
13
13
  "docs/",
14
14
  "hooks/",
15
15
  "schemas/",
@@ -41,9 +41,9 @@
41
41
  "type": "array",
42
42
  "items": { "type": "string" }
43
43
  },
44
- "commands": {
44
+ "skills": {
45
45
  "type": "string",
46
- "description": "Path to commands directory"
46
+ "description": "Path to skills directory"
47
47
  },
48
48
  "agents": {
49
49
  "type": "string",
@@ -42,7 +42,7 @@ get_cmd_field() {
42
42
  }
43
43
 
44
44
  # --- Check 1: Config Placeholder Validation ---
45
- # Verify all {config.*} references in commands/ and docs/ map to known config keys
45
+ # Verify all {config.*} references in skills/ and docs/ map to known config keys
46
46
 
47
47
  check_config_placeholders() {
48
48
  local template="$PROJECT_DIR/templates/afc.config.template.md"
@@ -66,9 +66,9 @@ check_config_placeholders() {
66
66
  local valid_keys
67
67
  valid_keys=$(printf '%s\n%s\n' "$yaml_keys" "$section_keys" | sort -u)
68
68
 
69
- # Extract all {config.*} references from commands and docs
69
+ # Extract all {config.*} references from skills and docs
70
70
  local refs
71
- refs=$(grep -rohE '\{config\.[a-z_]+\}' "$PROJECT_DIR/commands/" "$PROJECT_DIR/docs/" 2>/dev/null \
71
+ refs=$(grep -rohE '\{config\.[a-z_]+\}' "$PROJECT_DIR/skills/" "$PROJECT_DIR/docs/" 2>/dev/null \
72
72
  | sed 's/{config\.//;s/}//' \
73
73
  | sort -u || true)
74
74
 
@@ -104,9 +104,9 @@ check_agent_names() {
104
104
  | tr -d '"' \
105
105
  | sort -u || true)
106
106
 
107
- # Extract subagent_type references from commands (afc:agent-name pattern)
107
+ # Extract subagent_type references from skills (afc:agent-name pattern)
108
108
  local referenced_agents
109
- referenced_agents=$(grep -rohE 'subagent_type:[[:space:]]*"afc:[^"]*"' "$PROJECT_DIR/commands/" 2>/dev/null \
109
+ referenced_agents=$(grep -rohE 'subagent_type:[[:space:]]*"afc:[^"]*"' "$PROJECT_DIR/skills/" 2>/dev/null \
110
110
  | sed 's/.*"afc://;s/"//' \
111
111
  | sort -u || true)
112
112
 
@@ -122,7 +122,7 @@ check_agent_names() {
122
122
 
123
123
  # Check for unprefixed subagent_type that should have afc: prefix
124
124
  local unprefixed
125
- unprefixed=$(grep -rohE 'subagent_type:[[:space:]]*"afc-[^"]*"' "$PROJECT_DIR/commands/" 2>/dev/null \
125
+ unprefixed=$(grep -rohE 'subagent_type:[[:space:]]*"afc-[^"]*"' "$PROJECT_DIR/skills/" 2>/dev/null \
126
126
  | sed 's/.*subagent_type:[[:space:]]*"//;s/".*//' \
127
127
  | sort -u || true)
128
128
  for ref in $unprefixed; do
@@ -254,22 +254,22 @@ check_phase_ssot() {
254
254
  fi
255
255
  }
256
256
 
257
- # --- Check 7: Command Documentation Cross-Reference ---
258
- # Verify commands are documented in README.md, init.md, and CLAUDE.md
257
+ # --- Check 7: Skill Documentation Cross-Reference ---
258
+ # Verify skills are documented in README.md, init/SKILL.md, and CLAUDE.md
259
259
 
260
260
  check_command_docs() {
261
- local commands_dir="$PROJECT_DIR/commands"
262
- [ -d "$commands_dir" ] || return
261
+ local skills_dir="$PROJECT_DIR/skills"
262
+ [ -d "$skills_dir" ] || return
263
263
 
264
264
  local readme="$PROJECT_DIR/README.md"
265
- local init_cmd="$commands_dir/init.md"
265
+ local init_skill="$skills_dir/init/SKILL.md"
266
266
  local claude_md="$PROJECT_DIR/CLAUDE.md"
267
267
  local issues=0
268
268
 
269
- for cmd_file in "$commands_dir"/*.md; do
270
- [ -f "$cmd_file" ] || continue
269
+ for skill_file in "$skills_dir"/*/SKILL.md; do
270
+ [ -f "$skill_file" ] || continue
271
271
  local cmd_name
272
- cmd_name=$(basename "$cmd_file" .md)
272
+ cmd_name=$(basename "$(dirname "$skill_file")")
273
273
 
274
274
  # Sub-check A: README.md should mention /afc:{name}
275
275
  if [ -f "$readme" ]; then
@@ -279,29 +279,29 @@ check_command_docs() {
279
279
  fi
280
280
  fi
281
281
 
282
- # Sub-check B: init.md should mention afc:{name} for user-invocable commands
282
+ # Sub-check B: init/SKILL.md should mention afc:{name} for user-invocable skills
283
283
  local invocable
284
- invocable=$(get_cmd_field "$cmd_file" "user-invocable")
285
- if [ "$invocable" != "false" ] && [ -f "$init_cmd" ]; then
286
- if ! grep -qE "afc:${cmd_name}([^a-z0-9-]|$)" "$init_cmd" 2>/dev/null; then
287
- warn "Command '$cmd_name' missing from init.md skill routing"
284
+ invocable=$(get_cmd_field "$skill_file" "user-invocable")
285
+ if [ "$invocable" != "false" ] && [ -f "$init_skill" ]; then
286
+ if ! grep -qE "afc:${cmd_name}([^a-z0-9-]|$)" "$init_skill" 2>/dev/null; then
287
+ warn "Skill '$cmd_name' missing from init/SKILL.md skill routing"
288
288
  issues=$((issues + 1))
289
289
  fi
290
290
  fi
291
291
 
292
- # Sub-check C: CLAUDE.md fork list for context:fork commands
292
+ # Sub-check C: CLAUDE.md fork list for context:fork skills
293
293
  local ctx
294
- ctx=$(get_cmd_field "$cmd_file" "context")
294
+ ctx=$(get_cmd_field "$skill_file" "context")
295
295
  if [ "$ctx" = "fork" ] && [ -f "$claude_md" ]; then
296
296
  if ! grep "context: fork" "$claude_md" 2>/dev/null | grep -qE "([(, ])${cmd_name}([,) ]|$)"; then
297
- warn "Command '$cmd_name' (context:fork) missing from CLAUDE.md fork list"
297
+ warn "Skill '$cmd_name' (context:fork) missing from CLAUDE.md fork list"
298
298
  issues=$((issues + 1))
299
299
  fi
300
300
  fi
301
301
  done
302
302
 
303
303
  if [ "$issues" -eq 0 ]; then
304
- ok "Command docs: all commands referenced in README.md, init.md, CLAUDE.md"
304
+ ok "Skill docs: all skills referenced in README.md, init/SKILL.md, CLAUDE.md"
305
305
  fi
306
306
  }
307
307
 
@@ -457,8 +457,8 @@ if [ "$IS_DEV" = true ]; then
457
457
  # Cache sync check
458
458
  CACHE_DIR="$HOME/.claude/plugins/cache/all-for-claudecode/afc/$V_PKG"
459
459
  if [ -d "$CACHE_DIR" ]; then
460
- CACHE_AUTO="$CACHE_DIR/commands/auto.md"
461
- SOURCE_AUTO="$PROJECT_DIR/commands/auto.md"
460
+ CACHE_AUTO="$CACHE_DIR/skills/auto/SKILL.md"
461
+ SOURCE_AUTO="$PROJECT_DIR/skills/auto/SKILL.md"
462
462
  if [ -f "$CACHE_AUTO" ] && [ -f "$SOURCE_AUTO" ]; then
463
463
  if diff -q "$SOURCE_AUTO" "$CACHE_AUTO" >/dev/null 2>&1; then
464
464
  pass "Cache in sync"
@@ -472,21 +472,21 @@ if [ "$IS_DEV" = true ]; then
472
472
  warn "Plugin cache directory not found" "install plugin first, then npm run sync:cache"
473
473
  fi
474
474
 
475
- # --- Category 10: Command Definitions (dev only) ---
476
- section "Command Definitions (dev)"
475
+ # --- Category 10: Skill Definitions (dev only) ---
476
+ section "Skill Definitions (dev)"
477
477
 
478
- CMD_DIR="$PROJECT_DIR/commands"
479
- if [ -d "$CMD_DIR" ]; then
478
+ SKILL_DIR="$PROJECT_DIR/skills"
479
+ if [ -d "$SKILL_DIR" ]; then
480
480
  CMD_COUNT=0
481
481
  CMD_FM_MISSING=""
482
482
  CMD_FIELD_MISSING=""
483
483
  CMD_NAME_MISMATCH=""
484
484
  CMD_AGENT_MISSING=""
485
485
 
486
- for cmd_file in "$CMD_DIR"/*.md; do
486
+ for cmd_file in "$SKILL_DIR"/*/SKILL.md; do
487
487
  [ -f "$cmd_file" ] || continue
488
488
  CMD_COUNT=$((CMD_COUNT + 1))
489
- BASENAME=$(basename "$cmd_file" .md)
489
+ BASENAME=$(basename "$(dirname "$cmd_file")")
490
490
 
491
491
  # Check frontmatter exists (--- ... ---)
492
492
  if ! head -1 "$cmd_file" | grep -q '^---' 2>/dev/null; then
@@ -658,9 +658,9 @@ if [ "$IS_DEV" = true ]; then
658
658
  # --- Category 12: Doc References (dev only) ---
659
659
  section "Doc References (dev)"
660
660
 
661
- # Scan commands and agents for docs/ references
661
+ # Scan skills and agents for docs/ references
662
662
  DOC_REFS_MISSING=""
663
- for src_file in "$CMD_DIR"/*.md "$AGENT_DIR"/*.md; do
663
+ for src_file in "$SKILL_DIR"/*/SKILL.md "$AGENT_DIR"/*.md; do
664
664
  [ -f "$src_file" ] || continue
665
665
  while IFS= read -r ref; do
666
666
  [ -z "$ref" ] && continue
@@ -452,7 +452,7 @@ check_d1_cache_divergence() {
452
452
  local diverged=0
453
453
  local checked=0
454
454
 
455
- for subdir in commands scripts hooks; do
455
+ for subdir in skills scripts hooks; do
456
456
  local src_dir="$PROJECT_DIR/$subdir"
457
457
  local cache_subdir="$cache_version_dir/$subdir"
458
458
  [ -d "$src_dir" ] && [ -d "$cache_subdir" ] || continue
@@ -31,7 +31,7 @@ if [ ! -d "$CACHE_DIR" ]; then
31
31
  fi
32
32
 
33
33
  # Sync directories and files
34
- DIRS_TO_SYNC="commands agents scripts hooks docs schemas templates"
34
+ DIRS_TO_SYNC="skills agents scripts hooks docs schemas templates"
35
35
  FILES_TO_SYNC="package.json"
36
36
 
37
37
  for dir in $DIRS_TO_SYNC; do
@@ -101,128 +101,7 @@ Future pipelines can reference prior research to avoid redundant investigation.
101
101
 
102
102
  ### 4. Phase 1 — Write Design
103
103
 
104
- Create `.claude/afc/specs/{feature}/plan.md`. **Must** follow the structure below:
105
-
106
- ```markdown
107
- # Implementation Plan: {feature name}
108
-
109
- ## Summary
110
- {summary of core requirements from spec + technical approach, 3-5 sentences}
111
-
112
- ## Technical Context
113
- {Summarize key project settings from .claude/rules/afc-project.md (auto-loaded) and afc.config.md}
114
- - **Constraints**: {constraints extracted from spec}
115
-
116
- ## Principles Check
117
- {if .claude/afc/memory/principles.md exists: validation results against MUST principles}
118
- {if violations possible: state explicitly + justification}
119
-
120
- ## Architecture Decision
121
- ### Approach
122
- {core idea of the chosen design}
123
-
124
- ### Architecture Placement
125
- | Layer | Path | Role |
126
- |-------|------|------|
127
- | {entities/features/widgets/shared} | {path} | {description} |
128
-
129
- ### State Management Strategy (omit if not applicable)
130
- {what combination of Zustand store / React Query / Context is used where}
131
-
132
- ### API Design (omit if not applicable)
133
- {plan for new API endpoints or use of existing APIs}
134
-
135
- ## Test Strategy
136
-
137
- > Written alongside the File Change Map. Classify each implementation file and decide test coverage level.
138
- > Determines which files need test coverage and at what level.
139
-
140
- ### Code Classification
141
-
142
- | File | Code Type | Test Need | Reason |
143
- |------|-----------|:---------:|--------|
144
- | {path} | {business-logic / pure-function / side-effect / framework / config / UI} | {required / optional / unnecessary} | {brief justification} |
145
-
146
- > Classification guide:
147
- > - **business-logic / pure-function**: Required — unit tests (AAA pattern)
148
- > - **side-effect code** (external API, DB, file I/O): Required — integration tests with mocks
149
- > - **framework / config / getter-setter / boilerplate**: Unnecessary — no test
150
- > - **UI rendering** (no state logic): Optional — minimal snapshot or skip
151
-
152
- ### Test Pyramid
153
-
154
- - **Unit tests**: {count} files ({which files})
155
- - **Integration tests**: {count} files ({which files}, if applicable)
156
- - **E2E tests**: {count} (if applicable, only for critical user flows)
157
-
158
- ### Required Test Cases (derived from spec EARS requirements)
159
-
160
- {For each spec EARS requirement with `→ TC:` mapping, list the test case here}
161
- - `should_{behavior}_when_{trigger}` → covers FR-{NNN}
162
- - `should_{behavior}_while_{state}` → covers FR-{NNN}
163
-
164
- ## File Change Map
165
-
166
- | File | Action | Description | Depends On | Phase |
167
- |------|--------|-------------|------------|-------|
168
- | {path} | create/modify/delete | {summary} | {file(s) or "—"} | {1-N} |
169
-
170
- > - **Depends On**: list file(s) that must be created/modified first (enables dependency-aware task generation in /afc:implement).
171
- > - **Phase**: implementation phase number. Same-phase + no dependency + different file = parallelizable.
172
- > - **Test files**: For each implementation file classified as "required" in Code Classification, include a corresponding test file in the same Phase. Test files are first-class citizens in the File Change Map.
173
-
174
- ## Implementation Context
175
-
176
- > Auto-generated section for implementation agents. Compress to under 500 words.
177
- > This section travels with every sub-agent prompt during /afc:implement.
178
-
179
- - **Objective**: {1-sentence feature purpose from spec Overview}
180
- - **Key Constraints**: {NFR summaries + spec Constraints section, compressed}
181
- - **Critical Edge Cases**: {top 3 edge cases from spec, 1 line each}
182
- - **Risk Watchpoints**: {top risks from Risk & Mitigation table}
183
- - **Must NOT**: {explicit prohibitions — from spec constraints, principles.md, or CLAUDE.md}
184
- - **Acceptance Anchors**: {key acceptance criteria from spec that implementation must satisfy}
185
-
186
- ## Risk & Mitigation
187
- | Risk | Impact | Mitigation |
188
- |------|--------|------------|
189
- | {risk} | {H/M/L} | {approach} |
190
-
191
- ## Alternative Design
192
- ### Approach 0: No Change (status quo)
193
- {Why might the current state be sufficient? What is the cost of doing nothing?}
194
- {If no change is clearly inferior: state specific reason — "Status quo lacks X, which is required by FR-001"}
195
- {If no change is viable: recommend it — avoid implementing for the sake of implementing}
196
-
197
- ### Approach A: {chosen approach name}
198
- {Brief description — this is the approach detailed above}
199
-
200
- ### Approach B: {alternative approach name}
201
- {Brief description of a meaningfully different approach}
202
-
203
- | Criterion | No Change | Approach A | Approach B |
204
- |-----------|-----------|-----------|-----------|
205
- | Complexity | None | {evaluation} | {evaluation} |
206
- | Risk | None | {evaluation} | {evaluation} |
207
- | Maintainability | Current | {evaluation} | {evaluation} |
208
- | Justification | {why not enough} | {why this} | {why this} |
209
-
210
- **Decision**: Approach {0/A/B} — {1-sentence rationale}
211
- {If Approach 0 chosen: abort plan, report: "No implementation needed — current state satisfies requirements."}
212
-
213
- ## Phase Breakdown
214
- ### Phase 1: Setup
215
- {project structure, type definitions, configuration}
216
-
217
- ### Phase 2: Core Implementation
218
- {core business logic, state management}
219
-
220
- ### Phase 3: UI & Integration
221
- {UI components, API integration}
222
-
223
- ### Phase 4: Polish
224
- {error handling, performance optimization, tests}
225
- ```
104
+ Create `.claude/afc/specs/{feature}/plan.md` following the template in `${CLAUDE_SKILL_DIR}/plan-template.md`. Read it first, then generate the plan using that structure. **All sections are mandatory** unless marked "(omit if not applicable)".
226
105
 
227
106
  ### 4.5. File Path Verification
228
107
 
@@ -0,0 +1,118 @@
1
+ # Implementation Plan: {feature name}
2
+
3
+ ## Summary
4
+ {summary of core requirements from spec + technical approach, 3-5 sentences}
5
+
6
+ ## Technical Context
7
+ {Summarize key project settings from .claude/rules/afc-project.md (auto-loaded) and afc.config.md}
8
+ - **Constraints**: {constraints extracted from spec}
9
+
10
+ ## Principles Check
11
+ {if .claude/afc/memory/principles.md exists: validation results against MUST principles}
12
+ {if violations possible: state explicitly + justification}
13
+
14
+ ## Architecture Decision
15
+ ### Approach
16
+ {core idea of the chosen design}
17
+
18
+ ### Architecture Placement
19
+ | Layer | Path | Role |
20
+ |-------|------|------|
21
+ | {entities/features/widgets/shared} | {path} | {description} |
22
+
23
+ ### State Management Strategy (omit if not applicable)
24
+ {what combination of Zustand store / React Query / Context is used where}
25
+
26
+ ### API Design (omit if not applicable)
27
+ {plan for new API endpoints or use of existing APIs}
28
+
29
+ ## Test Strategy
30
+
31
+ > Written alongside the File Change Map. Classify each implementation file and decide test coverage level.
32
+ > Determines which files need test coverage and at what level.
33
+
34
+ ### Code Classification
35
+
36
+ | File | Code Type | Test Need | Reason |
37
+ |------|-----------|:---------:|--------|
38
+ | {path} | {business-logic / pure-function / side-effect / framework / config / UI} | {required / optional / unnecessary} | {brief justification} |
39
+
40
+ > Classification guide:
41
+ > - **business-logic / pure-function**: Required — unit tests (AAA pattern)
42
+ > - **side-effect code** (external API, DB, file I/O): Required — integration tests with mocks
43
+ > - **framework / config / getter-setter / boilerplate**: Unnecessary — no test
44
+ > - **UI rendering** (no state logic): Optional — minimal snapshot or skip
45
+
46
+ ### Test Pyramid
47
+
48
+ - **Unit tests**: {count} files ({which files})
49
+ - **Integration tests**: {count} files ({which files}, if applicable)
50
+ - **E2E tests**: {count} (if applicable, only for critical user flows)
51
+
52
+ ### Required Test Cases (derived from spec EARS requirements)
53
+
54
+ {For each spec EARS requirement with `→ TC:` mapping, list the test case here}
55
+ - `should_{behavior}_when_{trigger}` → covers FR-{NNN}
56
+ - `should_{behavior}_while_{state}` → covers FR-{NNN}
57
+
58
+ ## File Change Map
59
+
60
+ | File | Action | Description | Depends On | Phase |
61
+ |------|--------|-------------|------------|-------|
62
+ | {path} | create/modify/delete | {summary} | {file(s) or "—"} | {1-N} |
63
+
64
+ > - **Depends On**: list file(s) that must be created/modified first (enables dependency-aware task generation in /afc:implement).
65
+ > - **Phase**: implementation phase number. Same-phase + no dependency + different file = parallelizable.
66
+ > - **Test files**: For each implementation file classified as "required" in Code Classification, include a corresponding test file in the same Phase. Test files are first-class citizens in the File Change Map.
67
+
68
+ ## Implementation Context
69
+
70
+ > Auto-generated section for implementation agents. Compress to under 500 words.
71
+ > This section travels with every sub-agent prompt during /afc:implement.
72
+
73
+ - **Objective**: {1-sentence feature purpose from spec Overview}
74
+ - **Key Constraints**: {NFR summaries + spec Constraints section, compressed}
75
+ - **Critical Edge Cases**: {top 3 edge cases from spec, 1 line each}
76
+ - **Risk Watchpoints**: {top risks from Risk & Mitigation table}
77
+ - **Must NOT**: {explicit prohibitions — from spec constraints, principles.md, or CLAUDE.md}
78
+ - **Acceptance Anchors**: {key acceptance criteria from spec that implementation must satisfy}
79
+
80
+ ## Risk & Mitigation
81
+ | Risk | Impact | Mitigation |
82
+ |------|--------|------------|
83
+ | {risk} | {H/M/L} | {approach} |
84
+
85
+ ## Alternative Design
86
+ ### Approach 0: No Change (status quo)
87
+ {Why might the current state be sufficient? What is the cost of doing nothing?}
88
+ {If no change is clearly inferior: state specific reason — "Status quo lacks X, which is required by FR-001"}
89
+ {If no change is viable: recommend it — avoid implementing for the sake of implementing}
90
+
91
+ ### Approach A: {chosen approach name}
92
+ {Brief description — this is the approach detailed above}
93
+
94
+ ### Approach B: {alternative approach name}
95
+ {Brief description of a meaningfully different approach}
96
+
97
+ | Criterion | No Change | Approach A | Approach B |
98
+ |-----------|-----------|-----------|-----------|
99
+ | Complexity | None | {evaluation} | {evaluation} |
100
+ | Risk | None | {evaluation} | {evaluation} |
101
+ | Maintainability | Current | {evaluation} | {evaluation} |
102
+ | Justification | {why not enough} | {why this} | {why this} |
103
+
104
+ **Decision**: Approach {0/A/B} — {1-sentence rationale}
105
+ {If Approach 0 chosen: abort plan, report: "No implementation needed — current state satisfies requirements."}
106
+
107
+ ## Phase Breakdown
108
+ ### Phase 1: Setup
109
+ {project structure, type definitions, configuration}
110
+
111
+ ### Phase 2: Core Implementation
112
+ {core business logic, state management}
113
+
114
+ ### Phase 3: UI & Integration
115
+ {UI components, API integration}
116
+
117
+ ### Phase 4: Polish
118
+ {error handling, performance optimization, tests}
@@ -75,82 +75,7 @@ Detect whether `$ARGUMENTS` references external libraries, APIs, or technologies
75
75
 
76
76
  ### 3. Write Spec
77
77
 
78
- Create `.claude/afc/specs/{feature-name}/spec.md`:
79
-
80
- ```markdown
81
- # Feature Spec: {feature name}
82
-
83
- > Created: {YYYY-MM-DD}
84
- > Branch: {BRANCH_NAME}
85
- > Status: Draft
86
-
87
- ## Overview
88
- {2-3 sentences on the purpose and background of the feature}
89
-
90
- ## User Stories
91
-
92
- ### US1: {story title} [P1]
93
- **Description**: {feature description from user perspective}
94
- **Priority rationale**: {why this order}
95
- **Independent testability**: {whether this story can be tested on its own}
96
-
97
- #### Acceptance Scenarios (GWT for user scenarios)
98
- - [ ] Given {precondition}, When {action}, Then {result}
99
- - [ ] Given {precondition}, When {action}, Then {result}
100
-
101
- #### System Requirements (EARS notation)
102
-
103
- > Use one of the 5 EARS patterns for each requirement. Each requirement must map to at least one expected test case (TC).
104
-
105
- | Pattern | Template | Use When |
106
- |---------|----------|----------|
107
- | Ubiquitous | `THE System SHALL {behavior}` | Always-on property (no trigger needed) |
108
- | Event-driven | `WHEN {trigger}, THE System SHALL {response}` | Specific event triggers a response |
109
- | State-driven | `WHILE {state}, THE System SHALL {behavior}` | Behavior depends on system state |
110
- | Unwanted | `IF {condition}, THE System SHALL {handling}` | Error/failure handling |
111
- | Optional | `WHERE {feature/config active}, THE System SHALL {behavior}` | Feature flag or conditional capability |
112
-
113
- - [ ] WHEN {trigger}, THE System SHALL {behavior} → TC: `should_{behavior}_when_{trigger}`
114
- - [ ] WHILE {state}, THE System SHALL {behavior} → TC: `should_{behavior}_while_{state}`
115
-
116
- ### US2: {story title} [P2]
117
- {same format}
118
-
119
- ## Requirements
120
-
121
- ### Functional Requirements
122
- - **FR-001**: {requirement}
123
- - **FR-002**: {requirement}
124
-
125
- ### Non-Functional Requirements
126
- - **NFR-001**: {performance/security/accessibility etc.}
127
-
128
- ### Auto-Suggested NFRs
129
- {Load `${CLAUDE_PLUGIN_ROOT}/docs/nfr-templates.md` and select 3-5 relevant NFRs based on the project type detected from afc.config.md}
130
- - **NFR-A01** [AUTO-SUGGESTED]: {suggestion from matching project type template}
131
- - **NFR-A02** [AUTO-SUGGESTED]: {suggestion}
132
- - **NFR-A03** [AUTO-SUGGESTED]: {suggestion}
133
- {Tag each with [AUTO-SUGGESTED]. Users may accept, modify, or remove.}
134
-
135
- ### Key Entities
136
- | Entity | Description | Related Existing Code |
137
- |--------|-------------|-----------------------|
138
- | {name} | {description} | {path or "new"} |
139
-
140
- ## Success Criteria
141
- - **SC-001**: {measurable success indicator}
142
- - **SC-002**: {measurable success indicator}
143
-
144
- ## Edge Cases
145
- - {edge case 1}
146
- - {edge case 2}
147
-
148
- ## Constraints
149
- - {technical/business constraints}
150
-
151
- ## [NEEDS CLARIFICATION]
152
- - {uncertain items — record if any, remove section if none}
153
- ```
78
+ Create `.claude/afc/specs/{feature-name}/spec.md` following the template in `${CLAUDE_SKILL_DIR}/spec-template.md`. Read it first, then generate the spec using that structure.
154
79
 
155
80
  ### 3.5. Inline Clarification (standalone mode only)
156
81
 
@@ -0,0 +1,72 @@
1
+ # Feature Spec: {feature name}
2
+
3
+ > Created: {YYYY-MM-DD}
4
+ > Branch: {BRANCH_NAME}
5
+ > Status: Draft
6
+
7
+ ## Overview
8
+ {2-3 sentences on the purpose and background of the feature}
9
+
10
+ ## User Stories
11
+
12
+ ### US1: {story title} [P1]
13
+ **Description**: {feature description from user perspective}
14
+ **Priority rationale**: {why this order}
15
+ **Independent testability**: {whether this story can be tested on its own}
16
+
17
+ #### Acceptance Scenarios (GWT for user scenarios)
18
+ - [ ] Given {precondition}, When {action}, Then {result}
19
+ - [ ] Given {precondition}, When {action}, Then {result}
20
+
21
+ #### System Requirements (EARS notation)
22
+
23
+ > Use one of the 5 EARS patterns for each requirement. Each requirement must map to at least one expected test case (TC).
24
+
25
+ | Pattern | Template | Use When |
26
+ |---------|----------|----------|
27
+ | Ubiquitous | `THE System SHALL {behavior}` | Always-on property (no trigger needed) |
28
+ | Event-driven | `WHEN {trigger}, THE System SHALL {response}` | Specific event triggers a response |
29
+ | State-driven | `WHILE {state}, THE System SHALL {behavior}` | Behavior depends on system state |
30
+ | Unwanted | `IF {condition}, THE System SHALL {handling}` | Error/failure handling |
31
+ | Optional | `WHERE {feature/config active}, THE System SHALL {behavior}` | Feature flag or conditional capability |
32
+
33
+ - [ ] WHEN {trigger}, THE System SHALL {behavior} → TC: `should_{behavior}_when_{trigger}`
34
+ - [ ] WHILE {state}, THE System SHALL {behavior} → TC: `should_{behavior}_while_{state}`
35
+
36
+ ### US2: {story title} [P2]
37
+ {same format}
38
+
39
+ ## Requirements
40
+
41
+ ### Functional Requirements
42
+ - **FR-001**: {requirement}
43
+ - **FR-002**: {requirement}
44
+
45
+ ### Non-Functional Requirements
46
+ - **NFR-001**: {performance/security/accessibility etc.}
47
+
48
+ ### Auto-Suggested NFRs
49
+ {Load `${CLAUDE_SKILL_DIR}/nfr-templates.md` and select 3-5 relevant NFRs based on the project type detected from afc.config.md}
50
+ - **NFR-A01** [AUTO-SUGGESTED]: {suggestion from matching project type template}
51
+ - **NFR-A02** [AUTO-SUGGESTED]: {suggestion}
52
+ - **NFR-A03** [AUTO-SUGGESTED]: {suggestion}
53
+ {Tag each with [AUTO-SUGGESTED]. Users may accept, modify, or remove.}
54
+
55
+ ### Key Entities
56
+ | Entity | Description | Related Existing Code |
57
+ |--------|-------------|-----------------------|
58
+ | {name} | {description} | {path or "new"} |
59
+
60
+ ## Success Criteria
61
+ - **SC-001**: {measurable success indicator}
62
+ - **SC-002**: {measurable success indicator}
63
+
64
+ ## Edge Cases
65
+ - {edge case 1}
66
+ - {edge case 2}
67
+
68
+ ## Constraints
69
+ - {technical/business constraints}
70
+
71
+ ## [NEEDS CLARIFICATION]
72
+ - {uncertain items — record if any, remove section if none}
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
File without changes
File without changes
File without changes