bmad-epic-pipeline-worktree
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBMAD Epic Pipeline (Worktree Edition)
BMAD Epic Pipeline(Worktree版)
Deliver all incomplete user stories in Epic using configurable pipeline, each story developed in isolated worktree and merged only after tests pass.
{ARGUMENT}使用可配置流水线交付Epic 中所有未完成的用户故事,每个故事都在隔离的worktree中开发,仅在测试通过后才合并。
{ARGUMENT}Pre-step: Determine Epic Number
前置步骤:确定Epic编号
If no epic number is provided ( is empty):
{ARGUMENT}- Read (or
_bmad-output/implementation-artifacts/sprint-status.yaml)docs/sprint/sprint-status.yaml - Find all stories with status not (format:
done)X-Y-story-name - Extract Epic numbers X from these stories
- Select the smallest Epic number as
{ARGUMENT} - Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Auto-selected Epic: {ARGUMENT} (has incomplete stories)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Example:
- Status file has ,
3-2-llm-prompt-template: backlog,3-3-xxx: in-progress4-1-xxx: done - Incomplete Epics: 3
- Auto-select Epic: 3
如果未提供epic编号(为空):
{ARGUMENT}- 读取(或
_bmad-output/implementation-artifacts/sprint-status.yaml)docs/sprint/sprint-status.yaml - 找出所有状态不为的故事(格式:
done)X-Y-story-name - 从这些故事中提取Epic编号X
- 选择最小的Epic编号作为
{ARGUMENT} - 输出:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Auto-selected Epic: {ARGUMENT} (has incomplete stories)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━示例:
- 状态文件包含、
3-2-llm-prompt-template: backlog、3-3-xxx: in-progress4-1-xxx: done - 未完成的Epic:3
- 自动选择的Epic:3
Difference from bmad-epic-worktree
与bmad-epic-worktree的区别
| Feature | bmad-epic-worktree | bmad-epic-pipeline-worktree |
|---|---|---|
| Story delivery | bmad-story-worktree | bmad-story-pipeline-worktree |
| Workflow config | Fixed 8-step flow | Configurable via workflow-steps.md |
| Customization | Limited | Full pipeline customization |
| Safety level | High | High |
| 功能 | bmad-epic-worktree | bmad-epic-pipeline-worktree |
|---|---|---|
| 故事交付 | bmad-story-worktree | bmad-story-pipeline-worktree |
| 工作流配置 | 固定8步流程 | 可通过workflow-steps.md配置 |
| 自定义能力 | 有限 | 全流水线自定义 |
| 安全级别 | 高 | 高 |
Execution Strategy
执行策略
- Read all incomplete stories under the Epic
- Sort by Story number ascending
- Execute for each story sequentially
/bmad-story-pipeline-worktree - Only start next story after previous one completes
- If any story fails, stop and preserve current state
- 读取Epic下所有未完成的故事
- 按故事编号升序排序
- 依次为每个故事执行
/bmad-story-pipeline-worktree - 前一个故事完成后才开始下一个
- 如有任何故事失败,停止执行并保留当前状态
Execution Flow
执行流程
Step 1: Collect Epic Story List
步骤1:收集Epic故事列表
Read sprint-status.yaml, collect all incomplete stories under specified Epic:
Task(
subagent_type: general-purpose,
description: "Collect Epic {ARGUMENT} story list",
prompt: "Read _bmad-output/implementation-artifacts/sprint-status.yaml (or docs/sprint/sprint-status.yaml), collect all stories for Epic {ARGUMENT}:
1. Filter entries with key format '{ARGUMENT}-Y-story-name'
2. Keep only stories with status not 'done'
3. Sort by Story number Y ascending
4. Return story list with format:
- Story number: 'X.Y', Story name, Current status
- Number of incomplete stories
If no incomplete stories found, return 'Epic {ARGUMENT} has no incomplete stories'"
)Progress output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Epic {ARGUMENT} - Story List
Story | Name | Status
-------|-------------------------|--------
{ARGUMENT}.1 | {story-name-1} | backlog
{ARGUMENT}.3 | {story-name-3} | in-progress
...
📊 Total: {N} incomplete stories
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━读取sprint-status.yaml,收集指定Epic下所有未完成的故事:
Task(
subagent_type: general-purpose,
description: "Collect Epic {ARGUMENT} story list",
prompt: "Read _bmad-output/implementation-artifacts/sprint-status.yaml (or docs/sprint/sprint-status.yaml), collect all stories for Epic {ARGUMENT}:
1. Filter entries with key format '{ARGUMENT}-Y-story-name'
2. Keep only stories with status not 'done'
3. Sort by Story number Y ascending
4. Return story list with format:
- Story number: 'X.Y', Story name, Current status
- Number of incomplete stories
If no incomplete stories found, return 'Epic {ARGUMENT} has no incomplete stories'"
)进度输出:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Epic {ARGUMENT} - Story List
Story | Name | Status
-------|-------------------------|--------
{ARGUMENT}.1 | {story-name-1} | backlog
{ARGUMENT}.3 | {story-name-3} | in-progress
...
📊 Total: {N} incomplete stories
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Step 2~N: Deliver Stories Sequentially
步骤2~N:依次交付故事
For each incomplete story, execute in order:
For story {STORY_NUM} (i-th of N total):
Execute /bmad-story-pipeline-worktree {STORY_NUM}
Wait for completion before continuing to next storyEach story delivery progress:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔄 Story [{i}/{N}]: {STORY_NUM}
📝 Name: {story-name}
⏳ Executing configurable pipeline...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[... Execute bmad-story-pipeline-worktree phases ...]
Phase 1: Create Worktree
Phase 2: Configurable Pipeline (from workflow-steps.md)
Phase 3: Merge Branch
Phase 4: Update Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Story [{i}/{N}]: {STORY_NUM} Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━If any story fails:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
❌ Story [{i}/{N}]: {STORY_NUM} Failed
⚠️ Stopping subsequent story delivery
📁 Please handle manually before continuing
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━按顺序为每个未完成的故事执行:
For story {STORY_NUM} (i-th of N total):
Execute /bmad-story-pipeline-worktree {STORY_NUM}
Wait for completion before continuing to next story每个故事的交付进度:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔄 Story [{i}/{N}]: {STORY_NUM}
📝 Name: {story-name}
⏳ Executing configurable pipeline...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[... Execute bmad-story-pipeline-worktree phases ...]
Phase 1: Create Worktree
Phase 2: Configurable Pipeline (from workflow-steps.md)
Phase 3: Merge Branch
Phase 4: Update Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Story [{i}/{N}]: {STORY_NUM} Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━如果任何故事失败:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
❌ Story [{i}/{N}]: {STORY_NUM} Failed
⚠️ Stopping subsequent story delivery
📁 Please handle manually before continuing
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Final Delivery Report
最终交付报告
All complete:
╔════════════════════════════════════════════════════════╗
║ 🎉 BMAD Epic Pipeline Complete! ║
╠════════════════════════════════════════════════════════╣
║ Epic: {ARGUMENT} ║
║ ║
║ ✅ Story 1: {story-1} - done ║
║ ✅ Story 2: {story-2} - done ║
║ ... ║
║ ✅ Story N: {story-N} - done ║
║ ║
║ 📊 Total: {N}/{N} stories completed ║
║ 🎯 Epic status: done ║
╚════════════════════════════════════════════════════════╝Partial completion (has failures):
╔════════════════════════════════════════════════════════╗
║ ⚠️ BMAD Epic Pipeline - Partial Completion ║
╠════════════════════════════════════════════════════════╣
║ Epic: {ARGUMENT} ║
║ ║
║ ✅ Story 1: {story-1} - done ║
║ ✅ Story 2: {story-2} - done ║
║ ❌ Story 3: {story-3} - failed ║
║ ⏸️ Story 4: {story-4} - not started ║
║ ... ║
║ ║
║ 📊 Progress: {completed}/{total} stories completed ║
║ 📁 Failed story: {failed-story} ║
║ 💡 Handle failed story then re-run to continue ║
╚════════════════════════════════════════════════════════╝全部完成:
╔════════════════════════════════════════════════════════╗
║ 🎉 BMAD Epic Pipeline Complete! ║
╠════════════════════════════════════════════════════════╣
║ Epic: {ARGUMENT} ║
║ ║
║ ✅ Story 1: {story-1} - done ║
║ ✅ Story 2: {story-2} - done ║
║ ... ║
║ ✅ Story N: {story-N} - done ║
║ ║
║ 📊 Total: {N}/{N} stories completed ║
║ 🎯 Epic status: done ║
╚════════════════════════════════════════════════════════╝部分完成(存在失败):
╔════════════════════════════════════════════════════════╗
║ ⚠️ BMAD Epic Pipeline - Partial Completion ║
╠════════════════════════════════════════════════════════╣
║ Epic: {ARGUMENT} ║
║ ║
║ ✅ Story 1: {story-1} - done ║
║ ✅ Story 2: {story-2} - done ║
║ ❌ Story 3: {story-3} - failed ║
║ ⏸️ Story 4: {story-4} - not started ║
║ ... ║
║ ║
║ 📊 Progress: {completed}/{total} stories completed ║
║ 📁 Failed story: {failed-story} ║
║ 💡 Handle failed story then re-run to continue ║
╚════════════════════════════════════════════════════════╝Error Handling
错误处理
If any story delivery fails:
- Stop subsequent story delivery
- Preserve failed story's worktree (if any)
- Output failure information and completed progress
- Prompt user to handle manually
Resume delivery:
bash
undefined如果任何故事交付失败:
- 停止后续故事交付
- 保留失败故事的worktree(如果存在)
- 输出失败信息和已完成进度
- 提示用户手动处理
恢复交付:
bash
undefined1. Manually fix failed story
1. Manually fix failed story
cd {WORKTREE_PATH}
cd {WORKTREE_PATH}
Fix issues...
Fix issues...
git add . && git commit -m "fix: resolve issues"
cd {ORIGINAL_REPO_PATH}
git merge feature/story-{STORY_NUM}
git worktree remove {WORKTREE_PATH}
git add . && git commit -m "fix: resolve issues"
cd {ORIGINAL_REPO_PATH}
git merge feature/story-{STORY_NUM}
git worktree remove {WORKTREE_PATH}
2. Re-run epic delivery, will auto-skip completed stories
2. Re-run epic delivery, will auto-skip completed stories
/bmad-epic-pipeline-worktree {ARGUMENT}
---/bmad-epic-pipeline-worktree {ARGUMENT}
---Configuration
配置
Pipeline workflow uses 's configuration.
bmad-story-pipeline-worktreeTo customize the pipeline, edit:
bmad-story-pipeline-worktree/references/workflow-steps.md
Changes supported:
- Add/remove steps
- Modify step commands
- Reorder steps
- Change descriptions
流水线工作流使用的配置。
bmad-story-pipeline-worktree要自定义流水线,请编辑:
bmad-story-pipeline-worktree/references/workflow-steps.md
支持的修改:
- 添加/删除步骤
- 修改步骤命令
- 调整步骤顺序
- 修改描述
Relationship with bmad-story-pipeline-worktree
与bmad-story-pipeline-worktree的关系
- bmad-epic-pipeline-worktree is the batch version of bmad-story-pipeline-worktree
- Internally loops to call
/bmad-story-pipeline-worktree {story-num} - Each story has independent worktree, independent pipeline, independent merge
- Guarantees sequential execution, next starts only after previous completes
- Each story completion auto-updates: sprint-status.yaml + story design document
- Uses configurable workflow from workflow-steps.md
- bmad-epic-pipeline-worktree是bmad-story-pipeline-worktree的批量版本
- 内部循环调用
/bmad-story-pipeline-worktree {story-num} - 每个故事都有独立的worktree、独立的流水线、独立的合并逻辑
- 保证顺序执行,前一个完成后才启动下一个
- 每个故事完成后自动更新:sprint-status.yaml + 故事设计文档
- 使用来自workflow-steps.md的可配置工作流