Understanding Module Building
Building a BMad module happens in distinct phases. Understanding this separation prevents confusion and ensures you know what happens when.
The Three Phases of Module Creation
Section titled βThe Three Phases of Module Creationβflowchart TD A[Module Building Workflow] --> B[Phase 1: Planning] B --> C[Module Brief Created] C --> D[Phase 2: Scaffolding] D --> E[Module Structure Created] E --> F[Phase 3: Implementation] F --> G[Agents Built Separately] F --> H[Workflows Built Separately] G --> I[Complete Module] H --> I
style A fill:#e1f5fe style B fill:#fff9c4 style D fill:#f3e5f5 style F fill:#e8f5e9 style I fill:#c8e6c9Phase 1: Planning (The Brief)
Section titled βPhase 1: Planning (The Brief)βWhat happens: You work with Morgan (the module-builder agent) to create a module brief β a vision document that defines your moduleβs purpose, audience, agents, and workflows.
What gets created:
module-brief-{code}.mdβ A detailed vision document- Clear definitions of what agents you need
- Clear definitions of what workflows you need
- Scenarios describing how users will interact with your module
What does NOT get created:
- No actual agent
.agent.yamlfiles yet - No actual workflow
.mdfiles yet - No implementation details
Phase 2: Scaffolding (The Structure)
Section titled βPhase 2: Scaffolding (The Structure)βWhat happens: Morgan reads your module brief and creates the module structure β all the files, folders, and configuration needed for a working module.
What gets created:
your-module/βββ src/β βββ module.yaml # Module metadata and configβ βββ module-help.csv # Feature registry (optional but powerful)β βββ agents/ # Agent directoryβ β βββ your-agent.agent.yaml # Agent SPEC files (stubs)β βββ workflows/ # Workflow directoryβ β βββ your-workflow/ # Workflow SPEC files (stubs)β β βββ workflow.mdβββ README.md # Documentation templateβββ TODO.md # Implementation checklistWhat these SPEC files contain:
- Agent specs β Persona definitions (name, role, voice) as references for workflows
- Workflow specs β Outline of steps, goals, structure (not finished workflows)
What does NOT get created:
- No fully implemented agent prompts
- No detailed workflow step files
- No sidecar memory structures
- No actual functionality
Phase 3: Implementation (The Building)
Section titled βPhase 3: Implementation (The Building)βWhat happens: You use specialized workflows to build each component:
| Component | Builder | Workflow |
|---|---|---|
| Agents | Bond | bmad:bmb:agents:agent-builder |
| Workflows | Wendy | bmad:bmb:workflows:workflow-builder |
What gets created here:
- Full agent
.agent.yamlfiles with complete personas, prompts, menus - Full workflow
.mdfiles with detailed step files - Sidecar memory structures
- Actual functionality
Complete Example: Building a Wedding Planner Module
Section titled βComplete Example: Building a Wedding Planner ModuleβLetβs trace a complete module build from idea to implementation.
Phase 1: Planning β The Brief
Section titled βPhase 1: Planning β The BriefβYou run [PB] (product brief) with Morgan:
[PB]Morgan asks:
- What problem are you solving? βPlanning a wedding is overwhelming β couples forget tasks, blow budgets, and stress over detailsβ
- Who is this for? βEngaged couples with busy livesβ
- What agents would help? βA budget tracker, a vendor coordinator, a timeline managerβ
- What workflows would help? βBudget planning, vendor checklist, day-of timelineβ
Result: module-brief-wedding.md β a 20-page vision document with:
- Three agent definitions (Budget Specialist, Vendor Coordinator, Timeline Manager)
- Three workflow definitions (Budget Workshop, Vendor Vetting, Day-Of Schedule)
- User scenarios and journey mapping
- Creative direction (calm, organized, reassuring tone)
Phase 2: Scaffolding β The Structure
Section titled βPhase 2: Scaffolding β The StructureβYou run [CM] (create module) with Morgan:
[CM]Morgan reads your brief and creates:
wedding-planner/βββ src/β βββ module.yamlβ βββ module-help.csvβ βββ agents/β β βββ budget-specialist.agent.yaml # SPECβ β βββ vendor-coordinator.agent.yaml # SPECβ β βββ timeline-manager.agent.yaml # SPECβ βββ workflows/β β βββ budget-workshop/β β β βββ workflow.md # SPECβ β βββ vendor-vetting/β β β βββ workflow.md # SPECβ β βββ day-of-schedule/β β βββ workflow.md # SPECβββ README.mdβββ TODO.mdWhat the SPEC files contain:
budget-specialist.agent.yaml (spec):
# SPEC FILE - NOT READY FOR USEagent: metadata: name: "Penny" title: "Budget Specialist" # TODO: Define persona, prompts, menubudget-workshop/workflow.md (spec):
# Budget Workshop
**Goal:** TODO β Create comprehensive wedding budget
**Your Role:** TODO β Budget guide
## WORKFLOW ARCHITECTURETODO - Not implemented yetPhase 3: Implementation β Building Components
Section titled βPhase 3: Implementation β Building ComponentsβNow you build each component using specialists.
Building an Agent (Bond)
Section titled βBuilding an Agent (Bond)βFor the Budget Specialist:
bmad:bmb:agents:agent-builderBond walks you through:
- Persona development (Pennyβs personality, expertise, communication style)
- Prompt architecture (financial analysis, budget categories, vendor negotiation tips)
- Menu design (quick actions, deep dives, reporting)
- Memory structure (what Penny remembers about your budget)
Bond replaces the spec with a complete .agent.yaml file.
Building a Workflow (Wendy)
Section titled βBuilding a Workflow (Wendy)βFor the Budget Workshop:
bmad:bmb:workflows:workflow-builderWendy walks you through:
- Step architecture (assessment β categorization β allocation β contingency)
- Progressive disclosure (donβt overwhelm with everything at once)
- Decision points (when to revisit, when to adjust)
- Output design (budget spreadsheet format)
Wendy creates a complete workflow with step files:
budget-workshop/βββ workflow.mdβββ steps/β βββ step-01-assess.mdβ βββ step-02-categorize.mdβ βββ step-03-allocate.mdβ βββ step-04-contingency.mdFinal Result
Section titled βFinal ResultβAfter Phase 3, your module is complete and functional:
wedding-planner/βββ src/β βββ module.yaml # β
Completeβ βββ module-help.csv # β
Complete (optional but powerful)β βββ agents/β β βββ budget-specialist.agent.yaml # β
Built by Bondβ β βββ vendor-coordinator.agent.yaml # β
Built by Bondβ β βββ timeline-manager.agent.yaml # β
Built by Bondβ βββ workflows/β β βββ budget-workshop/ # β
Built by Wendyβ β βββ vendor-vetting/ # β
Built by Wendyβ β βββ day-of-schedule/ # β
Built by Wendyβββ README.md # β
Completeβββ TODO.md # β
All items checkedWhy This Architecture Works
Section titled βWhy This Architecture Worksβ| Benefit | Explanation |
|---|---|
| Specialization | Each builder optimizes for their domain β agents, workflows, or modules |
| Incremental | Build one component at a time, test as you go |
| Reusability | Agents and workflows can be reused across modules |
| Clarity | Planning before building prevents scope creep |
| Quality | Each component gets expert attention |
Common Confusions
Section titled βCommon Confusionsβ| Confusion | Reality |
|---|---|
| βThe module builder creates agentsβ | Morgan creates agent specs β Bond builds actual agents |
| βI should write agent prompts in the briefβ | No β brief defines WHAT, not HOW. Prompts come later |
| βThe module is done after scaffoldingβ | No β scaffolding creates structure, not content |
| βI need to do everything at onceβ | No β build incrementally, one component at a time |
Your Module Building Checklist
Section titled βYour Module Building Checklistβ-
Phase 1: Planning
- Run
[PB]to create module brief - Define all agents needed
- Define all workflows needed
- Map user journey and scenarios
- Run
-
Phase 2: Scaffolding
- Run
[CM]to create module structure - Review generated
module.yaml - Review generated
module-help.csv - Check spec files match your vision
- Run
-
Phase 3: Implementation
- For each agent: Run
agent-builderwith Bond - For each workflow: Run
workflow-builderwith Wendy - Test each component independently
- Run
[VM]to validate complete module
- For each agent: Run
Resources
Section titled βResourcesβ| Resource | Description |
|---|---|
| Create Your First Module | Hands-on tutorial |
| Discover Your Module Idea | Finding the right idea |
| What Are Modules | Module concepts |
| Agent or Module Decision Guide | What to build |