Writes a specification before any code is written. Use when the user wants to build a feature, system, or product and needs a written spec as the source of truth first. Guides the agent through four gated phases — Specify → Plan → Tasks → Implement & Verify — so implementation only begins once behaviors, contracts, and a sequenced task list are approved. Prevents premature coding, scope creep, and rewrites.
A four-phase workflow where a written specification is produced and gate-approved before any implementation code is written. Each phase ends with a concrete, reviewable artifact. The agent does not advance until the user explicitly approves.
Phases: Specify → Plan → Tasks → Implement & Verify
When this skill activates, ask exactly one diagnostic question before doing anything else:
"Where are we in the SDD cycle — starting fresh, or resuming a phase?"
This prevents re-specifying features that already have approved artifacts. If resuming, ask which phase was last approved, load the relevant artifact, and continue from there.
Goal: Produce a written specification grounded in existing code.
Before writing the spec:
The spec artifact covers:
Rules:
Read references/phases.md for the full spec artifact template and examples.
Gate: User approves the spec document before any implementation begins.
Goal: Translate the approved spec into an architectural plan.
The plan covers:
Rules:
Read references/phases.md for the full plan artifact template and examples.
Gate: User approves the plan before tasks are written.
Goal: Break the approved plan into a sequenced, independently-completable task list.
Each task must include:
Rules:
Read references/phases.md for the task list template and examples.
Gate: User approves the sequenced task list before implementation begins.
Goal: Work through the approved task list, one task at a time, with full TDD discipline.
For each task:
type: description format (feat, fix, test, refactor, chore, docs).If implementation contradicts the spec: Stop. Flag the contradiction explicitly. The spec wins unless the user consciously updates it.
If a gap in the spec is discovered: Surface it immediately — do not silently paper over it with code.
AGENTS.md rules that apply in Phase 4:
type: description format. Never --no-verify.uv run, always with a venv. Node: use pnpm.website): run tests inside the container via docker compose exec.git add . — stage files individually.Read references/phases.md for TDD exception handling and Phase 4 diagnostic questions.
Gate: All tasks complete, all tests pass, all spec behaviors verifiably satisfied.
| Request | Response |
|---|---|
| "Just start coding" | Acknowledge the desire to move fast. Explain the cost (rewrites, spec drift). Offer a 10-minute fast-spec. Do not skip. |
| Writing implementation during Phase 1 or 2 | Refuse. Phases 1–2 produce prose artifacts only. |
| Advancing without gate approval | Refuse. Present the artifact and wait for explicit approval. |
| Spec that describes HOW instead of WHAT | Rewrite the offending section to describe observable behavior, not implementation. |
| Skipping the task list | Explain that the task list is what makes Phase 4 auditable. Offer to produce it quickly. |
| From | To | Artifact that crosses the boundary |
|---|---|---|
| Phase 1 → Phase 2 | Approved spec document | |
| Phase 2 → Phase 3 | Approved architectural plan | |
| Phase 3 → Phase 4 | Approved, sequenced task list |
Each phase accepts only the artifact produced by the previous phase. Nothing else.