A four-phase, gated workflow promoted by GitHub’s AI team via the GitHub Spec Kit, where the specification — not the chat thread — is the centre of the engineering process. The spec drives implementation, checklists, and task breakdowns. Your role is to steer; the coding agent does the bulk of the writing. Each phase has a specific job; you don’t move on until the current phase is validated.

This is the productised, opinionated version of five-principle spec writing — and a structural defence against what Simon Willison calls “house of cards code”: fragile AI outputs that pass a glance but collapse under scrutiny.

The four phases

1. Specify — what and why

You provide a high-level description of what you’re building and why. The coding agent generates a detailed specification.

This isn’t about technical stacks or app design — it’s about user journeys, experiences, and what success looks like. Who uses this? What problem does it solve? How do they interact with it?

Output: a spec.md (or equivalent) that’s a “living artifact that evolves as you learn more.”

2. Plan — how

Now technical. You provide your desired stack, architecture, and constraints. The coding agent generates a comprehensive technical plan.

If your company standardises on certain technologies, this is where you say so. Legacy systems, compliance requirements, internal architectural patterns all go here. You can ask for multiple plan variations to compare approaches. If you make internal docs available, the agent can integrate your patterns into the plan.

Output: a plan.md covering stack, architecture, integration points, and constraints.

3. Tasks — small, reviewable chunks

The agent takes the spec and plan and breaks them into actual work — small, reviewable chunks that each solve a specific piece of the puzzle.

Each task should be something you can implement and test in isolation, almost like test-driven development for your AI agent.

Instead of “build authentication,” you get concrete tasks like “create a user registration endpoint that validates email format.”

Output: a task list (often tasks.md or a structured tasks.json — the same role as Anthropic’s feature_list.json in Long-Running Agents - Initializer + Coding Pattern).

4. Implement — one task at a time

Your coding agent tackles tasks one by one (or in parallel). Instead of reviewing thousand-line code dumps, you review focused changes that solve specific problems.

The agent now knows three things:

  • what to build (specification)
  • how to build it (plan)
  • what to work on now (task)

Crucially, your role is to verify at each phase: Does the spec capture what you want? Does the plan account for constraints? Are there edge cases the AI missed? The process builds in checkpoints for you to critique, spot gaps, and course-correct before moving forward.

The gating principle

The defining property of SDD is the gate between phases. The agent doesn’t proceed to Plan until you’ve validated the Spec; doesn’t generate Tasks until the Plan is signed off; doesn’t write code until the Tasks are reviewed.

Key

The intended rule is to validate each artifact before proceeding. Phase gates create checkpoints for catching upstream mistakes while correction is cheap. They do not make a mistaken spec, incomplete review, or faulty implementation impossible.

Counter-position: validation is not a correctness guarantee

Gabriella Gonzalez’s A Sufficiently Detailed Spec Is Code challenges the stronger promise: precise specification still requires engineering work, and a detailed document can still yield a broken implementation. The earlier version of this page said SDD made upstream failure “impossible by construction”; that overstatement is explicitly withdrawn. A gate can require approval, not prove the approver understood the system.

This is a structural answer to the three walls: it doesn’t fix self-verification (you’re still doing that), but it forces verification to happen at the right moment — when the artifact is small and the cost of correction is low.

Compare with Cursor Planner Worker Judge: SDD does at workflow time what planner/worker/judge does at runtime. Same separation-of-concerns, applied to phases instead of roles.

Why each phase outputs a separate artifact

Each phase produces a durable, version-controlled artifact — spec.md, plan.md, tasks.md. This is the same file-as-state principle from Context Window Management Strategies: state lives outside the model’s context, so any future session can reconstruct where we are without trusting the chat transcript.

The artifacts are also what the agent reads as input for the next phase, which is why they must be precise. Vague specs produce vague plans; vague plans produce vague tasks; vague tasks produce broken code.

How SDD relates to other patterns

PatternRelationship
Long-Running Agents - Initializer + Coding PatternThe initializer agent runs Specify + Plan + Tasks; the coding agent runs Implement, one task per session
Cursor Planner Worker JudgeCursor’s planner produces task specs (Tasks phase); workers Implement; judges gate progression
Ralph LoopRyan Carson’s Compound Product (analysis loop → planning loop → execution loop) is open-source SDD
Evaluation-First PromptingThe Specify phase is evaluation-first prompting at the project level — success criteria before code
Anthropic’s SkillsA similar pattern: reusable Markdown-based agent behaviours invoked at the right phase

When SDD pays off (and when it doesn’t)

Pays off:

  • Multi-feature projects where one mistaken assumption compounds across the codebase
  • Long-running runs where context windows can’t carry the whole project
  • Team-shared agents where the spec is also the documentation
  • Anything that has to ship to production

Overkill:

  • Throwaway prototypes, one-shot scripts
  • “Center this div” tasks where the spec is bigger than the work
  • Genuine exploration where the goal is to discover what the spec should say

The principle is the same as principle 4 of spec-writing: adjust spec detail to task complexity. SDD is a heavyweight workflow; reserve it for projects where heavyweight pays.

The limit: specs organize engineering, not eliminate it

A Sufficiently Detailed Spec Is Code distinguishes a useful requirement or design document from a promise that specification replaces programming with cheaper work. If spec.md defines data structures, formulas, and control flow, those decisions have already been engineered in another notation. If it leaves them open, the implementer still has to make them.

This does not negate SDD’s versioned artifacts or small-task discipline. It limits the claim: phase gates expose decisions for review; they cannot guarantee completeness, conformance, or net time savings. Use observable acceptance criteria, machine-checkable contracts where practical, and a Decision Ledger for consequential choices left open. Budget discovery, specification, correction, and verification alongside generation.

Gonzalez’s reported Symphony/Haskell failure is a counterexample to assuming a detailed spec guarantees a working result, not evidence that every iterative spec workflow fails. See the source caveats in A Sufficiently Detailed Spec Is Code.

Practical execution tips

  • Use Plan Mode (Claude Code, Shift+Tab) for the Specify and Plan phases — read-only operation prevents the agent from leaking into Implement before you’re ready.
  • Commit each artifact as you produce it. “Treat specs as code; maintain them diligently.”
  • Update upstream artifacts when downstream surprises arrive. If Implementation reveals a bad assumption, fix plan.md, not just the code.
  • Keep the artifacts small and focused. SDD doesn’t free you from the Curse of Instructions — it just moves it from prompt-time to phase-time.

Sources