Create implementation plan before coding. Plan file must exist with required sections before completion.
Create a detailed, actionable implementation plan. No vague language. No optional sections.
No arguments? Describe this skill and stop. Do not execute.
mkdir -p .claude && echo '{"skill":"plan","started":"'$(date -Iseconds)'"}' > .claude/active-workflow.json
Plan for code a master craftsperson would be proud of.
The plan should produce code that looks like it was written by a skilled human engineer, not generated by AI.
If your plan includes something a senior engineer would delete, remove it from the plan.
Load the rubric files (see Step 0d below) and apply them:
Every plan must explicitly address the loaded rubric concerns. For each item, the plan must either include a WORK_ITEM that implements it or state why it's not applicable (with justification). "Not applicable" is only valid for items that genuinely don't apply to the target (e.g., CSRF doesn't apply to a CLI tool).
If the plan omits any applicable item without justification, it fails validation.
Document decisions in the plan under ## PRODUCTION_CHECKLIST: using the Planning Checklist templates from each loaded rubric file. Combine all loaded templates into one section.
Before designing any component, check: does a well-known library already solve this?
commander, yargs, or cac — never hand-roll a parserproper-lockfile or lockfile — never hand-roll with mkdir/spinprompts or inquirer — never hand-roll with readlinezod, joi, or framework validators — never hand-roll schema validation for complex inputsdate-fns or dayjs if needed — never hand-roll date mathThe rule: If a mature, maintained library exists for the subproblem, plan to use it. Hand-rolling is only justified when the library would be heavier than the entire project, or when you need <20 lines of logic that doesn't warrant a dependency.
Document library choices in the plan under a DEPENDENCIES: section:
## DEPENDENCIES:
- commander: CLI argument parsing (replaces hand-rolled parser)
- prompts: interactive password input
You MUST produce a plan with ALL sections below. No "TBD". No "as needed". No "if applicable".
Every item must be SPECIFIC and ACTIONABLE.
Before starting, read these canon skills and apply their principles throughout:
Always load (base brain — all 10):
canon/clarity/SUMMARY.mdcanon/pragmatism/SUMMARY.mdcanon/simplicity/SUMMARY.mdcanon/composition/SUMMARY.mdcanon/distributed/SUMMARY.mdcanon/data-first/SUMMARY.mdcanon/correctness/SUMMARY.mdcanon/algorithms/SUMMARY.mdcanon/abstraction/SUMMARY.mdcanon/optimization/SUMMARY.mdAuto-detect domain canon (check files, load matches):
| Check | If found, also read |
|---|---|
*.ts or *.js files in target | canon/javascript/typescript/SUMMARY.md, canon/javascript/js-safety/SUMMARY.md, canon/javascript/js-perf/SUMMARY.md, canon/javascript/js-internals/SUMMARY.md, canon/javascript/functional/SUMMARY.md |
angular.json in project root | canon/angular/angular-arch/SUMMARY.md, canon/angular/angular-core/SUMMARY.md, canon/angular/angular-perf/SUMMARY.md, canon/angular/rxjs/SUMMARY.md |
package.json contains "react" | canon/javascript/react-state/SUMMARY.md, canon/javascript/react-test/SUMMARY.md, canon/javascript/reactivity/SUMMARY.md |
pom.xml or build.gradle in project | canon/java/SUMMARY.md |
*.py files in target | canon/python/python-advanced/SUMMARY.md, canon/python/python-idioms/SUMMARY.md, canon/python/python-patterns/SUMMARY.md, canon/python/python-protocols/SUMMARY.md |
*.cs files or *.csproj in project | canon/csharp/csharp-depth/SUMMARY.md, canon/csharp/type-systems/SUMMARY.md, canon/csharp/async/SUMMARY.md |
.tsx, .jsx, or HTML template files | canon/ui-ux/components/SUMMARY.md, canon/ui-ux/usability/SUMMARY.md, canon/ui-ux/tokens/SUMMARY.md |
d3 in package.json or imports | canon/visualization/d3/SUMMARY.md, canon/visualization/charts/SUMMARY.md, canon/visualization/dashboards/SUMMARY.md |
| SQL files or ORM imports | canon/database/sql/SUMMARY.md, canon/database/sql-perf/SUMMARY.md |
| Auth, tokens, secrets, encryption | canon/security/security-mindset/SUMMARY.md, canon/security/owasp/SUMMARY.md, canon/security/web-security/SUMMARY.md |
If a skill file doesn't exist (not installed in this project), skip it and continue. List loaded experts in EXPERTS_LOADED. In EXPERT_DECISIONS, show each specific planning decision an expert drove.
Read canon/pitfalls/SKILL.md if it exists. Apply its patterns as you work:
If the file doesn't exist, skip it and continue.
Read .claude/eval-proposals.md if it exists. This file contains proposals from phase 8 (evaluation) — findings that suggest changes to skills, pipeline, profiles, or config. Each proposal has a status (PENDING, APPLIED, REJECTED).
For each PENDING proposal:
List surfaced proposals in the plan under:
## EVAL_PROPOSALS_SURFACED:
- [proposal title]: [how it was incorporated or "flagged for user — outside plan scope"]
If no proposals file exists or no PENDING proposals are relevant, write:
## EVAL_PROPOSALS_SURFACED: none
Read .claude/rubric/AUTO-DETECT.md for the detection table. Then:
.claude/rubric/base.md and .claude/rubric/product-quality.md.claude/rubric/web-api.md, .claude/rubric/data-persistence.md, .claude/rubric/cli.md, .claude/rubric/microservice.md).## Planning Checklist table and template. Combine into a single PRODUCTION_CHECKLIST for the plan output.If a rubric file doesn't exist, skip it and continue. List loaded rubrics in:
## RUBRICS_LOADED: [base, product-quality, cli, data-persistence, ...]
Read .claude/rubric/contracts.md. Use the 7 abstract types when writing WORK_ITEM constraints and CONSTRUCTION_CHECKS. If Phase 2 (structure) produced a QUALITY_CONTRACTS table, incorporate its Construction Check entries into CONSTRUCTION_CHECKS.
.claude/plans/[slug].md# Plan: [Feature/Task Name]
## FILES:
- path/to/file.ts: purpose of this file
- path/to/another.ts: purpose of this file
## FUNCTIONS:
- functionName(params): ReturnType (max N lines) - purpose
- anotherFunction(params): ReturnType (max N lines) - purpose
## TYPES:
- TypeName: { field: Type, field2: Type }
- AnotherType: { field: Type }
## DEPENDENCIES:
- library-name: what subproblem it solves (why not hand-roll)
## INVARIANTS:
- Specific condition that must always be true
- Another specific invariant
## SECURITY:
- Specific security measure to implement
- Another specific security consideration
## QUALITY_CONTRACTS:
{from Phase 2, or identify boundaries here if Phase 2 was skipped}
| Boundary | Abstract Type | Contract | Construction Check |
|----------|--------------|----------|--------------------|
## UX:
- Default config path: [exact path, e.g., ~/.toolname/config.json]
- Required inputs: [input] → [flag] / [ENV_VAR] / [interactive prompt]
- Error messages: [scenario] → [user-facing message]
## TESTS:
- Specific test case: [what it verifies]
- Another test case: [what it verifies]
## PRODUCTION_CHECKLIST:
{Combine Planning Checklist templates from all loaded rubric files — base.md + product-quality.md + any domain matches}
## CONSTRUCTION_CHECKS:
- FILE: path/to/new-file.ts
- EXPORT_FUNCTION: functionName IN path/to/file.ts
- EXPORT_TYPE: TypeName IN path/to/file.ts
## WORK_ITEMS:
- [ ] WI-1: [verb] [specific thing] in [file(s)] [S/M/L]
Constraint: [one canon principle + BAD/GOOD]
- [ ] WI-2: [verb] [specific thing] in [file(s)] [S/M/L]
Constraint: [one canon principle + BAD/GOOD]
- [ ] WI-3: [verb] [specific thing] in [file(s)] [S/M/L]
Constraint: [one canon principle + BAD/GOOD]
## EXPERTS_LOADED: [list of skill names actually read]
## EXPERT_DECISIONS:
- [expert-skill]: [specific planning decision it drove]
PLAN_COMPLETE
Each work item includes a Constraint: — the ONE canon principle most likely to be violated in this unit. Name the source (Bloch, OWASP, GoF, Fowler, etc.) when applicable. Include a BAD/GOOD one-liner showing wrong vs right for this specific unit.
Example:
- [ ] WI-3: Create profile write function in src/profiles/create.ts [M]
Constraint: [ValidatedInput + CausedError] Validate inputs at boundary (Bloch Item 49). File I/O in try-catch with cause.
BAD: function create(name: string) { writeFileSync(path.join(dir, name), ...) }
GOOD: function create(validated: ValidatedName) { try { ... } catch(e) { throw new Error(..., {cause: e}) } }
The [AbstractType + ...] tag tells Phase 3 which contract idiom to implement. Tag every constraint with the matching abstract types from .claude/rubric/contracts.md.
WORK_ITEMS is the implementation checklist. Phases 3 and 4 iterate through it. Every item must be:
Group related changes into one item. "Add destroy() to all 24 modules" is one L item, not 24 S items.
Every planned change must appear as a WORK_ITEM. If it's in FILES/FUNCTIONS but not in WORK_ITEMS, it won't get implemented.
After outputting the plan:
/structureYour turn ends here. Output the plan and STOP.