What is the difference between vibe coding and spec-driven development?
| Criterion | Vibe Coding | Spec-Driven Development |
|---|---|---|
| Goal | Explore an idea | Deliver requirements |
| Process | Instruction iterations | Specification, plan, tasks, verification |
| Decision record | Often conversation | Versioned artifacts |
| Verification | Observe output | Tests and review against criteria |
| Upfront cost | Often lower for experiments | Requirements work |
| Change risk | Depends on additional controls | Bounded by explicit contracts and tests |
In its original sense, vibe coding means describing an outcome in natural language, observing the application and asking the model for changes without systematically examining the generated code. It is not a synonym for all AI-assisted programming. Developers can delegate implementation while remaining accountable for architecture, testing and change verification. [1]
SDD here means letting explicit specifications guide implementation and conformance checks. It is not a single normative standard: a specification may guide one change, remain a maintained product contract or become a primary artifact from which implementations are generated. SDD does not constitute formal verification and does not require AI. [2][3]
How does vibe coding work, and when is it useful?
- [Idea]
- [Instruction]
- [Change]
- [Observation]
- [Next instruction]
A typical iteration moves from an idea to an instruction, a generated change, execution, observation and another instruction. This helps discover preferences when users cannot yet describe a user interface precisely. Visual exploration, demonstrations and reversible prototypes using synthetic data are suitable contexts. A time limit and a narrow experimental scope prevent uncontrolled growth.
Visible behavior does not establish correct error handling, authorization or concurrency behavior. Another instruction may accidentally change previously working features. Keep the prototype separate from production and withhold customer data and production credentials. Before promoting a prototype, review the architecture and code, establish requirements and tests, or replace it with a controlled implementation. [5][8]
How does spec-driven development work?
- [Requirements]
- [Plan]
- [Tasks]
- [Implementation]
- [Verification]
- [Acceptance]
Start with purpose, scope and non-goals; then define business rules, error scenarios and measurable acceptance criteria. Inspect existing integration contracts and architectural constraints. Prepare a technical plan, dependencies and task order. An agent may draft every artifact, but the requirements owner approves the meaning of the rules. Do not let an agent resolve ambiguity by inventing business policy.
GitHub Spec Kit provides stages including specification, planning, tasks, implementation and convergence checks. Kiro organizes work around requirements, design and tasks, with different available workflows. Neither tool is mandatory: the same principles work with a repository and issue tracker. Decide whether the specification persists after delivery and who resolves inconsistencies among documentation, code and tests. [2][3][4]
The spec-first, spec-anchored and spec-as-source distinction is a useful taxonomy, not a normative classification. In the first variant a specification precedes a change; in the second it remains a maintained contract; in the third it becomes the primary source for generating code. In an existing system, start with spec-first or spec-anchored: code and tests still reveal behavior that documentation may omit. [2]
Example: exporting orders to CSV
| Criterion | Scenario | Expected outcome |
|---|---|---|
| AC-01 | Customer has orders in the period | Only their own orders with correct headers |
| AC-02 | Another customer has an order in the same period | No other customer's data |
| AC-03 | Invalid interval or more than 31 days | HTTP 400, no export |
| AC-04 | Unauthenticated request | HTTP 401, no data |
| AC-05 | No orders | CSV containing headers only |
| AC-06 | Orders exactly on interval boundaries | Start included, end excluded |
| AC-07 | 10,001 matching orders | HTTP 400, EXPORT_LIMIT_EXCEEDED, no partial CSV |
| AC-08 | Several orders with the same timestamp | Ascending createdAt, then id |
Suppose a signed-in customer needs an export of their own orders in a selected period. A request to add CSV export leaves questions about ownership, date semantics, empty results and spreadsheet formula interpretation unanswered. A prototype may simply download fictional data. A real feature needs explicit decisions to avoid unauthorized disclosure and incompatible output.
Example contract: derive ownership from the authenticated session; use a half-open UTC interval of at most 31 days; return UTF-8 CSV with headers id, createdAt, totalMinor, currency and correctly encoded fields. Empty results return headers only; invalid intervals return HTTP 400; absent authentication returns HTTP 401. Do not accept an owner identifier from the request. Define a spreadsheet formula-neutralization policy for applicable values; CSV quoting alone is insufficient. These are illustrative design decisions, not universal export requirements. [9]
Specify ISO 8601 UTC timestamps, comma separators, totalMinor as an integer in the currency’s minor unit, and a record limit. Define the response when that limit is exceeded instead of silently omitting orders. For CSV injection prevention, test the target spreadsheet applications, including saving and reopening the file. [9]
For this example, set a limit of 10,000 records: exceeding it returns HTTP 400 with EXPORT_LIMIT_EXCEEDED and no partial file. Authenticate before reading orders. Sort ascending by createdAt and then id; include the start, exclude the end, and reject empty or reversed intervals. IDs are canonical UUIDs, currencies come from the supported ISO 4217 code list, and amounts are validated integers. Do not export arbitrary user text in those fields. If free-text fields are added later, define and test a separate policy against formula interpretation. [9]
Testing, security and agent control
Trace tests to acceptance criteria, not the current implementation structure. Unit tests cover date validation and CSV encoding; integration tests cover owner isolation, authentication and repository queries; regression tests protect existing APIs. Develop negative cases independently: an agent generating both implementation and tests may repeat the same erroneous assumption. SDD can incorporate TDD and BDD but is not equivalent to either.
Run the agent on an isolated branch with restricted filesystem, network and secret access. Treat issue descriptions, documentation and tool output as potentially untrusted. In CI run required tests, static analysis, dependency and secret checks; review diffs and migrations. Do not allow the agent to bypass controls or weaken tests to obtain a passing result. Specifications cannot replace independently enforced access controls. [5][8]
Cost, speed and quality: how to compare the approaches
| Stage | Free-form iteration | SDD |
|---|---|---|
| Specification | 0 | 1.5 |
| Implementation | 2 | 3 |
| Review and tests | 3 | 1.5 |
| Rework | 3 | 1 |
| Total (h) | 8 | 7 |
| Labor cost (USD) | 400 | 350 |
| AI cost (USD) | 20 | 30 |
| Total (USD) | 420 | 380 |
Time to first working output is not time to accepted delivery. Measure requirements preparation, implementation, review, tests and rework, followed by regressions and maintenance costs. DORA reports associations between AI adoption, delivery throughput and instability; this does not prove that one approach always wins. METR highlights productivity measurement limitations, including participant selection and parallel use of agents. [6][7]
In a controlled METR study, 16 experienced developers worked on 246 tasks in familiar repositories. With access to the AI tools of that period, completion took 19% longer on average. A subsequent update suggests possible speedups but suffers from participant selection and difficulty measuring concurrent work. Neither study directly compares vibe coding with SDD; do not generalize its result to current models or all teams. [7][11]
Illustrative comparison for the same feature and acceptance criteria: free-form iteration takes 2 hours of implementation, 3 of review and tests and 3 of rework, totaling 8 hours. SDD takes 1.5 hours of specification, 3 of implementation, 1.5 of review and tests and 1 of rework, totaling 7 hours. At USD 50/hour and AI costs of USD 20 and USD 30, totals are USD 420 and USD 380. The extra AI cost is USD 10, so SDD breaks even if it saves 0.2 hours of labor (12 minutes). These are hypothetical inputs, not benchmark results or vendor prices.
When to choose a hybrid approach
- [Prototype]
- [Delivery decision]
- [Specification]
- [Controlled implementation]
- [Acceptance]
Start with exploration when the problem is unclear and changes are inexpensive. Once a prototype is accepted, record discovered requirements and decisions, separate demonstration elements from target functionality, define data, permissions, availability and acceptance criteria. In an existing system even a small authorization change or data migration warrants controls from the start. A minor visual adjustment may need only a short description and regression test.
Scale specifications to risk and dependencies rather than the number of files a tool produces. When requirements change, update the specification, plan and relevant tests in the same change; do not enforce an obsolete document. If an agent discovers a contradiction, it should report it and obtain a decision rather than silently moving the acceptance criteria.
How to adopt SDD in an existing team
Choose one feature with a bounded scope. Record repository instructions, API contracts, architectural decisions and test commands; provide only task-relevant context. Agree on completion criteria: approved specification, a small understandable diff, independent test results and authorized review. For database changes plan compatibility, rollout and data recovery; reverting code does not reverse data writes. See also Harness Engineering for the execution controls and architecture of coding agents. [10]
Compare both processes on similar tasks using the same model, risk level and quality criteria; include unfinished tasks. Measure human and agent time separately and cost per accepted outcome. Expand automation only when these measurements justify it. There is no need to replace the entire development lifecycle or treat specifications as immutable contracts. [5][6]
In a pilot, randomly assign or alternate comparable tasks between the two processes without having the same person solve the same task twice. Set acceptance criteria before implementation and use independent review. Record median human effort, elapsed time to acceptance, acceptance rate and regressions over a defined period. Compute cost per accepted feature as the total cost of all attempts, including failed ones, divided by the number accepted. If none are accepted, leave the ratio undefined.
