| name | implement |
| description | Docs-first implementation workflow. Use when building a new feature or making significant changes. Ensures user specs, tech architecture, and gap analysis are in place before writing code. Triggers on: 'implement issue #X', 'build feature X', 'work on #X', or '/implement'. |
Docs-First Implementation
Follow this sequence strictly. Do not skip to code.
Phase 1: Understand
- Fetch the issue — Read the GitHub issue (and parent epic if any) to understand scope
- Check existing docs — Search
docs/user/, docs/dev/, and docs/specs/ for related documentation
- Check existing code — Explore the codebase to understand what already exists
Phase 2: Document
Before writing any implementation code:
-
User spec (docs/user/) — Does a doc exist for this feature area? If not, create one. If yes, does it need updating? The user spec describes what the user sees and does. No code, no technical details, readable by a non-technical person. Keep it short.
-
Technical architecture (docs/dev/) — Does a doc exist? If not, create one. If yes, does it need updating? The tech doc describes the ideal system design. Use mermaid diagrams. Avoid function names or implementation details that change frequently. This should be durable.
-
Get user confirmation — Before proceeding, confirm the specs make sense. Don't assume.
Phase 3: Plan
- Gap analysis — Compare current codebase to the ideal architecture from Phase 2. What exists? What's missing? What needs to change?
- Post the plan to the GitHub issue — The plan lives in the issue, not as a
.md file
- If the gap is large — Break into smaller child issues under a parent epic
If the plan covers something not in the user spec or tech architecture, either shrink the plan or update the specs first.
Phase 4: Implement
- Write the code — Follow the plan
- Centralize, don't scatter — Use registries/config maps for dimension-varying logic (providers, environments). No if-else chains across files.
- Write tests that reflect the docs — Test descriptions should read like the requirements. Use generic test data, not hardcoded vendor values.
Phase 5: Verify
- Type check —
pnpm tsc
- Test —
pnpm test
- Lint —
pnpm lint
- Clean code review — Run the
code-review agent to check for scattered logic, hardcoded values, duplicated patterns
Phase 6: Update docs
- Update the README index in CLAUDE.md if new docs were created
- Update the GitHub issue comment with final implementation summary