跪拜 Guibai
← All articles
Artificial Intelligence · Developers

Spec-Driven Development Puts a Blueprint Under AI-Generated Code

By 东风破_ ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

As code generation gets cheaper, the bottleneck shifts from typing to deciding. SDD gives a team a single, version-controlled artifact that an AI agent can read to understand what to build, how to build it, and how to know when it's done—cutting the rework that makes AI-assisted projects net-negative after the first week.

Summary

Vibe Coding's chat-driven loop collapses under its own weight once a project grows beyond a single session. Without a durable record of decisions, AI agents guess at architecture, silently break existing features, and force developers into cycles of rework that erase the early speed gains. SDD addresses this by making a specification—not the chat log—the authoritative artifact that defines scope, design, tasks, and acceptance criteria.

The process follows a Spec → Plan → Tasks → Implement sequence. A proposal document locks down what the MVP will and won't do, a design document resolves technical risks like API surface and security constraints before a single line of code exists, and a task list breaks the work into small, verifiable units that keep an agent's context focused. When requirements change, the specification changes first, and any drift between the document and the codebase is treated as a defect.

A walkthrough using a Chrome translation plugin shows the method in practice: extracting article text, calling an OpenAI-compatible model, and rendering Markdown in a Side Panel. The upfront investment in writing clear, falsifiable acceptance criteria—"translation results display in a sidebar with independently scrollable body text" instead of "the interface should look good"—eliminates the guessing that causes AI-generated projects to unravel.

Takeaways
Vibe Coding skips the design phase and jumps straight to implementation, leaving critical architectural decisions to the model's guesswork.
SDD inverts the relationship: a specification becomes the persistent source of truth that requirements, design, tasks, and tests all depend on.
An effective spec must be executable (the AI knows what to modify), verifiable (every requirement has a pass/fail criterion), and traceable (changes propagate to affected artifacts).
Writing a proposal that explicitly lists non-goals prevents AI from over-implementing and keeps an MVP focused on its core workflow.
Design documents should resolve technical risks—like choosing Chrome's native Side Panel API over a CSS-simulated floating panel—before code is written.
Tasks should be broken into small, dependency-aware units so an AI agent works on one verifiable piece at a time, making failures easier to isolate and roll back.
Requirement changes must update the spec first, then the design, then the affected tasks and code; spec-code drift is treated as a defect.
Clear, falsifiable acceptance criteria—observable behaviors, not adjectives like 'fast' or 'stable'—are what stop the AI from guessing what 'done' means.
Conclusions

The core failure mode of Vibe Coding isn't the AI's capability but the absence of a durable, shared context that survives across sessions and feature additions.

SDD reframes documentation from a passive artifact that rots after implementation to an active constraint that governs what the AI generates, making it closer to a type system for intent.

The 'ten-minute spec' tradeoff—pausing before the first prompt to write why, what, how, and how-to-verify—is a leverage point that compounds as project complexity grows.

Treating specification drift as a defect rather than a documentation debt item changes the team's relationship with AI-generated code: the spec is the product, and the code is one of its outputs.

Concepts & terms
Spec-Driven Development (SDD)
A development approach where a specification—covering requirements, design, tasks, and acceptance criteria—is written first and serves as the persistent source of truth that AI agents and developers both read and validate against, rather than letting the codebase become the sole authority.
Vibe Coding
An AI-assisted coding style where developers describe features conversationally in a chat interface and iterate by appending corrections, often skipping upfront design and leaving architectural decisions to the model's guesses.
Specification Drift
The divergence between a written specification and the actual codebase. In SDD, this is treated as a defect to be fixed immediately, not as deferred documentation debt.
Acceptance Criteria
Falsifiable, observable conditions that define when a requirement is met—for example, 'the sidebar displays translation results with independently scrollable body text' rather than 'the interface should look good.'
Source: juejin.cn ↗ Google Translate ↗ Backup ↗