Level 9Lesson 73โฑ๏ธ 40 min

What Is Spec-Driven Development?

Stop describing what you want and hoping. Write a real spec, make it the source of truth, and let the agent build from it

The Problem: Vibe Coding

The way most people use AI to build software looks like this: type "make me a login page," see what comes out, type "no, add a remember-me box," and keep nudging. People call this vibe coding - you steer by feel, turn by turn. It's fast and fun for a demo, and it falls apart on anything real.

Why it falls apart: the AI is constantly guessing what you meant, and you only find out it guessed wrong after it's built the wrong thing.

The core insight of 2026: modern AI agents rarely write bugsanymore - they write intent gaps. Places where the agent assumed you meant something different than you did. The hard part of AI development isn't getting code; it's making sure the agent builds the right thing.

The Fix: Spec-Driven Development

Spec-Driven Development (SDD) flips the order. Instead of jumping to code, you first write a clear specification - what to build, for whom, and what "done" means. Then the agent generates the code from that spec. The spec becomes the primary artifact; the code is just its output.

The one-line shift: in normal coding, the code is the source of truth and the docs rot. In SDD, the spec is the source of truth and the code is generated to match it. You edit intent, not just implementation.

An Analogy: Blueprints Before Bricks

Nobody builds a house by telling builders "just start laying bricks and I'll tell you when it looks wrong." You draw blueprints first - rooms, dimensions, where the plumbing goes - get them approved, and then build. Changing a line on the blueprint is cheap; knocking down a built wall is expensive.

SDD is blueprints for software. The spec is the blueprint. Fixing a misunderstanding in the spec costs a sentence. Fixing it after the agent built a week of code costs a week. SDD moves the correction to where it's cheap.

The Core Loop: Spec โ†’ Plan โ†’ Tasks โ†’ Implement

Most SDD methods share the same four-step shape. You and the AI move through it together, with you approving each step before the next:

1. SPEC       Describe WHAT to build and what "done" means.
              (the requirements - no code yet)

2. PLAN       Turn the spec into a technical approach.
              (architecture, tech choices, how it fits together)

3. TASKS      Break the plan into small, testable pieces of work.
              (each one a clear, checkable chunk)

4. IMPLEMENT  The agent builds each task, checked against the spec.
              (code, finally - and it traces back to the spec)

Each step produces a written document that feeds the next. You review at every arrow. The agent never runs ahead and builds on a guess.

The "Constitution": Rules That Govern Everything

Most serious SDD setups start with a constitution (sometimes a CLAUDE.md-style file): a short set of governing principles that everyspec, plan, and task must obey. Think of it as the project's house rules.

# Project Constitution (example)

- Language: TypeScript. No new languages without approval.
- Every feature ships with tests. No exceptions.
- Accessibility: all UI must be keyboard-navigable.
- No secrets in code; use environment variables.
- Prefer boring, well-known libraries over clever new ones.
Why it matters: the constitution is the instruction pillar from Level 8 applied to a whole project. It keeps every agent - and every spec - pulling in the same direction, so quality doesn't drift from feature to feature.

How This Level Builds Up

SDD is a family of methods. We'll go from the shared foundation to the two biggest named systems:

74  Writing specs that don't lie  - EARS notation, FRs vs NFRs
75  The SDD toolbox              - Spec Kit, Kiro, OpenSpec, Tessl
76  BMAD, part 1                 - the AI "product team" of agents
77  BMAD, part 2                 - the full workflow, step by step
78  BMAD, part 3                 - build a real small app with it
79  LID                          - Linked Intent Development, the "arrow"
80  Best practices & anti-patterns - when SDD helps, when it's overkill

Hands-On: Catch an Intent Gap

Hands-on (15 min): Ask an AI to build something small and deliberately vague - e.g. "make a to-do list app." Look at what it produced and list every decision itmade that you never specified: Did tasks save anywhere? Can you delete them? Due dates? Accounts? Each of those is an intent gap - a place it guessed. Now write a three-sentence spec that would have closed those gaps up front. You just felt exactly why SDD exists.
Lesson 73 Quick Reference
Vibe coding

Steering an AI turn by turn by feel; fast for demos, breaks down on real work

Intent gap

Where the agent assumed you meant something you didn't - the main failure of modern AI coding

Spec-Driven Development

Write the spec first; the agent builds from it. The spec is the source of truth, code is its output

Blueprints before bricks

Fixing a misunderstanding in the spec costs a sentence; fixing built code costs a week

Spec โ†’ Plan โ†’ Tasks โ†’ Implement

The shared four-step SDD loop, with human approval at each step

Constitution

Short governing principles every spec/plan/task must obey - the project's house rules

โ† Level 8 Capstone
Unlocks in ~10 min of reading