afc-plan
Implementation design — plan approach, create file change map, design architecture
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Implementation design — plan approach, create file change map, design architecture
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Code and component analysis — analyze code, trace flows, audit consistency, inspect components
Architecture analysis and design review
Full auto pipeline — run spec-to-clean cycle automatically for new features
Save session state for later resumption
Resolve spec ambiguities with clarifying questions
Pipeline artifact cleanup and codebase hygiene
| name | afc:plan |
| description | Implementation design — plan approach, create file change map, design architecture |
| argument-hint | [additional context or constraints] |
| allowed-tools | ["Read","Glob","Grep","Write","WebSearch","WebFetch"] |
| model | sonnet |
Generates an implementation plan (plan.md) based on the feature specification (spec.md). Ensures quality with convergence-based Critic Loop and runs research in parallel when needed.
$ARGUMENTS — (optional) Additional context or constraints!cat .claude/afc.config.md 2>/dev/null || echo "[CONFIG NOT FOUND] .claude/afc.config.md not found. Create it with /afc:init."
Always read .claude/afc.config.md first (read manually if not auto-loaded above) — needed for CI Commands (YAML).
Architecture, Code Style, and Project Context are auto-loaded via .claude/rules/afc-project.md.
If config file is missing:
.claude/afc.config.md not found. Run /afc:init to set up the project?"/afc:init, then restart this command with the original $ARGUMENTSBRANCH_NAME.claude/afc/specs/ for a directory matching the current branch name or $ARGUMENTS/afc:spec to create it first." then execute /afc:spec with $ARGUMENTS. After spec completes, restart this command from the beginning with the original $ARGUMENTS.claude/afc/memory/quality-history/*.json exists, load the most recent 10 files (sorted by filename descending) and display trend: "Last {N} pipelines: avg critic_fixes {X}, avg ci_failures {Y}". Use trends to inform risk assessment..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..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.[NEEDS CLARIFICATION] tags:
/afc:clarify then abortExtract technical uncertainties from spec.md:
If no uncertain items: skip Phase 0.
If there are uncertain items, follow the 3-step ReWOO flow:
List all research topics as a numbered list:
1. {topic1} — {what we need to know}
2. {topic2} — {what we need to know}
3. {topic3} — {what we need to know}
Task("Research: {topic1}", subagent_type: "general-purpose")
Task("Research: {topic2}", subagent_type: "general-purpose")
Collect all results and record in .claude/afc/specs/{feature}/research.md:
## {topic}
**Decision**: {chosen approach}
**Rationale**: {reason}
**Alternatives**: {other approaches considered}
**Source**: {URL or file path}
Copy research findings to .claude/afc/memory/research/{feature}.md for cross-session reuse.
Future pipelines can reference prior research to avoid redundant investigation.
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)".
After writing plan.md, verify all paths in the File Change Map:
src/utils/ vs src/lib/) → auto-correct with the real directory. Do not search across architectural boundaries (e.g., frontend/ vs backend/)Path verification: {M}/{N} paths confirmed ({K} corrected)Always read
${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.mdfirst and follow it.
Run the critic loop until convergence. Safety cap: 5 passes.
| Criterion | Validation |
|---|---|
| COMPLETENESS | Are all requirements (FR-*) from spec.md reflected in the plan? For each implementation file classified as "required" in Test Strategy Code Classification, does the File Change Map include a corresponding test file? Report: {M}/{N} test pairs present. |
| FEASIBILITY | Is it compatible with the existing codebase? Are dependencies available? |
| ARCHITECTURE | Does it comply with {config.architecture} rules? |
| CROSS_CONSISTENCY | Spec↔Plan cross-artifact validation (see checklist below) |
| RISK | Are there any unidentified risks? Additionally, if .claude/afc/memory/retrospectives/ directory contains files from previous pipeline runs, load the most recent 10 files (sorted by filename descending) and check whether the current plan addresses the patterns recorded there. Tag matched patterns with [RETRO-CHECKED]. |
| PRINCIPLES | Does it not violate the MUST principles in principles.md? |
CROSS_CONSISTENCY checklist (mandatory, check all 5):
Key Entities table appears in at least one File Change Map row. Report: {M}/{N} entities covered.{M}/{N} NFRs traced.Constraints section is addressed in Risk & Mitigation or Implementation Context Must NOT. Report: {M}/{N} constraints propagated.Acceptance Anchors faithfully reflect spec.md's acceptance scenarios (no omissions, no misinterpretations).Follow verdict handling and output format per docs/critic-loop-rules.md.
When the afc-architect agent is available, invoke it to record architecture decisions:
Task("ADR: Record decisions for {feature}", subagent_type: "afc:afc-architect",
prompt: "Review the plan and record key architecture decisions to your persistent memory.
Plan sections: Architecture Decision + File Change Map.
Check for conflicts with existing ADRs. Return: { decisions_recorded: N, conflicts: [] }")
When not running inside /afc:auto, save progress for /afc:resume:
.claude/afc/memory/checkpoint.md with: branch, last commit, feature name, current phase (plan complete), next step (/afc:implement)Plan generated
├─ .claude/afc/specs/{feature}/plan.md
├─ .claude/afc/specs/{feature}/research.md (if research was performed)
├─ Implementation Context: generated ({W} words)
├─ Critic: converged ({N} passes, {M} fixes, {E} escalations)
└─ Next step: /afc:implement (tasks generated automatically at implement start)