BMAD · SDLC Playbook
A complete step-by-step guide for transforming raw requirements into a production-ready application through 8 AI-orchestrated stages — from product requirements through live deployment verification.
What is BMAD-SDLC?
BMAD-SDLC is an AI-powered full-lifecycle software development orchestration system that lives inside Claude Code. It turns business requirements into deployable software through 8 sequential stages, each run by specialist BMAD agents, enforced by quality auditors, and gated by role-based approvals.
🌱 Greenfield Mode
Start a brand-new project from scratch. System scaffolds the entire codebase, directory structure, and deployment pipeline.
🔄 Brownfield Mode
Analyze an existing codebase first (Stage 0), then layer new features or improvements while preserving existing patterns.
📐 System Architecture
| Layer | Technology | URL / Port |
|---|---|---|
| Frontend | Next.js 14 + React + TypeScript + Tailwind CSS | http://localhost:3000 |
| Backend | NestJS 10 + Node.js | http://localhost:3001/api/v1 |
| Database | PostgreSQL 16 | localhost:5432 |
| Cache | Redis 7 | localhost:6379 |
| Queue | RabbitMQ | localhost:5672 |
Note: Java + Spring Boot is always offered as an alternative to NestJS during intake (Step 4).
Prerequisites
Before You StartC:\Program Files\Python313\python.exe — python-docx 1.2.0 must be installedtools\plantuml.jar; renders diagrams via java -jarRoles & Permissions Matrix
Access ControlSix roles are available. Each stage has a designated approver — only that role can unlock the next stage. The same person cannot provide both L1 and L2 approval on the same stage.
| Stage | Developer | BA | Architect | Tech Lead | Test Lead | PM |
|---|---|---|---|---|---|---|
| 1 · PRD | — | ✅ L1 | — | — | — | — |
| 2 · FRS | — | ✅ L1 | — | — | — | — |
| 3 · User Stories | — | ✅ L1 | — | — | — | — |
| 4 · Design Docs | — | — | ✅ L1 | ✅ L2 | — | — |
| 5 · Code | — | — | ✅ L2 | ✅ L1 | — | — |
| 6 · Unit Tests | — | — | — | — | ✅ L1 | — |
| 7 · CI/CD | — | — | ✅ L1 | — | — | — |
| 8 · Verify | — | — | — | — | ✅ L1 | — |
docs/sdlc/session.md under the stage entry.
Session Startup
Step 0
When you open Claude Code in the dynamic-sdlc project directory, the system auto-starts immediately — no confirmation gate. The startup hook runs silently and the welcome screen appears.
- Open Claude Code in the project directory
~/projects/dynamic-sdlc - The
startup-hook.ps1fires automatically — readsdocs/sdlc/session.mdto detect session state - The SDLC Banner (from
assets/banner.txt) is displayed as the first output - System reads the session file and shows the correct welcome screen
Welcome Screen — Existing Session
docs/sdlc/session.md first — it shows ✅ for truly approved stages, never relying on stale system-prompt memory.
Welcome Screen — No Session (First Run)
If no session file exists, the system skips straight to the 5-step Project Intake sequence.
Project Intake (5 Questions)
Step 1 of Session SetupFor new projects, the system asks exactly 5 sequential questions — one at a time, each in a styled ╔══╗ box. The 5-step intake is mandatory and cannot be skipped. Every question includes numbered answer options, a "✏️ Type my own answer" option, and EXIT.
Question 1 of 5 — Project Name
Question 2 of 5 — Mode
- Greenfield — Brand-new project; full scaffold from scratch
- Brownfield — Existing codebase; system runs Stage 0 (codebase analysis) first
- ✏️ Type my own answer
- TBD
- 🔁 Correct the previous answer (Q2 onward)
Question 3 of 5 — Application Type
7 options including: Web App, Mobile App, API/Microservice, Desktop App, CLI Tool, Data Pipeline, Embedded System
Question 4 of 5 — Language / Framework
Options always include: React + Spring Boot (Java), React + NestJS (Node), Vue + FastAPI (Python), Angular + .NET (C#), Next.js (Full Stack), ✏️ Type my own answer, TBD.
Question 5 of 5 — Requirements Input Method
Exactly 5 numbered options are always shown:
- 📝 Paste requirements as free text now
- 📁 Provide a file path (.txt, .md, .docx)
- 🎤 Provide an MP4 recording path (auto-transcribed via Whisper)
- 📸 Describe from scribble / whiteboard notes
- ⏳ TBD — Move on and add requirements later
After Intake Completes
- System saves
docs/sdlc/session.mdwith project metadata - Role selection prompt is shown (6 role options)
- Main Menu appears with Stage 1 unlocked
Main Menu
Navigation Hub- Stage progress is always displayed as a bordered ASCII table (#·Stage·Status·Artifact columns)
- ✅ = Approved, 🔄 = In Progress, 🔒 = Locked (prerequisite incomplete)
- After every action (save, approve, redo, correct) the main menu re-appears automatically
- For every approved stage, BMAD++ appears as option B in its own section on the menu
Stage 1 — Requirements (PRD)
Product Requirements DocumentRequirements — Product Requirements Document
Transform raw input into a structured PRD via elicitation → generation → audit → approval
Step-by-Step Flow
- Invoke BMAD PM Agent: System calls
Skill: bmad-agent-pm— never executes stage work directly - Elicitation (≤7 questions): PM agent asks focused questions about vision, users, features, constraints — one at a time in ╔══╗ boxes. Total count declared on Q1. Numbered options always shown.
- Vision Discovery: Questions use numbered options (not open-ended text prompts) for scope, user personas, market positioning, and success criteria
- PRD Generation: System calls
Skill: bmad-create-prdwith all gathered context - Enforcer Audit:
agent-s1-prd-enforcerruns automatically — verifies completeness, auto-fixes gaps (verify-s1.md → enhance-s1.md) - Stage Completion Screen: Accuracy %, token utilization (input+output), TBD count displayed — saved to
session.md - Present for Review: Draft shown inside ╔══╗ box — never as plain markdown
- BA Approval: BA enters their full name; role + timestamp recorded in session.md
- Stage 2 Unlocks after approval
Mandatory PRD Sections (100% Standard Required)
- Functional Requirements → Journey Traceability Matrix (FR↔journey mapping)
- Stakeholder Matrix (role, interest, influence, action)
- Acceptance Criteria stubs for each feature
- Regulatory Risk Register (GDPR, PCI-DSS, SOX etc. as applicable)
- Structured Competitive Analysis (not freeform prose)
⚡ BMAD++ Option Available After Generation
After standard PRD is generated, system shows:
A · Approve Standard | B · Generate BMAD++ | R · Revise | M · Menu
BMAD++ is never auto-triggered — only on user picking B. Produces a separate enhanced file. Accuracy score can exceed 100% (target 110%–130%), calibrated to project complexity.
Stage 2 — Functional Requirements (FRS)
Functional Requirements SpecificationFunctional Requirements Specification
Derive detailed feature behaviours and business rules directly from the approved PRD
- Invoke BMAD Analyst Agent: System calls
Skill: bmad-agent-analyst - Direct Generation: Agent reads approved PRD (
01-prd.md) — no elicitation sequence - FRS Content Generated:
- Feature Specification (behaviour per feature from PRD)
- Business Rules catalogue
- Functional Workflow diagrams (textual)
- Data Dictionary (field names, types, constraints, validation)
- Role × Feature Access Matrix
- Integration Contracts (API surface for each external dependency)
- FRS Enforcer Audit:
agent-s2-frs-enforcervalidates FR traceability back to PRD - Stage metrics shown: accuracy %, tokens, TBD count
- BA Review and Approval — name + timestamp saved to session.md
- Stage 3 unlocks
Stage 3 — User Stories & BDD Test Cases
Epics · Stories · Acceptance TestsUser Stories + BDD Business Test Cases
Decompose FRS into Epics → Stories → BDD-style acceptance test scenarios
- Invoke Epic/Story Skill: System calls
Skill: bmad-create-epics-and-stories— reads approved FRS - Stories Generated: All features decomposed into epics and user stories with acceptance criteria
- Invoke ATDD Skill: System calls
Skill: bmad-testarch-atdd— generates BDD scenarios for every story - BDD Format: Given/When/Then style test cases covering happy path, edge cases, and negative scenarios
- Stories Enforcer Audit:
agent-s3-stories-enforcerverifies story coverage and BDD traceability back to FRS - Jira Upload: Approved stories uploaded to Jira via MCP connector (Stage 3 only)
- BA Approval — name + timestamp saved
- Stage 4 unlocks
Stage 4 — Design Documents
HLD · LLD · Enterprise ArchitectureHigh-Level Design · Low-Level Design · Architecture
Three independent design documents with embedded PlantUML diagrams — dual approval required
- Invoke Architect Agent: System calls
Skill: bmad-agent-architect→Skill: bmad-create-architecture - Generate HLD — High-Level Design document
- Generate LLD — Low-Level Design document
- Generate Arch — Enterprise Architecture document
- PlantUML Diagrams rendered —
java -jar tools\plantuml.jar -tpng— embedded in each .docx via add_picture() - Design Enforcer Audit:
agent-s4-design-enforcerreviews all three docs for completeness - Architect L1 Approval — name + timestamp saved
- Tech Lead L2 Approval — name + timestamp saved; Stage 5 unlocks
Document Contents
| Document | Sections | Diagrams (PlantUML) |
|---|---|---|
| HLD | §1 Overview, §2 Flow (Fig 1), §3 Components (Fig 2), §4 Tech Stack, §5 Security, §6 Scalability | Fig 1: Overall Flow (sequence) · Fig 2: Component Architecture (component) |
| LLD | §1 DB Schema, §2 API Contracts, §3 Feature Sequences (one per PRD feature), §4 Error Handling | ERD (class w/ <<entity>>) · One sequence diagram per feature (Figs 3–9) |
| Arch | §1 Enterprise Context, §2 Deployment Zones (Fig 10), §3 Integration Points, §4 Governance | Fig 10: Enterprise Architecture (deployment or component with zones) |
PlantUML Pipeline Rules
.pumlsources saved underdocs/sdlc/diagrams/— text-diffable in git- Rendered to PNG via
java -jar plantuml.jar -tpng {file}.puml - PNG embedded in the correct section of each .docx via
add_picture() - SMETANA layout engine used (no Graphviz dependency needed)
- Close Word files before generating — python-docx will fail if the file is open
- Never use matplotlib, draw.io, or Mermaid — only PlantUML
Stage 5 — Code Creation
Scaffolding · Generation · Review · SecurityCode Creation — Full Application Build
Scaffold → Generate → Senior Review (Phase B) → OWASP Security Audit (Phase C)
- Invoke Dev Agent: System calls
Skill: bmad-agent-dev→Skill: bmad-quick-dev - Greenfield Scaffold: Creates project directory structure, package.json/pom.xml, config files, Docker-free startup scripts
- Phase A — Code Generation (layer order must be respected):
- Configuration & Environment
- Data Layer (models, migrations, repositories)
- Service Layer (business logic)
- API Layer (controllers, routes, DTOs, validators)
- Integration Layer (external APIs, message queues)
- Entry Point & startup wiring
- Phase B — Senior Code Review: Checks correctness, architecture conformance, and operability (logging, error handling, observability)
- Phase C — OWASP Top 10 Security Audit: Maps each vulnerability category (injection, broken auth, XSS, IDOR, etc.) against the generated code; Critical & High findings auto-fixed before proceeding
- Code Enforcer Audit:
agent-s5-code-enforcerreviews for residual issues - Tech Lead L1 Approval
- Architect L2 Approval → Stage 6 unlocks
Stage 6 — Unit Tests
Comprehensive Test SuiteUnit Test Suite — Full Coverage
Generate comprehensive tests matched to the language & framework chosen in intake
- Invoke Test Agent: System calls
Skill: bmad-tea→Skill: bmad-testarch-test-design+bmad-testarch-framework - Framework Selection matches language: Jest (React/Node), JUnit 5 + Mockito (Java/Spring Boot), pytest (Python), Vitest (Vite projects)
- Coverage Targets:
Layer Coverage Target Service Layer 90% line + branch API / Controller Layer 85% Data / Repository Layer 80% - Test Types Generated: Unit tests, integration tests, contract tests, edge case tests, negative path tests
- Tests Enforcer Audit:
agent-s6-tests-enforcervalidates coverage reports - Test Lead Approval → Stage 7 unlocks
Stage 7 — CI/CD Pipeline
Build · Deploy · ReleaseCI/CD Pipeline Configuration
GitHub Actions workflows + deployment to local Apache Tomcat
- Invoke CI Skill: System calls
Skill: bmad-testarch-ci - CI Workflow (ci.yml): Triggered on push/PR — runs lint, unit tests, build, SAST scan
- CD Workflow (cd.yml): Triggered on merge to main — builds artifact, deploys to local Tomcat
- Deployment Runbook generated — step-by-step deployment instructions
- Environment configuration documented — secrets management, env var injection
- CI/CD Enforcer Audit:
agent-s7-cicd-enforcerreviews pipeline configuration - Architect Approval → Stage 8 unlocks
Stage 8 — Verify Application
Smoke Tests · Health Checks · Sign-offApplication Verification & Final Sign-Off
Validate the deployed application end-to-end before final acceptance
- Read Deployment Artifact: System reads
07-cicd.mdto determine deployed app location and start commands - Smoke Test Suite: Invokes
Skill: bmad-agent-devto execute smoke tests against deployed app - Endpoint Verification: All API endpoints from LLD validated (
GET /api/v1/health, auth, core features) - Log Review: No critical errors in application logs
- Performance Baseline: Response time benchmarks captured
- Verify Enforcer Audit:
agent-s8-verify-enforcervalidates the verification report - Test Lead Approval — all 8 stages now complete
• Stage status table (bordered ASCII) with all 8 stages marked ✅
• Frontend:
http://localhost:3000• Backend:
http://localhost:3001/api/v1• Note: The app is NOT auto-started. Type
start app to launch it.
BMAD++ Accuracy Boost
Optional EnhancementBMAD++ is an optional enhancement layer available after every stage. It never auto-triggers. Selecting it generates a superset document that includes all standard content plus additional depth markers.
BMAD++ Rules
- Accuracy score is dynamic and multi-dimensional — calibrated to project type and complexity
- Score can exceed 100% (target range: 110%–130%) — no fixed ceiling, never a fake number
- BMAD++ document is fully self-contained — includes ALL standard content + enhancements; never says "See Standard §X — unchanged"
- Additions marked with
[B++]inline throughout the document - Every BMAD++ doc opens with: (1) full TOC with [B++] markers, (2) Enhancements Summary table
- Both standard and BMAD++ versions saved separately as
*-bmad.mdand*-bmadpp.md - On the Main Menu, BMAD++ remains as option B for every approved stage — never disappears
- Word docs: BMAD++ gets teal banner + green [B++] row tinting in tables
Approval Workflow
3-Step Chain Per StageEvery stage follows the same 3-step approval chain. The chain is sequential — the next step does not start until the current one passes.
Step 1 — Claude Auto-Review
- Stage-specific enforcer agent runs (e.g.,
agent-s1-prd-enforcer) - Checks artifact against quality criteria from
verify-s{n}.md - Auto-fixes issues using
enhance-s{n}.mdinstructions - Only presents to human once APPROVED internally
Step 2 — Human Approval
- System checks logged-in role against designated approver — blocks if mismatch
- For Stages 4 & 5: dual L1+L2 required (two separate named approvers)
- Approver types their full name; role + timestamp recorded in session.md
- Partial artifacts (from early EXIT) can be approved as TBD-gap versions
Step 3 — Post-Approval
- Stage marked complete in session.md
- Next stage unlocked on Main Menu
- Stage 3 only: stories uploaded to Jira via MCP
- Main Menu re-displayed automatically after approval
Redo Any Stage
Non-Destructive Re-RunAny stage can be redone at any time — even after approval. This is always allowed and is never blocked.
- Type
redo {n}(e.g.,redo 2) from the Main Menu or during any stage - System re-runs the stage from the beginning using current session context
- Downstream stages are flagged (⚠ may need re-approval) but not deleted
- Previous artifact files are preserved — new versions appended with a timestamp suffix
- After redo completes, Main Menu is re-displayed
Exit & Save
4 Exit PathsEXIT is available everywhere. It always appears in its own visually distinct ╔══╗ section — never mixed with action options.
| Exit Path | Trigger | Behaviour |
|---|---|---|
| Main Menu | Select option 10 | Confirmation dialog → Save session + all artifacts → Goodbye message |
| During Question | Type exit |
Confirmation → Generate partial artifact (TBD gaps marked) → BA approval prompt → Goodbye |
| During Approval | Type E |
Confirmation → Mark stage as pending-approval in session.md → Goodbye |
| Terminal Close (✕) | Window close / Ctrl+C | close-guard.ps1 intercepts → Native Windows dialog → Auto-save via Stop hook (stop-hook.ps1) |
Keyword Commands
Anywhere in Session| Command | Effect |
|---|---|
| menu | Display the Main Menu from any context |
| status | Show current session state and stage progress table |
| role | Switch your active role (prompts role selection again) |
| redo {n} | Redo stage number N (e.g., redo 3 re-runs Stage 3) |
| start app | Verify all 8 stages complete → read deployment artifact → launch frontend + backend |
| exit | Exit with save (confirmation prompt shown) |
Artifact Reference
All Output Files.md AND .docx. Every filename is prefixed with the project name: {ProjectName}_{artifact}. Example: CreditCard_01-prd.md.
| Stage | Artifact Files | Approver |
|---|---|---|
| 1 · PRD | {Name}_01-prd.md · .docx{Name}_01-prd-bmadpp.md · .docx (optional) |
BA |
| 2 · FRS | {Name}_02-frs.md · .docx |
BA |
| 3 · User Stories | {Name}_03-epics-stories.md · .docx{Name}_03b-business-test-cases.md · .docx |
BA |
| 4 · Design | {Name}_HLD.md · .docx{Name}_LLD.md · .docx{Name}_Arch.md · .docxdocs/sdlc/diagrams/*.puml · *.png |
Arch + Tech Lead |
| 5 · Code | {Name}_05-code-creation.md · .docxsrc/ (all source files) |
Tech Lead + Arch |
| 6 · Unit Tests | {Name}_06-unit-tests.md · .docxtests/unit/ |
Test Lead |
| 7 · CI/CD | {Name}_07-cicd.md · .docx.github/workflows/ci.yml.github/workflows/cd.yml |
Architect |
| 8 · Verify | {Name}_08-verify.md · .docx |
Test Lead |
| Session | docs/sdlc/session.md |
Auto-managed |
Document Quality Standards (All .docx)
- TOC on page 2
- Headers and footers (project name + date + page number)
- Document properties set (title, author, subject)
- Styled tables: navy header row + alternating row shading
- PlantUML diagrams embedded with figure captions
- BMAD++ docs: teal banner on cover + green [B++] row tinting
API Endpoints (Backend)
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /api/v1/auth/login | JWT authentication |
| GET | /api/v1/projects | List all projects |
| POST | /api/v1/projects | Create new project |
| GET | /api/v1/projects/{id} | Project detail + stage status |
| POST | /api/v1/projects/{id}/stages/{n}/start | Start a stage |
| POST | /api/v1/projects/{id}/stages/{n}/submit | Submit for approval |
| POST | /api/v1/stages/{stageId}/approvals | Approve or reject |
| GET | /api/v1/projects/{id}/stream | SSE live event stream |
Default User Logins
| Username | Role |
|---|---|
ba | Business Analyst |
developer | Developer |
architect | Architect |
tech_lead | Tech Lead |
test_lead | Test Lead |
pm | Project Manager |
Quick Reference — Full Pipeline at a Glance
| # | Stage | Primary BMAD Agent | Enforcer | Approver(s) | Key Output |
|---|---|---|---|---|---|
| 1 | PRD | bmad-agent-pmbmad-create-prd |
agent-s1-prd-enforcer |
BA (L1) | Product Requirements Document |
| 2 | FRS | bmad-agent-analyst |
agent-s2-frs-enforcer |
BA (L1) | Functional Requirements Spec |
| 3 | User Stories | bmad-create-epics-and-storiesbmad-testarch-atdd |
agent-s3-stories-enforcer |
BA (L1) | Epics + Stories + BDD Tests |
| 4 | Design | bmad-agent-architectbmad-create-architecture |
agent-s4-design-enforcer |
Arch (L1) + TL (L2) | HLD + LLD + Enterprise Arch |
| 5 | Code | bmad-agent-devbmad-quick-dev |
agent-s5-code-enforcer |
TL (L1) + Arch (L2) | Full application source |
| 6 | Unit Tests | bmad-teabmad-testarch-test-design |
agent-s6-tests-enforcer |
Test Lead (L1) | Test suite (90%/85%/80% coverage) |
| 7 | CI/CD | bmad-testarch-ci |
agent-s7-cicd-enforcer |
Architect (L1) | GitHub Actions + Tomcat deploy |
| 8 | Verify | bmad-agent-dev |
agent-s8-verify-enforcer |
Test Lead (L1) | Verification report |