Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
Vibe coding vs spec-driven development: improvise, or blueprint?
Both hand the typing to an AI. The difference is where the thinking goes. Vibe coding thinks while building — prompt, run it, react, prompt again — and is glorious for exploration and brutal at scale. Spec-driven development front-loads the thinking into a written spec the agent implements against, trading the fun of improvisation for a contract you can verify. Most real work lives on the line between them.
The one distinction that decides everything
Vibe coding is conversational and exploratory: you describe what you want, the agent generates code, you run it, and you steer with the next prompt based on what happened. The spec lives in your head and evolves as you go. Spec-driven development (SDD) inverts the order: you write a precise specification — the intended behavior and the tests that pin it down — first, and the agent’s job is to produce an implementation that satisfies it. The thinking is externalized before the code exists.
Vibe coding: discover the requirements by building. SDD: fix the requirements, then build to them. Improvisation vs blueprint — the question is whether you know what "done" means before you start.
Head to head
| Dimension | Vibe Coding | Spec-Driven Development |
|---|---|---|
| Where the spec lives | In your head, evolving | Written down, up front |
| Definition of done | "It seems to work" | Tests pass against the spec |
| Best for | Prototypes, exploration, one-offs | Durable, shared, high-stakes code |
| Human role | Prompt and eyeball the result | Author the spec, review the diff |
| Upfront cost | Near zero | Writing the spec first |
| Scaling behavior | Degrades — context and intent drift | Holds — the spec anchors intent |
| Failure mode | Plausible code that is subtly wrong | An over-specified or wrong spec |
| What it rewards | Speed of iteration | Clarity of intent + review skill |
When to reach for each
Vibe coding
- Prototypes and throwaway spikes
- Exploring an unfamiliar API or library
- Personal tools where you are the only user
- When you do not yet know what you want
- Rapid iteration on look-and-feel
Spec-driven development
- Code others will read, own, and extend
- Anything with correctness or safety stakes
- Features whose behavior must be pinned down
- Work split across multiple agents or people
- When the cost of "subtly wrong" is high
The SDD loop: spec → plan → tasks → implement
Spec-driven development is a repeatable loop, and each stage narrows ambiguity before the next.
| Stage | You produce | Why it matters |
|---|---|---|
| 1 · Spec | The intended behavior + acceptance tests | Fixes "done" before any code — the contract |
| 2 · Plan | An approach: architecture, interfaces, risks | Surfaces design decisions while they are cheap |
| 3 · Tasks | The plan broken into small, ordered units | Each is agent-sized and independently checkable |
| 4 · Implement | Code per task, run against the tests | The spec verifies the work, not vibes |
The spec and tests are the same artifact viewed two ways: a human-readable contract and a machine-checkable one. That is what lets an agent implement freely while you stay confident it did the right thing — you review against a fixed target instead of guessing.
Why vibe coding breaks at scale
Vibe coding’s failure is quiet. The agent produces code that looks right and passes the one case you tried, but the intent only ever lived in a scroll of chat — so as the project grows, context drifts, earlier decisions get silently contradicted, and "subtly wrong" accumulates faster than you can eyeball it. The very thing that makes it fast (no fixed target) is what makes it fragile (nothing to check against).
SDD pays that cost up front instead. Its risk is the mirror image: a spec that is wrong, or over-specified to the point of straitjacketing the implementation, and the ceremony is genuine overhead for a five-minute script. The skill SDD rewards is not typing speed but intent clarity and review — writing a spec that says exactly enough, and reading a diff against it. That is precisely the skill the 2026 interview loop has started testing, because it is the half of the job AI does not do for you.
Vibe coding front-loads speed and back-loads correctness risk. SDD front-loads clarity and back-loads flexibility. Pick by how much "subtly wrong" costs you later.
A worked scenario: prototype today, ship next week
You are validating an idea. Day one is pure vibe coding: you prompt a UI into existence, wire a fake backend, click around, and throw away three versions before one feels right. Writing a spec here would be waste — you are discovering the requirements by building, and the code is disposable. Speed of iteration is the whole game.
The idea lands, and now it has to become real software other people depend on. You switch to SDD: take what the prototype taught you, write it up as a spec with acceptance tests, break it into tasks, and let the agent implement each against the tests while you review. The prototype was the research; the spec is the contract. Same tools, same AI — the difference is that "done" is now defined before the code, not discovered after it. That progression, vibe to spec as stakes rise, is how the two most often coexist.
Explore by vibe coding; harden by spec-driven development. The transition point is the moment someone other than you will depend on the result.
The picture: a loop versus a pipeline
Cost and trade-offs: where each approach spends its effort
Neither approach is free; they spend effort at different times. Here Time is the effort before you have something working, Space is what the choice costs you later, in rework, review or maintenance.
| Case | Time | Space | Why |
|---|---|---|---|
| Vibe-code a throwaway spike | Minutes | Nothing, if it really is thrown away | The best case for vibe coding. The code was a way to learn, and what you learned is the output. |
| Vibe-coded code that quietly ships | Minutes | High, and growing | No statement of intent exists, so every later change or review starts by guessing what the code was meant to do. Bugs found later are hard to classify: was that behaviour intended? |
| SDD on a five-minute script | Longer than the script | Little saved | The page’s “genuine overhead” case. When you can read the whole result in a minute, a spec adds ceremony and no safety. |
| SDD on a shared feature | A spec and tests before any code | Low: review against a fixed target | Regressions show up as failing tests, not user reports. Tasks with their own checks can go to several agents or people at once. |
| Over-specified spec | Long to write | Churn every time the spec meets reality | Spelling out how, not just what, rules out better implementations, and every discovery means editing both the spec and the tests. |
| Wrong spec | Normal | High: the failure is upstream | The tests pass and the product is still wrong. SDD moves the risk from “the code misses the intent” to “the intent was wrong”, which only users or domain experts can catch. |
| Vibe first, then spec | Prototype, then spec, then rebuild | Low | You pay twice in part, since prototype code is often discarded. But the spec is written from evidence instead of guesses, which is why the page recommends it. |
| Agent writes the code and its tests together | Fast | High: tests that confirm the code, not the intent | Asked for both at once, an agent writes tests that pass against what it built, bugs included. Have the tests come from the spec, and read them yourself before any implementation exists. |
| Prose spec with no tests | Moderate | Review is still by eye | That is only half of the artifact the page describes. Without the machine-checkable half, “done” goes back to someone’s judgement, which is the vibe-coding definition of done. |
| Spec left to drift | Free at the time | High: the document misleads | Once code changes without the spec, the spec describes a system that no longer exists. Update both together, or the spec becomes harmful. |
Read down the Space column and the trade is clear. Vibe coding is cheap until the code outlives the conversation that produced it. SDD is cheap once the code has more than one owner. The expensive mistakes are mismatches: ceremony on disposable code, or chat-only intent on code that other people depend on. A useful test before you start: if this code were still running in six months, who would need to know what it was meant to do? If the answer is only you, today, vibe-code it. If it is anyone else, including you later, write the spec.
Where this shows up in real-world teams and interviews
- The names, and the tools around them
Andrej Karpathy coined “vibe coding” in February 2025 for building by prompting and accepting what comes back without reading it closely. Spec-driven tooling formalises the page’s loop: GitHub’s Spec Kit, for example, walks an agent through spec, plan, tasks and implementation as separate steps. A lighter version is a project rules file such as
CLAUDE.mdorAGENTS.md. It does not specify a feature, but it keeps decisions written down outside the chat, which is the core idea of SDD. Teams often find they already do a version of this: a ticket with clear acceptance criteria, handed to an agent, is a small spec. What SDD adds is writing those criteria as runnable tests before the code exists, so the agent can check its own work against them. - Parallel agents need contracts
One agent in one chat can get by on shared context. Three agents working on three parts of a feature cannot, because each sees only its own conversation. The task breakdown, stage 3 of the loop, is what keeps them consistent: each task names its interface and its passing tests, so the pieces fit together when they are merged. Without that, each agent makes different choices about naming, data shapes and error handling, and you find out at integration. The same holds for people: a task with its own tests can be handed to a colleague who never saw the prototype.
- Code with real stakes
Payments, auth, permissions and data deletion are where “subtly wrong” is costly, and their rules are easy to write as tests: a refund never exceeds the captured amount, a deleted user’s data is gone from every store, a viewer cannot reach an admin route. Writing those invariants first and having the agent satisfy them is SDD in its most useful form. A prototype of the same feature can still be vibe-coded, but only against fake money and fake users. When it is promoted, the invariants are written first and the prototype code is treated as a reference, not as the starting point.
- The interview version
AI-assisted interview loops increasingly hand you an agent and a loosely worded task. What is being judged is the SDD skill set: asking clarifying questions, writing acceptance criteria before you prompt, then reading the generated diff against them and catching the plausible-looking bug. Saying “let me pin down what done means first” out loud, then testing exactly that, shows the judgement the page describes.
Which would you pick?
Three situations. Pick the side you'd actually build — the explanation follows.
You are exploring an idea and genuinely do not yet know what "done" looks like.
A spec fixes requirements, which is only possible once you know them. Writing one for a problem you are still exploring produces a confident document about guesses — and tests written first bind you to an interface you have not yet learned is the right one.
The prototype worked, and two other teams are about to build on it.
The page names this exact transition point: the moment someone else depends on the result. Vibe coding front-loads speed and back-loads correctness risk, and “subtly wrong” has just become much more expensive. Documenting afterwards describes whatever was built rather than committing to what it should do.
In spec-driven development, what is the relationship between the spec and the tests?
Treating them as one artifact is what lets an agent implement freely while you stay confident: the tests are the spec in executable form, so satisfying them is satisfying the contract. Letting the spec drift once tests exist leaves the human-readable version describing a system that no longer exists — which is how specs earn their reputation as waste.
Quick answers
What is spec-driven development?
Spec-driven development (SDD) writes a precise specification first — the intended behavior plus acceptance tests — and has an AI agent implement code that satisfies it, with the tests as the contract. It follows a loop: spec, then plan, then tasks, then implementation verified against the spec. The human’s role shifts from typing code to authoring intent and reviewing the diff against a fixed target.
How is it different from vibe coding?
Vibe coding is conversational and exploratory — you prompt, run the result, and steer with the next prompt, with the spec living in your head and evolving. SDD fixes the requirements up front so "done" is defined before any code exists. Vibe coding discovers requirements by building; SDD builds to a written contract. One optimizes iteration speed, the other correctness and reviewability.
When should I use each?
Use vibe coding for prototypes, spikes, unfamiliar APIs, and personal tools where you do not yet know what you want. Use spec-driven development for durable code others will own, anything with correctness or safety stakes, and work split across multiple agents or people. A common path is to vibe-code the prototype, then switch to SDD once someone else will depend on the result.
Why does vibe coding struggle at scale?
Because the intent only lives in the chat history, so as a project grows, context drifts, earlier decisions get silently contradicted, and code that looks right but is subtly wrong accumulates with nothing to check it against. SDD avoids this by anchoring intent in a written spec and tests, at the cost of writing that spec up front.
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The Agentic AI Interview HandbookTwenty topics every senior AI engineer should be able to reason about live — from eval pipelines to reliability patterns for generative systems.Read →
- The Senior AI Engineer Interview Handbook60 questions across architecture, production incidents, agentic systems, RAG, evals, cost, safety, and leadership — what staff-level AI interviewers actually probe for.Read →
- 50 Angular Interview QuestionsA visual handbook covering components, change detection, RxJS, signals, routing, forms, performance, and testing — what interviewers actually probe for in senior Angular roles.Read →
- 50 Python Interview QuestionsFundamentals to advanced: data structures, OOP, iterators & generators, the GIL, asyncio, memory, testing, and the standard library — a visual walk through everything a Python interview touches.Read →
- 51 LLM Evals Interview QuestionsGolden sets, LLM-as-judge, regression testing, offline vs online evals, RAG evals, agent evals, red-teaming, and observability — demystified for interviews and production.Read →
- The Agent Evaluations HandbookA self-contained handbook on evaluating AI agents — theory, interactive widgets, and practical guidance. Trajectory evals, tool-use scoring, LLM-as-judge, observability, and reliability for PMs, engineers, and founders.Read →