BMAD Orchestrator
Orchestrate the 4-phase BMAD Method (Breakthrough Method of Agile AI Driven Development) across OpenClaw ↔ Claude Code.
Architecture
- - Phases 1-3 (Interactive): Run through OpenClaw chat with the user. You facilitate brainstorming, refine the PRD, debate architecture. The user's ideas matter most here.
- Party Mode: At key decision points, suggest running party mode on Claude Code — multiple BMAD agents debate the topic and produce richer output.
- Phase 4 (Automated): Delegate to Claude Code via tmux on the dev VM. Monitor progress, report back.
Prerequisites
- - Claude Code installed on dev VM (accessible via SSH)
- BMAD framework installed in the project (
_bmad/ directory with agents, workflows, commands) - tmux available on the dev VM
State Tracking
Track workflow state in _bmad-output/orchestrator-state.yaml:
CODEBLOCK0
Phase 1: Analysis (Interactive with User)
1.1 Brainstorming (bmad-brainstorming)
Run this conversationally with the user in OpenClaw chat:
- 1. Ask: "What project are we building? Give me the elevator pitch."
- Explore the problem space — ask about users, pain points, existing solutions
- Challenge assumptions — play devil's advocate
- Suggest Party Mode: "Want me to run party mode on Claude Code? The BMAD agents (analyst, architect, PM, dev) will debate your idea and surface things we might miss."
- If party mode → send
/bmad-brainstorming to Claude Code, capture output, share highlights - Synthesize into key decisions and themes
- Produce: INLINECODE4
1.2 Research (bmad-bmm-research) — Optional
If the project needs market/technical/domain validation:
- 1. Discuss with user what needs validation
- Send research workflow to Claude Code for heavy lifting
- Review findings together
1.3 Product Brief (bmad-bmm-create-product-brief)
- 1. Start from brainstorming output
- Walk through with user: vision, target users, success metrics, scope
- Suggest Party Mode: "The PM and analyst agents can stress-test this brief. Run it?"
- If party mode → send command, capture debate highlights
- Iterate until user approves
- Produce: INLINECODE7
Phase 2: Planning (Interactive with User)
2.1 PRD (bmad-bmm-create-prd)
- 1. Load product brief as context
- Walk through requirements with user section by section:
- Functional requirements (FRs)
- Non-functional requirements (NFRs)
- User journeys
- Success metrics
- 3. Suggest Party Mode: "PM + architect + QA can review these requirements together. Good time to catch gaps."
- If party mode → send command, share findings
- Iterate until user signs off
- Produce: INLINECODE9
2.2 UX Design (bmad-bmm-create-ux-design) — If applicable
Only for projects with UI. Skip for backend/infrastructure tools.
Phase 3: Solutioning (Interactive with User)
3.1 Architecture (bmad-bmm-create-architecture)
- 1. Load PRD as context
- Discuss technical decisions with user:
- Language/framework choices
- Deployment model
- Key patterns and trade-offs
- ADRs (Architecture Decision Records)
- 3. Suggest Party Mode: "Architect + dev + QA debating the architecture will surface implementation risks early."
- If party mode → send command, share the debate
- Iterate with user
- Produce:
architecture.md with ADRs
3.2 Epics & Stories (bmad-bmm-create-epics-and-stories)
- 1. Load architecture + PRD
- Present epic breakdown to user for review
- Discuss story sizing, priorities, dependencies
- Produce:
epics.md with stories
3.3 Readiness Check (bmad-bmm-check-implementation-readiness)
- 1. Send to Claude Code for automated gate check
- Share result: PASS / CONCERNS / FAIL
- If CONCERNS/FAIL → discuss with user, fix gaps
- Produce: readiness report
3.4 Project Context (bmad-bmm-generate-project-context)
- 1. Send to Claude Code after architecture is finalized
- Review output with user
- Produce: INLINECODE17
Phase 4: Implementation (Automated via Claude Code)
4.0 Setup
See references/tmux-setup.md for tmux session initialization.
4.1 Sprint Planning
Send to Claude Code:
/bmad-bmm-sprint-planning
Capture and save
sprint-status.yaml.
4.2 Story Loop (per epic)
For each epic, for each story:
- 1. Create Story: Send
/bmad-bmm-create-story → produces INLINECODE20 - Dev Story: Send
/bmad-bmm-dev-story → implements code + tests - Code Review: Send
/bmad-bmm-code-review → validates quality - If review fails → send fixes back, re-review
- Update sprint status
- Commit after each story
4.3 Epic Completion
After all stories in an epic:
- 1. Send
/bmad-bmm-retrospective for lessons learned - Optionally run
/bmad-bmm-automate for E2E test generation - Commit and update sprint status
4.4 Monitoring
Set up a cron job to monitor Claude Code progress every 15 minutes.
Report status updates to user via chat.
Party Mode Integration
Party mode simulates a multi-agent discussion in Claude Code. Use it at these moments:
| When | Why | Command |
|---|
| After brainstorming | Surface blind spots | INLINECODE25 with brainstorming context |
| After product brief |
Stress-test the vision |
/bmad-party-mode with brief |
| During PRD review | Catch requirement gaps |
/bmad-party-mode with PRD draft |
| Architecture decisions | Debate trade-offs |
/bmad-party-mode with architecture |
To trigger party mode on Claude Code:
tmux send-keys -l -- "/bmad-party-mode" && sleep 0.3 && tmux send-keys Enter
Capture output, extract key insights, present to user.
Claude Code Commands Reference
See references/bmad-commands.md for the full command list.
Quick Flow (Skip Phases 1-3)
For small, well-understood work:
- 1.
/bmad-bmm-quick-spec → tech-spec.md - INLINECODE30 → implementation
Only use when user explicitly says the project is simple and well-understood.
Sending Commands to Claude Code
See references/tmux-setup.md for the tmux interaction patterns.
Key rules:
- - Split text and Enter with a delay (Claude Code TUI timing)
- Use
capture-pane -S -200 to read output - Wait for idle prompt before sending next command
- Use
C-c to interrupt if stuck
BMAD Orchestrator
在OpenClaw ↔ Claude Code之间编排四阶段BMAD方法(敏捷AI驱动开发的突破性方法)。
架构
- - 阶段1-3(交互式):通过OpenClaw聊天与用户共同推进。你负责引导头脑风暴、完善PRD、讨论架构。用户的意见在此阶段最为重要。
- 派对模式:在关键决策点,建议在Claude Code上运行派对模式——多个BMAD智能体就主题进行辩论,产生更丰富的输出。
- 阶段4(自动化):通过开发虚拟机上的tmux委托给Claude Code。监控进度并汇报。
前置条件
- - 在开发虚拟机上安装Claude Code(可通过SSH访问)
- 在项目中安装BMAD框架(_bmad/目录包含智能体、工作流、命令)
- 开发虚拟机上可用tmux
状态追踪
在_bmad-output/orchestrator-state.yaml中追踪工作流状态:
yaml
project: <名称>
vm_host:
vm_user: <用户名>
project_path: <路径>
tmux_socket: /tmp/openclaw-tmux-sockets/openclaw.sock
tmux_session: bmad-<项目>
current_phase: 1|2|3|4
current_workflow: <工作流名称>
artifacts:
brainstorming_report: null|路径
product_brief: null|路径
prd: null|路径
ux_spec: null|路径
architecture: null|路径
epics: null|路径
sprint_status: null|路径
project_context: null|路径
阶段1:分析(与用户交互)
1.1 头脑风暴(bmad-brainstorming)
在OpenClaw聊天中与用户对话式进行:
- 1. 提问:我们要构建什么项目?请给我电梯演讲。
- 探索问题空间——询问用户、痛点、现有解决方案
- 挑战假设——扮演唱反调的角色
- 建议派对模式:想让我在Claude Code上运行派对模式吗?BMAD智能体(分析师、架构师、项目经理、开发者)将辩论你的想法,发现我们可能忽略的问题。
- 如果选择派对模式 → 向Claude Code发送/bmad-brainstorming,捕获输出,分享要点
- 综合成关键决策和主题
- 产出:brainstorming-report.md
1.2 研究(bmad-bmm-research)——可选
如果项目需要市场/技术/领域验证:
- 1. 与用户讨论需要验证的内容
- 将研究工作流发送给Claude Code处理繁重任务
- 一起审查发现
1.3 产品简介(bmad-bmm-create-product-brief)
- 1. 从头脑风暴输出开始
- 与用户逐项讨论:愿景、目标用户、成功指标、范围
- 建议派对模式:项目经理和分析师智能体可以对这个简介进行压力测试。要运行吗?
- 如果选择派对模式 → 发送命令,捕获辩论要点
- 迭代直到用户批准
- 产出:product-brief.md
阶段2:规划(与用户交互)
2.1 PRD(bmad-bmm-create-prd)
- 1. 加载产品简介作为上下文
- 与用户逐节讨论需求:
- 功能需求(FRs)
- 非功能需求(NFRs)
- 用户旅程
- 成功指标
- 3. 建议派对模式:项目经理+架构师+QA可以一起审查这些需求。是发现差距的好时机。
- 如果选择派对模式 → 发送命令,分享发现
- 迭代直到用户确认
- 产出:prd.md
2.2 UX设计(bmad-bmm-create-ux-design)——如适用
仅适用于有UI的项目。后端/基础设施工具跳过。
阶段3:方案设计(与用户交互)
3.1 架构(bmad-bmm-create-architecture)
- 1. 加载PRD作为上下文
- 与用户讨论技术决策:
- 语言/框架选择
- 部署模型
- 关键模式和权衡
- ADR(架构决策记录)
- 3. 建议派对模式:架构师+开发者+QA讨论架构将提前发现实施风险。
- 如果选择派对模式 → 发送命令,分享辩论内容
- 与用户迭代
- 产出:包含ADR的architecture.md
3.2 史诗与故事(bmad-bmm-create-epics-and-stories)
- 1. 加载架构+PRD
- 向用户展示史诗分解供审查
- 讨论故事规模、优先级、依赖关系
- 产出:包含故事的epics.md
3.3 就绪检查(bmad-bmm-check-implementation-readiness)
- 1. 发送给Claude Code进行自动关卡检查
- 分享结果:通过 / 关注 / 失败
- 如果关注/失败 → 与用户讨论,修复差距
- 产出:就绪报告
3.4 项目上下文(bmad-bmm-generate-project-context)
- 1. 架构确定后发送给Claude Code
- 与用户一起审查输出
- 产出:project-context.md
阶段4:实施(通过Claude Code自动化)
4.0 设置
参见references/tmux-setup.md了解tmux会话初始化。
4.1 冲刺规划
发送给Claude Code:
/bmad-bmm-sprint-planning
捕获并保存sprint-status.yaml。
4.2 故事循环(按史诗)
对于每个史诗,对于每个故事:
- 1. 创建故事:发送/bmad-bmm-create-story → 产出story-[slug].md
- 开发故事:发送/bmad-bmm-dev-story → 实现代码+测试
- 代码审查:发送/bmad-bmm-code-review → 验证质量
- 如果审查失败 → 发送修复,重新审查
- 更新冲刺状态
- 每个故事后提交
4.3 史诗完成
史诗中所有故事完成后:
- 1. 发送/bmad-bmm-retrospective获取经验教训
- 可选运行/bmad-bmm-automate生成端到端测试
- 提交并更新冲刺状态
4.4 监控
设置cron作业每15分钟监控Claude Code进度。
通过聊天向用户报告状态更新。
派对模式集成
派对模式模拟Claude Code中的多智能体讨论。在以下时刻使用:
| 何时 | 原因 | 命令 |
|---|
| 头脑风暴后 | 发现盲点 | /bmad-party-mode 附带头脑风暴上下文 |
| 产品简介后 |
压力测试愿景 | /bmad-party-mode 附带简介 |
| PRD审查期间 | 发现需求差距 | /bmad-party-mode 附带PRD草稿 |
| 架构决策时 | 讨论权衡 | /bmad-party-mode 附带架构 |
在Claude Code上触发派对模式:
bash
tmux send-keys -l -- /bmad-party-mode && sleep 0.3 && tmux send-keys Enter
捕获输出,提取关键见解,呈现给用户。
Claude Code命令参考
参见references/bmad-commands.md获取完整命令列表。
快速流程(跳过阶段1-3)
对于小型、理解充分的工作:
- 1. /bmad-bmm-quick-spec → tech-spec.md
- /bmad-bmm-quick-dev → 实施
仅在用户明确说明项目简单且理解充分时使用。
向Claude Code发送命令
参见references/tmux-setup.md了解tmux交互模式。
关键规则:
- - 文本和回车之间添加延迟(Claude Code TUI时序)
- 使用capture-pane -S -200读取输出
- 等待空闲提示后再发送下一个命令
- 卡住时使用C-c中断