Spec-Driven Development: Make Your Coding Agent Ship Mergeable Code
A coding agent will produce a confident diff for almost anything you ask it. The gap between that diff and something you would actually merge is not the model, it is the spec. Ask for "rate limiting on the API" and the agent quietly decides everything that matters: fixed window, which header identifies the caller, what the reset value means. Those were your decisions, and you gave them away in one sentence. This session walks GitHub's spec-kit end to end on a real codebase, not a toy. Init, constitution, specify, clarify, plan, tasks, implement. The interesting part is clarify: before any code exists, the tool interrogates the request and makes you answer the questions you would otherwise discover in review. Can a caller farm fresh quota by rotating X-Client-Id, or do you always key on the network address? You answer once, in the repo, and every future task inherits it. Then the half spec-kit does not give you: a gate. One dependency-free file that reads the changed files out of git, matches them against an allow list and a deny list, and refuses to typecheck or test a diff that went outside its allowed paths. A spec without a fence is a suggestion.
In this episode
- Why the question is no longer "can it write the code" but "who is making the decisions"
- The four things a spec pins down: the interface, acceptance criteria, constraints, conventions, and why a tool can write three of them
- The constitution: standing rules the agent respects on every task, committed to the repo
- Clarify as the real value: answering ambiguity before code exists, not during review
- Prose can be argued with, a failing test cannot
- A guardrail in one file: a diff and two globs, failing before compile so the real finding stays on screen
- Committing specs so every developer on the repo works to the same principles
- spec-kit analyze, for when two specs start to overlap
Transcript
CHAPTERS
0:04 Intro
1:02 GitHub spec-kit
1:55 The five commands
2:22 The demo codebase
3:41 Prompt it and the agent decides for you
4:36 A spec is four things
5:03 Reading the actual spec, tasks and contracts
6:45 The constitution
7:12 Clarify: answering before code exists
9:57 A real clarify question
10:51 Ad-hoc prompt vs the four commands
11:47 The guardrail: a diff and two globs
13:34 Run order, end to end
14:27 Plan, tasks, implement, repeat
14:55 Committing specs so the team shares them
15:34 Where to go next
GO DEEPER
I run a hands-on Maven cohort, Production-Ready Systems with LLMs and Agents: An Intensive for Engineers. Six weeks, twelve live sessions, five graded projects where you ship real LLM and agent systems, not notebooks.
Use code AGENTS300 for 300 dollars off (early-bird, capped at 12 on purpose).
LINKS
Course and cohort: https://maven.com (search "Ehsan Gazar")
Slides for this session: https://hub.gazar.dev/spec-driven-development
Starter repo for this session: https://github.com/ehsangazar/lightning-lesson-spec-driven-starter
Site and writing: https://gazar.dev
Subscribe: @gazarbreakpoint