BMad document templates are defined in YAML format to drive interactive document generation and agent interaction. Templates separate structure definition from content generation, making them both human and LLM-agent-friendly.
template:
id: template-identifier
name: Human Readable Template Name
version: 1.0
output:
format: markdown
filename: default-path/to/{{filename}}.md
title: '{{variable}} Document Title'
workflow:
mode: interactive
elicitation: advanced-elicitation
sections:
- id: section-id
title: Section Title
instruction: |
Detailed instructions for the LLM on how to handle this section
# ... additional section properties
Use {{variable_name}} in titles, templates, and content:
title: 'Epic {{epic_number}} {{epic_title}}'
template: 'As a {{user_type}}, I want {{action}}, so that {{benefit}}.'
- id: ui-section
title: User Interface Design
condition: Project has UX/UI Requirements
instruction: Only include if project has UI components
choices:
architecture: [Monolith, Microservices, Serverless]
testing: [Unit Only, Unit + Integration, Full Pyramid]
- id: system-architecture
title: System Architecture Diagram
type: mermaid
instruction: Create a system architecture diagram showing key components and data flow
mermaid_type: flowchart
details: |
Show the following components:
- User interface layer
- API gateway
- Core services
- Database layer
- External integrations
Supported mermaid_type values:
Core Diagram Types:
flowchart - Flow charts and process diagramssequenceDiagram - Sequence diagrams for interactionsclassDiagram - Class relationship diagrams (UML)stateDiagram - State transition diagramserDiagram - Entity relationship diagramsgantt - Gantt charts for timelinespie - Pie charts for data visualizationAdvanced Diagram Types:
journey - User journey mapsmindmap - Mindmaps for brainstormingtimeline - Timeline diagrams for chronological eventsquadrantChart - Quadrant charts for data categorizationxyChart - XY charts (bar charts, line charts)sankey - Sankey diagrams for flow visualizationSpecialized Types:
c4Context - C4 context diagrams (experimental)requirement - Requirement diagramspacket - Network packet diagramsblock - Block diagramskanban - Kanban boards- id: story-details
title: Story
owner: scrum-master
editors: [scrum-master]
readonly: false
sections:
- id: dev-notes
title: Dev Notes
owner: dev-agent
editors: [dev-agent]
readonly: false
instruction: Implementation notes and technical details
- id: qa-results
title: QA Results
owner: qa-agent
editors: [qa-agent]
readonly: true
instruction: Quality assurance test results
- id: epic-details
title: Epic {{epic_number}} {{epic_title}}
repeatable: true
sections:
- id: story
title: Story {{epic_number}}.{{story_number}} {{story_title}}
repeatable: true
sections:
- id: criteria
title: Acceptance Criteria
type: numbered-list
item_template: '{{criterion_number}}: {{criteria}}'
repeatable: true
examples:
- 'FR6: The system must authenticate users within 2 seconds'
- |
```mermaid
sequenceDiagram
participant User
participant API
participant DB
User->>API: POST /login
API->>DB: Validate credentials
DB-->>API: User data
API-->>User: JWT token
```
- |
**Architecture Decision Record**
**Decision**: Use PostgreSQL for primary database
**Rationale**: ACID compliance and JSON support needed
**Consequences**: Requires database management expertise
Templates define the complete document structure starting with the first H2 - each level in is the next H#:
sections:
- id: overview
title: Project Overview
sections:
- id: goals
title: Goals
- id: scope
title: Scope
sections:
- id: in-scope
title: In Scope
- id: out-scope
title: Out of Scope
Templates should be validated for:
When converting from markdown+frontmatter templates:
[[LLM:]] instructions to instruction fields<<REPEAT>> blocks to repeatable: true sections^^CONDITIONS^^ to condition fields@{examples} to examples arrays{{placeholders}} to proper variable syntaxThis specification ensures templates are both human-readable and machine-processable while maintaining the flexibility needed for complex document generation.