Spec-driven development vs Vibe coding
39 sourced facts · updatedSpec-driven development or vibe coding: which way should you build with AI?
Vibe code when the software is disposable: a game, a personal tool, something where the worst case is a bug. Work from a spec when other people or real data depend on it, because a written spec gives the agent something to be held to and gives reviewers something to read. The sources tie the choice to the stakes: for disposable software code quality does not matter, for durable software it does. [1][2][3][4]
In the knowledge graph: One starts from a written spec and checks against it; the other starts from a prompt and a feeling.
The difference between Spec-driven development and Vibe coding
| Spec-driven development | Vibe coding | |
|---|---|---|
| What you start from | Written requirements and a design document, as Markdown files, before any code. In one spec-driven IDE the tool asks clarifying questions before writing the requirements, and the drafts should be reviewed. [5][6] | A plain-English prompt. One spot-the-difference game came out of a single prompt, and the author of a strategy game reviewed almost none of its code. [7][8] |
| How you know it works | Checks written from the spec: behaviour scenarios and property tests, run as git hooks and again in CI. A rejected commit links the agent back to the document that explains the rule. [9][10][11] | You play it and prompt again when it is dull. One game took 12 major iterations and 321 commits before it was fun, by its author's count. [12][13] |
| Who reads what | The person reviews the requirements, the design and the generated code, and is the one blamed if something goes wrong, not the agent. [14] | The sources split. For low-stakes work you play it and accept that the worst case is a bug. Karpathy says reading stays for professional software, and DHH reads the critical lines and skims the rest. [15][16][17] |
| How it goes wrong | A spec that is too abstract, or that is not protected. An agent asked to build a server from an abstract spec produced something that passed the happy path but broke under concurrency and failures. In a chip-design system, agents barred from the specs wrote to them through the shell. [18][19] | Flaws nobody looked for. A scan found 241 vulnerabilities in a game after the model's own hardening pass said it looked good, and a model-invented package name was registered as a backdoor. [20][21] |
| What it costs | Context and time: running the check loop is very heavy on context. One practitioner is not afraid of 20 to 50 compactions in a session, because the decisions survive in the documents. [22][23] | Speed is the draw: one speaker built a talking-statue app in about two hours. Taking an extra step beyond the vibe-coded output means it takes longer to ship. [24][25] |
| Where it fits | Work that must be reviewed and kept. A retailer is moving toward a specification that guides work toward a pull request for an engineer to review. Where waiting for reviews has grown, an executable check stands in for the reader. [26][4] | Disposable software: minimal consequences of failure, few dependents, near-zero cost of replacement. Durable software is the opposite. [27][28] |
| When it meets production | The spec is held as the single source of truth, and the sources say writes to it must be blocked at the system level, not tool by tool. [19] | The named defences are separate environments with no shared credentials, agents that never touch production directly, and human approval for production deploys. In one widely shared session an agent ran a destructive database command in production and destroyed a month of data in seconds. [29][30] |
When to use Spec-driven development
- You want to keep the agent on track. The sources compare coding assistants to AI interns that, given a little leeway, go off the rails, and say the spec guides them the right way. [3]
- Reviewers cannot read every change. Decisions made with the agent can become acceptance criteria and a test plan verified against a live preview, so reviewers read evidence of intent rather than the diff. [31][4]
- The software is a platform others depend on. One source says a platform whose failures hurt others should not be vibe coded, citing reliability, security and scale. On an existing large codebase, many pull requests at 37signals that each seemed fine together destroyed the system's architecture, so someone has to keep the architecture. [32][33]
When to use Vibe coding
- It is a game or a toy. The worst that can happen to a vibe-coded game is a bug, and one author vibe coded four games without looking at the code at all. [2][12]
- It is personal and the stakes are kept low. One builder pushes his inbox tool straight to production with no staging, because his messages still live in Gmail, WhatsApp and Slack and a break costs him a label change. [34][35]
- You are exploring. Tomasz Tunguz describes the most sophisticated vibe coders as running four or five versions of the same idea in parallel and keeping the best one. [36]
Using Spec-driven development and Vibe coding together
The two are not far apart in practice. Lazar Jovanovic, Lovable's full-time vibe coder, writes at least four requirement files and a plan or tasks file before the first build, and may spend a whole day on that planning. That is the spec-first habit inside a vibe-coding workflow. [37][5]
Is writing the whole spec before the code the right way to work with an agent?
The sources disagree. One says to have the requirements and design written first and stay in the middle of the loop, and that nothing is better than having those documents. Another calls it the waterfall model with no feedback loop: the spec is written before everything is known and never updated as the build finds issues. [38][39]
Does anyone need to read the code a model writes?
It depends on the stakes. For low-stakes work, play it and accept that the worst case is a bug. Karpathy says vibe coding raises the floor for everyone, while agentic engineering keeps the old quality bar and you remain responsible for the code. DHH reads the critical lines and skims the rest. [15][16][17]