From e93d00a7d798f47f2356541197895191a755c7c9 Mon Sep 17 00:00:00 2001 From: Jonah Schulte Date: Tue, 27 Jan 2026 00:30:45 -0500 Subject: [PATCH] feat: unified workflow format for batch-super-dev (GSD-style) Converted batch-super-dev from 1,270 line instructions.md to 317 line unified workflow.md (75% reduction). Uses semantic tags, explicit orchestrator reconciliation steps, and @patterns references. --- .../batch-super-dev/workflow.md | 317 ++++++++++++++++++ .../batch-super-dev/workflow.md | 317 ++++++++++++++++++ 2 files changed, 634 insertions(+) create mode 100644 src/bmm/workflows/4-implementation/batch-super-dev/workflow.md create mode 100644 src/modules/bmm/workflows/4-implementation/batch-super-dev/workflow.md diff --git a/src/bmm/workflows/4-implementation/batch-super-dev/workflow.md b/src/bmm/workflows/4-implementation/batch-super-dev/workflow.md new file mode 100644 index 00000000..612974ef --- /dev/null +++ b/src/bmm/workflows/4-implementation/batch-super-dev/workflow.md @@ -0,0 +1,317 @@ +# Batch Super-Dev v3.0 - Unified Workflow + + +Interactive story selector for batch implementation. Scan codebase for gaps, select stories, process with super-dev-pipeline, reconcile results. + +**AKA:** "Mend the Gap" - Mind the gap between story requirements and reality, then mend it. + + + +**Gap Analysis First, Build Only What's Missing** + +1. Scan codebase to verify what's actually implemented +2. Find the gap between story requirements and reality +3. Build ONLY what's truly missing (no duplicate work) +4. Update tracking to reflect actual completion + +Orchestrator coordinates. Agents do implementation. Orchestrator does reconciliation. + + + +name: batch-super-dev +version: 3.0.0 + +modes: + sequential: {description: "Process one-by-one in this session", recommended_for: "gap analysis"} + parallel: {description: "Spawn concurrent Task agents", recommended_for: "greenfield batch"} + +complexity_routing: + micro: {max_tasks: 3, max_files: 5, skip_review: true} + standard: {max_tasks: 15, max_files: 30, full_pipeline: true} + complex: {min_tasks: 16, keywords: [auth, security, payment, migration], enhanced_review: true} + + + +@patterns/hospital-grade.md +@patterns/agent-completion.md +@super-dev-pipeline/workflow.md + + + + + +**Load and parse sprint-status.yaml** + +```bash +SPRINT_STATUS="docs/sprint-artifacts/sprint-status.yaml" +[ -f "$SPRINT_STATUS" ] || { echo "ERROR: sprint-status.yaml not found"; exit 1; } +``` + +Use Read tool on sprint-status.yaml. Extract: +- Stories with status `ready-for-dev` or `backlog` +- Exclude epics (`epic-*`) and retrospectives (`*-retrospective`) +- Sort by epic number, then story number + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📋 LOADING SPRINT STATUS +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +If no available stories: report "All stories complete!" and exit. + + + +**Display available stories with file status** + +For each story: +1. Check if story file exists in `docs/sprint-artifacts/` +2. Try patterns: `story-{epic}.{story}.md`, `{epic}-{story}.md`, `{story_key}.md` +3. Mark status: ✅ exists, ❌ missing, 🔄 already implemented + +```markdown +## 📦 Available Stories (N) + +### Ready for Dev (X) +1. **17-10** ✅ occupant-agreement-view +2. **17-11** ✅ agreement-status-tracking + +### Backlog (Y) +3. **18-1** ❌ [needs story file] + +Legend: ✅ ready | ❌ missing | 🔄 done but not tracked +``` + + + +**Validate story files have required sections** + +For each story with existing file: +1. Read story file +2. Check for 12 BMAD sections (Business Context, Acceptance Criteria, Tasks, etc.) +3. If invalid: mark for regeneration or skip + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🔍 VALIDATING STORY FILES +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +Skip stories with missing files (status ready-for-dev but no file). + + + +**Score story complexity for pipeline routing** + +For each validated story: + +```bash +# Count tasks +TASK_COUNT=$(grep -c "^- \[ \]" "$STORY_FILE") + +# Check for risk keywords +RISK_KEYWORDS="auth|security|payment|encryption|migration|database|schema" +HIGH_RISK=$(grep -ciE "$RISK_KEYWORDS" "$STORY_FILE") +``` + +**Scoring:** +| Criteria | micro | standard | complex | +|----------|-------|----------|---------| +| Tasks | ≤3 | 4-15 | ≥16 | +| Files | ≤5 | ≤30 | >30 | +| Risk keywords | 0 | low | high | + +Store `complexity_level` for each story. + + + +**Get user selection** + +Use AskUserQuestion: +``` +Which stories would you like to implement? + +Options: +1. All ready-for-dev stories (X stories) +2. Select specific stories by number +3. Single story (enter key like "17-10") +``` + +Validate selection against available stories. + + + +**Choose execution mode** + +Use AskUserQuestion: +``` +How should stories be processed? + +Options: +1. Sequential (recommended for gap analysis) + - Process one-by-one in this session + - Verify code → build gaps → check boxes → next + +2. Parallel (for greenfield batch) + - Spawn Task agents concurrently + - Faster but harder to monitor +``` + +For sequential: proceed to `execute_sequential` +For parallel: proceed to `execute_parallel` + + + +**Sequential Processing** + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📦 SEQUENTIAL PROCESSING +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +For each selected story: + +**Step A: Invoke super-dev-pipeline** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📦 Story {{index}}/{{total}}: {{story_key}} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +Use super-dev-pipeline workflow with: +- mode: batch +- story_key: {{story_key}} +- complexity_level: {{complexity}} + +**Step B: Reconcile (orchestrator does this directly)** + +After super-dev-pipeline completes: + +1. Get what was built: +```bash +git log -3 --oneline | grep "{{story_key}}" +git diff HEAD~1 --name-only | head -20 +``` + +2. Read story file, check off tasks: +``` +Use Edit tool: "- [ ]" → "- [x]" for completed tasks +``` + +3. Fill Dev Agent Record: +``` +Use Edit tool to add implementation date, files, notes +``` + +4. Verify: +```bash +CHECKED=$(grep -c "^- \[x\]" "$STORY_FILE") +[ "$CHECKED" -gt 0 ] || { echo "❌ BLOCKER: Zero tasks checked"; exit 1; } +echo "✅ Reconciled: $CHECKED tasks" +``` + +5. Update sprint-status.yaml: +``` +Use Edit tool: "{{story_key}}: ready-for-dev" → "{{story_key}}: done" +``` + +**Step C: Next story or complete** +- If more stories: continue loop +- If complete: proceed to `summary` + + + +**Parallel Processing with Wave Pattern** + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📦 PARALLEL PROCESSING +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +**Wave Configuration:** +- Max concurrent: 3 agents +- Wait for wave completion before next wave + +**For each wave:** + +1. Spawn Task agents (up to 3 parallel): +``` +Task({ + subagent_type: "general-purpose", + description: "Implement {{story_key}}", + prompt: ` +Execute super-dev-pipeline for story {{story_key}}. + + +@super-dev-pipeline/workflow.md + + + +Story: [inline story content] +Complexity: {{complexity_level}} + + + +- [ ] All pipeline phases complete +- [ ] Git commit created +- [ ] Return ## AGENT COMPLETE with summary + +` +}) +``` + +2. Wait for all agents in wave to complete + +3. **Orchestrator reconciles each completed story:** + - Get git diff + - Check off tasks + - Fill Dev Agent Record + - Verify updates + - Update sprint-status + +4. Continue to next wave or summary + + + +**Display Batch Summary** + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +✅ BATCH COMPLETE +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Stories processed: {{total}} +Successful: {{success_count}} +Failed: {{fail_count}} + +## Results + +| Story | Status | Tasks | Commit | +|-------|--------|-------|--------| +| 17-10 | ✅ done | 8/8 | abc123 | +| 17-11 | ✅ done | 5/5 | def456 | + +## Next Steps +- Run /bmad:sprint-status to verify +- Review commits with git log +``` + + + + + +**Story file missing:** Skip with warning, continue to next. +**Pipeline fails:** Mark story as failed, continue to next. +**Reconciliation fails:** Fix with Edit tool, retry verification. +**All stories fail:** Report systemic issue, halt batch. + + + +- [ ] All selected stories processed +- [ ] Each story has checked tasks (count > 0) +- [ ] Each story has Dev Agent Record filled +- [ ] Sprint status updated for all stories +- [ ] Summary displayed with results + diff --git a/src/modules/bmm/workflows/4-implementation/batch-super-dev/workflow.md b/src/modules/bmm/workflows/4-implementation/batch-super-dev/workflow.md new file mode 100644 index 00000000..612974ef --- /dev/null +++ b/src/modules/bmm/workflows/4-implementation/batch-super-dev/workflow.md @@ -0,0 +1,317 @@ +# Batch Super-Dev v3.0 - Unified Workflow + + +Interactive story selector for batch implementation. Scan codebase for gaps, select stories, process with super-dev-pipeline, reconcile results. + +**AKA:** "Mend the Gap" - Mind the gap between story requirements and reality, then mend it. + + + +**Gap Analysis First, Build Only What's Missing** + +1. Scan codebase to verify what's actually implemented +2. Find the gap between story requirements and reality +3. Build ONLY what's truly missing (no duplicate work) +4. Update tracking to reflect actual completion + +Orchestrator coordinates. Agents do implementation. Orchestrator does reconciliation. + + + +name: batch-super-dev +version: 3.0.0 + +modes: + sequential: {description: "Process one-by-one in this session", recommended_for: "gap analysis"} + parallel: {description: "Spawn concurrent Task agents", recommended_for: "greenfield batch"} + +complexity_routing: + micro: {max_tasks: 3, max_files: 5, skip_review: true} + standard: {max_tasks: 15, max_files: 30, full_pipeline: true} + complex: {min_tasks: 16, keywords: [auth, security, payment, migration], enhanced_review: true} + + + +@patterns/hospital-grade.md +@patterns/agent-completion.md +@super-dev-pipeline/workflow.md + + + + + +**Load and parse sprint-status.yaml** + +```bash +SPRINT_STATUS="docs/sprint-artifacts/sprint-status.yaml" +[ -f "$SPRINT_STATUS" ] || { echo "ERROR: sprint-status.yaml not found"; exit 1; } +``` + +Use Read tool on sprint-status.yaml. Extract: +- Stories with status `ready-for-dev` or `backlog` +- Exclude epics (`epic-*`) and retrospectives (`*-retrospective`) +- Sort by epic number, then story number + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📋 LOADING SPRINT STATUS +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +If no available stories: report "All stories complete!" and exit. + + + +**Display available stories with file status** + +For each story: +1. Check if story file exists in `docs/sprint-artifacts/` +2. Try patterns: `story-{epic}.{story}.md`, `{epic}-{story}.md`, `{story_key}.md` +3. Mark status: ✅ exists, ❌ missing, 🔄 already implemented + +```markdown +## 📦 Available Stories (N) + +### Ready for Dev (X) +1. **17-10** ✅ occupant-agreement-view +2. **17-11** ✅ agreement-status-tracking + +### Backlog (Y) +3. **18-1** ❌ [needs story file] + +Legend: ✅ ready | ❌ missing | 🔄 done but not tracked +``` + + + +**Validate story files have required sections** + +For each story with existing file: +1. Read story file +2. Check for 12 BMAD sections (Business Context, Acceptance Criteria, Tasks, etc.) +3. If invalid: mark for regeneration or skip + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🔍 VALIDATING STORY FILES +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +Skip stories with missing files (status ready-for-dev but no file). + + + +**Score story complexity for pipeline routing** + +For each validated story: + +```bash +# Count tasks +TASK_COUNT=$(grep -c "^- \[ \]" "$STORY_FILE") + +# Check for risk keywords +RISK_KEYWORDS="auth|security|payment|encryption|migration|database|schema" +HIGH_RISK=$(grep -ciE "$RISK_KEYWORDS" "$STORY_FILE") +``` + +**Scoring:** +| Criteria | micro | standard | complex | +|----------|-------|----------|---------| +| Tasks | ≤3 | 4-15 | ≥16 | +| Files | ≤5 | ≤30 | >30 | +| Risk keywords | 0 | low | high | + +Store `complexity_level` for each story. + + + +**Get user selection** + +Use AskUserQuestion: +``` +Which stories would you like to implement? + +Options: +1. All ready-for-dev stories (X stories) +2. Select specific stories by number +3. Single story (enter key like "17-10") +``` + +Validate selection against available stories. + + + +**Choose execution mode** + +Use AskUserQuestion: +``` +How should stories be processed? + +Options: +1. Sequential (recommended for gap analysis) + - Process one-by-one in this session + - Verify code → build gaps → check boxes → next + +2. Parallel (for greenfield batch) + - Spawn Task agents concurrently + - Faster but harder to monitor +``` + +For sequential: proceed to `execute_sequential` +For parallel: proceed to `execute_parallel` + + + +**Sequential Processing** + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📦 SEQUENTIAL PROCESSING +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +For each selected story: + +**Step A: Invoke super-dev-pipeline** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📦 Story {{index}}/{{total}}: {{story_key}} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +Use super-dev-pipeline workflow with: +- mode: batch +- story_key: {{story_key}} +- complexity_level: {{complexity}} + +**Step B: Reconcile (orchestrator does this directly)** + +After super-dev-pipeline completes: + +1. Get what was built: +```bash +git log -3 --oneline | grep "{{story_key}}" +git diff HEAD~1 --name-only | head -20 +``` + +2. Read story file, check off tasks: +``` +Use Edit tool: "- [ ]" → "- [x]" for completed tasks +``` + +3. Fill Dev Agent Record: +``` +Use Edit tool to add implementation date, files, notes +``` + +4. Verify: +```bash +CHECKED=$(grep -c "^- \[x\]" "$STORY_FILE") +[ "$CHECKED" -gt 0 ] || { echo "❌ BLOCKER: Zero tasks checked"; exit 1; } +echo "✅ Reconciled: $CHECKED tasks" +``` + +5. Update sprint-status.yaml: +``` +Use Edit tool: "{{story_key}}: ready-for-dev" → "{{story_key}}: done" +``` + +**Step C: Next story or complete** +- If more stories: continue loop +- If complete: proceed to `summary` + + + +**Parallel Processing with Wave Pattern** + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📦 PARALLEL PROCESSING +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +**Wave Configuration:** +- Max concurrent: 3 agents +- Wait for wave completion before next wave + +**For each wave:** + +1. Spawn Task agents (up to 3 parallel): +``` +Task({ + subagent_type: "general-purpose", + description: "Implement {{story_key}}", + prompt: ` +Execute super-dev-pipeline for story {{story_key}}. + + +@super-dev-pipeline/workflow.md + + + +Story: [inline story content] +Complexity: {{complexity_level}} + + + +- [ ] All pipeline phases complete +- [ ] Git commit created +- [ ] Return ## AGENT COMPLETE with summary + +` +}) +``` + +2. Wait for all agents in wave to complete + +3. **Orchestrator reconciles each completed story:** + - Get git diff + - Check off tasks + - Fill Dev Agent Record + - Verify updates + - Update sprint-status + +4. Continue to next wave or summary + + + +**Display Batch Summary** + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +✅ BATCH COMPLETE +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Stories processed: {{total}} +Successful: {{success_count}} +Failed: {{fail_count}} + +## Results + +| Story | Status | Tasks | Commit | +|-------|--------|-------|--------| +| 17-10 | ✅ done | 8/8 | abc123 | +| 17-11 | ✅ done | 5/5 | def456 | + +## Next Steps +- Run /bmad:sprint-status to verify +- Review commits with git log +``` + + + + + +**Story file missing:** Skip with warning, continue to next. +**Pipeline fails:** Mark story as failed, continue to next. +**Reconciliation fails:** Fix with Edit tool, retry verification. +**All stories fail:** Report systemic issue, halt batch. + + + +- [ ] All selected stories processed +- [ ] Each story has checked tasks (count > 0) +- [ ] Each story has Dev Agent Record filled +- [ ] Sprint status updated for all stories +- [ ] Summary displayed with results +