| íëŠĐ | ëīėĐ |
|---|---|
| Category | petmedi-workflow |
| MCP Servers | zenhub, sequential |
/dev:batch#
Sequentially processes child issues of an Epic/Story using a hierarchical branch strategy. Stories are merged into the Epic branch, and Sub-tasks are merged into the Story branch.
Usage#
/dev:batch {epic_number}
Hierarchical Branch Strategy#
development
âââ epic/{epic_number}-{slug} â Created in Phase 1
âââ feature/{story_1}-{slug} â Sequentially processed in Phase 2
â âââ feature/{subtask_1}-{slug} â Sub-tasks processed sequentially within Story
â âââ feature/{subtask_2}-{slug}
âââ feature/{story_2}-{slug}
âââ feature/{story_3}-{slug}
â Epic â development PR in Phase 3
Workflow#
Phase 1: Epic Branch Creation#
1. Query Epic issue info (ZenHub)
2. Update development branch to latest
3. Create Epic branch: epic/{epic_number}-{slug}
4. Move Epic to In Progress pipeline
Phase 2: Sequential Story Processing (Per-Story Cycle)#
Executes the /dev:run cycle for each Story.
Base branch is automatically set to the Epic branch.
Per-Story Cycle:
1. Move Pipeline to " In Progress "
2. Create Story branch: feature/{story_number}-{slug} (based on Epic branch)
3. If Sub-tasks exist â execute Per-Sub-task Cycle
4. If no Sub-tasks â implement directly
5. Write and run tests
6. Pre-push verification (lint + DCM)
7. Code Review Gate
8. Create PR â targeting Epic branch (base: epic/{epic_number}-{slug})
9. Squash merge â integrated into Epic branch
10. Move to next Story
Phase 2.5: Sequential Sub-task Processing (Optional)#
When a Story has Sub-tasks, process them with the same pattern.
Per-Sub-task Cycle:
1. Create Sub-task branch: feature/{subtask_number}-{slug} (based on Story branch)
2. Implementation work
3. Write and run tests
4. Verification gate
5. Create PR â targeting Story branch (base: feature/{story_number}-{slug})
6. Squash merge â integrated into Story branch
7. Move to next Sub-task
Phase 3: Epic PR Creation#
After all Stories are complete:
1. Verify all Stories are integrated into Epic branch
2. Review changes against development
3. Create Epic PR â targeting development
4. Conduct code review
5. Squash merge after user approval
6. Epic issue auto-Close
Flow Diagram#
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â /dev:batch {epic_number} â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââĪ
â â
â Phase 1: Epic Branch Creation â
â âââ Query Epic issue (ZenHub) â
â âââ git checkout development & & git pull â
â âââ git checkout -b epic/{number}-{slug} â
â âââ git push -u origin epic/{number}-{slug} â
â â
â Phase 2: Sequential Story Processing â
â âââ Query Story list (child issues) â
â âââ for each Story: â
â â âââ /dev:run --base epic/{number}-{slug} {story_num} â
â â â âââ Branch: feature/{story}-{slug} â
â â â âââ [If Sub-tasks exist] â
â â â â âââ Per-Sub-task Cycle â
â â â â âââ feature/{subtask}-{slug} (Story-based) â
â â â â âââ Implement â Test â Verify â
â â â â âââ PR â Merge into Story branch â
â â â âââ Implement â Test â Verification Gate â
â â â âââ PR â Merge into Epic branch â
â â âââ Next Story â
â â â
â Phase 3: Epic PR Creation â
â âââ Create Epic branch â development PR â
â âââ Review full changes â
â âââ Wait for user approval â
â âââ Squash merge â Epic Close â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
MCP Call Order#
// Phase 1: Initialization
const workspace = await mcp__zenhub__getWorkspacePipelinesAndRepositories();
const epic = await mcp__zenhub__searchLatestIssues({ query: `#${epicNumber}` });
const stories = await mcp__zenhub__searchLatestIssues({
query: `parent:${epic[0].id}`,
});
// Phase 2: Per-Story processing
for (const story of stories) {
// Check Sub-tasks
const subtasks = await mcp__zenhub__searchLatestIssues({
query: `parent:${story.id}`,
});
if (subtasks.length > 0) {
// Story with Sub-tasks â create Story branch first
// Process Sub-tasks sequentially, then integrate into Story branch
for (const subtask of subtasks) {
// /dev:run --base feature/{story_number}-{slug} {subtask.number}
}
// PR Story branch to Epic branch
} else {
// Story without Sub-tasks â implement directly
// /dev:run --base epic/{epic_number}-{slug} {story.number}
}
}
// Phase 3: Epic PR
// gh pr create --base development --title " [Epic] ... "
Pipeline Query#
Pipeline IDs differ per workspace. Dynamic query at session start:
const workspace = await mcp__zenhub__getWorkspacePipelinesAndRepositories();
const pipelines = workspace.pipelines;
// Find by name in pipelines: " New Issues " , " In Progress " , " Review/QA " , etc.
// Done pipeline is not used (auto Close via GitHub " Closes # " keyword on merge)
PR Creation Templates#
Story PR (â Epic branch)#
gh pr create --base " epic/{epic_number}-{slug} " \
--title " {story.title} " --body " $(cat < < ' EOF '
## Summary
- {Change summary}
## Related Issue
- Closes #{story.number}
- Parent Epic: #{epic_number}
## Test Plan
- [ ] UseCase unit tests passed
- [ ] BLoC unit tests passed
ðĪ Generated with [Claude Code](https://claude.ai/claude-code)
EOF
) "
Epic PR (â development)#
gh pr create --base " development " \
--title " [Epic] {epic.title} " --body " $(cat < < ' EOF '
## Summary
- {Epic full change summary}
## Included Stories
- â
#{story_1} - {title}
- â
#{story_2} - {title}
- â
#{story_3} - {title}
## Related Issue
- Closes #{epic_number}
## Test Plan
- [ ] Full integration tests passed
- [ ] Manual testing complete
ðĪ Generated with [Claude Code](https://claude.ai/claude-code)
EOF
) "
Verification Checklist#
- Epic branch correctly branched from development
- Each Story branch branched from Epic branch
- Sub-task branches branched from Story branch
- Story PR base is Epic branch
- Epic PR base is development
- Epic PR created after all Stories are merged
- BDD scenarios vs actual implementation comparison
- Code conventions followed
- Lint 0 issues + DCM error 0 issues