bmad-epic-pipeline-worktree

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

BMAD Epic Pipeline (Worktree Edition)

BMAD Epic Pipeline(Worktree版)

Deliver all incomplete user stories in Epic
{ARGUMENT}
using configurable pipeline, each story developed in isolated worktree and merged only after tests pass.
使用可配置流水线交付Epic
{ARGUMENT}
中所有未完成的用户故事,每个故事都在隔离的worktree中开发,仅在测试通过后才合并。

Pre-step: Determine Epic Number

前置步骤:确定Epic编号

If no epic number is provided (
{ARGUMENT}
is empty):
  1. Read
    _bmad-output/implementation-artifacts/sprint-status.yaml
    (or
    docs/sprint/sprint-status.yaml
    )
  2. Find all stories with status not
    done
    (format:
    X-Y-story-name
    )
  3. Extract Epic numbers X from these stories
  4. Select the smallest Epic number as
    {ARGUMENT}
  5. Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Auto-selected Epic: {ARGUMENT} (has incomplete stories)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Example:
  • Status file has
    3-2-llm-prompt-template: backlog
    ,
    3-3-xxx: in-progress
    ,
    4-1-xxx: done
  • Incomplete Epics: 3
  • Auto-select Epic: 3

如果未提供epic编号(
{ARGUMENT}
为空):
  1. 读取
    _bmad-output/implementation-artifacts/sprint-status.yaml
    (或
    docs/sprint/sprint-status.yaml
  2. 找出所有状态不为
    done
    的故事(格式:
    X-Y-story-name
  3. 从这些故事中提取Epic编号X
  4. 选择最小的Epic编号作为
    {ARGUMENT}
  5. 输出:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Auto-selected Epic: {ARGUMENT} (has incomplete stories)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
示例:
  • 状态文件包含
    3-2-llm-prompt-template: backlog
    3-3-xxx: in-progress
    4-1-xxx: done
  • 未完成的Epic:3
  • 自动选择的Epic:3

Difference from bmad-epic-worktree

与bmad-epic-worktree的区别

Featurebmad-epic-worktreebmad-epic-pipeline-worktree
Story deliverybmad-story-worktreebmad-story-pipeline-worktree
Workflow configFixed 8-step flowConfigurable via workflow-steps.md
CustomizationLimitedFull pipeline customization
Safety levelHighHigh

功能bmad-epic-worktreebmad-epic-pipeline-worktree
故事交付bmad-story-worktreebmad-story-pipeline-worktree
工作流配置固定8步流程可通过workflow-steps.md配置
自定义能力有限全流水线自定义
安全级别

Execution Strategy

执行策略

  1. Read all incomplete stories under the Epic
  2. Sort by Story number ascending
  3. Execute
    /bmad-story-pipeline-worktree
    for each story sequentially
  4. Only start next story after previous one completes
  5. If any story fails, stop and preserve current state

  1. 读取Epic下所有未完成的故事
  2. 按故事编号升序排序
  3. 依次为每个故事执行
    /bmad-story-pipeline-worktree
  4. 前一个故事完成后才开始下一个
  5. 如有任何故事失败,停止执行并保留当前状态

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 story
Each 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:
  1. Stop subsequent story delivery
  2. Preserve failed story's worktree (if any)
  3. Output failure information and completed progress
  4. Prompt user to handle manually
Resume delivery:
bash
undefined
如果任何故事交付失败:
  1. 停止后续故事交付
  2. 保留失败故事的worktree(如果存在)
  3. 输出失败信息和已完成进度
  4. 提示用户手动处理
恢复交付:
bash
undefined

1. 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
bmad-story-pipeline-worktree
's configuration.
To 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-worktreebmad-story-pipeline-worktree的批量版本
  • 内部循环调用
    /bmad-story-pipeline-worktree {story-num}
  • 每个故事都有独立的worktree、独立的流水线、独立的合并逻辑
  • 保证顺序执行,前一个完成后才启动下一个
  • 每个故事完成后自动更新:sprint-status.yaml + 故事设计文档
  • 使用来自workflow-steps.md的可配置工作流