Spec-Driven Development: Write the Spec Before the AI Writes the Code
Vibe coding goes off track when the AI has to guess what you want. Spec-driven development fixes that: write clear requirements first, then let the AI plan and build from them.
Video not loading? Watch the reel on Facebook.
Most people start an AI coding session the same way: "Build me a to-do app." The AI picks a framework, invents features you didn't ask for, skips the ones you needed, and you spend the next hour steering it back.
The problem isn't the AI. It's that the AI started coding before anyone decided what "done" looks like.
What spec-driven development is
Instead of going straight to code, you write a short spec first: what you are building, for whom, and what it must do. The AI then turns that spec into a technical plan, breaks the plan into small tasks, and builds the tasks one by one. Every step produces a file you can read and correct before the next one starts.
It sounds slower. In practice it is faster, because you catch wrong assumptions in a one-page document instead of in 500 lines of code.
The steps
- Principles. The ground rules for the whole project, like "keep it simple" or "every feature needs a test".
- Specify. What to build and why, in plain language. No technology choices yet.
- Plan. Now the technical decisions: language, framework, where data is stored.
- Tasks. The plan split into small, checkable steps.
- Implement. The AI works through the tasks.
Review the output of each step before moving on. That review is the whole point.
Try it with GitHub Spec Kit
Spec Kit is a free, open-source (MIT) toolkit from GitHub that sets up this workflow inside your AI coding agent. It works with Claude Code, Codex, GitHub Copilot, Gemini and many others. You need Python 3.11 or newer and the uv package manager.
uv tool install specify-cli
specify init todo-app
The setup asks which AI agent you use. Then open the project in that agent, where Spec Kit adds a slash command for each step. Here is the whole flow for a simple to-do app:
| Step | What you type |
|---|---|
| Principles | /speckit.constitution Simple, tested, accessible. |
| Specify | /speckit.specify Users can add, tick off and delete to-dos. The list is still there after a page reload. |
| Plan | /speckit.plan Plain HTML and JavaScript, saved in the browser's localStorage. |
| Tasks | /speckit.tasks |
| Build | /speckit.implement |
The exact command spelling depends on your agent (some use /speckit-specify with a dash). Type /speckit and your agent will list them.
Other tools that do the same thing
- Kiro, Amazon's AI editor, has specs built in: requirements, design and tasks files, made in three phases.
- BMAD Method is an open-source framework that runs the same idea through a team of AI "roles" like analyst, architect and developer.
You don't need a tool to start
The habit matters more than the toolkit. Before your next AI coding session, write five lines:
What am I building? Who is it for? What must it do? What should it not do? How will I know it works?
Paste that at the top of your first prompt and ask the AI for a plan before any code. Even a simple to-do app comes out cleaner.
Try it: GitHub Spec Kit
New to building with AI? Start with my free AI Starter course. Follow my Facebook page for more.