Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Handbooks  /  Vibe Coding vs Spec-Driven Development
AI~9 min readComparison
Head to Head

Vibe coding vs spec-driven development: improvise, or blueprint?

Vibe CodingvsSpec-Driven Development

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.

01

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.

→ The rule

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.

02

Head to head

DimensionVibe CodingSpec-Driven Development
Where the spec livesIn your head, evolvingWritten down, up front
Definition of done"It seems to work"Tests pass against the spec
Best forPrototypes, exploration, one-offsDurable, shared, high-stakes code
Human rolePrompt and eyeball the resultAuthor the spec, review the diff
Upfront costNear zeroWriting the spec first
Scaling behaviorDegrades — context and intent driftHolds — the spec anchors intent
Failure modePlausible code that is subtly wrongAn over-specified or wrong spec
What it rewardsSpeed of iterationClarity of intent + review skill
03

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
04

The SDD loop: spec → plan → tasks → implement

Spec-driven development is a repeatable loop, and each stage narrows ambiguity before the next.

StageYou produceWhy it matters
1 · SpecThe intended behavior + acceptance testsFixes "done" before any code — the contract
2 · PlanAn approach: architecture, interfaces, risksSurfaces design decisions while they are cheap
3 · TasksThe plan broken into small, ordered unitsEach is agent-sized and independently checkable
4 · ImplementCode per task, run against the testsThe spec verifies the work, not vibes
→ The point of the ceremony

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.

05

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.

→ The trade

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.

06

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.

→ The pattern

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

The picture: a loop versus a pipeline

vibe coding: a loopspec-driven: a pipeline prompt generate run it eyeball intent livesin your head done = "it seems to work" promotewhen othersdepend on it spec + acceptance tests plan: interfaces, risks tasks: small, checkable implement, per task tests pass → review diff
The shapes are the whole difference. Vibe coding is a loop with no fixed exit: each turn ends when the result looks right to you, so the only record of what “right” means is the chat. Spec-driven development is a pipeline whose first box is the exit condition. The tests written at the top are what the last box checks against. The arrow in the middle is the page’s transition point: the prototype loop is how you learn what to write in that first box. Notice too where the human sits. In the loop you judge every turn by eye. In the pipeline you do the hard thinking twice, once when writing the spec and once when reading the final diff, and the agent works through the middle boxes alone.
Trade-offs

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.

CaseTimeSpaceWhy
Vibe-code a throwaway spikeMinutesNothing, if it really is thrown awayThe best case for vibe coding. The code was a way to learn, and what you learned is the output.
Vibe-coded code that quietly shipsMinutesHigh, and growingNo 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 scriptLonger than the scriptLittle savedThe 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 featureA spec and tests before any codeLow: review against a fixed targetRegressions show up as failing tests, not user reports. Tasks with their own checks can go to several agents or people at once.
Over-specified specLong to writeChurn every time the spec meets realitySpelling out how, not just what, rules out better implementations, and every discovery means editing both the spec and the tests.
Wrong specNormalHigh: the failure is upstreamThe 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 specPrototype, then spec, then rebuildLowYou 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 togetherFastHigh: tests that confirm the code, not the intentAsked 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 testsModerateReview is still by eyeThat 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 driftFree at the timeHigh: the document misleadsOnce 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.

In the wild

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.md or AGENTS.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.

Your call

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.

The prototype worked, and two other teams are about to build on it.

In spec-driven development, what is the relationship between the spec and the tests?

Frequently asked

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.

Vibe Coding vs Spec-Driven Development · Vibe Engines · 2026
Finished this one? 0 / 209 Handbooks done
NextClaude Code vs Codex vs Gemini CLI Next on the “Your engineering role in the AI era” ladder · rung 10 of 10

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.