Back to Experiments
aiFeatured

Spec-Driven Development: Why Writing Specs Before Code Is the Next Paradigm Shift

11 min read
spec-driven-developmenttesslai-codingsoftware-architecturespecificationsmethodology

Here's a pattern I see every week: a developer asks an AI agent to "add a payment endpoint." The agent generates 200 lines of code. The developer reviews it and says "no, it needs Stripe webhook verification." The agent regenerates. "Also, it needs idempotency keys." Regenerates again. "And rate limiting." Again. Four rounds later, the code is a Frankenstein of patched-together generations, and nobody — not the developer, not the agent — has a clear picture of what the endpoint is supposed to do.

The agent rushed to code because that's what it was asked to do. No one stopped to define what "add a payment endpoint" actually means.

Spec-driven development (SDD) fixes this by making specifications — not code — the source of truth. Define what you want. Validate it. Then let the agent implement against a documented contract.

The Specification Gap

Code alone lacks critical information. When an AI agent receives "add a payment endpoint," it has to infer:

  • Authentication model (API key? OAuth? JWT?)
  • Error handling strategy (what happens when Stripe is down?)
  • Data validation (what constitutes a valid payment request?)
  • Edge cases (duplicate payments? currency conversion? partial refunds?)
  • Integration points (webhooks? event queues? audit logs?)
  • Performance requirements (latency budget? throughput?)

Without structure, the agent makes assumptions. Some will be wrong. You'll discover which ones during review — or worse, in production.

The Specification Gap
-'Add a payment endpoint' → Agent assumes REST, no auth, basic validation, no webhooks, no idempotency. Four rounds of regeneration. The final code is a patchwork of corrections with no coherent design. No tests. No documentation.
+Payment endpoint specification defines: Stripe integration with webhook verification, JWT auth, idempotency via request keys, retry logic with exponential backoff, event emission for audit trail. Agent implements against this contract. One round. Tests validate the spec.

What Is Spec-Driven Development?

SDD is a structured workflow where detailed specifications are written before code is generated. Specifications serve as the authoritative source of truth for both human developers and AI agents.

Tessl, the company pioneering this approach, defines three adoption levels:

Spec-Driven Development Maturity Levels
1

Spec-First

Specifications written for immediate tasks. They guide implementation but may be discarded after. The lightest adoption level — good for getting started.

2

Spec-Anchored

Specifications persist and evolve with features throughout their lifetime. They serve as living documentation and regression guards. Code and specs stay in sync.

3

Spec-as-Source

Specifications become the canonical artifact. Code is entirely generated and regenerable from specs. The specification IS the product — code is a derived artifact.

The most ambitious level — spec-as-source — inverts traditional development entirely. The specification isn't documentation of code. The code is a derivation of the specification. If you change the spec, you regenerate the code. If the code doesn't match the spec, the code is wrong.

How Tessl Implements SDD

Tessl provides two complementary products:

The Tessl Framework (Closed Beta)

The framework guides AI agents through structured development workflows before any coding begins. It requires three resources:

  1. Written plans outlining change strategies
  2. Natural language specifications capturing intended functionality
  3. Tests validating code against intent

Specifications map 1:1 to code files. Generated code is marked with // GENERATED FROM SPEC - DO NOT EDIT comments. The framework supports annotations:

text
1@generate    → Produce code from this specification
2@describe    → Document existing code as a specification
3@use         → Import another specification as a dependency

This creates a traceable chain: specification → generated code → tests → verification. At every point, you can answer "why does this code exist?" by tracing back to the spec.

The Tessl Spec Registry (Open Beta)

This is where it gets interesting. Tessl maintains a registry of over 10,000 version-matched specifications for open-source libraries. These specs tell AI agents exactly how to use a library's API — the correct function signatures, parameters, return types, and patterns for a specific version.

Info

The spec registry directly attacks the hallucination problem. Without it, AI agents generate outdated API calls, confuse library versions, and invent functions that don't exist. With version-matched specs, the agent works from verified documentation — not training data that may be months or years old.

The results are measurable:

Case StudyWithout SpecsWith SpecsImprovement
ElevenLabs API usageBaseline agent success2x agent success rate100% improvement
Bowser npm library57% accuracy93% accuracy63% improvement

Teams can also publish custom specifications to the registry — reflecting internal standards, security policies, and architectural preferences. Your organization's "how we do authentication" becomes a spec that every AI agent in the company follows.

The Four-Step Tessl Workflow

Spec-Driven Development with Tessl
1

Requirements Gathering

Agent asks clarifying questions about endpoints, authentication, error handling, data management, and edge cases. Nothing is assumed — everything is documented.

2

Specification Creation

Documentation in specs/ folders captures functional requirements, API contracts, edge cases, and test links. Each spec describes a component with capabilities, API definition, and verification criteria.

3

Approval Checkpoint

Users and stakeholders review specifications before development begins. This is the critical gate — catching misalignment here prevents costly mid-project corrections.

4

Specification-Aligned Implementation

Agents build against documented requirements and verify compliance upon completion. Code is generated from specs, not from ambiguous prompts.

The approval checkpoint is the most important step. In traditional AI-assisted development, the first time a human reviews the agent's interpretation of requirements is when they review the generated code. By then, wrong assumptions are baked into the implementation. With SDD, you review the spec — and fixing a spec is orders of magnitude cheaper than fixing code.

Why This Matters: The Cost of Iteration

Tip

Spec-driven iteration is genuinely low-cost: rewind, improve the spec, ask the agent to regenerate. No need to start from scratch when the output isn't correct. The spec preserves your intent across regeneration cycles.

This is the fundamental economics of SDD. Traditional AI development has a hidden cost curve:

Rendering diagram...
💡 Drag to pan • Scroll to zoom • Click controls to zoom

Each regeneration cycle costs tokens, time, and attention. And because the agent has no persistent memory of requirements, each cycle risks introducing new misalignments while fixing old ones.

With SDD:

Rendering diagram...
💡 Drag to pan • Scroll to zoom • Click controls to zoom

The spec acts as a stable anchor. Regeneration happens against a documented contract, not a drifting conversation. The agent can regenerate code confidently because the specification hasn't changed.

The Competitive Landscape (2026)

SDD isn't just Tessl. Three major platforms launched dedicated tooling in rapid succession:

ToolApproachBest For
Tessl FrameworkSpec-anchored / spec-as-source, 1:1 spec-to-code mapping, paired registryProduction teams wanting the deepest spec integration
GitHub Spec KitSpec-first workflow with Constitution → Specify → Plan → TasksTeams using Copilot/Claude/Gemini who want open-source flexibility
AWS KiroRequirements → Design → Tasks with VS Code integrationSimplest entry point, lightweight steering approach

Tessl's competitive advantage is the registry. Having 10,000+ pre-built, version-matched specs means agents start with verified API knowledge instead of training data. That's a moat that compounds — every new library spec makes the platform more valuable.

The Honest Tradeoffs

SDD isn't a silver bullet. The honest assessment:

Where It Shines

  • Greenfield features with well-understood requirements — new API endpoints, CRUD modules, integration layers
  • Teams with governance needs — auditable specs create compliance trails
  • Complex domains where getting requirements wrong is expensive — payments, authentication, data pipelines
  • Long-lived products where specs serve as living documentation

Where It Struggles

  • Simple changes — A typo fix doesn't need a specification lifecycle
  • Exploratory work — Prototyping and UI experiments need speed, not specs
  • Rapidly changing requirements — Specs can become stale faster than they're updated
  • Overhead concern — If spec review takes longer than code review, the process is counterproductive
When To Use SDD
-Writing a 16-point specification with acceptance criteria for a CSS color change. Using full SDD lifecycle for a one-line bug fix. Creating specs for throwaway prototypes. Treating every change as production-critical.
+Using SDD for new features, API endpoints, and architectural decisions where getting requirements wrong costs real time and money. Scaling the process to the size of the change. Skipping specs for trivial fixes and exploratory work.

The key is matching process to problem size. Not every change deserves a specification. But every significant feature deserves one.

Specs as Long-Term Memory

Here's the underappreciated benefit of SDD: specifications function as long-term memory of what your product should do.

Code tells you how something works. Specifications tell you why it exists and what it should do. When a new developer joins the team (or a new AI agent session starts), the spec provides context that code alone cannot.

This matters especially for AI agents, which have no memory between sessions. A specification document gives the agent instant context about the component it's working on — its purpose, constraints, API contract, and test criteria. No ramp-up time. No re-discovery.

Info

Think of specs as the institutional knowledge layer. Engineers leave. Conversations get lost. Code gets refactored beyond recognition. Specifications persist, evolve, and maintain the original intent across all of these changes.

Getting Started

The lightest way to adopt SDD is spec-first for your next feature:

Starting with Spec-Driven Development

Even without Tessl's tooling, the practice of writing a specification document before asking an AI agent to generate code will immediately improve your results. The spec becomes the prompt — structured, complete, and reviewable.

The Paradigm Shift

We're at an inflection point. The first wave of AI-assisted development was "let the model write code." The second wave is "let the model implement specifications." The difference is enormous:

  • Declared intent transforms into validated code, not guessed intent into hoped-for code
  • Requirement changes become spec edits and regeneration, not manual rework
  • Review shifts from "does this code do what I want?" to "does this spec capture what I want?"
  • Institutional knowledge lives in specs, not in people's heads or lost chat histories
  • Regeneration becomes safe because the contract is stable

The teams adopting SDD now are building specification libraries that compound over time. Every new spec is a template. Every refined spec is institutional knowledge. Every verified spec is a regression guard.

Over 450 tools now support spec-driven workflows. Three major platforms have launched dedicated SDD tooling in 2026 alone. The ecosystem is forming fast.

Write the spec. Then write the code.

Resources