Leanpub Header

Skip to main content

Spec Driven Development

Build With AI Without Losing Control

Using AI to code is easy. Using it without losing control — not so much.

By week three, your project stops moving. The agent forgets decisions it made ten days ago. A change in auth breaks the dashboard. You spend more time re-explaining context than writing features. The code works, but only you know why — and you're not even sure you remember all of it.

That's vibe coding hitting its ceiling.

Spec-Driven Development is the method that replaces the chaos with a spec the AI actually executes. Not a ceremonial document. A working artifact: PRD, issues, tests, code — all traceable, all connected, all in the right order.

This book shows you:

  • How to grill your own idea before writing a single prompt
  • How to write a PRD the AI won't misinterpret
  • The 7 phases that turn an idea into working software
  • How to use GitHub SpecKit and openSpec (and when not to)
  • How to work this way in a team without slowing down
  • The 5 anti-patterns that destroy every spec

22,000 words. 13 chapters. 5 appendices with ready-to-copy templates.

No theory dumps. No filler. Just the method.

This book is a translation into English of Spec Driven Development which was originally written in Spanish

Minimum price

$14.99

$19.99

You pay

$19.99

Author earns

$15.99
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
WEB
About

About

About the Book

Your agent isn't bad.

Your spec is bad.

Or worse: you don't have a spec.

You’ve been building with AI for weeks. The agent builds fast. The results are real. You think this is the future.

It is. But it has an invisible limit.

As the project grows, the agent begins to hallucinate things that aren't there. It contradicts decisions you made last week. It implements features you didn't ask for. Every session starts from scratch because there is no artifact telling it what it’s building and why.

It’s not a model problem. It’s a method problem.

Spec-Driven Development is the answer.

It’s not the opposite of "vibe coding." It’s not Waterfall. It’s not documentation that nobody reads.

It is a way of working where the spec exists before the agent starts. It describes behavior, not implementation. It lives in the repository. It is versioned with the code.

With a spec, the agent executes clear instructions instead of filling gaps with its own assumptions.

And when it’s finished, you can verify if what it built matches what you specified. Not by "eye-balling" it, but with concrete criteria.

What’s inside the book

Part I — The Problem (3 chapters) Why vibe coding has an expiration date. What SDD is and what it isn't. The spec as a primary artifact: what it means and why it changes everything.

Part II — The Method (4 chapters) The 7 phases of AI-driven development. How to write a PRD that the agent can't misinterpret. From PRD to issues: vertical slices and tracer bullets. The execution loop: Ralph loop, GSD, and when to intervene.

Part III — The Tools (3 chapters) GitHub SpecKit: 72K stars, the constitution, the 5 main flow commands, and the 3 quality commands that almost nobody knows. openSpec for existing projects. Agnostic flows: Ralph loop, BMAD, and living-spec platforms.

Part IV — In Practice (3 chapters) Greenfield vs. brownfield: how to adopt SDD in an existing project. The 5 anti-patterns that destroy a spec—with the fix for each. SDD in a team: who writes the PRD, spec reviews, and the risk of "spec theater."

4 Appendices Copy-paste PRD template. Constitution with the 5 sections and a real-world example. Pre-execution quality checklist. SDD Glossary.

Who this book is for
  • Developers working with AI agents—Claude Code, GitHub Copilot, Cursor, or any other—who want results to be predictable, not a gamble.
  • Anyone who tried vibe coding and hit the limit: the project is growing, the agent is contradicting itself, and context is getting lost between sessions.
  • Those who want to adopt SDD without scrapping what they already have. There is a specific chapter for existing projects.
Who it is NOT for

If your project is less than two weeks old and you’re still exploring what you want to build, the book can wait. The method assumes you know what you want to build—SDD doesn't replace thinking; it organizes it.

About the Author

Bezael Pérez is a developer and technical content creator. Founder of DominiCode, where he teaches developers how to build software with AI in a structured way. Instructor for Claude Code for Developers, Build with AI, and Agentic AI for Developers on Udemy.

Book Details
  • 13 chapters + 4 appendices
  • Format: PDF
  • Language: Spanish
  • Lifetime access — direct download
  • DRM-free
  • Includes a 20% discount coupon for DominiCode courses on Udemy

Questions before buying? Write to me at me@dominicode.com

Share this book

This book is a translation into English of Spec Driven Development which was originally written in Spanish

Author

About the Author

Bezael Pérez

¿Se puede escribir código que funcione… y que además dé gusto leer?

Soy frontend developer senior, con más de 10 años de experiencia y 4 centrado en Angular. He trabajado en productos propios y plataformas empresariales, siempre buscando arquitecturas limpias, testing automatizado y un código que no dé miedo tocar.

Sigo de cerca lo nuevo en Angular —Signals, componentes standalone, Jest, Tailwind— y disfruto colaborar con otros equipos, entender el producto y aportar más allá del código.

Me gusta compartir lo que sé, aprender de quienes piensan distinto y trabajar en entornos con confianza y ganas de construir bien.

Si buscas a alguien técnico, pero con visión de producto y equipo, aquí estoy.

Translations

Translations

Languages

Contents

Table of Contents

Chapter 1: Vibe Coding: It Works Until It Doesn’t

  1. The Project That Goes Well Until It Doesn’t
  2. The Three Symptoms
  3. Why This Happens
  4. The Mistake Almost Everyone Makes
  5. This Isn’t an AI Problem
  6. What Comes Next

Chapter 3: The Spec as Primary Artifact

  1. Why Traditional Specs Fail
  2. The Living Spec
  3. Behavior, Not Architecture
  4. What a Spec Has and What It Doesn’t
  5. The Contract Between You and the Agent
  6. How Long Does It Take to Write a Spec
  7. The Shortest Spec You Can Write
  8. Before Moving On

Chapter 4: The 7 Phases of AI Development

  1. Phase 1: Idea
  2. Phase 2: Research
  3. Phase 3: Prototype
  4. Phase 4: PRD
  5. Phase 5: Kanban
  6. Phase 6: Execution Loop
  7. Phase 7: QA
  8. When to Skip Phases
  9. The Complete Flow

Chapter 6: From PRD to Issues — Vertical Slices and Tracer Bullets

  1. What a Vertical Slice Is
  2. Tracer Bullets: The Uncertain Comes First
  3. Blocking Relationships
  4. What an Executable Issue Needs
  5. A Poorly Written Issue and a Well-Written One
  6. Login → httpOnly Cookie
  7. How to Create the Issues
  8. Before the Next Chapter

Chapter 7: The Execution Loop

  1. The Contract with the Agent
  2. Ralph Loop
  3. When to Intervene
  4. The Human Always Reads the Code
  5. GSD: Context Management Between Sessions
  6. Session State — [date]
  7. QA as an Issue, Not an Afterthought
  8. The Complete Loop in One View

Chapter 8: GitHub SpecKit — SDD with Formal Structure

  1. What SpecKit Actually Is
  2. Installation and Directory Structure
  3. The Constitution
  4. Technology Standards
  5. Security Requirements
  6. Performance & Scalability
  7. Coding Standards
  8. Compliance & Governance
  9. The 5 Commands of the Main Flow
  10. The 3 Quality Commands
  11. Branch Strategy: The Spec Travels with the Code
  12. When to Use SpecKit

Chapter 9: openSpec — Lightweight Specs for Existing Projects

  1. What openSpec Is
  2. The Problem It Solves
  3. How It Works

[Feature or component name]

  1. What it does
  2. What it doesn’t do
  3. Acceptance Criteria
  4. Assumptions
  5. The Brownfield Case
  6. A Real Example

Email Notifications — Task Deadlines

  1. What it does
  2. What it doesn’t do
  3. Acceptance Criteria
  4. Assumptions
  5. The Difference from “Writing a Good Prompt”
  6. When to Migrate to SpecKit
  7. The Golden Rule

Chapter 10: Tool-Agnostic Flows

  1. Ralph Loop
  2. GSD
  3. BMAD
  4. Living-Spec Platforms
  5. How to Choose
  6. What Comes in Part IV

Chapter 11: Greenfield vs Brownfield

  1. Greenfield: The Ideal Scenario
  2. The Greenfield Trap
  3. Brownfield: The Reality for Most Projects
  4. Gradual Adoption
  5. Retrofitting SpecKit
  6. Brownfield Without SpecKit
  7. What Brownfield Teaches Us About Greenfield
  8. One Rule for Each Context

Chapter 12: The 5 Anti-Patterns That Destroy a Spec

  1. Anti-Pattern 1: The Endless PRD
  2. Anti-Pattern 2: Prescribing Implementation
  3. Anti-Pattern 3: Empty Out of Scope
  4. Anti-Pattern 4: Empty or Missing Assumptions
  5. Anti-Pattern 5: Vague Acceptance Criteria
  6. The Quick Check

Chapter 13: SDD in Teams

  1. The Spec as a Shared Language
  2. Who Writes the PRD
  3. Spec Review, Not Code Review
  4. The Shared Constitution
  5. Async SDD
  6. The Risk of Spec Theater
  7. What SDD Doesn’t Replace
  8. The Book Ends Here

Appendix A: Complete PRD Template

PRD: [Feature Name]

  1. Problem Statement
  2. Solution
  3. User Stories
  4. Constraints
  5. Acceptance Criteria
  6. Out of Scope
  7. Assumptions ⚠️
  8. Implementation Notes
  9. Quick Checklist Before Approving
  10. Usage Notes

Appendix B: Constitution — The 5 Sections with a Real Example

  1. The Template

Constitution — [Project Name]

  1. Technology Standards
  2. Security Requirements
  3. Performance & Scalability
  4. Coding Standards
  5. Compliance & Governance
  6. Real Example: Modern Web Project

Constitution — AI Spec Builder

  1. Technology Standards
  2. Security Requirements
  3. Performance & Scalability
  4. Coding Standards
  5. Compliance & Governance
  6. How to Write the Constitution for an Existing Project
  7. What Does NOT Go in the Constitution

Appendix C: Quality Checklist Before Executing

  1. PRD Checklist
  2. Issues Checklist
  3. Constitution Checklist
  4. Pre-QA Checklist
  5. Post-QA Checklist
  6. The Most Important Question

Appendix D: SDD Glossary

Example: Completed PRD — Migrate Auth to httpOnly Cookies

PRD: Migrate Authentication to httpOnly Cookies

  1. Problem Statement
  2. Solution
  3. User Stories
  4. Constraints
  5. Acceptance Criteria
  6. Out of Scope
  7. Assumptions
  8. Implementation Notes

Spec-Driven Development

Why This Book

Chapter 1: Vibe Coding: It Works Until It Doesn’t

  1. The Project That Goes Well Until It Doesn’t
  2. The Three Symptoms
  3. Why This Happens
  4. The Mistake Almost Everyone Makes
  5. This Isn’t an AI Problem
  6. What Comes Next

Chapter 2: What SDD Is (and What It Isn’t)

  1. What It Isn’t
  2. How We Got Here
  3. Why Now
  4. The Table That Sums It Up
  5. What SDD Doesn’t Solve
  6. A Definition Worth Keeping

Chapter 3: The Spec as Primary Artifact

  1. Why Traditional Specs Fail
  2. The Living Spec
  3. Behavior, Not Architecture
  4. What a Spec Has and What It Doesn’t
  5. The Contract Between You and the Agent
  6. How Long Does It Take to Write a Spec
  7. The Shortest Spec You Can Write
  8. Before Moving On

Chapter 4: The 7 Phases of AI Development

  1. Phase 1: Idea
  2. Phase 2: Research
  3. Phase 3: Prototype
  4. Phase 4: PRD
  5. Phase 5: Kanban
  6. Phase 6: Execution Loop
  7. Phase 7: QA
  8. When to Skip Phases
  9. The Complete Flow

Chapter 5: The PRD — How to Write a Spec AI Won’t Misinterpret

  1. Before Writing: The Grilling
  2. The Eight Parts of the PRD
  3. A Complete PRD

PRD: Migrate Authentication to httpOnly Cookies

  1. Problem Statement
  2. Solution
  3. User Stories
  4. Constraints
  5. Acceptance Criteria
  6. Out of Scope
  7. Assumptions
  8. Implementation Notes
  9. Where the PRD Lives
  10. The Right Length

Chapter 6: From PRD to Issues — Vertical Slices and Tracer Bullets

  1. What a Vertical Slice Is
  2. Tracer Bullets: The Uncertain Comes First
  3. Blocking Relationships
  4. What an Executable Issue Needs
  5. A Poorly Written Issue and a Well-Written One
  6. Login → httpOnly Cookie
  7. How to Create the Issues
  8. Before the Next Chapter

Chapter 7: The Execution Loop

  1. The Contract with the Agent
  2. Ralph Loop
  3. When to Intervene
  4. The Human Always Reads the Code
  5. GSD: Context Management Between Sessions
  6. Session State — [date]
  7. QA as an Issue, Not an Afterthought
  8. The Complete Loop in One View

Chapter 8: GitHub SpecKit — SDD with Formal Structure

  1. What SpecKit Actually Is
  2. Installation and Directory Structure
  3. The Constitution
  4. Technology Standards
  5. Security Requirements
  6. Performance & Scalability
  7. Coding Standards
  8. Compliance & Governance
  9. The 5 Commands of the Main Flow
  10. The 3 Quality Commands
  11. Branch Strategy: The Spec Travels with the Code
  12. When to Use SpecKit

Chapter 9: openSpec — Lightweight Specs for Existing Projects

  1. What openSpec Is
  2. The Problem It Solves
  3. How It Works

[Feature or component name]

  1. What it does
  2. What it doesn’t do
  3. Acceptance Criteria
  4. Assumptions
  5. The Brownfield Case
  6. A Real Example

Email Notifications — Task Deadlines

  1. What it does
  2. What it doesn’t do
  3. Acceptance Criteria
  4. Assumptions
  5. The Difference from “Writing a Good Prompt”
  6. When to Migrate to SpecKit
  7. The Golden Rule

Chapter 10: Tool-Agnostic Flows

  1. Ralph Loop
  2. GSD
  3. BMAD
  4. Living-Spec Platforms
  5. How to Choose
  6. What Comes in Part IV

Chapter 11: Greenfield vs Brownfield

  1. Greenfield: The Ideal Scenario
  2. The Greenfield Trap
  3. Brownfield: The Reality for Most Projects
  4. Gradual Adoption
  5. Retrofitting SpecKit
  6. Brownfield Without SpecKit
  7. What Brownfield Teaches Us About Greenfield
  8. One Rule for Each Context

Chapter 12: The 5 Anti-Patterns That Destroy a Spec

  1. Anti-Pattern 1: The Endless PRD
  2. Anti-Pattern 2: Prescribing Implementation
  3. Anti-Pattern 3: Empty Out of Scope
  4. Anti-Pattern 4: Empty or Missing Assumptions
  5. Anti-Pattern 5: Vague Acceptance Criteria
  6. The Quick Check

Chapter 13: SDD in Teams

  1. The Spec as a Shared Language
  2. Who Writes the PRD
  3. Spec Review, Not Code Review
  4. The Shared Constitution
  5. Async SDD
  6. The Risk of Spec Theater
  7. What SDD Doesn’t Replace
  8. The Book Ends Here

Appendix A: Complete PRD Template

PRD: [Feature Name]

  1. Problem Statement
  2. Solution
  3. User Stories
  4. Constraints
  5. Acceptance Criteria
  6. Out of Scope
  7. Assumptions ⚠️
  8. Implementation Notes
  9. Quick Checklist Before Approving
  10. Usage Notes

Appendix B: Constitution — The 5 Sections with a Real Example

  1. The Template

Constitution — [Project Name]

  1. Technology Standards
  2. Security Requirements
  3. Performance & Scalability
  4. Coding Standards
  5. Compliance & Governance
  6. Real Example: Modern Web Project

Constitution — AI Spec Builder

  1. Technology Standards
  2. Security Requirements
  3. Performance & Scalability
  4. Coding Standards
  5. Compliance & Governance
  6. How to Write the Constitution for an Existing Project
  7. What Does NOT Go in the Constitution

Appendix C: Quality Checklist Before Executing

  1. PRD Checklist
  2. Issues Checklist
  3. Constitution Checklist
  4. Pre-QA Checklist
  5. Post-QA Checklist
  6. The Most Important Question

Appendix D: SDD Glossary

Example: Completed PRD — Migrate Auth to httpOnly Cookies

PRD: Migrate Authentication to httpOnly Cookies

  1. Problem Statement
  2. Solution
  3. User Stories
  4. Constraints
  5. Acceptance Criteria
  6. Out of Scope
  7. Assumptions
  8. Implementation Notes

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub