Vibe coding vs spec driven development: how to build real software with AI agents
Vibe coding means building software with an AI agent without reviewing or understanding the code it writes. It is fast and fine for prototypes, throwaway tools and learning, but it tends to break as a codebase grows: nobody understands the code, behaviour drifts and security bugs hide. Spec driven development flips the order: you write the requirements, a design and a task list first, the agent implements against them one small task at a time, and the spec stays the source of truth. Most real work sits somewhere between the two.
Video · What is vibe coding? When it's great and when it's risky · 0:47
What vibe coding means
Prefer to watch? The one-minute Short: What is vibe coding?. This guide goes further.
Vibe coding is building software by talking to an AI agent and accepting what it writes, without reading or understanding the code. You describe what you want, the agent changes files, you run the app, and if something breaks you paste the error back in. You judge the work only by whether it seems to run.
The term comes from a post by the AI researcher Andrej Karpathy on 2 February 2025. He described "a new kind of coding" where you "fully give in to the vibes" and "forget that the code even exists".
In his description you accept every change without reading the diff (the list of lines a change adds and removes), and when a bug will not go away you work around it or ask for random changes until it disappears. He was clear about the scope: "not too bad for throwaway weekend projects".
The word spread quickly. Merriam-Webster listed it as slang and trending in March 2025, and Collins Dictionary named vibe coding its word of the year for 2025.
Vibe coding vs AI-assisted coding
Not every use of AI to write code is vibe coding, and the difference matters. The developer Simon Willison put it simply: if an AI wrote every line, but you reviewed it, tested it and could explain how it works to someone else, that is not vibe coding, it is software development.
So the line is not the tool. The same agent, used the same way, can produce vibe coded software or carefully reviewed software. The difference is what you check before you accept a change. Keep that definition in mind, because it explains both where vibe coding shines and where it fails.
The running example: one habit tracker, built twice
To make this concrete, picture Streak, a small habit tracker app. You add habits such as "read ten pages", tick them off each day and watch your streak grow. We build it twice with the same AI coding agent.
Build A is vibe coded. We type "make me a habit tracker with streaks and reminders". Twenty minutes later it runs. We ask for dark mode, a chart and a share button, and each one just works. We never open the code. After one weekend, build A is far ahead.
Build B is spec driven. Before any code, we spend about an hour on a one-page spec. One requirement reads: when the user ticks a habit, the streak goes up by one, once per calendar day, in the user's time zone. The design notes say where data lives and how a streak is computed, and the task list has eight small steps. After the weekend, build B has fewer features, but every one is written down and tested.
We will come back to both at week three.
What vibe coding is good for
Vibe coding is the right tool more often than purists admit. It shines whenever the stakes are low:
-
Prototypes. You want to see whether an idea feels right before you invest in it.
-
Throwaway tools. A script that renames a thousand photos, or a one-off chart for a meeting.
-
Learning and exploring. Trying a new library, or finding out what is even possible.
-
Demos. Something clickable you can put in front of people to get feedback fast.
The common thread: if it breaks, nobody gets hurt, and you can throw it away.
Where vibe coding breaks: the "it works until it doesn't" curve
Vibe coded projects tend to follow a familiar shape. Early on, every prompt adds a feature, because the codebase is small and nothing depends on anything yet. As the code grows, each change touches code nobody has read. Fixes start to break other things, progress flattens, and then it goes backwards. A spec driven project starts slower, because you write things down first, but it keeps climbing. That curve is an illustration rather than a measurement, yet most people who have vibe coded past a weekend recognise it.
There are four usual reasons:
-
The codebase outgrows the conversation. The agent cannot hold every earlier decision in its context, so it reinvents things, and you end up with three different date helpers. (The guide to the context window explains why models forget.)
-
Nobody understands the code. Not you, and not the agent in a fresh session. Every bug becomes a mystery.
-
Drift. Without a written goal, each prompt nudges the app somewhere new, and behaviour you wanted on day one quietly changes.
-
Security. Code that runs fine can still be unsafe.
Vibe coding and security
Security deserves its own section because its bugs do not announce themselves. In its 2025 GenAI Code Security Report, the security company Veracode tested more than 100 language models on 80 coding tasks, each with a secure and an insecure way to solve it. In 45 percent of the test cases, the generated code contained a vulnerability from the OWASP Top 10, and newer, larger models did not do better on security than older ones.
When nobody reads the code, nobody notices the API key pasted into the app, the missing check on who may see which data, or the user input that goes straight into a database query. These are exactly the mistakes that a short review catches. If your app has sign in, the guide to authentication vs authorization covers the checks a reviewer should look for.
What is spec driven development?
Spec driven development flips the order. You write the spec first, and the AI agent implements against it. A spec, short for specification, is a written description of what the software must do and why. In practice it usually has three parts:
-
Requirements: what the software must do, written so each one can be tested.
-
Design: how it will be built, such as where data lives and the main components.
-
Tasks: an ordered list of small steps that turn the design into code.
The agent then implements one task at a time, and you check each result against the spec.
The key idea is that the spec is not thrown away after kickoff. It stays the source of truth. When something changes, you change the spec first, then the plan, the tasks and the code follow. GitHub's write up on the approach calls specs "living, executable artifacts that evolve with the project". Because the spec is plain text in your repository, it is reviewed and versioned like code.
How GitHub Spec Kit and Kiro approach spec driven development
Several tools now build this workflow in. Here are two, described from their own documentation, with no ranking.
GitHub Spec Kit is an open source toolkit (MIT licence) that GitHub announced in September 2025. Its command line tool is called specify, and it works with several coding agents. The workflow is a sequence of commands you run inside your agent: a constitution with the project's principles, then specify (what to build and why), plan (the technical choices), tasks (small, reviewable work items) and implement. The project's own write up sums up the idea as treating specifications as the source of truth, so that maintaining software means evolving specifications.
Kiro, an agentic development environment built by AWS, makes specs part of the tool. Each spec is three files: requirements.md (user stories and acceptance criteria), design.md (architecture and diagrams) and tasks.md (discrete, trackable tasks). Requirements can use EARS, the Easy Approach to Requirements Syntax, which reads like "WHEN the user ticks a habit THE SYSTEM SHALL add one to its streak".
Tasks can run one by one or all together, and Kiro's docs advise storing specs in the repository next to the code. There are also bugfix specs for diagnosing and fixing bugs.
Different tools, same core idea: write it down, break it down, then build.
The spectrum between vibe coding and a full spec
It is not either, or. Think of a spectrum:
| Point on the spectrum | What you do | Good for |
|---|---|---|
| Pure vibe | Accept everything, never read the code | Throwaway experiments |
| Vibe and look | Run the app and skim the diff before you accept | Personal tools you will keep a while |
| Plan first | Ask for a plan, read it, then let the agent edit | Most day to day changes |
| One-page spec | Goal, testable requirements, out of scope, acceptance checks | New features others will use |
| Full spec | Requirements, design and tasks, as in Spec Kit or Kiro | Larger features, teams, regulated data |
Moving right costs time at the start and saves time later, when you need to change the software. In the middle of the spectrum, many agents offer a planning step: Claude Code's plan mode, for example, reads files and proposes a plan, and makes no edits until you approve it. The skill is picking the right point for each piece of work.
A practical spec driven workflow in six steps
This workflow works with almost any coding agent:
-
Write the spec. Short, in plain words, including what is out of scope.
-
Ask for a plan and read it. It is the cheapest moment to catch a wrong idea, before any code exists.
-
Split the plan into small tasks. Each task should end in a change you can review in a few minutes. "Build the whole streak system" is not a task; "count a tick once per calendar day" is.
-
Use tests as acceptance. Each requirement becomes at least one test, and a task is done when its tests pass, not when the agent says it is done.
-
Review the diff. Read what changed the way you would review a colleague's pull request.
-
Update the spec. If you learned something or changed your mind, write it down, so the next session starts from the truth.
Small tasks keep the agent focused, keep the diffs readable and give you a clean point to stop and commit. The Claude Code best practices guide covers the same habits from the tool side, and a project memory file such as CLAUDE.md is a natural place to point the agent at the spec in every session.
How tests and code review fit in
Tests are what turn a spec into something the agent can check on its own. Take the requirement "the streak goes up once per calendar day". Its acceptance test says: tick a habit twice on the same day, and the streak stays at one. The agent can run that test after every change, so regressions show up immediately instead of in a user's review. The guide to types of software testing explains which kinds of tests to write for which risks.
One warning: an agent may make a failing test pass by changing the test. Treat any edit to a test as the most important part of the diff. Review is the human checkpoint in this loop, the same idea as human in the loop for AI agents.
Use this checklist when you review an AI generated diff:
- Does it do what the task said, and nothing else?
- Did it touch files it did not need to?
- Did any test change, or disappear?
- Is there a secret, a new dependency, or data crossing a trust boundary?
- Could you explain this change to a colleague? If not, ask the agent to explain it before you accept.
Week three: what happens to each build
At week three, users ask for three things: habits that count three times a week instead of daily, streaks that survive a trip abroad, and reminders at a custom time.
In build A, we prompt for weekly habits. The agent rewrites the streak logic, and daily streaks start resetting at midnight in the wrong time zone. We paste the error back. The fix breaks reminders. Nobody knows which of the three date helpers is the real one.
In build B, we first add the new requirements to the spec: weekly habits, and what a day means when you travel. The agent proposes a plan, we read it, and it becomes four small tasks. The old tests still pass, so daily streaks did not break. One new test fails on a time zone edge case, and we catch it in review rather than in a one star rating. Build B was slower in week one; in week three it is the one still moving.
When to vibe code and when to write a spec
A simple decision guide:
| Question | If yes |
|---|---|
| Will you throw it away (prototype, demo, one-off script)? | Vibe it and enjoy the speed |
| Will other people use it, or will you change it next month? | Write at least a one-page spec |
| Does it touch money, personal data, logins or health? | Spec, tests and a review of every diff |
| Is it a change to a shared, existing codebase? | Plan first, small tasks, tests |
There is also a move that gives you both: vibe to learn, spec to keep. Vibe code the prototype to find out what you actually want. If it is worth keeping, stop, write the spec from what the prototype taught you, and build the real version against it. The prototype was not wasted; it was research.
A one-page spec template
Keep the spec to one page per feature, in eight short parts:
-
Goal: one or two sentences on what this feature is for.
-
Users and scenarios: who it is for, written as short stories of someone using it.
-
Requirements: each one testable, ideally with a condition and an expected result.
-
Out of scope: what not to build, so the agent does not add things nobody asked for.
-
Constraints: platform, stack, privacy rules, performance numbers, deadline.
-
Design notes: where data lives and the main parts.
-
Acceptance checks: one or more per requirement; these become your tests.
-
Open questions: unknowns written down instead of guessed.
For Streak at week three, a new requirement could read "a weekly habit has a target, such as three times a week", with the acceptance check "three ticks from Monday to Sunday keep the weekly streak; two reset it", and an open question: "when the user travels, which time zone counts?". If the spec grows past a page, split the feature. Save it in the repository next to the code and point the agent at it at the start of every session.
Common mistakes with vibe coding and spec driven development
On the vibe side:
-
Shipping the prototype. It worked in the demo, so it went to real users, and nobody understands it.
-
The endless fix loop. Pasting the same error back again and again while the code gets worse. Stop, write down what you want, and start over with a plan.
On the spec side:
-
A spec that is too big. Fifty pages written up front is the old waterfall problem in a new outfit. Write one page per feature.
-
A stale spec. The code changed and the spec did not, so the agent follows a document that is wrong. Update the spec in the same change as the code.
-
Vague requirements. "Make it fast" or "make it user friendly" cannot be tested. Say what fast means, with a number.
-
Trusting the spec instead of checking the code. A spec says what you want; only tests and review tell you what you got.
Recap
Vibe coding means building with AI without reviewing the code. It is great for prototypes, throwaway tools and learning, and it breaks as the code grows: nobody understands it, behaviour drifts and security bugs hide. Spec driven development writes the requirements, design and tasks first and keeps the spec as the source of truth. In practice: spec, plan, small tasks, tests as acceptance, review the diff, update the spec. Vibe to learn, spec to keep.
Sources: Andrej Karpathy's original post (2 Feb 2025), Simon Willison, Not all AI-assisted programming is vibe coding, Veracode 2025 GenAI Code Security Report, GitHub Blog, Spec-driven development with AI, GitHub Spec Kit, Spec Kit spec-driven.md, Kiro docs, Specs, Kiro docs, Feature specs, Kiro docs, Spec best practices, Claude Code docs, Common workflows.
FAQ
What is vibe coding?
Vibe coding is building software by prompting an AI agent and accepting what it writes without reviewing or understanding the code. Andrej Karpathy coined the term in a post on 2 February 2025, describing accepting every change without reading the diffs and pasting error messages back in. He called it fine for throwaway weekend projects. Collins Dictionary made vibe coding its word of the year for 2025.
What is spec driven development?
Spec driven development is a way of building software with AI agents where you write a specification first, usually requirements, a technical design and a task list, and the agent implements against it one small task at a time. The spec stays in the repository as the source of truth: when something changes, you update the spec first and the code follows.
Is using AI to write code the same as vibe coding?
No. If an AI wrote the code but you reviewed it, tested it and could explain how it works to a colleague, that is ordinary software development with an AI assistant. Vibe coding specifically means not reviewing or understanding the code, and judging it only by whether it seems to run.
When should I vibe code and when should I write a spec?
Vibe code when the result is throwaway: a prototype, a demo, a one-off script, or a way to learn a library. Write at least a one-page spec when other people will use the software, when you will still be changing it next month, or when it touches money, personal data, logins or health. For changes to a shared codebase, ask for a plan first, work in small tasks and keep tests green.
What do GitHub Spec Kit and Kiro do?
Both build a spec driven workflow into AI coding. GitHub Spec Kit is an open source toolkit with a CLI called specify and a sequence of steps you run inside your coding agent: a constitution with project principles, then specify, plan, tasks and implement. Kiro, from AWS, writes each spec as three files, requirements.md, design.md and tasks.md, can phrase requirements in EARS notation, and runs tasks one by one or all together.
Read next
- Claude Code Plan Mode: When and How to Use It
- Claude Code Best Practices: 10 Habits That Work
- Types of Software Testing: Unit, Integration, E2E and More
- Claude Code Tutorial for Beginners: Install to First Commit
- Context Engineering vs Prompt Engineering: Fix Context Rot
- Software Engineering Unpacked: home
- The CCAR-F video playlist on YouTube