plan
Task planning and PRD generation. Auto-invoke when the user describes a new task, feature request, bug to fix (multi-file), refactoring need, or says "plan", "let's build", "I need", "implement", "cre
SKILL.mddot_claude/skills/plan/SKILL.md
GitHubPlan: Task Classification and PRD Generation
Steps
Classify mode based on scope:
- Quick Fix: Single-file, < 30 lines, no architectural impact → skip this skill, fix directly (no PRD needed)
- Standard: Multi-file, clear scope, moderate complexity → Minimal PRD
- PRD + Sprint: Large feature, multi-component, >1h of work → Full PRD
If Quick Fix: Tell the user this doesn't need a PRD — they can fix directly or use
/plan-build-test. Done.If Standard or PRD+Sprint: a. Run Contract-First Pattern: mirror your understanding back to user, get confirmation before proceeding b. Run Correctness Discovery (scaled by mode — see CLAUDE.md):
- Standard: Audience + Verification (2 questions)
- PRD+Sprint: All 6 questions (full framework in
~/.claude/skills/plan/correctness-discovery.md) c. If project has a Context Routing Table in its CLAUDE.md → follow it. Otherwise → search for relevant docs manually d. Create the PRD directory at<task-file-location>/<area>/<category>/YYYY-MM-DD_HHmm-name/(create if needed) —task-file-locationcomes from the project CLAUDE.md## Execution Config; defaultdocs/tasks/. This directory holds the execution bundle (sprints/,progress.json,INVARIANTS.md) and MUST stay inside the code repo — hooks (check-invariants.sh), the Build Candidate git tag, and sprint-executor worktrees all resolve paths relative to it. e. Resolve where the PRD prose (spec.md) is written:- If the project CLAUDE.md
## Execution Configdefinesprd-location→ write the PRD prose there asprd-location/YYYY-MM-DD_HHmm-name.md(a single note; that location may be a separate repo such as an Obsidian vault — commit + push it per that repo's branch policy). Keep the execution bundle from step (d) in the code repo. Inprogress.json, set the"prd"field to the absolute path of this note so/plan-build-testcan still locate the prose. Sprint specs remain self-contained (nospec.mdlookup during execution), so this split never breaks execution. - Otherwise (default) → write the PRD as
spec.mdinside the task directory from step (d) (co-located, not a standalone.mdfile). f. Fill "Context Loaded" section with what you learned from docs g. Write PRD using appropriate template (read from~/.claude/skills/plan/prd-template-minimal.mdfor Standard,~/.claude/skills/plan/prd-template-full.mdfor PRD+Sprint) h. Run Spec Self-Evaluator — spawn a separate haiku agent (different context = different perspective) to evaluate the spec:Read
~/.claude/docs/on-demand/evaluation-reference.mdfor the 14-point Spec Self-Evaluator checklist AND the Cross-Section Validation checks. Then read the PRD at [spec.md path]. Phase 1: Score each of the 14 per-section criteria as PASS or FAIL with a brief reason. Phase 2: Run the 3 cross-section validation checks:- Architecture Decisions ↔ Security Boundaries (contradictions?)
- Data Model ↔ Access Patterns (technology fit?)
- Security Boundaries ↔ Sprint Decomposition (mitigations propagated?) Return: total score, list of failures, cross-section contradictions, and specific suggestions to fix each. Must score 11+ out of 14 AND have zero cross-section contradictions to proceed. If below threshold: revise the PRD, then re-evaluate. Using a separate agent prevents the author from grading their own homework.
- If the project CLAUDE.md
If PRD+Sprint — Extract Sprint Specs, INVARIANTS.md, and Build Candidate (MANDATORY):
Sprint extraction protocol:
~/.claude/skills/plan/sprint-extraction-protocol.mdSummary: create
sprints/NN-title.mdper sprint (self-contained, includes file boundaries) → createprogress.json(schema in protocol doc) → createINVARIANTS.md(machine-verifiable contracts for cross-cutting concepts) → runbash ~/.claude/hooks/scripts/validate-sprint-boundaries.sh <prd-dir>→ tag Build Candidate (git tag "build-candidate/<prd-name>"). Maximum 5 sprints per PRD.Tell the user: "PRD prose saved at [spec.md or prd-location note path]. Execution bundle (sprint specs,
progress.json,INVARIANTS.md) at [task-directory]/ in the code repo. Build Candidate tagged. Stop this session. Open a fresh session and run/plan-build-testto execute — do NOT continue in this window. Keeping planning and execution in separate context windows prevents/compactchurn during the build."Do NOT execute. Do NOT invoke
/plan-build-testfrom this session, even if the user's next message asks for it — tell them to start a new session instead (context hygiene). This skill produces the plan only.