Skip to content

Understanding Spec-Driven Development

Spec-driven development makes a structured specification the primary source of truth for AI coding agents, replacing vibe coding with a verifiable contract.

Tuan Tran Van
11 min read
Contents (9 sections)
  1. What is spec-driven development?
  2. Why SDD emerged: vibe coding and technical debt
  3. The three levels of SDD: spec-first, spec-anchored, spec-as-source
  4. What goes into a good spec? (for members)
  5. How the SDD workflow runs with an AI coding agent (for members)
  6. SDD tools: Kiro, Spec-kit, Tessl (for members)
  7. Limits and criticism: waterfall echoes and the over-engineering trap (for members)
  8. When to use (and not use) SDD (for members)
  9. References (for members)

The nature of building software has shifted. Writing and reviewing syntax is no longer the primary bottleneck in the software development lifecycle; the new challenge is conveying precise architectural intent to large language models (LLMs). Spec-driven development prioritizes authoring a detailed implementation specification before a single line of executable code is generated.

Your role shifts from manual executor to technical verifier. Spec-driven development (SDD) replaces "vibe coding" — a process that is functionally non-deterministic and fails at scale — with a structured framework that governs how the AI operates. By defining the "what" and the "how" through a formal contract, you give coding agents the anchoring they need to produce reliable, maintainable systems.

SDD treats the specification as the primary artifact of the project, while the code becomes a downstream implementation detail. This shift matters because AI is only as capable as the instructions it receives. Without a rigorous specification, you risk accruing technical debt through context drift and architectural fragmentation, where AI-generated features fail to align with existing system constraints or established design patterns.

The specification is the central blueprint that guides an AI coding agent to generate code for a software project.

What is spec-driven development?

Spec-driven development is an evolution in the software development lifecycle (SDLC) where a detailed specification is the single source of truth. In traditional development, documentation often follows the code as an afterthought. SDD reverses this, establishing the specification as a contract that defines the system's behavior, data schemas, and constraints before implementation begins. This gives the coding agent a clear, unambiguous roadmap and reduces the likelihood of hallucinations or ignored requirements.

While it shares DNA with test-driven development (TDD) and behavior-driven development (BDD), SDD is effectively "TDD on steroids." Where TDD focuses on outcome-based tests and BDD on collaborative behavior, SDD demands a comprehensive definition of the entire implementation plan. It treats code as a last-mile concern, shifting the developer's focus higher up the abstraction ladder to the level of architectural intent.

By formalizing requirements upfront, the team establishes a shared understanding that governs every phase of the project. This matters most when using AI agents, since these models require precise instructions to stay consistent across a codebase. The specification becomes the governing document the AI reads to understand the broader system context, which keeps it from making isolated decisions that break existing functionality.

Why SDD emerged: vibe coding and technical debt

SDD is a direct response to the "vibe coding" trend, where developers use natural language prompts to generate code without structured planning. Vibe coding is useful for rapid prototyping, but it is inherently non-deterministic. That lack of structure leads to a slippery slope of technical debt, marked by context drift — a fix in one area inadvertently breaks another because the AI lacked a global understanding of the system's state and dependencies.

Vibe coding without a spec leads to technical debt: context drift, architectural fragmentation, and rising operational cost.

Technical debt in the AI era also shows up as architectural fragmentation. Without a spec to anchor the generation process, newly created features may fail to align with established conventions, eroding the maintainability of the codebase. There is a significant operational cost too: developers often get trapped in lengthy, expensive prompting cycles, consuming thousands of tokens to resolve errors that a well-defined specification would have prevented entirely.

SDD puts the brakes on vibe coding. It prevents the scenario where a developer rushes a feature through a series of AI prompts, creating a functional UI that hides vulnerabilities, dependency conflicts, and forgotten edge cases. A formal specification grounds the AI's output in a verified design rather than a probabilistic guess based on a vague prompt.

The three levels of SDD: spec-first, spec-anchored, spec-as-source

Adopting SDD typically happens across three levels of maturity. The first is spec-first, the entry point where a specification is written before code generation to provide initial clarity. In this model the spec is not necessarily maintained as the software evolves, so it can quickly grow outdated as the implementation diverges from the initial plan.

The second level is spec-anchored, where the specification is a living document that evolves alongside the code. When requirements change, the spec is updated first. Automated tests often connect the two here, integrated into a CI/CD pipeline to keep the implementation and the documentation synchronized. This is generally the most practical and scalable approach for professional engineering teams.

The most advanced level is spec-as-source. At this stage humans only interact with the specification; the AI handles all code refactoring. This mirrors the historical failures of Model-Driven Development (MDD). Just as MDD struggled with awkward abstraction levels and inflexibility, spec-as-source risks combining the constraints of rigid modeling with the non-determinism of LLMs. Without rigorous human oversight, this level can produce inconsistent output that is hard to validate.

The three levels of spec-driven development on a rising scale: spec-first, spec-anchored, and spec-as-source.

Share this article