Page
1
(This page has no text content)
Page
2
Spec-Driven Development with BMAD Master Agentic Workflows using Cursor, BMAD, and Context Engineering Marlon Vidal Ferreira
Page
3
Spec-Driven Development with BMAD Copyright © 2026 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Portfolio Director: Ashwin Nair Portfolio Manager: Sneha Shinde Project Manager: Vishnu Priya R Content Engineer: Nithya Sadanandan Technical Editor: Rohit Singh Copy Editor: Nithya Sadanandan Indexer: Pratik Shirodkar Proofreader: Nithya Sadanandan Production Designer: Ajay Patule Growth Lead: Anamika Singh First published: September 2026 Production reference: 1140826 Published by Packt Publishing Ltd. Grosvenor House 11 St Paul's Square Birmingham B3 1RB, UK. ISBN 978-1-80808-607-6 www.packtpub.com
Page
4
I would like to dedicate this book to my family, my safe harbor through all of life's transitions (and there were many; those who know me are well aware). To my mother, who dedicated her life to caring for me and my siblings, and who taught me the meaning of genuine love for another person. To my father (in memoriam), who showed me the value of hard work and dedication. Though he is no longer here to witness this achievement, he remains my greatest inspiration to be as good a father as he was. To you, the reader, for believing that my experience can contribute to your own journey of growth. – Marlon Vidal Ferreira
Page
5
Contributors About the author Marlon Vidal Ferreira is a technology executive with a 15-year career and more than 7 years of experience in digital marketing, a unique combination of technical expertise and business vision. He is currently an Engineering Manager at TELUS Digital, an official Cursor Ambassador in Brazil for the cities of Belo Horizonte, MG, and Porto Alegre, RS, and the owner of a digital marketing agency focused on online advertising. His career includes stints at companies such as Banco BS2, Avenue Code, Gap, Fanatics, BMG Money, Grupo Fácil, Minds Digital, and Grupo Boticário, progressing from developer to Head of Technology. Along the way, he also founded two companies, further strengthening his entrepreneurial vision. Connect with the author: https://linkedin.com/in/marlonvidal https://github.com/marlonvidal https://marlonvidal.com.br/#en
Page
6
About the reviewers Andrii Derevianko is a Chief Quality Officer and QA Architect with over 15 years of experience spanning software engineering, IoT hardware integration, and industrial automation. Holding an M.Sc. in Automation Engineering, he specializes in scaling QA infrastructure through AI- driven workflows and rigorous shift-left methodologies. Andrii's expertise encompasses modern test automation frameworks, digital twin virtualization, and CI/CD quality gates. A strong advocate of clean code and strict architectural contracts, he champions Spec-Driven Development to eliminate chaotic implementation patterns, ensuring enterprise systems are built on resilient, testable, and deeply validated foundations. Tim Dickey is a product development and business agility coach who helps teams connect strategy, delivery, and real-world product work. A 2024–2025 LinkedIn Top Voice, he shares practical, human-centered insights on product development, coaching, and new ways of working. Before consulting, Tim served for nearly 25 years in the U.S. Navy, on active duty and in the reserve, including service in the submarine force and in support of deployed special operations units, where he learned servant leadership under pressure. He has worked with organizations such as Carnival Cruise Lines, Verizon, IBM, and Improving. Today, Tim helps product teams become more AI-fluent through experimentation, collaboration, systems thinking, and rapid MVP learning.
Page
7
(This page has no text content)
Page
8
Table of Contents Preface xiii Free benefits with your book ................................................................................................ xviii Chapter 1: Introducing Spec-Driven Development and BMAD Method 1 Technical requirements ............................................................................................................. 2 Why SDD is the future of development ..................................................................................... 3 Looking at the BMAD method ................................................................................................... 4 Understanding the BMAD workflows ....................................................................................... 4 Understanding BMAD modules ................................................................................................. 5 BMAD Builder • 5 Creative Intelligence Suite (CIS) • 6 Game Dev Studio (GDS) • 6 Test enterprise architect (TEA) • 6 Moving forward: our focus on quality • 6 Context engineering: the foundation of good specs .................................................................. 7 The context gap challenge • 7 Context drift • 7 What is context engineering? • 7 The three pillars of upstream context ........................................................................................ 8 The first pillar: the who • 8 The second pillar: the why • 8 The third pillar: the what • 9 A real-world context example • 9 Building a full feature using the complete BMAD cycle ........................................................... 10 Configuring BMAD in the project ............................................................................................. 12 The _bmad-output folder • 15 Differences between v4 and v6 ................................................................................................. 15 Progressive disclosure ............................................................................................................. 16 What is new in v6 ..................................................................................................................... 17
Page
9
Modular architecture • 17 Workflows without agents • 17 QuickSpec workflow • 17 BMAD Help • 17 Party Mode • 18 Project context • 18 BMAD Agile and TEA workflows ............................................................................................. 18 Analysis phase • 18 Planning phase • 19 Solutioning phase • 19 Implementation phase • 20 TEA workflows • 21 The importance of project-context.md ................................................................................... 22 Installing v6 and updating from v4 ......................................................................................... 23 Prerequisites • 23 Fresh installation • 23 Upgrading from v4 to v6 • 23 Recommended workflow for getting started ........................................................................... 24 New projects • 24 Existing projects • 24 Summary ................................................................................................................................ 24 Chapter 2: Upstream Phase: Analysis, Planning and Solutioning 25 The analysis phase .................................................................................................................. 26 Brainstorming the product idea • 28 Performing market research • 31 Creating the product brief • 33 Working backwards with PRFAQ • 34 The planning phase ................................................................................................................. 35 Working with John, the product manager • 35 Creating the PRD • 37 Updating and validating the PRD • 39 Working with Sally, the UX designer • 39 Creating the UX design • 40 The solution phase .................................................................................................................. 43 Table of Contents viii
Page
10
Working with Winston, the architect • 43 Creating the architecture • 45 Generating project context • 46 Working with Murat, the test architect • 48 Designing the test strategy • 49 Creating epics and stories • 51 Checking implementation readiness • 53 Summary ................................................................................................................................ 54 Chapter 3: Downstream Phase: Implementing and Sprinting 55 The implementation phase ..................................................................................................... 56 Working with Amelia, the developer • 56 Initializing the sprint plan • 58 The development cycle • 59 Creating a story • 59 Implementing the story • 61 Reviewing the Code • 62 The quick dev workflow • 64 Handling Mid-Sprint changes • 65 The testing cycle • 66 Setting up the test framework • 67 Configuring the CI pipeline • 68 Generating test scaffolds before implementation • 69 Expanding coverage after implementation • 71 The coverage gate • 73 The epic retrospective • 74 Summary ................................................................................................................................ 76 Chapter 4: Applying BMAD to an Existing Project 77 Technical requirements ........................................................................................................... 79 Knowing the project and installing dependencies ................................................................... 79 Knowing the problems and installing BMAD v6 ..................................................................... 80 Setting up BMAD • 80 Understanding the installed folder structure • 81 Running the TEA framework ................................................................................................... 82 ix Table of Contents
Page
11
Documenting the project ........................................................................................................ 85 Creating the project context ................................................................................................... 88 Adding new customers via QuickSpec ..................................................................................... 91 Understanding the Clarify-and-Route step • 92 Using TEA automate to create E2E tests .................................................................................. 94 Adding new tags via quick spec ............................................................................................... 96 Using TEA ATDD to generate tests before implementation ..................................................... 97 Wrapping up implementation and using TEA automate ......................................................... 98 Validating tests and real-world scenarios .............................................................................. 100 Recommended workflow for quick spec ................................................................................. 101 Creating a dashboard through a PRD ..................................................................................... 101 Advanced elicitation • 102 Party mode • 104 Creating epics and stories ..................................................................................................... 105 Validating implementation readiness ................................................................................... 106 Sprint planning ..................................................................................................................... 107 Creating test scenarios .......................................................................................................... 108 Risk-based testing strategy • 108 Creating the story ................................................................................................................. 109 Vertical slicing and team extensibility • 110 Creating tests using ATDD ..................................................................................................... 110 Developing the story .............................................................................................................. 112 Reviewing the code ................................................................................................................ 113 Automating tests .................................................................................................................... 114 Wrapping up the entire workflow .......................................................................................... 115 Correcting the course during the sprint ................................................................................. 116 Performing the retrospective ................................................................................................. 116 Summary ............................................................................................................................... 118 Chapter 5: Applying BMAD to a New Project 119 Recommended workflow ...................................................................................................... 120 Brainstorming session ............................................................................................................ 121 Research customers, competitors and technology ................................................................. 127 Creating the product brief ..................................................................................................... 129 Creating the PRD .................................................................................................................... 132 Table of Contents x
Page
12
Creating the UX ...................................................................................................................... 134 Creating the architecture ....................................................................................................... 143 Creating the test design and setting up test framework ........................................................ 146 Creating project context, epics and stories and wrapping up ................................................ 148 Summary ............................................................................................................................... 151 Chapter 6: BMAD in Practice: Answers to Real-World Questions 153 On skipping steps ................................................................................................................... 154 Can I skip stages if context already exists? • 154 When is it acceptable to skip the UX step entirely? • 154 Does a validated Figma prototype mean I can skip UX? • 154 When does running the UX step cost more than it delivers? • 154 What about quick dev – does it replace the UX step for small changes? • 155 On structuring work .............................................................................................................. 155 How should I break up PRDs? By user journey, by feature, or by epic? • 155 Should I generate all stories for all epics at once, or epic by epic? • 155 Can I run multiple stories in parallel? • 156 How complex should a single PRD be? We have a product with dozens of sub-features • 156 The BMAD agent asked me about endpoints and request parameters during PRD creation. is that appropriate? • 156 What's the difference between a product brief and a PRD? • 157 On context management ........................................................................................................ 157 Our PRD is picking up technical context we didn't include – it seems biased toward certain technology choices even after we cleaned it • 157 We work across three separate repositories. How do we share context without duplicating everything? • 157 Should the _bmad artifacts be versioned in git? • 158 On teams and processes ........................................................................................................ 158 What team composition works best with BMAD? • 158 How do we handle work cycles? Do we still do sprints? • 158 How do multiple product managers work with BMAD? Do they share PRD creation? • 159 On architecture ...................................................................................................................... 159 We're trying to evolve our data architecture from an existing pattern to a reference architecture. Can BMAD help? • 159 Should I provide architecture context before generating the architecture document, or let BMAD suggest one? • 159 xi Table of Contents
Page
13
We want to reuse corporate components across all applications. How do we prevent teams from building things that already exist? • 160 Who should own each workflow? • 160 On UX and design systems ..................................................................................................... 160 Our design team works directly in HTML rather than Figma. Does the UX workflow still apply? • 160 How do we ensure BMAD doesn't generate components that contradict our design system? • 161 The UX workflow didn't help us explore unhappy paths. It mostly validated what we already had. • 161 We receive prototypes from stakeholders built in informal tools. Can we use those as a BMAD starting point? • 161 How do we validate early concepts without going through the full BMAD process? • 161 On quality and testing ............................................................................................................ 162 What is the recommended sequence for the testing workflow? • 162 Why not generate all ATDD tests at the beginning of an epic? • 162 What is the relationship between test design and ATDD? • 162 We tried running ATDD on a legacy system and most of our tests failed immediately • 163 Can test design documents be modified after the fact? • 163 Should test coverage percentages be configured in BMAD or in the pipeline? • 163 We want to use our organization's custom test framework, but BMAD keeps generating tests for the default frameworks • 163 Our test repository is separate from our application repository. Can BMAD generate tests there? • 164 Does BMAD support the concept of tests that must pass before code is accepted? • 164 On governance and maintenance .......................................................................................... 164 How do we prevent teams from using different versions of BMAD and getting inconsistent results? • 164 How do we handle breaking changes when BMAD releases new versions? ............................ 165 The BMAD help command – is it actually useful for day-to-day questions? • 165 Crosscutting themes .............................................................................................................. 165 Chapter 7: Unlock the Code Bundle and the PDF Version 167 Unlock this book's free benefits in three easy steps ............................................................... 168 Other Books You May Enjoy 173 Index 177 Table of Contents xii
Page
14
Preface There is a moment most developers recognize. You have a capable AI model in front of you, a clear feature to build, and an afternoon of back-and-forth that produces something that mostly works. Then, two weeks later, in a fresh conversation, the same model has forgotten everything. The context is gone. The decisions are gone. You are explaining the same project from scratch, and the output is different from what you built before. That moment was where this book started for me. I came to AI-assisted development with the same instinct most developers bring: start writing, iterate fast, and let the model fill the gaps. What I found was that the faster I moved, the more fragile the result became. Each session was a fresh negotiation. Each change introduced new inconsistencies. The AI was capable, but the process had no structure. There was no shared memory, no contract between what I wanted and what the model understood. I was getting code, but I was not building software. I started looking for a better approach. Discovering BMAD The BMAD Method is a framework for AI-assisted software development built around a simple premise: the model is not the problem. The process is. Most failures in AI-driven development happen before a single line of code is written because the work of defining what to build, why to build it, and how to structure it has been skipped. BMAD does not skip that work. It makes it explicit, structured, and artifact-driven. I found BMAD through Brian Madison's YouTube masterclass. At the time of writing, it remains the most complete video resource on the method. Beyond that, the documentation is the primary source of knowledge. There is no ecosystem of tutorials and no abundance of secondary explanations. Learning BMAD means reading, experimenting, and building. That constraint turned out to be useful. It forced me to go beyond surface familiarity and develop a working understanding of why each phase exists and what it produces. Applying it in Practice I began applying BMAD to personal projects first. The early results were different enough from what I had experienced with unstructured AI development that I continued. The artifacts produced during the analysis and planning phases gave the implementation agents real
Page
15
context to work from. The work did not restart with each session. The decisions accumulated rather than dissolved. At my current company, TELUS Digital, I extended that practice to professional projects. The conditions were more demanding: a larger scope, real stakeholders, and production constraints. BMAD held. The method scales because it separates concerns cleanly: analysis is not the same work as planning, planning is not the same work as solutioning, and solutioning is not the same work as implementation. Each phase produces artifacts that the next phase depends on. That chain of dependencies is what makes AI-assisted development reproducible rather than accidental. Working through those projects gave me enough confidence in the method to teach it. This book is the result of that teaching. Who this book is for This book is for developers who are already using AI tools and want to do so more deliberately. It assumes you have worked with a model-native coding tool and encountered its limits. You do not need prior experience with BMAD. You do need a willingness to slow down during the planning phases to move faster and more reliably during implementation. The book is not for readers looking for a comparison of AI coding tools or an introduction to AI- assisted development in general. The focus is narrow and intentional: the BMAD Method, how it works, and how to use it. What this book covers The book follows the structure of the method itself, moving from the core concepts through each phase of development. Chapter 1, Introducing Spec Driven Development and BMAD Method, introduces Spec-Driven Development and the BMAD Method. It covers the core idea behind artifact-driven AI development and explains why it produces different outcomes than unstructured prompting. Chapter 2, Upstream Phase: Analysis, Planning and Solutioning, covers the analysis, planning, and solutioning phases. These are the upstream phases, where the work of defining the product, understanding the domain, and designing the solution happens before any code is written. Each phase has dedicated agents and workflows that guide the process. Chapter 3, Downstream Phase: Implementing and Sprinting, covers the implementation phase. This is where stories are developed, code is written, tests are generated, and progress is tracked. It is where the artifacts from the upstream phases pay off. Preface xiv
Page
16
Chapter 4, Applying BMAD to an Existing Project, addresses working with existing applications. Applying BMAD to a greenfield project is different from applying it to an existing codebase. This chapter covers the specific adaptations the method requires when the starting point is not a blank slate. Chapter 5, Applying BMAD to a New Project, covers working with new applications, from the first brainstorming session through to a working implementation. It follows the recommended flow from end to end, with examples drawn from real project work. Chapter 6, BMAD in Practice: Answers to Real-World Questions, addresses frequently asked questions and real-world scenarios. It covers the situations that do not fit cleanly into the standard flow: scope changes during implementation, working without a complete set of artifacts, integrating BMAD into team environments, and handling the edge cases that any serious use of the method eventually produces. The method is learnable. The process is repeatable. That is the claim this book makes, and each chapter is an attempt to demonstrate it. To get the most out of this book The examples in this book use Cursor as the primary AI-powered IDE. Cursor was chosen because it offers tight integration between the editor and the model, and because it reflects how many developers are currently working with AI tools in practice. If you prefer a different environment, the method translates directly. VS Code, Windsurf, or any other AI-native editor will work. The BMAD artifacts are plain-text files. The agents are prompts. The process does not depend on any particular tool. Software engineering experience is helpful but not required. You will encounter code in the implementation chapters, and familiarity with at least one programming language will help you follow along more closely. That said, the core of what BMAD teaches happens before the code is written: how to define the problem, how to structure the solution, and how to give an AI model the context it needs to do useful work. Those skills transfer regardless of your technical background. Before you start, you will need access to an AI-powered IDE and an active subscription or API key for a capable model, such as Anthropic Claude, OpenAI GPT, or Cursor Composer. The book does not cover model selection in depth, but any model capable of maintaining context and generating code will be sufficient. xv Preface
Page
17
Download the example code files This book includes a complete downloadable code bundle containing all the example projects and files used throughout the chapters. We recommend downloading the bundle so you can follow along smoothly and experiment with the examples. Use the bundle as a practical starting point. Modify it, extend it, and apply what you learn by creating your own variations as you progress through the chapters. Get the code bundle If you bought the book directly from Packt: Go to packtpub.com Click your profile picture and select Your Orders Find this book and click Download Code If you bought this book from Amazon or any other channel partner: Go to packtpub.com/unlock or scan the following QR code: Search for this book Sign up or log in to your free Packt account Upload your proof of purchase and download the code bundle locally Usage note: You're free to use and modify this code for personal learning and non-commercial projects. Download the color images Your purchase includes a color, DRM-free PDF copy of this book, ideal for viewing color images, screenshots, and diagrams. Refer to Free benefits with your book section at the end of the Preface to unlock your PDF copy. Conventions used There are a number of text conventions used throughout this book. 1. 2. 3. 1. 2. 3. 4. Preface xvi
Page
18
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: "Execute the /bmad‑prd command:" Any command-line input or output is written as follows: npx install bmad-method Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: "Select BMAD Agile-Driven from the Modules section." Get in touch Feedback from our readers is always welcome. General feedback: If you have questions about any aspect of this book or have any general feedback, please email us at customercare@packt.com and mention the book's title in the subject of your message. Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you reported this to us. Please visit http://www.packt.com/submit-errata, click Submit Errata, and fill in the form. Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material. If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit http:// authors.packt.com/. Warnings or important notes appear like this. Note Tips and tricks appear like this. Tip xvii Preface
Page
19
Free benefits with your book This book includes free benefits designed to support your learning and help you apply what you learn effectively. Activate them now for instant access (see the How to unlock section for instructions). Here's a quick overview of what you can instantly unlock with your purchase: Preface xviii
Page
20
How to unlock Scan the QR code (or go to packtpub.com/unlock). Search for this book by name, confirm the edition, and then follow the steps on the page. Note: Have your invoice handy. Purchases made directly from the Packt website don't require an invoice. xix Preface