Skip to content
πŸ€– AI-optimized docs: llms-full.txt

Understanding Module Building

Building a BMad module happens in distinct phases. Understanding this separation prevents confusion and ensures you know what happens when.

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:#c8e6c9

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.yaml files yet
  • No actual workflow .md files yet
  • No implementation details

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 checklist

What 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

What happens: You use specialized workflows to build each component:

ComponentBuilderWorkflow
AgentsBondbmad:bmb:agents:agent-builder
WorkflowsWendybmad:bmb:workflows:workflow-builder

What gets created here:

  • Full agent .agent.yaml files with complete personas, prompts, menus
  • Full workflow .md files with detailed step files
  • Sidecar memory structures
  • Actual functionality

Let’s trace a complete module build from idea to implementation.

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)

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.md

What the SPEC files contain:

budget-specialist.agent.yaml (spec):

# SPEC FILE - NOT READY FOR USE
agent:
metadata:
name: "Penny"
title: "Budget Specialist"
# TODO: Define persona, prompts, menu

budget-workshop/workflow.md (spec):

# Budget Workshop
**Goal:** TODO β€” Create comprehensive wedding budget
**Your Role:** TODO β€” Budget guide
## WORKFLOW ARCHITECTURE
TODO - Not implemented yet

Now you build each component using specialists.

For the Budget Specialist:

bmad:bmb:agents:agent-builder

Bond 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.

For the Budget Workshop:

bmad:bmb:workflows:workflow-builder

Wendy 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.md

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 checked
BenefitExplanation
SpecializationEach builder optimizes for their domain β€” agents, workflows, or modules
IncrementalBuild one component at a time, test as you go
ReusabilityAgents and workflows can be reused across modules
ClarityPlanning before building prevents scope creep
QualityEach component gets expert attention
ConfusionReality
”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
  • Phase 1: Planning

    • Run [PB] to create module brief
    • Define all agents needed
    • Define all workflows needed
    • Map user journey and scenarios
  • Phase 2: Scaffolding

    • Run [CM] to create module structure
    • Review generated module.yaml
    • Review generated module-help.csv
    • Check spec files match your vision
  • Phase 3: Implementation

    • For each agent: Run agent-builder with Bond
    • For each workflow: Run workflow-builder with Wendy
    • Test each component independently
    • Run [VM] to validate complete module
ResourceDescription
Create Your First ModuleHands-on tutorial
Discover Your Module IdeaFinding the right idea
What Are ModulesModule concepts
Agent or Module Decision GuideWhat to build