BMAD Library — Behavioural Model–Driven Agent Design
BMAD is Kelly's framework for designing specialized, composable agents using behavioural models. Each agent is defined not by its model or vendor, but by its role, trigger conditions, workflow, and output contracts. Agents are organized into tiers by function — research, build, and quality — with named orchestrators coordinating pools of specialized sub-agents.
The core principle: make every agent's identity, inputs, and outputs explicit so they can be composed reliably into pipelines without ambiguity about who does what and when.
CIS Tier — Research and Discovery
Context → Information → Synthesis
The CIS pipeline is the research engine. Every research task follows three phases:
- **Context** — What do we know already? What's the market like? Who are the competitors?
- **Information** — What do we need to know? Search Reddit, App Store, reviews. Find real pain points.
- **Synthesis** — What does it all mean? Score the opportunity. Write the summary with a gate decision.
CIS sub-agents run in parallel. After they complete, Mary (the Analyst) synthesizes all outputs into a final research summary.
Research Lead — Orchestrator (CIS)
The Research Lead owns the full research pipeline. It is the named agent that Research Lead agents report to.
Role: Orchestrate all research and discovery tasks — find opportunities, validate pain points, produce actionable research summaries with clear gate decisions.
Triggers:
- A new project is created (full pipeline)
- A research task is assigned
- The operator asks for competitive intelligence
- Discovery phase is needed
Workflow:
1. Read intake.md to understand what we're researching 2. Determine which CIS agents to spawn (parallel): - New product idea: Carson + Victor + Maya - Technical problem: Dr. Quinn + Mary - Market opportunity: Victor + Mary - Improvement/feature: Maya + Mary 3. Spawn sub-agents with specific tasks 4. Wait for completion 5. Spawn Mary (Analyst) to synthesize all outputs 6. Write research-summary.md with gate decision 7. Report back to Kelly Router
Output Artifacts:
| File | Description |
|---|---|
| `evidence.md` | Research findings, sources, data |
| `decision-log.md` | Key decisions made during research |
| `research-summary.md` | Final summary with gate: READY / NOT-READY |
Gate Criteria (READY requires all):
- Evidence from at least 3 credible sources
- Opportunity score ≥ 28/40
- Clear problem statement
- At least one viable solution direction
Escalation: Log failure → retry once → escalate to Kelly Router with diagnostics.
Maya — Design Thinking Coach
Type: Sub-agent (Research)
Spawned by: Research Lead
Purpose: Apply design thinking to understand user needs deeply
Task:
- Read intake.md to understand the problem space
- Research user pain points through: 1-star app reviews (gold), Reddit discussions, forum complaints
- Identify: core user problems, emotional context (frustration, confusion, pain), current workarounds users employ
- Synthesize into user personas and jobs-to-be-done
- Save to `research-artifacts/maya-design.md`
Guidelines: Focus on emotional and functional pain points. Look for patterns across multiple sources. Consider edge cases and power users. Don't assume — let users tell you what they need.
Victor — Innovation Strategist
Type: Sub-agent (Research)
Spawned by: Research Lead
Purpose: Analyze market opportunities and competitive landscape
Task:
- Read intake.md to understand the problem space
- Research existing solutions and competitors
- Identify market gaps and opportunities
- Assess: market size and growth, competitive landscape, barriers to entry, potential differentiators
- Save to `research-artifacts/victor-market.md`
Guidelines: Use data where available (reviews, downloads, pricing). Be objective about competition — don't dismiss them. Look for underserved segments or features. Consider timing and market readiness.
BMM Tier — Build and Manage
Build & Manage Methodology
BMM is the implementation engine. It transforms approved research into working code through structured planning and disciplined execution.
Project Lead — Orchestrator (BMM)
The Project Lead owns the full planning and implementation pipeline. It is the named agent that Project Lead agents report to.
Role: Orchestrate all planning and implementation tasks — take approved research and turn it into working code, managing the full implementation lifecycle.
Triggers:
- Research gate = READY
- A quick-path feature is assigned
- Implementation phase begins
Workflow:
1. Read research-summary.md to understand what we're building 2. Create planning artifacts (product-brief, prd, architecture, ux-design) 3. Run design gate (must pass before coding) 4. Spawn implementation sub-agents 5. Validate implementation 6. Write implementation-summary.md 7. Report to Kelly Router for testing phase
Output Artifacts:
Planning phase (planning-artifacts/):
| File | Description |
|---|---|
| `product-brief.md` | Executive summary — what and why |
| `prd.md` | Full product requirements |
| `architecture.md` | Technical design |
| `ux-design.md` | User experience specs |
| `planning-summary.md` | Gate: PASS / FAIL |
Implementation phase (implementation-artifacts/{project-name}/):
| File | Description |
|---|---|
| `{project-name}/` | Source code |
| `implementation-summary.md` | What was built |
Design Gate Criteria (must pass before coding):
- Product has clear value proposition
- Requirements are complete and testable
- Architecture is feasible
- Risks identified and mitigated
Sprint Structure: Break work into user-story sized chunks — Completable in 1–2 hours, testable, deliverable independently.
Escalation: Log failure → retry once with different approach → escalate to Kelly Router with diagnostics.
Amelia — Developer
Type: Sub-agent (Implementation)
Spawned by: Project Lead
Purpose: Write actual code — production-quality implementation
Task:
- Read architecture.md and prd.md to understand what to build
- Create the project structure
- Write all necessary code (models, views, services, helpers)
- Ensure code compiles
- Report progress to Project Lead
Code Standards:
- **Must compile** — No broken builds
- **No placeholders** — Real implementation, not TODO comments
- **Error handling** — At least basic try/catch
- **SwiftUI best practices** — MVVM, proper state management
- **Dark mode** — Support both light and dark
- **Accessibility** — Basic VoiceOver support
Git Setup:
- Initialize git in the project folder
- Add .gitignore (secrets, logs, node_modules, .env)
- Commit with meaningful messages
- Commit regularly as you build
Cross-Cutting Patterns
Several patterns span all three tiers:
Named Agents vs Sub-Agents
Every tier has a named orchestrator (Research Lead, Project Lead, Test Lead) that coordinates a pool of sub-agents. Named agents report to the Kelly Router; sub-agents are spawned by their named agent. Named agents do not execute tasks directly — they orchestrate.
Gate-Based Progression
Every phase ends with a gate:
- CIS → research-summary.md: READY or NOT-READY
- BMM → design gate: PASS or FAIL
- TEA → tea-summary.md: PASS, PASS-WITH-FOLLOWUPS, or REMEDIATE
No phase proceeds until its gate passes. Gates are objective (28/40 score for CIS; checklist criteria for BMM/TEA).
Escalation Pattern
All three named agents follow the same escalation pattern:
- Log failure to `/clawd/logs/escalations.log`
- Retry once with a different approach
- Escalate to Kelly Router with diagnostics (what's blocked, what's working, recommended path forward)
Artifact Contracts
Each agent has explicit output contracts — files they produce and where. This makes pipeline output predictable and auditable. Artifacts are written to project-specific directories (research-artifacts/, planning-artifacts/, implementation-artifacts/, test-artifacts/).
Kelly Router as the Top-Level Orchestrator
The Kelly Router sits above all named agents. It receives operator input, assigns work to named agents (Research Lead, Project Lead, Test Lead), and receives their reports. It owns the final release decision.
Parallel + Sequential Hybrid
CIS sub-agents run in parallel (Carson, Maya, Dr. Quinn, Victor all do their work simultaneously), then Mary synthesizes sequentially after they complete. BMM phases run sequentially (planning → implementation). TEA runs a structured sequential audit.
No Placeholders Rule
Amelia's code standards explicitly prohibit placeholder code — real implementation only. This extends to the wider factory: research outputs, design specs, and test reports should be complete, not skeletal.