refactor: orchestrator-driven reconciliation and structured agent returns

Phase 1: Fix Story Reconciliation
- Remove Reconciler agent (orchestrator does this directly now)
- Rewrite step-4.5 from XML to explicit Bash/Read/Edit commands
- Update batch-super-dev instructions with explicit tool calls
- Principle: agents do creative work, orchestrator does bookkeeping

Phase 2: Structured Agent Returns
- Add ## AGENT COMPLETE format to builder, inspector, reviewer, fixer
- Remove story/sprint update responsibility from Fixer agent
- Agents now return parseable output (files, status, evidence)

This aligns BMAD workflows with GSD patterns for better reliability.
This commit is contained in:
Jonah Schulte 2026-01-26 23:33:41 -05:00
parent e1c6a05259
commit 07592e4c36
17 changed files with 997 additions and 1900 deletions

View File

@ -895,11 +895,20 @@ Enter number (2-10) or 'all':
<check if="super-dev-pipeline succeeded"> <check if="super-dev-pipeline succeeded">
<output>✅ Implementation complete: {{story_key}}</output> <output>✅ Implementation complete: {{story_key}}</output>
<action>Execute Step 4.5: Smart Story Reconciliation</action> <critical>ORCHESTRATOR: You must execute reconciliation directly using Bash/Read/Edit tools.</critical>
<action>Load reconciliation instructions: {installed_path}/step-4.5-reconcile-story-status.md</action> <critical>Do NOT delegate this to an agent. YOU do it.</critical>
<action>Execute reconciliation with story_key={{story_key}}</action>
<check if="reconciliation succeeded"> <reconciliation>
1. Use Bash: `git log -3 --oneline | grep "{{story_key}}"` to find commit
2. Use Bash: `git diff HEAD~1 --name-only` to get files changed
3. Use Read: `docs/sprint-artifacts/{{story_key}}.md` to see tasks
4. Use Edit: Check off tasks (change `- [ ]` to `- [x]`) for completed work
5. Use Edit: Fill Dev Agent Record with files/date/summary
6. Use Bash: Verify with `grep -c "^- \[x\]"` (must be > 0)
7. Use Edit: Update sprint-status.yaml to "done" or "review"
</reconciliation>
<check if="reconciliation succeeded (checked tasks > 0)">
<output>✅ COMPLETED: {{story_key}} (reconciled)</output> <output>✅ COMPLETED: {{story_key}} (reconciled)</output>
<action>Increment completed counter</action> <action>Increment completed counter</action>
@ -1096,16 +1105,24 @@ Press [C] to continue or [P] to pause:
<output>✅ Worker {{worker_id}} completed: {{story_key}}</output> <output>✅ Worker {{worker_id}} completed: {{story_key}}</output>
<action>Execute Step 4.5: Smart Story Reconciliation</action> <critical>ORCHESTRATOR: You must execute reconciliation directly using Bash/Read/Edit tools.</critical>
<action>Load reconciliation instructions: {installed_path}/step-4.5-reconcile-story-status.md</action>
<action>Execute reconciliation with story_key={{story_key}}</action>
<check if="reconciliation succeeded"> <reconciliation>
1. Use Bash: `git log -3 --oneline | grep "{{story_key}}"` to find commit
2. Use Bash: `git diff HEAD~1 --name-only` to get files changed
3. Use Read: `docs/sprint-artifacts/{{story_key}}.md` to see tasks
4. Use Edit: Check off tasks (change `- [ ]` to `- [x]`) for completed work
5. Use Edit: Fill Dev Agent Record with files/date/summary
6. Use Bash: Verify with `grep -c "^- \[x\]"` (must be > 0)
7. Use Edit: Update sprint-status.yaml to "done" or "review"
</reconciliation>
<check if="reconciliation succeeded (checked tasks > 0)">
<output>✅ COMPLETED: {{story_key}} (reconciled)</output> <output>✅ COMPLETED: {{story_key}} (reconciled)</output>
<action>Add to completed_stories</action> <action>Add to completed_stories</action>
</check> </check>
<check if="reconciliation failed"> <check if="reconciliation failed (checked tasks = 0)">
<output>⚠️ WARNING: {{story_key}} completed but reconciliation failed</output> <output>⚠️ WARNING: {{story_key}} completed but reconciliation failed</output>
<action>Add to completed_stories (implementation successful)</action> <action>Add to completed_stories (implementation successful)</action>
<action>Add to reconciliation_warnings: {story_key: {{story_key}}, warning_message: "Reconciliation failed - manual verification needed"}</action> <action>Add to reconciliation_warnings: {story_key: {{story_key}}, warning_message: "Reconciliation failed - manual verification needed"}</action>

View File

@ -1,390 +1,171 @@
# Step 4.5: Smart Story Reconciliation # Step 4.5: Story Reconciliation (Orchestrator-Driven)
<critical>Execute AFTER super-dev-pipeline completes but BEFORE marking story as "completed"</critical> **Version:** 2.1.0
<critical>This ensures story checkboxes and status accurately reflect actual implementation</critical> **Execute:** AFTER super-dev-pipeline completes, BEFORE marking story done
**Who:** Orchestrator (YOU) - not an agent
## Goal
Verify story file accuracy by reconciling:
1. **Acceptance Criteria checkboxes** vs Dev Agent Record
2. **Tasks/Subtasks checkboxes** vs Dev Agent Record
3. **Definition of Done checkboxes** vs Dev Agent Record
4. **Story status** (should be "done" if implementation complete)
5. **sprint-status.yaml entry** (should match story file status)
--- ---
## Execution ## Why Orchestrator Does This
### 1. Load Story File Agents ignore reconciliation instructions. The orchestrator:
- Has full context of what just happened
<action>Read story file: {story_file_path}</action> - Can use tools directly (Bash, Read, Edit)
<action>Extract sections: - Won't skip "boring" bookkeeping tasks
- Acceptance Criteria (## Acceptance Criteria)
- Tasks / Subtasks (## Tasks / Subtasks)
- Definition of Done (## Definition of Done)
- Dev Agent Record (## Dev Agent Record)
- Story status header (**Status:** ...)
</action>
### 2. Analyze Dev Agent Record
<action>Read "Dev Agent Record" section</action>
<check if="Dev Agent Record is empty or says '(To be filled by dev agent)'">
<output>⚠️ Story {{story_key}}: Dev Agent Record is empty - cannot reconcile</output>
<output>This suggests super-dev-pipeline did not complete successfully.</output>
<action>Mark story as FAILED reconciliation</action>
<action>Return early (skip remaining checks)</action>
</check>
<action>Parse Dev Agent Record fields:
- **Agent Model Used** (should have model name, not empty)
- **Implementation Summary** (should describe what was built)
- **File List** (should list new/modified files)
- **Test Results** (should show test counts)
- **Completion Notes** (should document what works)
</action>
<check if="Implementation Summary contains 'COMPLETE' or lists specific deliverables">
<action>Set implementation_status = COMPLETE</action>
</check>
<check if="Implementation Summary is vague or says 'pending'">
<action>Set implementation_status = INCOMPLETE</action>
<output>⚠️ Story {{story_key}}: Implementation appears incomplete based on Dev Agent Record</output>
</check>
### 3. Reconcile Acceptance Criteria
<action>For each AC subsection (AC1, AC2, AC3, AC4, etc.):</action>
<iterate>For each checkbox in AC section:</iterate>
<substep n="3a" title="Identify expected status from Dev Agent Record">
<action>Search Implementation Summary and File List for keywords from checkbox text</action>
<example>
Checkbox: "[ ] FlexibleGridSection component (renders dynamic grid layouts)"
Implementation Summary mentions: "FlexibleGridSection component created"
File List includes: "FlexibleGridSection.tsx"
→ Expected status: CHECKED
</example>
<action>Determine expected_checkbox_status:
- CHECKED if Implementation Summary confirms it OR File List shows created files OR Test Results mention it
- UNCHECKED if no evidence in Dev Agent Record
- PARTIAL if mentioned as "pending" or "infrastructure ready"
</action>
</substep>
<substep n="3b" title="Compare actual vs expected">
<action>Read actual checkbox state from story file ([x] vs [ ] vs [~])</action>
<check if="actual != expected">
<output>🔧 Reconciling AC: "{{checkbox_text}}"
Actual: {{actual_status}}
Expected: {{expected_status}}
Reason: {{evidence_from_dev_record}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
</substep>
<action>After checking all ACs:
- Count total AC items
- Count checked AC items (after reconciliation)
- Calculate AC completion percentage
</action>
### 4. Reconcile Tasks / Subtasks
<action>For each Task (Task 1, Task 2, etc.):</action>
<iterate>For each checkbox in Tasks section:</iterate>
<substep n="4a" title="Identify expected status from Dev Agent Record">
<action>Search Implementation Summary and File List for task keywords</action>
<example>
Task checkbox: "[ ] **2.2:** Create FlexibleGridSection component"
File List includes: "apps/frontend/web/src/components/FlexibleGridSection.tsx"
→ Expected status: CHECKED
</example>
<action>Determine expected_checkbox_status using same logic as AC section</action>
</substep>
<substep n="4b" title="Compare and reconcile">
<action>Read actual checkbox state</action>
<check if="actual != expected">
<output>🔧 Reconciling Task: "{{task_text}}"
Actual: {{actual_status}}
Expected: {{expected_status}}
Reason: {{evidence_from_dev_record}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
</substep>
<action>After checking all Tasks:
- Count total task items
- Count checked task items (after reconciliation)
- Calculate task completion percentage
</action>
### 5. Reconcile Definition of Done
<action>For each DoD category (Code Quality, Testing, Security, etc.):</action>
<iterate>For each checkbox in DoD section:</iterate>
<substep n="5a" title="Determine expected status">
<action>Check Test Results, Completion Notes for evidence</action>
<example>
DoD checkbox: "[ ] Type check passes: `pnpm type-check` (zero errors)"
Completion Notes say: "Type check passes ✅"
→ Expected status: CHECKED
</example>
<example>
DoD checkbox: "[ ] Unit tests: 90%+ coverage"
Test Results say: "37 tests passing"
Completion Notes say: "100% coverage on FlexibleGridSection"
→ Expected status: CHECKED
</example>
<action>Determine expected_checkbox_status</action>
</substep>
<substep n="5b" title="Compare and reconcile">
<action>Read actual checkbox state</action>
<check if="actual != expected">
<output>🔧 Reconciling DoD: "{{dod_text}}"
Actual: {{actual_status}}
Expected: {{expected_status}}
Reason: {{evidence_from_dev_record}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
</substep>
<action>After checking all DoD items:
- Count total DoD items
- Count checked DoD items (after reconciliation)
- Calculate DoD completion percentage
</action>
### 6. Determine Correct Story Status
<action>Based on completion percentages, determine correct story status:</action>
<check if="AC >= 95% AND Tasks >= 95% AND DoD >= 95%">
<action>Set correct_story_status = "done"</action>
</check>
<check if="AC >= 80% AND Tasks >= 80% AND DoD >= 80%">
<action>Set correct_story_status = "review"</action>
</check>
<check if="AC < 80% OR Tasks < 80% OR DoD < 80%">
<action>Set correct_story_status = "in-progress"</action>
</check>
<check if="implementation_status == INCOMPLETE">
<action>Override: Set correct_story_status = "in-progress"</action>
<output>⚠️ Overriding status to "in-progress" due to incomplete implementation</output>
</check>
<action>Read current story status from story file (**Status:** ...)</action>
<check if="current_story_status != correct_story_status">
<output>🔧 Story status mismatch:
Current: {{current_story_status}}
Expected: {{correct_story_status}}
Reason: AC={{ac_pct}}% Tasks={{tasks_pct}}% DoD={{dod_pct}}%
</output>
<action>Add to reconciliation_changes list</action>
</check>
### 7. Verify sprint-status.yaml Entry
<action>Read {sprint_status} file</action>
<action>Find entry for {{story_key}}</action>
<action>Extract current status from sprint-status.yaml</action>
<check if="sprint_status_yaml_status != correct_story_status">
<output>🔧 sprint-status.yaml mismatch:
Current: {{sprint_status_yaml_status}}
Expected: {{correct_story_status}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
### 8. Apply Reconciliation Changes
<check if="reconciliation_changes is empty">
<output>✅ Story {{story_key}}: Already accurate (0 changes needed)</output>
<action>Return SUCCESS (no updates needed)</action>
</check>
<check if="reconciliation_changes is NOT empty">
<output>
🔧 Story {{story_key}}: Reconciling {{count}} issues
**Changes to apply:**
{{#each reconciliation_changes}}
{{@index}}. {{change_description}}
{{/each}}
</output>
<ask>Apply these reconciliation changes? (yes/no):</ask>
<check if="response != 'yes'">
<output>⏭️ Skipping reconciliation for {{story_key}}</output>
<action>Return SUCCESS (user declined changes)</action>
</check>
<substep n="8a" title="Update Acceptance Criteria">
<action>For each AC checkbox that needs updating:</action>
<action>Use Edit tool to update checkbox from [ ] to [x] or [~]</action>
<action>Add note explaining why: "- [x] Item - COMPLETE: {{evidence}}"</action>
</substep>
<substep n="8b" title="Update Tasks / Subtasks">
<action>For each Task checkbox that needs updating:</action>
<action>Use Edit tool to update checkbox</action>
<action>Update task header if all subtasks complete: "### Task 1: ... ✅ COMPLETE"</action>
</substep>
<substep n="8c" title="Update Definition of Done">
<action>For each DoD checkbox that needs updating:</action>
<action>Use Edit tool to update checkbox</action>
<action>Add verification note: "- [x] Item ✅ (verified in Dev Agent Record)"</action>
</substep>
<substep n="8d" title="Update Story Status">
<check if="story status needs updating">
<action>Use Edit tool to update status line</action>
<action>Change from: **Status:** {{old_status}}</action>
<action>Change to: **Status:** {{correct_story_status}}</action>
</check>
</substep>
<substep n="8e" title="Update sprint-status.yaml with status and progress">
<check if="sprint-status.yaml needs updating">
<action>Use Edit tool to update status entry</action>
<action>Count tasks from story file:
- total_tasks = all top-level tasks
- checked_tasks = tasks marked [x]
- progress_pct = (checked_tasks / total_tasks) × 100
</action>
<action>Update comment with progress tracking (NEW v1.3.0):
If status == "in-progress":
Format: {{story_key}}: in-progress # {{checked_tasks}}/{{total_tasks}} tasks ({{progress_pct}}%)
If status == "review":
Format: {{story_key}}: review # {{checked_tasks}}/{{total_tasks}} tasks ({{progress_pct}}%) - awaiting review
If status == "done":
Format: {{story_key}}: done # ✅ COMPLETED: {{brief_summary}}
</action>
<example>
Before: 20-8-...: ready-for-dev # Story description
During: 20-8-...: in-progress # 3/10 tasks (30%)
During: 20-8-...: in-progress # 7/10 tasks (70%)
Review: 20-8-...: review # 10/10 tasks (100%) - awaiting review
After: 20-8-...: done # ✅ COMPLETED: Component + tests + docs
</example>
</check>
</substep>
<output>✅ Story {{story_key}}: Reconciliation complete ({{count}} changes applied)</output>
</check>
### 9. Final Verification
<action>Re-read story file to verify changes applied correctly</action>
<action>Calculate final completion percentages</action>
<output>
📊 Story {{story_key}} - Final Status
**Acceptance Criteria:** {{ac_checked}}/{{ac_total}} ({{ac_pct}}%)
**Tasks/Subtasks:** {{tasks_checked}}/{{tasks_total}} ({{tasks_pct}}%)
**Definition of Done:** {{dod_checked}}/{{dod_total}} ({{dod_pct}}%)
**Story Status:** {{correct_story_status}}
**sprint-status.yaml:** {{correct_story_status}}
{{#if correct_story_status == "done"}}
✅ Story is COMPLETE and accurately reflects implementation
{{/if}}
{{#if correct_story_status == "review"}}
⚠️ Story needs review (some items incomplete)
{{/if}}
{{#if correct_story_status == "in-progress"}}
⚠️ Story has significant gaps (implementation incomplete)
{{/if}}
</output>
<action>Return SUCCESS with reconciliation summary</action>
--- ---
## Success Criteria ## Execute These Steps
Story reconciliation succeeds when: ### Step 1: Get What Was Built
1. ✅ All checkboxes match Dev Agent Record evidence
2. ✅ Story status accurately reflects completion (done/review/in-progress)
3. ✅ sprint-status.yaml entry matches story file status
4. ✅ Completion percentages calculated and reported
5. ✅ Changes documented in reconciliation summary
--- Run this command with Bash tool:
## Error Handling ```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔧 STORY RECONCILIATION: {{story_key}}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
<check if="story file not found"> # Get the commit for this story
<output>❌ Story {{story_key}}: File not found at {{story_file_path}}</output> echo "Recent commits:"
<action>Return FAILED reconciliation</action> git log -5 --oneline | grep -i "{{story_key}}" || echo "(no commits found with story key)"
</check>
<check if="Dev Agent Record missing or empty"> # Get files changed
<output>⚠️ Story {{story_key}}: Cannot reconcile - Dev Agent Record not populated</output> echo ""
<action>Mark as INCOMPLETE (not implemented yet)</action> echo "Files changed in last commit:"
<action>Return WARNING reconciliation</action> git diff HEAD~1 --name-only | grep -v "__tests__" | grep -v "\.test\." | head -20
</check>
<check if="Edit tool fails">
<output>❌ Story {{story_key}}: Failed to apply changes (Edit tool error)</output>
<action>Log error details</action>
<action>Return FAILED reconciliation</action>
</check>
---
## Integration with batch-super-dev
**Insert this step:**
- **Sequential mode:** After Step 4s-a (Process individual story), before marking completed
- **Parallel mode:** After Step 4p-a (Spawn Task agents), after agent completes but before marking completed
**Flow:**
```
super-dev-pipeline completes → Step 4.5 (Reconcile) → Mark as completed/failed
``` ```
**Benefits:** Store the output - you'll need it for the next steps.
- Ensures all batch-processed stories have accurate status
- Catches mismatches automatically ### Step 2: Read Story File
- Prevents "done" stories with unchecked items
- Maintains sprint-status.yaml accuracy Use Read tool on: `docs/sprint-artifacts/{{story_key}}.md`
Find these sections:
- **Tasks** (lines starting with `- [ ]` or `- [x]`)
- **Dev Agent Record** (section with Agent Model, Implementation Date, etc.)
### Step 3: Check Off Completed Tasks
For EACH task in the Tasks section that relates to files changed:
Use Edit tool:
```
file_path: docs/sprint-artifacts/{{story_key}}.md
old_string: "- [ ] Create the SomeComponent"
new_string: "- [x] Create the SomeComponent"
```
**Match logic:**
- If task mentions a file that was created → check it off
- If task mentions a service/component that now exists → check it off
- If unsure → leave unchecked (don't over-claim)
### Step 4: Fill Dev Agent Record
Use Edit tool to replace the placeholder record:
```
file_path: docs/sprint-artifacts/{{story_key}}.md
old_string: "### Dev Agent Record
- **Agent Model Used:** [Not set]
- **Implementation Date:** [Not set]
- **Files Created/Modified:** [Not set]
- **Tests Added:** [Not set]
- **Completion Notes:** [Not set]"
new_string: "### Dev Agent Record
- **Agent Model Used:** Claude Sonnet 4 (multi-agent pipeline)
- **Implementation Date:** 2026-01-26
- **Files Created/Modified:**
- path/to/file1.ts
- path/to/file2.ts
[list all files from git diff]
- **Tests Added:** X tests (from Inspector report)
- **Completion Notes:** Implemented [brief summary]"
```
### Step 5: Verify Updates
Run this command with Bash tool:
```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 RECONCILIATION VERIFICATION"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
STORY_FILE="docs/sprint-artifacts/{{story_key}}.md"
# Count checked tasks
CHECKED=$(grep -c "^- \[x\]" "$STORY_FILE" 2>/dev/null || echo "0")
UNCHECKED=$(grep -c "^- \[ \]" "$STORY_FILE" 2>/dev/null || echo "0")
TOTAL=$((CHECKED + UNCHECKED))
echo "Tasks: $CHECKED/$TOTAL checked"
if [ "$CHECKED" -eq 0 ]; then
echo ""
echo "❌ BLOCKER: Zero tasks checked off"
echo "You MUST go back to Step 3 and check off tasks"
exit 1
fi
# Check Dev Agent Record filled
if grep -q "Implementation Date: \[Not set\]" "$STORY_FILE" 2>/dev/null; then
echo "❌ BLOCKER: Dev Agent Record not filled"
echo "You MUST go back to Step 4 and fill it"
exit 1
fi
if grep -A 3 "### Dev Agent Record" "$STORY_FILE" | grep -q "Implementation Date: 202"; then
echo "✅ Dev Agent Record: Filled"
else
echo "❌ BLOCKER: Dev Agent Record incomplete"
exit 1
fi
echo ""
echo "✅ RECONCILIATION COMPLETE"
echo " Checked tasks: $CHECKED/$TOTAL"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
```
### Step 6: Update Sprint Status
Use Read tool: `docs/sprint-artifacts/sprint-status.yaml`
Find the entry for {{story_key}} and use Edit tool to update:
```
old_string: "{{story_key}}: ready-for-dev"
new_string: "{{story_key}}: done # ✅ COMPLETED 2026-01-26"
```
Or if 95%+ complete but not 100%:
```
new_string: "{{story_key}}: review # 8/10 tasks - awaiting review"
```
---
## Status Decision Logic
Based on verification results:
| Condition | Status |
|-----------|--------|
| 95%+ tasks checked + Dev Record filled | `done` |
| 80-94% tasks checked | `review` |
| <80% tasks checked | `in-progress` |
| Dev Record not filled | `in-progress` |
---
## If Verification Fails
1. **DO NOT** proceed to next story
2. **DO NOT** mark story as done
3. **FIX** the issue using Edit tool
4. **RE-RUN** verification command
5. **REPEAT** until verification passes
This is mandatory. No shortcuts.

View File

@ -93,4 +93,43 @@ When complete, provide:
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** builder
**Story:** {{story_key}}
**Status:** SUCCESS | FAILED
### Files Created
- path/to/new/file1.ts
- path/to/new/file2.ts
### Files Modified
- path/to/existing/file.ts
### Tests Added
- X test files
- Y test cases total
### Implementation Summary
Brief description of what was built and key decisions made.
### Known Gaps
- Any functionality not implemented
- Any edge cases not handled
- NONE if all tasks complete
### Ready For
Inspector validation (next phase)
```
**Why this format?** The orchestrator parses this output to:
- Verify claimed files actually exist
- Track what was built for reconciliation
- Route to next phase appropriately
---
**Remember:** You are the BUILDER. Build it well, but don't validate or review your own work. Other agents will do that with fresh eyes. **Remember:** You are the BUILDER. Build it well, but don't validate or review your own work. Other agents will do that with fresh eyes.

View File

@ -20,15 +20,15 @@ You are the **FIXER** agent. Your job is to fix CRITICAL and HIGH issues from th
- Fix security vulnerabilities immediately - Fix security vulnerabilities immediately
- Fix logic bugs and edge cases - Fix logic bugs and edge cases
- Re-run tests after each fix - Re-run tests after each fix
- Update story checkboxes - Commit code changes with descriptive message
- Update sprint-status.yaml
- Commit changes
**DO NOT:** **DO NOT:**
- Skip CRITICAL issues - Skip CRITICAL issues
- Skip HIGH issues - Skip HIGH issues
- Spend time on LOW issues - Spend time on LOW issues
- Make unnecessary changes - Make unnecessary changes
- Update story checkboxes (orchestrator does this)
- Update sprint-status.yaml (orchestrator does this)
--- ---
@ -79,22 +79,7 @@ low_issues: [#10, #11] # SKIP (gold-plating)
## After Fixing Issues ## After Fixing Issues
### 1. Update Story File ### Commit Changes
**Mark completed tasks:**
```bash
# Update checkboxes in story file
# Change [ ] to [x] for completed tasks
```
### 2. Update Sprint Status
**Update sprint-status.yaml:**
```yaml
17-10-occupant-agreement-view: done # was: ready-for-dev
```
### 3. Commit Changes
```bash ```bash
git add . git add .
@ -153,10 +138,6 @@ All tests passing, type check clean, lint clean."
**Git:** **Git:**
- ✅ Commit created: a1b2c3d - ✅ Commit created: a1b2c3d
- ✅ Story checkboxes updated
- ✅ Sprint status updated
**Story Status:** COMPLETE
``` ```
--- ---
@ -183,4 +164,47 @@ All tests passing, type check clean, lint clean."
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** fixer
**Story:** {{story_key}}
**Status:** SUCCESS | PARTIAL | FAILED
### Issues Fixed
- **CRITICAL:** X/Y fixed
- **HIGH:** X/Y fixed
- **Total:** X issues resolved
### Fixes Applied
1. [CRITICAL] file.ts:45 - Fixed SQL injection with parameterized query
2. [HIGH] file.ts:89 - Added null check
### Files Modified
- path/to/file1.ts
- path/to/file2.ts
### Quality Checks
- **Type Check:** PASS | FAIL
- **Lint:** PASS | FAIL
- **Tests:** X passing, Y failing
### Git Commit
- **Hash:** abc123
- **Message:** fix({{story_key}}): address code review findings
### Deferred Issues
- MEDIUM: X issues (defer to follow-up)
- LOW: X issues (skip as gold-plating)
### Ready For
Orchestrator reconciliation (story file updates)
```
**Note:** Story checkboxes and sprint-status updates are done by the orchestrator, not you.
---
**Remember:** You are the FIXER. Fix real problems, skip gold-plating, commit when done. **Remember:** You are the FIXER. Fix real problems, skip gold-plating, commit when done.

View File

@ -150,4 +150,35 @@ Cannot proceed to code review until these are fixed.
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** inspector
**Story:** {{story_key}}
**Status:** PASS | FAIL
### Evidence
- **Type Check:** PASS (0 errors) | FAIL (X errors)
- **Lint:** PASS (0 warnings) | FAIL (X warnings)
- **Build:** PASS | FAIL
- **Tests:** X passing, Y failing, Z% coverage
### Files Verified
- path/to/file1.ts ✓
- path/to/file2.ts ✓
- path/to/missing.ts ✗ (NOT FOUND)
### Failures (if FAIL status)
1. Specific failure with file:line reference
2. Another specific failure
### Ready For
- If PASS: Reviewer (next phase)
- If FAIL: Builder needs to fix before proceeding
```
---
**Remember:** You are the INSPECTOR. Your job is to find the truth, not rubber-stamp the Builder's work. If something is wrong, say so with evidence. **Remember:** You are the INSPECTOR. Your job is to find the truth, not rubber-stamp the Builder's work. If something is wrong, say so with evidence.

View File

@ -187,4 +187,37 @@ Before completing review, check:
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** reviewer
**Story:** {{story_key}}
**Status:** ISSUES_FOUND | CLEAN
### Issue Summary
- **CRITICAL:** X issues (security, data loss)
- **HIGH:** X issues (production bugs)
- **MEDIUM:** X issues (tech debt)
- **LOW:** X issues (nice-to-have)
- **TOTAL:** X issues
### Must Fix (CRITICAL + HIGH)
1. [CRITICAL] file.ts:45 - SQL injection in user query
2. [HIGH] file.ts:89 - Missing null check causes crash
### Should Fix (MEDIUM)
1. file.ts:123 - No error handling for API call
### Files Reviewed
- path/to/file1.ts ✓
- path/to/file2.ts ✓
### Ready For
Fixer agent to address CRITICAL and HIGH issues
```
---
**Remember:** You are the ADVERSARIAL REVIEWER. Your success is measured by finding legitimate issues. Don't be nice - be thorough. **Remember:** You are the ADVERSARIAL REVIEWER. Your success is measured by finding legitimate issues. Don't be nice - be thorough.

View File

@ -1,15 +1,19 @@
# Super-Dev Pipeline - Multi-Agent Architecture # Super-Dev-Pipeline v2.1 - Multi-Agent Architecture
**Version:** 2.1.0
**Architecture:** GSDMAD (GSD + BMAD) **Architecture:** GSDMAD (GSD + BMAD)
**Philosophy:** Trust but verify, separation of concerns **Philosophy:** Agents do creative work, orchestrator does bookkeeping
--- ---
## Overview ## Overview
This workflow implements a story using **4 independent agents** with external validation at each phase. This workflow implements a story using **4 independent agents** with orchestrator-driven reconciliation.
**Key Innovation:** Each agent has single responsibility and fresh context. No agent validates its own work. **Key Innovation:**
- Each agent has single responsibility and fresh context
- No agent validates its own work
- **Orchestrator does bookkeeping** (story file updates, verification) - not agents
--- ---
@ -21,40 +25,48 @@ This workflow implements a story using **4 independent agents** with external va
│ - Loads story │ │ - Loads story │
│ - Spawns agents sequentially │ │ - Spawns agents sequentially │
│ - Verifies each phase │ │ - Verifies each phase │
│ - DOES RECONCILIATION DIRECTLY (not via agent) │
│ - Final quality gate │ │ - Final quality gate │
└─────────────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────────────┘
├──> Phase 1: Builder (Steps 1-4) ├──> Phase 1: Builder (Steps 1-4) [AGENT]
│ - Load story, analyze gaps │ - Load story, analyze gaps
│ - Write tests (TDD) │ - Write tests (TDD)
│ - Implement code │ - Implement code
│ - Report what was built (NO VALIDATION) │ - Report what was built (NO VALIDATION)
├──> Phase 2: Inspector (Steps 5-6) ├──> Phase 2: Inspector (Steps 5-6) [AGENT]
│ - Fresh context, no Builder knowledge │ - Fresh context, no Builder knowledge
│ - Verify files exist │ - Verify files exist
│ - Run tests independently │ - Run tests independently
│ - Run quality checks │ - Run quality checks
│ - PASS or FAIL verdict │ - PASS or FAIL verdict
├──> Phase 3: Reviewer (Step 7) ├──> Phase 3: Reviewer (Step 7) [AGENT]
│ - Fresh context, adversarial stance │ - Fresh context, adversarial stance
│ - Find security vulnerabilities │ - Find security vulnerabilities
│ - Find performance problems │ - Find performance problems
│ - Find logic bugs │ - Find logic bugs
│ - Report issues with severity │ - Report issues with severity
├──> Phase 4: Fixer (Steps 8-9) ├──> Phase 4: Fixer (Steps 8-9) [AGENT]
│ - Fix CRITICAL issues (all) │ - Fix CRITICAL issues (all)
│ - Fix HIGH issues (all) │ - Fix HIGH issues (all)
│ - Fix MEDIUM issues (if time) │ - Fix MEDIUM issues (if time)
│ - Skip LOW issues (gold-plating) │ - Skip LOW issues (gold-plating)
│ - Update story + sprint-status │ - Commit code changes
│ - Commit changes
└──> Final Verification (Main) ├──> Phase 5: Reconciliation (Step 10) [ORCHESTRATOR] 🔧
│ - Orchestrator uses Bash/Read/Edit tools directly
│ - Check off completed tasks in story file
│ - Fill Dev Agent Record with details
│ - Verify updates with bash commands
│ - BLOCKER if verification fails
└──> Final Verification [ORCHESTRATOR]
- Check git commits exist - Check git commits exist
- Check story checkboxes updated - Check story checkboxes updated (count > 0)
- Check Dev Agent Record filled
- Check sprint-status updated - Check sprint-status updated
- Check tests passed - Check tests passed
- Mark COMPLETE or FAILED - Mark COMPLETE or FAILED
@ -182,45 +194,181 @@ Task({
**Wait for Fixer to complete.** **Wait for Fixer to complete.**
### Phase 5: Orchestrator Reconciliation (MANDATORY)
🚨 **THIS PHASE IS MANDATORY. ORCHESTRATOR DOES THIS DIRECTLY. NO AGENT SPAWN.** 🚨
**Why orchestrator, not agent?** Agents ignore instructions. The orchestrator has the context
and can use tools directly. This is bookkeeping work, not creative work.
**YOU (the orchestrator) must execute these commands directly:**
**Step 5.1: Get what was built**
```bash
# Get commit for this story
COMMIT_INFO=$(git log -5 --oneline | grep "{{story_key}}" | head -1)
echo "Commit: $COMMIT_INFO"
# Get files changed (production code only)
FILES_CHANGED=$(git diff HEAD~1 --name-only | grep -v "__tests__" | grep -v "\.test\." | grep -v "\.spec\.")
echo "Files changed:"
echo "$FILES_CHANGED"
```
**Step 5.2: Read story file tasks**
Use Read tool: `{{story_file}}`
Find the Tasks section and identify which tasks relate to the files changed.
**Step 5.3: Check off completed tasks**
Use Edit tool for EACH task that was completed:
```
old_string: "- [ ] Task description here"
new_string: "- [x] Task description here"
```
**Step 5.4: Fill Dev Agent Record**
Use Edit tool to update the Dev Agent Record section:
```
old_string: "### Dev Agent Record
- **Agent Model Used:** [Not set]
- **Implementation Date:** [Not set]
- **Files Created/Modified:** [Not set]
- **Tests Added:** [Not set]
- **Completion Notes:** [Not set]"
new_string: "### Dev Agent Record
- **Agent Model Used:** Claude Sonnet 4 (multi-agent: Builder + Inspector + Reviewer + Fixer)
- **Implementation Date:** {{date}}
- **Files Created/Modified:**
{{#each files_changed}}
- {{this}}
{{/each}}
- **Tests Added:** [count from Inspector report]
- **Completion Notes:** [brief summary of what was implemented]"
```
**Step 5.5: Verify updates (BLOCKER)**
```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 RECONCILIATION VERIFICATION"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Count checked tasks
CHECKED=$(grep -c "^- \[x\]" {{story_file}})
echo "Checked tasks: $CHECKED"
if [ "$CHECKED" -eq 0 ]; then
echo "❌ BLOCKER: Zero checked tasks"
echo "Go back to Step 5.3 and check off tasks"
exit 1
fi
# Verify Dev Agent Record
RECORD=$(grep -A 5 "### Dev Agent Record" {{story_file}} | grep -c "Implementation Date:")
if [ "$RECORD" -eq 0 ]; then
echo "❌ BLOCKER: Dev Agent Record not filled"
echo "Go back to Step 5.4 and fill it"
exit 1
fi
echo "✅ Reconciliation verified: $CHECKED tasks checked"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
```
**If verification fails:** DO NOT proceed. Fix immediately using Edit tool, then re-verify.
--- ---
## Final Verification (Main Orchestrator) ## Final Verification (Main Orchestrator)
**After all agents complete, verify:** 🚨 **CRITICAL: This verification is MANDATORY. DO NOT skip.** 🚨
**After all agents complete (including Reconciler), YOU (the main orchestrator) must:**
1. **Use the Bash tool** to run these commands
2. **Read the output** to see if verification passed
3. **If verification fails**, use Edit and Bash tools to fix it NOW
4. **Do not proceed** until verification passes
**COMMAND TO RUN WITH BASH TOOL:**
```bash ```bash
# 1. Check git commits echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 FINAL VERIFICATION (MANDATORY)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# 1. Check git commits exist
echo "Checking git commits..."
git log --oneline -3 | grep "{{story_key}}" git log --oneline -3 | grep "{{story_key}}"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "❌ FAILED: No commit found" echo "❌ FAILED: No commit found for {{story_key}}"
echo "The Fixer agent did not commit changes."
exit 1 exit 1
fi fi
echo "✅ Git commit found"
# 2. Check story checkboxes # 2. Check story file has checked tasks (ABSOLUTE BLOCKER)
before=$(git show HEAD~1:{{story_file}} | grep -c '^- \[x\]') echo "Checking story file updates..."
after=$(grep -c '^- \[x\]' {{story_file}}) CHECKED_COUNT=$(grep -c '^- \[x\]' {{story_file}})
if [ $after -le $before ]; then echo "Checked tasks: $CHECKED_COUNT"
echo "❌ FAILED: Checkboxes not updated"
if [ "$CHECKED_COUNT" -eq 0 ]; then
echo ""
echo "❌ BLOCKER: Story file has ZERO checked tasks"
echo ""
echo "This means the Fixer agent did NOT update the story file."
echo "The story CANNOT be marked complete without checked tasks."
echo ""
echo "You must:"
echo " 1. Read the git commit to see what was built"
echo " 2. Read the story Tasks section"
echo " 3. Use Edit tool to check off completed tasks"
echo " 4. Fill in Dev Agent Record"
echo " 5. Verify with grep"
echo " 6. Re-run this verification"
echo ""
exit 1 exit 1
fi fi
echo "✅ Story file has $CHECKED_COUNT checked tasks"
# 3. Check sprint-status # 3. Check Dev Agent Record filled
git diff HEAD~1 {{sprint_status}} | grep "{{story_key}}: done" echo "Checking Dev Agent Record..."
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" {{story_file}} | grep -c "Agent Model")
if [ "$RECORD_FILLED" -eq 0 ]; then
echo "❌ BLOCKER: Dev Agent Record NOT filled"
echo "The Fixer agent did not document what was built."
exit 1
fi
echo "✅ Dev Agent Record filled"
# 4. Check sprint-status updated
echo "Checking sprint-status..."
git diff HEAD~1 {{sprint_status}} | grep "{{story_key}}"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "❌ FAILED: Sprint status not updated" echo "❌ FAILED: Sprint status not updated for {{story_key}}"
exit 1 exit 1
fi fi
echo "✅ Sprint status updated"
# 4. Check Inspector output for test evidence # 5. Check test evidence (optional - may have test failures)
grep -E "PASS|tests.*passing" inspector_output.txt echo "Checking test evidence..."
if [ $? -ne 0 ]; then if [ -f "inspector_output.txt" ]; then
echo "❌ FAILED: No test evidence" grep -E "PASS|tests.*passing" inspector_output.txt && echo "✅ Tests passing"
exit 1
fi fi
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ STORY COMPLETE - All verifications passed" echo "✅ STORY COMPLETE - All verifications passed"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
``` ```
**IF VERIFICATION FAILS:**
- DO NOT mark story as "done"
- DO NOT proceed to next story
- FIX the failure immediately
- Re-run verification until it passes
--- ---
## Benefits Over Single-Agent ## Benefits Over Single-Agent

View File

@ -67,6 +67,8 @@ agents:
trust_level: "medium" # Incentive to minimize work trust_level: "medium" # Incentive to minimize work
timeout: 2400 # 40 minutes timeout: 2400 # 40 minutes
# Reconciliation: orchestrator does this directly (see workflow.md Phase 5)
# Complexity level (determines which steps to execute) # Complexity level (determines which steps to execute)
complexity_level: "standard" # micro | standard | complex complexity_level: "standard" # micro | standard | complex

View File

@ -94,40 +94,30 @@ Run `/bmad_bmm_sprint-status` to see current status.</output>
<example>Input: "20-11" → epic=20, story=11, suffix=""</example> <example>Input: "20-11" → epic=20, story=11, suffix=""</example>
</substep> </substep>
<substep n="2b" title="Check for story file using CANONICAL format only"> <substep n="2b" title="Try multiple file patterns using Glob tool">
<critical>🚨 ONE CANONICAL FORMAT - NO VARIATIONS</critical> <action>Use Glob tool to search for files matching these patterns (in priority order):</action>
<action>CANONICAL FORMAT: {story_key}.md</action> <pattern n="1">story-{epic_num}.{story_num}.md</pattern>
<example>20-9-megamenu-navigation.md (epic-story-slug, NO prefix)</example> <example>story-20.9.md (DOT notation, no suffix)</example>
<example>18-1-charge-model-state-machine.md (epic-story-slug, NO prefix)</example>
<action>Check if file exists: {sprint_artifacts}/{story_key}.md</action> <pattern n="2">story-{epic_num}.{story_num}*.md</pattern>
<example>story-20.9-megamenu-navigation.md (DOT notation WITH suffix - use Glob wildcard)</example>
<check if="file exists"> <pattern n="3">{epic_num}-{story_num}.md</pattern>
<action>Set file_status = ✅ EXISTS</action> <example>20-9.md (HYPHEN notation, no "story-" prefix)</example>
<action>Store file_path = {sprint_artifacts}/{story_key}.md</action>
</check>
<check if="file does NOT exist"> <pattern n="4">{epic_num}-{story_num}*.md</pattern>
<action>Set file_status = ❌ MISSING</action> <example>20-9-megamenu-navigation.md (HYPHEN notation WITH suffix)</example>
<action>Check for legacy wrong-named files:</action> <pattern n="5">story-{story_key}.md</pattern>
<action> Search for: story-{story_key}.md (wrong - has "story-" prefix)</action> <example>story-20-9-megamenu-navigation.md (literal story_key with "story-" prefix)</example>
<check if="found wrong-named file"> <pattern n="6">{story_key}.md</pattern>
<output>⚠️ Found legacy file: story-{story_key}.md</output> <example>20-9-megamenu-navigation.md (literal story_key)</example>
<output>🔧 AUTO-RENAMING to canonical: {story_key}.md</output>
<action>Rename: mv story-{story_key}.md {story_key}.md</action> <action>Stop at first match and store file_path</action>
<action>Verify rename worked</action> <action>If NO match found after all 6 patterns → file_status = ❌ MISSING</action>
<action>Set file_status = ✅ EXISTS (after rename)</action> <action>If match found → file_status = ✅ EXISTS</action>
<action>Store file_path = {sprint_artifacts}/{story_key}.md</action>
</check>
<check if="no file found (canonical OR legacy)">
<action>file_status = ❌ MISSING (genuinely missing)</action>
</check>
</check>
</substep> </substep>
<action>Mark stories as: ✅ (file exists), ❌ (file missing), 🔄 (already implemented but not marked done)</action> <action>Mark stories as: ✅ (file exists), ❌ (file missing), 🔄 (already implemented but not marked done)</action>
@ -685,59 +675,24 @@ Gap analysis will happen just-in-time during implementation (Step 2 of super-dev
</check> </check>
</check> </check>
<output>🚀 Spawning {{needs_creation.length}} parallel agents for story creation...</output>
<action>Spawn Task agents in PARALLEL (send all Task calls in SINGLE message):</action>
<iterate>For each story in needs_creation:</iterate> <iterate>For each story in needs_creation:</iterate>
<substep n="2.7a" title="Spawn story creation agent"> <substep n="2.7a" title="Create individual story file">
<action> <output>📝 Creating story {{@index}}/{{needs_creation.length}}: {{story_key}}...</output>
Task tool call:
- subagent_type: "general-purpose"
- description: "Create story {{story_key}}"
- prompt: "Create basic story file for {{story_key}}.
INSTRUCTIONS: <action>Invoke workflow: /bmad_bmm_create-story</action>
1. Read epic description from docs/epics.md (Epic {{epic_num}}) <action>Parameters:
2. Read PRD requirements (docs/prd-art-collective-tenants.md) - story_key: {{story_key}}
3. Read architecture (docs/architecture-space-rentals.md) - epic_num: {{epic_num}}
4. Extract FRs for this story from PRD - mode: batch (auto-approve, minimal prompts)
5. Break down into 3-7 tasks with subtasks
6. Create story file at: docs/sprint-artifacts/{{story_key}}.md
7. Use template from: _bmad/bmm/workflows/4-implementation/create-story/template.md
8. NO gap analysis (defer to implementation)
9. Commit story file when complete
10. Report: story file path
Mode: batch (lightweight, no codebase scanning)"
- Store returned agent_id for tracking
</action> </action>
</substep>
<output> <check if="story creation succeeded">
⏳ Waiting for {{needs_creation.length}} parallel agents to complete...
Story creation agents:
{{#each needs_creation}}
- Agent {{@index}}: {{story_key}}
{{/each}}
</output>
<action>Wait for ALL agents to complete (blocking)</action>
<iterate>Check each agent output:</iterate>
<substep n="2.7b" title="Verify story creation results">
<action>Parse agent output for {{story_key}}</action>
<check if="agent succeeded AND story file exists">
<output>✅ Story created: {{story_key}}</output> <output>✅ Story created: {{story_key}}</output>
<action>Verify file exists at docs/sprint-artifacts/{{story_key}}.md</action>
<action>Mark story.needs_story_creation = false</action> <action>Mark story.needs_story_creation = false</action>
</check> </check>
<check if="agent failed OR story file missing"> <check if="story creation failed">
<output>❌ Failed to create story: {{story_key}}</output> <output>❌ Failed to create story: {{story_key}}</output>
<action>Add to failed_creations list</action> <action>Add to failed_creations list</action>
<action>Remove from selected_stories</action> <action>Remove from selected_stories</action>
@ -830,93 +785,25 @@ QUALITY OVER SPEED: Taking time to ensure correctness.
<action>Set quality_multiplier = 1.5</action> <action>Set quality_multiplier = 1.5</action>
</check> </check>
<substep n="3.1" title="Automatic Dependency Analysis (from GSD)">
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 ANALYZING STORY DEPENDENCIES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
<iterate>For each selected story:</iterate>
<action>Read story file Tasks section</action>
<action>Analyze task descriptions for dependencies on other selected stories:</action>
<action>
Dependency detection rules:
- Look for mentions of other story keys (e.g., "18-1", "18-2")
- Look for phrases like "requires", "depends on", "needs", "after"
- Look for file paths that other stories create
- Look for models/services that other stories define
</action>
<action>Build dependency map:
story_key: {
depends_on: [list of story keys this depends on],
blocks: [list of story keys that depend on this]
}
</action>
<action>Compute waves using topological sort:</action>
<action>
Wave 1: Stories with no dependencies (can start immediately)
Wave 2: Stories that only depend on Wave 1
Wave 3: Stories that depend on Wave 2
...
</action>
<output>
📊 **Dependency Analysis Complete**
{{#each waves}}
**Wave {{@index}}** ({{count}} stories):
{{#each stories}}
- {{story_key}}{{#if depends_on}} [depends on: {{depends_on}}]{{/if}}
{{/each}}
{{/each}}
**Execution Strategy:**
{{#if waves.length == 1}}
✅ All stories are independent - can run fully in parallel
{{else}}
⚙️ Dependencies detected - wave-based execution recommended
- Wave 1: {{wave_1_count}} stories (parallel)
- Total waves: {{waves.length}}
- Sequential time: {{total_time_sequential}}
- Wave-based time: {{total_time_waves}} ({{time_savings}}% faster)
{{/if}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
</substep>
<ask> <ask>
**How should these stories be processed?** **How should these stories be processed?**
Options: Options:
- **S**: Sequential - Run stories one-by-one (Task agent finishes before next starts) - **sequential**: Run stories one-by-one in this session (slower, easier to monitor)
- **P**: Parallel - Run stories concurrently (Multiple Task agents running simultaneously) - **parallel**: Spawn Task agents to process stories concurrently (faster, autonomous)
**Note:** Both modes use Task agents to keep story context out of the main thread. Enter: sequential or parallel
The only difference is the number running at once.
Enter: S or P
</ask> </ask>
<action>Capture response as: execution_strategy</action> <action>Capture response as: execution_mode</action>
<check if="execution_strategy == 's' OR execution_strategy == 'S'"> <check if="execution_mode == 'sequential'">
<action>Set execution_mode = "sequential"</action>
<action>Set parallel_count = 1</action> <action>Set parallel_count = 1</action>
<action>Set use_task_agents = true</action> <action>Set use_task_agents = false</action>
<output> <output>✅ Sequential mode selected - stories will be processed one-by-one in this session</output>
⏺ ✅ Sequential mode selected - stories will be processed one-by-one
Each story runs in its own Task agent. Agents execute sequentially (one completes before next starts).
This keeps the main thread clean while maintaining easy monitoring.
</output>
</check> </check>
<check if="execution_strategy == 'p' OR execution_strategy == 'P'"> <check if="execution_mode == 'parallel'">
<action>Set execution_mode = "parallel"</action>
<action>Set use_task_agents = true</action> <action>Set use_task_agents = true</action>
<ask> <ask>
@ -939,33 +826,26 @@ Enter number (2-10) or 'all':
<check if="parallel_count was capped at 10"> <check if="parallel_count was capped at 10">
<output>⚠️ Requested {{original_count}} agents, capped at 10 (safety limit)</output> <output>⚠️ Requested {{original_count}} agents, capped at 10 (safety limit)</output>
</check> </check>
<output>
⏺ ✅ Parallel mode selected - {{parallel_count}} Task agents will run concurrently
Each story runs in its own Task agent. Multiple agents execute in parallel for faster completion.
</output>
</check> </check>
<output> <output>
## ⚙️ Execution Plan ## ⚙️ Execution Plan
**Mode:** {{execution_mode}} **Mode:** {{execution_mode}}
**Task Agents:** {{parallel_count}} {{#if parallel_count > 1}}running concurrently{{else}}running sequentially{{/if}} {{#if use_task_agents}}
**Task Agents:** {{parallel_count}} running concurrently
**Agent Type:** general-purpose (autonomous) **Agent Type:** general-purpose (autonomous)
{{else}}
**Sequential processing** in current session
{{/if}}
**Stories to process:** {{count}} **Stories to process:** {{count}}
**Estimated total time:** **Estimated total time:**
{{#if parallel_count > 1}} {{#if use_task_agents}}
- With {{parallel_count}} agents: {{estimated_hours / parallel_count}} hours - With {{parallel_count}} agents: {{estimated_hours / parallel_count}} hours
{{else}} {{else}}
- Sequential: {{estimated_hours}} hours - Sequential: {{estimated_hours}} hours
{{/if}} {{/if}}
**Complexity Routing:**
{{#each stories_by_complexity}}
- {{complexity}}: {{count}} stories ({{pipeline_description}})
{{/each}}
</output> </output>
<ask>Confirm execution plan? (yes/no):</ask> <ask>Confirm execution plan? (yes/no):</ask>
@ -980,476 +860,56 @@ Each story runs in its own Task agent. Multiple agents execute in parallel for f
<action>Initialize counters: completed=0, failed=0, failed_stories=[], reconciliation_warnings=[], reconciliation_warnings_count=0</action> <action>Initialize counters: completed=0, failed=0, failed_stories=[], reconciliation_warnings=[], reconciliation_warnings_count=0</action>
<action>Set start_time = current timestamp</action> <action>Set start_time = current timestamp</action>
<check if="parallel_count == 1"> <check if="use_task_agents == true">
<action>Jump to Step 4-Sequential (Task agents, one at a time)</action> <action>Jump to Step 4-Parallel (Task Agent execution)</action>
</check> </check>
<check if="parallel_count > 1 AND waves.length > 1"> <check if="use_task_agents == false">
<action>Jump to Step 4-Wave (Task agents, wave-based parallel)</action> <action>Continue to Step 4-Sequential (In-session execution)</action>
</check>
<check if="parallel_count > 1 AND waves.length <= 1">
<action>Jump to Step 4-Parallel (Task agents, multiple concurrent)</action>
</check> </check>
</step> </step>
<step n="4-Wave" goal="Wave-based parallel execution"> <step n="4-Sequential" goal="Sequential processing in current session">
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 WAVE-BASED PARALLEL PROCESSING STARTED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Stories:** {{count}}
**Total waves:** {{waves.length}}
**Mode:** Task agents (parallel by wave)
**Max concurrent agents:** {{parallel_count}}
**Continue on failure:** {{continue_on_failure}}
**Pattern:** Wave barrier (complete wave before next wave)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 **Wave Plan (from dependency analysis):**
{{#each waves}}
Wave {{@index}}: {{count}} stories
{{#each stories}}
- {{story_key}}{{#if depends_on}} [depends on: {{depends_on}}]{{/if}}
{{/each}}
{{/each}}
</output>
<action>Set abort_batch = false</action>
<iterate>For each wave in waves (in order):</iterate>
<substep n="4w-start" title="Start wave {{@index}}">
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌊 STARTING WAVE {{@index}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Stories in this wave:
{{#each stories}}
- {{story_key}}{{#if depends_on}} (depends on: {{depends_on}}){{/if}}
{{/each}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
<action>Initialize wave worker pool state:</action>
<action>
- wave_queue = stories
- Resolve wave_queue items to full story objects by matching story_key in selected_stories (include complexity_level, story_file_path)
- active_workers = {} (map of worker_id → {story_key, task_id, started_at})
- completed_wave_stories = []
- failed_wave_stories = []
- next_story_index = 0
- max_workers = min(parallel_count, wave_queue.length)
</action>
</substep>
<substep n="4w-init" title="Fill initial worker slots for wave {{@index}}">
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 Initializing {{max_workers}} worker slots for Wave {{@index}}...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
<action>Spawn first {{max_workers}} agents (or fewer if less stories):</action>
<iterate>While next_story_index < min(max_workers, wave_queue.length):</iterate>
<action>
story_key = wave_queue[next_story_index].story_key
complexity_level = wave_queue[next_story_index].complexity_level
story_file_path = wave_queue[next_story_index].story_file_path
worker_id = next_story_index + 1
Spawn Task agent:
- subagent_type: "general-purpose"
- description: "Implement story {{story_key}}"
- prompt: "Execute super-dev-pipeline workflow for story {{story_key}}.
Story file: docs/sprint-artifacts/{{story_key}}.md
Complexity: {{complexity_level}}
Mode: batch
Load workflow: /Users/jonahschulte/git/BMAD-METHOD/src/modules/bmm/workflows/4-implementation/super-dev-pipeline
Follow the multi-agent pipeline (builder, inspector, reviewer, fixer).
Commit when complete, update story status, report results."
- run_in_background: true (non-blocking)
Store in active_workers[worker_id]:
story_key: {{story_key}}
task_id: {{returned_task_id}}
started_at: {{timestamp}}
status: "running"
</action>
<action>Increment next_story_index</action>
<output>🚀 Worker {{worker_id}} started: {{story_key}}</output>
</substep>
<substep n="4w-pool" title="Maintain wave worker pool for wave {{@index}}">
<critical>WAVE BARRIER: Complete all stories in this wave before starting next wave</critical>
<iterate>While active_workers.size > 0 OR next_story_index < wave_queue.length:</iterate>
<action>Poll for completed workers (check task outputs non-blocking):</action>
<iterate>For each worker_id in active_workers:</iterate>
<action>Check if worker task completed using TaskOutput(task_id, block=false)</action>
<check if="worker task is still running">
<action>Continue to next worker (don't wait)</action>
</check>
<check if="worker task completed successfully">
<action>Get worker details: story_key = active_workers[worker_id].story_key</action>
<output>✅ Worker {{worker_id}} completed: {{story_key}}</output>
<action>Execute Step 4.5: Smart Story Reconciliation</action>
<action>Load reconciliation instructions: {installed_path}/step-4.5-reconcile-story-status.md</action>
<action>Execute reconciliation with story_key={{story_key}}</action>
<critical>🚨 MANDATORY STORY FILE VERIFICATION - MAIN ORCHESTRATOR MUST RUN BASH</critical>
<bash_required>
STORY_FILE="docs/sprint-artifacts/{{story_key}}.md"
echo "🔍 Verifying story file: {{story_key}}"
CHECKED_COUNT=$(grep -c "^- \[x\]" "$STORY_FILE" 2>/dev/null || echo "0")
TOTAL_COUNT=$(grep -c "^- \[.\]" "$STORY_FILE" 2>/dev/null || echo "0")
echo " Checked tasks: $CHECKED_COUNT/$TOTAL_COUNT"
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" "$STORY_FILE" 2>/dev/null | grep -c "Claude Sonnet" || echo "0")
echo " Dev Agent Record: $RECORD_FILLED"
echo "$CHECKED_COUNT" > /tmp/checked_{{story_key}}.txt
echo "$RECORD_FILLED" > /tmp/record_{{story_key}}.txt
</bash_required>
<check if="checked_count == 0 OR record_filled == 0">
<output>
❌ Story {{story_key}}: Agent FAILED to update story file
Checked tasks: {{checked_tasks}}/{{total_tasks}}
Dev Agent Record: {{dev_agent_record_status}}
🔧 EXECUTING AUTO-FIX RECONCILIATION...
</output>
<action>AUTO-FIX PROCEDURE:</action>
<action>1. Read agent's commit to see what files were created/modified</action>
<action>2. Read story Tasks section to see what was supposed to be built</action>
<action>3. For each task, check if corresponding code exists in commit</action>
<action>4. If code exists, check off the task using Edit tool</action>
<action>5. Fill in Dev Agent Record with commit details</action>
<action>6. Verify fixes worked (re-count checked tasks)</action>
<check if="auto_fix_succeeded AND checked_tasks > 0">
<output>✅ AUTO-FIX SUCCESS: {{checked_tasks}}/{{total_tasks}} tasks now checked</output>
<action>Continue with story completion</action>
</check>
<check if="auto_fix_failed OR checked_tasks still == 0">
<output>
❌ AUTO-FIX FAILED: Cannot reconcile story {{story_key}}
After auto-fix attempts:
- Checked tasks: {{checked_tasks}}/{{total_tasks}}
- Dev Agent Record: {{dev_agent_record_status}}
**Agent produced code but story file cannot be updated.**
Marking story as "in-progress" (not done) and continuing with warnings.
</output>
<action>Override story status to "in-progress"</action>
<action>Add to reconciliation_warnings with detailed diagnostic</action>
<action>Continue (do NOT kill workers)</action>
</check>
</check>
<check if="reconciliation succeeded AND checked_tasks > 0 AND dev_agent_record_filled">
<output>✅ COMPLETED: {{story_key}} (reconciled and verified)</output>
<output> Tasks: {{checked_tasks}}/{{total_tasks}} ({{task_completion_pct}}%)</output>
<action>Increment completed counter</action>
<action>Add to completed_wave_stories</action>
</check>
<check if="task_completion_pct < 80">
<output>⚠️ WARNING: {{story_key}} - Low completion ({{task_completion_pct}}%)</output>
<action>Add to reconciliation_warnings: {story_key: {{story_key}}, warning_message: "Only {{task_completion_pct}}% tasks checked - manual verification needed"}</action>
</check>
<action>Remove worker_id from active_workers (free the slot)</action>
<action>IMMEDIATELY refill slot if stories remain in this wave:</action>
<check if="next_story_index < wave_queue.length">
<action>story_key = wave_queue[next_story_index].story_key</action>
<action>complexity_level = wave_queue[next_story_index].complexity_level</action>
<action>story_file_path = wave_queue[next_story_index].story_file_path</action>
<output>🔄 Worker {{worker_id}} refilled: {{story_key}}</output>
<action>Spawn new Task agent for this worker_id (same parameters as init)</action>
<action>Update active_workers[worker_id] with new task_id and story_key</action>
<action>Increment next_story_index</action>
</check>
</check>
<check if="worker task failed">
<action>Get worker details: story_key = active_workers[worker_id].story_key</action>
<output>❌ Worker {{worker_id}} failed: {{story_key}}</output>
<action>Increment failed counter</action>
<action>Add story_key to failed_stories list</action>
<action>Add to failed_wave_stories</action>
<action>Remove worker_id from active_workers (free the slot)</action>
<check if="continue_on_failure == false">
<output>⚠️ Stopping wave and batch due to failure (continue_on_failure=false)</output>
<action>Kill all active workers</action>
<action>Clear active_workers</action>
<action>Set abort_batch = true</action>
<action>Break worker pool loop</action>
</check>
<check if="continue_on_failure == true AND next_story_index < wave_queue.length">
<action>story_key = wave_queue[next_story_index].story_key</action>
<action>complexity_level = wave_queue[next_story_index].complexity_level</action>
<action>story_file_path = wave_queue[next_story_index].story_file_path</action>
<output>🔄 Worker {{worker_id}} refilled: {{story_key}} (despite previous failure)</output>
<action>Spawn new Task agent for this worker_id</action>
<action>Update active_workers[worker_id] with new task_id and story_key</action>
<action>Increment next_story_index</action>
</check>
</check>
<check if="abort_batch == true">
<action>Break worker pool loop</action>
</check>
<action>Display live progress every 30 seconds:</action>
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Live Progress (Wave {{@index}} - {{timestamp}})
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Completed: {{completed}}
❌ Failed: {{failed}}
🔄 Active workers: {{active_workers.size}}
📋 Queued in wave: {{wave_queue.length - next_story_index}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
<action>Sleep 5 seconds before next poll (prevents tight loop)</action>
</substep>
<check if="abort_batch == true">
<output>⛔ Aborting remaining waves due to failure and continue_on_failure=false</output>
<action>Jump to Step 5 (Summary)</action>
</check>
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ WAVE {{@index}} COMPLETE
Stories completed: {{completed_wave_stories.length}}
Stories failed: {{failed_wave_stories.length}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
<action>After all waves processed, jump to Step 5 (Summary)</action>
</step>
<step n="4-Sequential" goal="Sequential Task agent execution (one at a time)">
<output> <output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 SEQUENTIAL BATCH PROCESSING STARTED 🚀 SEQUENTIAL BATCH PROCESSING STARTED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Stories:** {{count}} **Stories:** {{count}}
**Mode:** Task agents (sequential, one at a time) **Mode:** super-dev-pipeline (batch, sequential)
**Continue on failure:** {{continue_on_failure}} **Continue on failure:** {{continue_on_failure}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output> </output>
<iterate>For each story in selected_stories:</iterate> <iterate>For each story in selected_stories:</iterate>
<substep n="4s-a" title="Spawn Task agent for story"> <substep n="4s-a" title="Process individual story">
<output> <output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📦 Story {{current_index}}/{{total_count}}: {{story_key}} 📦 Story {{current_index}}/{{total_count}}: {{story_key}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Complexity: {{complexity_level}}
Pipeline: {{#if complexity_level == 'micro'}}Lightweight (skip tests, skip review){{else if complexity_level == 'standard'}}Full quality gates{{else}}Enhanced validation{{/if}}
Spawning Task agent...
</output> </output>
<action> <action>Invoke workflow: /bmad:bmm:workflows:super-dev-pipeline</action>
Use Task tool to spawn agent: <action>Parameters: mode=batch, story_key={{story_key}}, complexity_level={{story_key}}.complexity.level</action>
- subagent_type: "general-purpose"
- description: "Implement story {{story_key}}"
- prompt: "Execute super-dev-pipeline workflow for story {{story_key}}.
Story file: docs/sprint-artifacts/{{story_key}}.md <check if="super-dev-pipeline succeeded">
Complexity: {{complexity_level}}
Mode: batch
Load workflow: /Users/jonahschulte/git/BMAD-METHOD/src/modules/bmm/workflows/4-implementation/super-dev-pipeline
Follow the multi-agent pipeline (builder, inspector, reviewer, fixer).
Commit when complete, update story status, report results."
- Store agent_id
</action>
<action>WAIT for agent to complete (blocking call)</action>
<check if="Task agent succeeded">
<output>✅ Implementation complete: {{story_key}}</output> <output>✅ Implementation complete: {{story_key}}</output>
<critical>🚨 STORY RECONCILIATION - ORCHESTRATOR DOES THIS NOW (NOT AGENTS)</critical> <critical>ORCHESTRATOR: You must execute reconciliation directly using Bash/Read/Edit tools.</critical>
<critical>Do NOT delegate this to an agent. YOU do it.</critical>
<output> <reconciliation>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. Use Bash: `git log -3 --oneline | grep "{{story_key}}"` to find commit
🔧 RECONCILING STORY FILE: {{story_key}} 2. Use Bash: `git diff HEAD~1 --name-only` to get files changed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3. Use Read: `docs/sprint-artifacts/{{story_key}}.md` to see tasks
Main orchestrator performing reconciliation (not delegating) 4. Use Edit: Check off tasks (change `- [ ]` to `- [x]`) for completed work
</output> 5. Use Edit: Fill Dev Agent Record with files/date/summary
6. Use Bash: Verify with `grep -c "^- \[x\]"` (must be > 0)
7. Use Edit: Update sprint-status.yaml to "done" or "review"
</reconciliation>
<action>YOU (orchestrator) must use Bash tool NOW with this command:</action> <check if="reconciliation succeeded (checked tasks > 0)">
<output>✅ COMPLETED: {{story_key}} (reconciled)</output>
<bash_command>
STORY_FILE="docs/sprint-artifacts/{{story_key}}.md"
echo "Verifying story file: $STORY_FILE"
CHECKED_COUNT=$(grep -c "^- \[x\]" "$STORY_FILE" 2>/dev/null || echo "0")
TOTAL_COUNT=$(grep -c "^- \[.\]" "$STORY_FILE" 2>/dev/null || echo "0")
echo "Checked tasks: $CHECKED_COUNT/$TOTAL_COUNT"
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" "$STORY_FILE" 2>/dev/null | grep -c "Claude Sonnet" || echo "0")
echo "Dev Agent Record: $RECORD_FILLED"
echo "checked_count=$CHECKED_COUNT"
echo "record_filled=$RECORD_FILLED"
</bash_command>
<action>After running Bash tool, read the output and extract checked_count and record_filled values</action>
<check if="checked_count == 0 OR record_filled == 0">
<output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
❌ STORY FILE VERIFICATION FAILED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Story: {{story_key}}
Checked tasks: {{checked_count}}/{{total_count}}
Dev Agent Record: {{#if record_filled > 0}}FILLED{{else}}EMPTY{{/if}}
🚨 The agent DID NOT update the story file.
YOU (the main orchestrator) must fix this NOW.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
</output>
<critical>MANDATORY AUTO-FIX - MAIN ORCHESTRATOR MUST EXECUTE THIS</critical>
<action>AUTO-FIX PROCEDURE (YOU MUST DO THIS):</action>
<bash_required>
# Step 1: Get commit for this story
COMMIT_SHA=$(git log -1 --grep="{{story_key}}" --pretty=format:"%H" 2>/dev/null)
if [ -z "$COMMIT_SHA" ]; then
# Try finding by story key pattern
COMMIT_SHA=$(git log -5 --pretty=format:"%H %s" | grep -i "{{story_key}}" | head -1 | cut -d' ' -f1)
fi
echo "Found commit: $COMMIT_SHA"
# Step 2: Get files changed
git diff ${COMMIT_SHA}~1 $COMMIT_SHA --name-only | grep -v "test/" | grep -v "__tests__"
</bash_required>
<action>Step 3: Read story file to get Tasks section:</action>
<read_required>docs/sprint-artifacts/{{story_key}}.md</read_required>
<action>Step 4: For EACH task in Tasks section:</action>
<iterate>For each line starting with "- [ ]":</iterate>
<action>
- Extract task description
- Check if git diff contains related file/function
- If YES: Use Edit tool to change "- [ ]" to "- [x]"
- Verify edit: Run bash grep to confirm checkbox is now checked
</action>
<action>Step 5: Fill Dev Agent Record using Edit tool:</action>
<action>
- Find "### Dev Agent Record" section
- Replace with actual data:
* Agent Model: Claude Sonnet 4.5 (multi-agent pipeline)
* Date: {{current_date}}
* Files: {{files_from_git_diff}}
* Notes: {{from_commit_message}}
</action>
<action>Step 6: Re-run verification bash commands:</action>
<bash_required>
CHECKED_COUNT=$(grep -c "^- \[x\]" "$STORY_FILE")
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" "$STORY_FILE" | grep -c "Claude Sonnet")
echo "After auto-fix:"
echo " Checked tasks: $CHECKED_COUNT"
echo " Dev Agent Record: $RECORD_FILLED"
if [ "$CHECKED_COUNT" -eq 0 ]; then
echo "❌ AUTO-FIX FAILED: Story file still not updated"
exit 1
fi
echo "✅ AUTO-FIX SUCCESS"
</bash_required>
<check if="auto_fix_bash_exit_code == 0">
<output>✅ AUTO-FIX SUCCESS: Story file now updated ({{checked_count}} tasks checked)</output>
<action>Continue with story as completed</action>
</check>
<check if="auto_fix_bash_exit_code != 0">
<output>
❌ AUTO-FIX FAILED: Cannot reconcile story {{story_key}}
After multiple fix attempts, story file still shows:
- Checked tasks: {{checked_count}}
- Dev Agent Record: {{record_status}}
Marking story as "in-progress" (not done).
</output>
<action>Update sprint-status to "in-progress" instead of "done"</action>
<action>Add to failed_stories list</action>
<action>Continue to next story (if continue_on_failure)</action>
</check>
</check>
<check if="task_completion_pct < 80">
<output>
⚠️ WARNING: Story {{story_key}} - LOW TASK COMPLETION
Only {{checked_tasks}}/{{total_tasks}} tasks checked ({{task_completion_pct}}%).
This suggests incomplete implementation. Cannot mark as "done".
Marking as "in-progress" instead.
</output>
<action>Override story status to "in-progress"</action>
<action>Override sprint-status to "in-progress"</action>
<action>Add to reconciliation_warnings</action>
</check>
<check if="reconciliation succeeded AND checked_tasks > 0 AND dev_agent_record_filled">
<output>✅ COMPLETED: {{story_key}} (reconciled and verified)</output>
<output> Tasks: {{checked_tasks}}/{{total_tasks}} ({{task_completion_pct}}%)</output>
<action>Increment completed counter</action> <action>Increment completed counter</action>
<check if="execution_mode == 'interactive_checkpoint'"> <check if="execution_mode == 'interactive_checkpoint'">
@ -1594,13 +1054,15 @@ Press [C] to continue or [P] to pause:
- description: "Implement story {{story_key}}" - description: "Implement story {{story_key}}"
- prompt: "Execute super-dev-pipeline workflow for story {{story_key}}. - prompt: "Execute super-dev-pipeline workflow for story {{story_key}}.
Story file: docs/sprint-artifacts/{{story_key}}.md CRITICAL INSTRUCTIONS:
Complexity: {{complexity_level}} 1. Load workflow.xml: _bmad/core/tasks/workflow.xml
Mode: batch 2. Load workflow config: _bmad/bmm/workflows/4-implementation/super-dev-pipeline/workflow.yaml
3. Execute in BATCH mode with story_key={{story_key}} and complexity_level={{story_key}}.complexity.level
4. Follow all 7 pipeline steps (init, pre-gap, implement, post-validate, code-review, complete, summary)
5. Commit changes when complete
6. Report final status (done/failed) with file list
Load workflow: /Users/jonahschulte/git/BMAD-METHOD/src/modules/bmm/workflows/4-implementation/super-dev-pipeline Story file will be auto-resolved from multiple naming conventions."
Follow the multi-agent pipeline (builder, inspector, reviewer, fixer).
Commit when complete, update story status, report results."
- run_in_background: true (non-blocking - critical for semaphore pattern) - run_in_background: true (non-blocking - critical for semaphore pattern)
Store in active_workers[worker_id]: Store in active_workers[worker_id]:
@ -1643,77 +1105,27 @@ Press [C] to continue or [P] to pause:
<output>✅ Worker {{worker_id}} completed: {{story_key}}</output> <output>✅ Worker {{worker_id}} completed: {{story_key}}</output>
<action>Execute Step 4.5: Smart Story Reconciliation</action> <critical>ORCHESTRATOR: You must execute reconciliation directly using Bash/Read/Edit tools.</critical>
<action>Load reconciliation instructions: {installed_path}/step-4.5-reconcile-story-status.md</action>
<action>Execute reconciliation with story_key={{story_key}}</action>
<critical>🚨 MANDATORY STORY FILE VERIFICATION - MAIN ORCHESTRATOR MUST RUN BASH</critical> <reconciliation>
1. Use Bash: `git log -3 --oneline | grep "{{story_key}}"` to find commit
2. Use Bash: `git diff HEAD~1 --name-only` to get files changed
3. Use Read: `docs/sprint-artifacts/{{story_key}}.md` to see tasks
4. Use Edit: Check off tasks (change `- [ ]` to `- [x]`) for completed work
5. Use Edit: Fill Dev Agent Record with files/date/summary
6. Use Bash: Verify with `grep -c "^- \[x\]"` (must be > 0)
7. Use Edit: Update sprint-status.yaml to "done" or "review"
</reconciliation>
<bash_required> <check if="reconciliation succeeded (checked tasks > 0)">
STORY_FILE="docs/sprint-artifacts/{{story_key}}.md" <output>✅ COMPLETED: {{story_key}} (reconciled)</output>
echo "🔍 Verifying story file: {{story_key}}"
CHECKED_COUNT=$(grep -c "^- \[x\]" "$STORY_FILE" 2>/dev/null || echo "0")
TOTAL_COUNT=$(grep -c "^- \[.\]" "$STORY_FILE" 2>/dev/null || echo "0")
echo " Checked tasks: $CHECKED_COUNT/$TOTAL_COUNT"
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" "$STORY_FILE" 2>/dev/null | grep -c "Claude Sonnet" || echo "0")
echo " Dev Agent Record: $RECORD_FILLED"
echo "$CHECKED_COUNT" > /tmp/checked_{{story_key}}.txt
echo "$RECORD_FILLED" > /tmp/record_{{story_key}}.txt
</bash_required>
<check if="checked_count == 0 OR record_filled == 0">
<output>
❌ Story {{story_key}}: Agent FAILED to update story file
Checked tasks: {{checked_tasks}}/{{total_tasks}}
Dev Agent Record: {{dev_agent_record_status}}
🔧 EXECUTING AUTO-FIX RECONCILIATION...
</output>
<action>AUTO-FIX PROCEDURE:</action>
<action>1. Read agent's commit to see what files were created/modified</action>
<action>2. Read story Tasks section to see what was supposed to be built</action>
<action>3. For each task, check if corresponding code exists in commit</action>
<action>4. If code exists, check off the task using Edit tool</action>
<action>5. Fill in Dev Agent Record with commit details</action>
<action>6. Verify fixes worked (re-count checked tasks)</action>
<check if="auto_fix_succeeded AND checked_tasks > 0">
<output>✅ AUTO-FIX SUCCESS: {{checked_tasks}}/{{total_tasks}} tasks now checked</output>
<action>Continue with story completion</action>
</check>
<check if="auto_fix_failed OR checked_tasks still == 0">
<output>
❌ AUTO-FIX FAILED: Cannot reconcile story {{story_key}}
After auto-fix attempts:
- Checked tasks: {{checked_tasks}}/{{total_tasks}}
- Dev Agent Record: {{dev_agent_record_status}}
**Agent produced code but story file cannot be updated.**
Marking story as "in-progress" (not done) and continuing with warnings.
</output>
<action>Override story status to "in-progress"</action>
<action>Add to reconciliation_warnings with detailed diagnostic</action>
<action>Continue (do NOT kill workers)</action>
</check>
</check>
<check if="reconciliation succeeded AND checked_tasks > 0 AND dev_agent_record_filled">
<output>✅ COMPLETED: {{story_key}} (reconciled and verified)</output>
<output> Tasks: {{checked_tasks}}/{{total_tasks}} ({{task_completion_pct}}%)</output>
<action>Add to completed_stories</action> <action>Add to completed_stories</action>
</check> </check>
<check if="task_completion_pct < 80"> <check if="reconciliation failed (checked tasks = 0)">
<output>⚠️ WARNING: {{story_key}} - Low completion ({{task_completion_pct}}%)</output> <output>⚠️ WARNING: {{story_key}} completed but reconciliation failed</output>
<action>Add to reconciliation_warnings: {story_key: {{story_key}}, warning_message: "Only {{task_completion_pct}}% tasks checked - manual verification needed"}</action> <action>Add to completed_stories (implementation successful)</action>
<action>Add to reconciliation_warnings: {story_key: {{story_key}}, warning_message: "Reconciliation failed - manual verification needed"}</action>
</check> </check>
<action>Remove worker_id from active_workers (free the slot)</action> <action>Remove worker_id from active_workers (free the slot)</action>

View File

@ -1,390 +1,171 @@
# Step 4.5: Smart Story Reconciliation # Step 4.5: Story Reconciliation (Orchestrator-Driven)
<critical>Execute AFTER super-dev-pipeline completes but BEFORE marking story as "completed"</critical> **Version:** 2.1.0
<critical>This ensures story checkboxes and status accurately reflect actual implementation</critical> **Execute:** AFTER super-dev-pipeline completes, BEFORE marking story done
**Who:** Orchestrator (YOU) - not an agent
## Goal
Verify story file accuracy by reconciling:
1. **Acceptance Criteria checkboxes** vs Dev Agent Record
2. **Tasks/Subtasks checkboxes** vs Dev Agent Record
3. **Definition of Done checkboxes** vs Dev Agent Record
4. **Story status** (should be "done" if implementation complete)
5. **sprint-status.yaml entry** (should match story file status)
--- ---
## Execution ## Why Orchestrator Does This
### 1. Load Story File Agents ignore reconciliation instructions. The orchestrator:
- Has full context of what just happened
<action>Read story file: {story_file_path}</action> - Can use tools directly (Bash, Read, Edit)
<action>Extract sections: - Won't skip "boring" bookkeeping tasks
- Acceptance Criteria (## Acceptance Criteria)
- Tasks / Subtasks (## Tasks / Subtasks)
- Definition of Done (## Definition of Done)
- Dev Agent Record (## Dev Agent Record)
- Story status header (**Status:** ...)
</action>
### 2. Analyze Dev Agent Record
<action>Read "Dev Agent Record" section</action>
<check if="Dev Agent Record is empty or says '(To be filled by dev agent)'">
<output>⚠️ Story {{story_key}}: Dev Agent Record is empty - cannot reconcile</output>
<output>This suggests super-dev-pipeline did not complete successfully.</output>
<action>Mark story as FAILED reconciliation</action>
<action>Return early (skip remaining checks)</action>
</check>
<action>Parse Dev Agent Record fields:
- **Agent Model Used** (should have model name, not empty)
- **Implementation Summary** (should describe what was built)
- **File List** (should list new/modified files)
- **Test Results** (should show test counts)
- **Completion Notes** (should document what works)
</action>
<check if="Implementation Summary contains 'COMPLETE' or lists specific deliverables">
<action>Set implementation_status = COMPLETE</action>
</check>
<check if="Implementation Summary is vague or says 'pending'">
<action>Set implementation_status = INCOMPLETE</action>
<output>⚠️ Story {{story_key}}: Implementation appears incomplete based on Dev Agent Record</output>
</check>
### 3. Reconcile Acceptance Criteria
<action>For each AC subsection (AC1, AC2, AC3, AC4, etc.):</action>
<iterate>For each checkbox in AC section:</iterate>
<substep n="3a" title="Identify expected status from Dev Agent Record">
<action>Search Implementation Summary and File List for keywords from checkbox text</action>
<example>
Checkbox: "[ ] FlexibleGridSection component (renders dynamic grid layouts)"
Implementation Summary mentions: "FlexibleGridSection component created"
File List includes: "FlexibleGridSection.tsx"
→ Expected status: CHECKED
</example>
<action>Determine expected_checkbox_status:
- CHECKED if Implementation Summary confirms it OR File List shows created files OR Test Results mention it
- UNCHECKED if no evidence in Dev Agent Record
- PARTIAL if mentioned as "pending" or "infrastructure ready"
</action>
</substep>
<substep n="3b" title="Compare actual vs expected">
<action>Read actual checkbox state from story file ([x] vs [ ] vs [~])</action>
<check if="actual != expected">
<output>🔧 Reconciling AC: "{{checkbox_text}}"
Actual: {{actual_status}}
Expected: {{expected_status}}
Reason: {{evidence_from_dev_record}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
</substep>
<action>After checking all ACs:
- Count total AC items
- Count checked AC items (after reconciliation)
- Calculate AC completion percentage
</action>
### 4. Reconcile Tasks / Subtasks
<action>For each Task (Task 1, Task 2, etc.):</action>
<iterate>For each checkbox in Tasks section:</iterate>
<substep n="4a" title="Identify expected status from Dev Agent Record">
<action>Search Implementation Summary and File List for task keywords</action>
<example>
Task checkbox: "[ ] **2.2:** Create FlexibleGridSection component"
File List includes: "apps/frontend/web/src/components/FlexibleGridSection.tsx"
→ Expected status: CHECKED
</example>
<action>Determine expected_checkbox_status using same logic as AC section</action>
</substep>
<substep n="4b" title="Compare and reconcile">
<action>Read actual checkbox state</action>
<check if="actual != expected">
<output>🔧 Reconciling Task: "{{task_text}}"
Actual: {{actual_status}}
Expected: {{expected_status}}
Reason: {{evidence_from_dev_record}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
</substep>
<action>After checking all Tasks:
- Count total task items
- Count checked task items (after reconciliation)
- Calculate task completion percentage
</action>
### 5. Reconcile Definition of Done
<action>For each DoD category (Code Quality, Testing, Security, etc.):</action>
<iterate>For each checkbox in DoD section:</iterate>
<substep n="5a" title="Determine expected status">
<action>Check Test Results, Completion Notes for evidence</action>
<example>
DoD checkbox: "[ ] Type check passes: `pnpm type-check` (zero errors)"
Completion Notes say: "Type check passes ✅"
→ Expected status: CHECKED
</example>
<example>
DoD checkbox: "[ ] Unit tests: 90%+ coverage"
Test Results say: "37 tests passing"
Completion Notes say: "100% coverage on FlexibleGridSection"
→ Expected status: CHECKED
</example>
<action>Determine expected_checkbox_status</action>
</substep>
<substep n="5b" title="Compare and reconcile">
<action>Read actual checkbox state</action>
<check if="actual != expected">
<output>🔧 Reconciling DoD: "{{dod_text}}"
Actual: {{actual_status}}
Expected: {{expected_status}}
Reason: {{evidence_from_dev_record}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
</substep>
<action>After checking all DoD items:
- Count total DoD items
- Count checked DoD items (after reconciliation)
- Calculate DoD completion percentage
</action>
### 6. Determine Correct Story Status
<action>Based on completion percentages, determine correct story status:</action>
<check if="AC >= 95% AND Tasks >= 95% AND DoD >= 95%">
<action>Set correct_story_status = "done"</action>
</check>
<check if="AC >= 80% AND Tasks >= 80% AND DoD >= 80%">
<action>Set correct_story_status = "review"</action>
</check>
<check if="AC < 80% OR Tasks < 80% OR DoD < 80%">
<action>Set correct_story_status = "in-progress"</action>
</check>
<check if="implementation_status == INCOMPLETE">
<action>Override: Set correct_story_status = "in-progress"</action>
<output>⚠️ Overriding status to "in-progress" due to incomplete implementation</output>
</check>
<action>Read current story status from story file (**Status:** ...)</action>
<check if="current_story_status != correct_story_status">
<output>🔧 Story status mismatch:
Current: {{current_story_status}}
Expected: {{correct_story_status}}
Reason: AC={{ac_pct}}% Tasks={{tasks_pct}}% DoD={{dod_pct}}%
</output>
<action>Add to reconciliation_changes list</action>
</check>
### 7. Verify sprint-status.yaml Entry
<action>Read {sprint_status} file</action>
<action>Find entry for {{story_key}}</action>
<action>Extract current status from sprint-status.yaml</action>
<check if="sprint_status_yaml_status != correct_story_status">
<output>🔧 sprint-status.yaml mismatch:
Current: {{sprint_status_yaml_status}}
Expected: {{correct_story_status}}
</output>
<action>Add to reconciliation_changes list</action>
</check>
### 8. Apply Reconciliation Changes
<check if="reconciliation_changes is empty">
<output>✅ Story {{story_key}}: Already accurate (0 changes needed)</output>
<action>Return SUCCESS (no updates needed)</action>
</check>
<check if="reconciliation_changes is NOT empty">
<output>
🔧 Story {{story_key}}: Reconciling {{count}} issues
**Changes to apply:**
{{#each reconciliation_changes}}
{{@index}}. {{change_description}}
{{/each}}
</output>
<ask>Apply these reconciliation changes? (yes/no):</ask>
<check if="response != 'yes'">
<output>⏭️ Skipping reconciliation for {{story_key}}</output>
<action>Return SUCCESS (user declined changes)</action>
</check>
<substep n="8a" title="Update Acceptance Criteria">
<action>For each AC checkbox that needs updating:</action>
<action>Use Edit tool to update checkbox from [ ] to [x] or [~]</action>
<action>Add note explaining why: "- [x] Item - COMPLETE: {{evidence}}"</action>
</substep>
<substep n="8b" title="Update Tasks / Subtasks">
<action>For each Task checkbox that needs updating:</action>
<action>Use Edit tool to update checkbox</action>
<action>Update task header if all subtasks complete: "### Task 1: ... ✅ COMPLETE"</action>
</substep>
<substep n="8c" title="Update Definition of Done">
<action>For each DoD checkbox that needs updating:</action>
<action>Use Edit tool to update checkbox</action>
<action>Add verification note: "- [x] Item ✅ (verified in Dev Agent Record)"</action>
</substep>
<substep n="8d" title="Update Story Status">
<check if="story status needs updating">
<action>Use Edit tool to update status line</action>
<action>Change from: **Status:** {{old_status}}</action>
<action>Change to: **Status:** {{correct_story_status}}</action>
</check>
</substep>
<substep n="8e" title="Update sprint-status.yaml with status and progress">
<check if="sprint-status.yaml needs updating">
<action>Use Edit tool to update status entry</action>
<action>Count tasks from story file:
- total_tasks = all top-level tasks
- checked_tasks = tasks marked [x]
- progress_pct = (checked_tasks / total_tasks) × 100
</action>
<action>Update comment with progress tracking (NEW v1.3.0):
If status == "in-progress":
Format: {{story_key}}: in-progress # {{checked_tasks}}/{{total_tasks}} tasks ({{progress_pct}}%)
If status == "review":
Format: {{story_key}}: review # {{checked_tasks}}/{{total_tasks}} tasks ({{progress_pct}}%) - awaiting review
If status == "done":
Format: {{story_key}}: done # ✅ COMPLETED: {{brief_summary}}
</action>
<example>
Before: 20-8-...: ready-for-dev # Story description
During: 20-8-...: in-progress # 3/10 tasks (30%)
During: 20-8-...: in-progress # 7/10 tasks (70%)
Review: 20-8-...: review # 10/10 tasks (100%) - awaiting review
After: 20-8-...: done # ✅ COMPLETED: Component + tests + docs
</example>
</check>
</substep>
<output>✅ Story {{story_key}}: Reconciliation complete ({{count}} changes applied)</output>
</check>
### 9. Final Verification
<action>Re-read story file to verify changes applied correctly</action>
<action>Calculate final completion percentages</action>
<output>
📊 Story {{story_key}} - Final Status
**Acceptance Criteria:** {{ac_checked}}/{{ac_total}} ({{ac_pct}}%)
**Tasks/Subtasks:** {{tasks_checked}}/{{tasks_total}} ({{tasks_pct}}%)
**Definition of Done:** {{dod_checked}}/{{dod_total}} ({{dod_pct}}%)
**Story Status:** {{correct_story_status}}
**sprint-status.yaml:** {{correct_story_status}}
{{#if correct_story_status == "done"}}
✅ Story is COMPLETE and accurately reflects implementation
{{/if}}
{{#if correct_story_status == "review"}}
⚠️ Story needs review (some items incomplete)
{{/if}}
{{#if correct_story_status == "in-progress"}}
⚠️ Story has significant gaps (implementation incomplete)
{{/if}}
</output>
<action>Return SUCCESS with reconciliation summary</action>
--- ---
## Success Criteria ## Execute These Steps
Story reconciliation succeeds when: ### Step 1: Get What Was Built
1. ✅ All checkboxes match Dev Agent Record evidence
2. ✅ Story status accurately reflects completion (done/review/in-progress)
3. ✅ sprint-status.yaml entry matches story file status
4. ✅ Completion percentages calculated and reported
5. ✅ Changes documented in reconciliation summary
--- Run this command with Bash tool:
## Error Handling ```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔧 STORY RECONCILIATION: {{story_key}}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
<check if="story file not found"> # Get the commit for this story
<output>❌ Story {{story_key}}: File not found at {{story_file_path}}</output> echo "Recent commits:"
<action>Return FAILED reconciliation</action> git log -5 --oneline | grep -i "{{story_key}}" || echo "(no commits found with story key)"
</check>
<check if="Dev Agent Record missing or empty"> # Get files changed
<output>⚠️ Story {{story_key}}: Cannot reconcile - Dev Agent Record not populated</output> echo ""
<action>Mark as INCOMPLETE (not implemented yet)</action> echo "Files changed in last commit:"
<action>Return WARNING reconciliation</action> git diff HEAD~1 --name-only | grep -v "__tests__" | grep -v "\.test\." | head -20
</check>
<check if="Edit tool fails">
<output>❌ Story {{story_key}}: Failed to apply changes (Edit tool error)</output>
<action>Log error details</action>
<action>Return FAILED reconciliation</action>
</check>
---
## Integration with batch-super-dev
**Insert this step:**
- **Sequential mode:** After Step 4s-a (Process individual story), before marking completed
- **Parallel mode:** After Step 4p-a (Spawn Task agents), after agent completes but before marking completed
**Flow:**
```
super-dev-pipeline completes → Step 4.5 (Reconcile) → Mark as completed/failed
``` ```
**Benefits:** Store the output - you'll need it for the next steps.
- Ensures all batch-processed stories have accurate status
- Catches mismatches automatically ### Step 2: Read Story File
- Prevents "done" stories with unchecked items
- Maintains sprint-status.yaml accuracy Use Read tool on: `docs/sprint-artifacts/{{story_key}}.md`
Find these sections:
- **Tasks** (lines starting with `- [ ]` or `- [x]`)
- **Dev Agent Record** (section with Agent Model, Implementation Date, etc.)
### Step 3: Check Off Completed Tasks
For EACH task in the Tasks section that relates to files changed:
Use Edit tool:
```
file_path: docs/sprint-artifacts/{{story_key}}.md
old_string: "- [ ] Create the SomeComponent"
new_string: "- [x] Create the SomeComponent"
```
**Match logic:**
- If task mentions a file that was created → check it off
- If task mentions a service/component that now exists → check it off
- If unsure → leave unchecked (don't over-claim)
### Step 4: Fill Dev Agent Record
Use Edit tool to replace the placeholder record:
```
file_path: docs/sprint-artifacts/{{story_key}}.md
old_string: "### Dev Agent Record
- **Agent Model Used:** [Not set]
- **Implementation Date:** [Not set]
- **Files Created/Modified:** [Not set]
- **Tests Added:** [Not set]
- **Completion Notes:** [Not set]"
new_string: "### Dev Agent Record
- **Agent Model Used:** Claude Sonnet 4 (multi-agent pipeline)
- **Implementation Date:** 2026-01-26
- **Files Created/Modified:**
- path/to/file1.ts
- path/to/file2.ts
[list all files from git diff]
- **Tests Added:** X tests (from Inspector report)
- **Completion Notes:** Implemented [brief summary]"
```
### Step 5: Verify Updates
Run this command with Bash tool:
```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 RECONCILIATION VERIFICATION"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
STORY_FILE="docs/sprint-artifacts/{{story_key}}.md"
# Count checked tasks
CHECKED=$(grep -c "^- \[x\]" "$STORY_FILE" 2>/dev/null || echo "0")
UNCHECKED=$(grep -c "^- \[ \]" "$STORY_FILE" 2>/dev/null || echo "0")
TOTAL=$((CHECKED + UNCHECKED))
echo "Tasks: $CHECKED/$TOTAL checked"
if [ "$CHECKED" -eq 0 ]; then
echo ""
echo "❌ BLOCKER: Zero tasks checked off"
echo "You MUST go back to Step 3 and check off tasks"
exit 1
fi
# Check Dev Agent Record filled
if grep -q "Implementation Date: \[Not set\]" "$STORY_FILE" 2>/dev/null; then
echo "❌ BLOCKER: Dev Agent Record not filled"
echo "You MUST go back to Step 4 and fill it"
exit 1
fi
if grep -A 3 "### Dev Agent Record" "$STORY_FILE" | grep -q "Implementation Date: 202"; then
echo "✅ Dev Agent Record: Filled"
else
echo "❌ BLOCKER: Dev Agent Record incomplete"
exit 1
fi
echo ""
echo "✅ RECONCILIATION COMPLETE"
echo " Checked tasks: $CHECKED/$TOTAL"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
```
### Step 6: Update Sprint Status
Use Read tool: `docs/sprint-artifacts/sprint-status.yaml`
Find the entry for {{story_key}} and use Edit tool to update:
```
old_string: "{{story_key}}: ready-for-dev"
new_string: "{{story_key}}: done # ✅ COMPLETED 2026-01-26"
```
Or if 95%+ complete but not 100%:
```
new_string: "{{story_key}}: review # 8/10 tasks - awaiting review"
```
---
## Status Decision Logic
Based on verification results:
| Condition | Status |
|-----------|--------|
| 95%+ tasks checked + Dev Record filled | `done` |
| 80-94% tasks checked | `review` |
| <80% tasks checked | `in-progress` |
| Dev Record not filled | `in-progress` |
---
## If Verification Fails
1. **DO NOT** proceed to next story
2. **DO NOT** mark story as done
3. **FIX** the issue using Edit tool
4. **RE-RUN** verification command
5. **REPEAT** until verification passes
This is mandatory. No shortcuts.

View File

@ -93,4 +93,43 @@ When complete, provide:
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** builder
**Story:** {{story_key}}
**Status:** SUCCESS | FAILED
### Files Created
- path/to/new/file1.ts
- path/to/new/file2.ts
### Files Modified
- path/to/existing/file.ts
### Tests Added
- X test files
- Y test cases total
### Implementation Summary
Brief description of what was built and key decisions made.
### Known Gaps
- Any functionality not implemented
- Any edge cases not handled
- NONE if all tasks complete
### Ready For
Inspector validation (next phase)
```
**Why this format?** The orchestrator parses this output to:
- Verify claimed files actually exist
- Track what was built for reconciliation
- Route to next phase appropriately
---
**Remember:** You are the BUILDER. Build it well, but don't validate or review your own work. Other agents will do that with fresh eyes. **Remember:** You are the BUILDER. Build it well, but don't validate or review your own work. Other agents will do that with fresh eyes.

View File

@ -20,15 +20,15 @@ You are the **FIXER** agent. Your job is to fix CRITICAL and HIGH issues from th
- Fix security vulnerabilities immediately - Fix security vulnerabilities immediately
- Fix logic bugs and edge cases - Fix logic bugs and edge cases
- Re-run tests after each fix - Re-run tests after each fix
- Update story checkboxes - Commit code changes with descriptive message
- Update sprint-status.yaml
- Commit changes
**DO NOT:** **DO NOT:**
- Skip CRITICAL issues - Skip CRITICAL issues
- Skip HIGH issues - Skip HIGH issues
- Spend time on LOW issues - Spend time on LOW issues
- Make unnecessary changes - Make unnecessary changes
- Update story checkboxes (orchestrator does this)
- Update sprint-status.yaml (orchestrator does this)
--- ---
@ -79,118 +79,7 @@ low_issues: [#10, #11] # SKIP (gold-plating)
## After Fixing Issues ## After Fixing Issues
### 1. Update Story File (MANDATORY) ### Commit Changes
**THIS STEP IS MANDATORY. DO NOT SKIP.**
**Step 1a: Identify what was built**
```bash
# Get list of files changed in latest commit
git diff HEAD~1 --name-only
# Get commit message
git log -1 --pretty=%B
```
**Step 1b: Read story Tasks section**
```bash
# Find the Tasks section in story file
grep -A 100 "^## Tasks" docs/sprint-artifacts/{{story_key}}.md | grep "^- \["
```
**Step 1c: Check off completed tasks**
For EACH task in the Tasks section:
1. Read the task description
2. Check if related files/functions exist in git diff
3. If code for that task exists, use Edit tool to change `- [ ]` to `- [x]`
4. Verify edit worked with grep
**Example:**
```bash
# Task says: "Create RetryScheduler service"
# Check if file exists in commit:
git diff HEAD~1 --name-only | grep -i retry
# Result: lib/billing/retry-scheduler.ts
# Use Edit tool to check off task:
# Find exact line: grep -n "RetryScheduler" docs/sprint-artifacts/{{story_key}}.md
# Edit: Change "- [ ] Create RetryScheduler service" → "- [x] Create RetryScheduler service"
# Verify:
grep "^\- \[x\].*RetryScheduler" docs/sprint-artifacts/{{story_key}}.md
# Should return the checked line
```
**Step 1d: Fill Dev Agent Record**
Find the Dev Agent Record section and fill it in:
```markdown
### Dev Agent Record
- **Agent Model Used:** Claude Sonnet 4.5 (multi-agent pipeline: Builder + Inspector + Reviewer + Fixer)
- **Implementation Date:** 2026-01-26
- **Files Created/Modified:**
- lib/billing/retry-scheduler.ts
- lib/billing/payment-processor.ts
- lib/billing/worker.ts
- [list ALL files from git diff]
- **Tests Added:**
- lib/billing/__tests__/retry-scheduler.test.ts
- lib/billing/__tests__/payment-processor.test.ts
- lib/billing/__tests__/worker.test.ts
- **Completion Notes:**
- Implemented exponential backoff retry logic
- Added payment processor with Stripe integration
- Created worker with queue processing
- Fixed 8 CRITICAL/HIGH code review findings
- All production code passing type-check and lint
```
**Step 1e: Verify story file was updated**
```bash
# Count checked tasks
grep -c "^\- \[x\]" docs/sprint-artifacts/{{story_key}}.md
# Verify Dev Agent Record filled
grep -A 20 "^### Dev Agent Record" docs/sprint-artifacts/{{story_key}}.md | grep -c "Agent Model"
# If count is 0, STOP and fix it. DO NOT PROCEED to commit.
```
### 2. Update Sprint Status
**Update sprint-status.yaml:**
```yaml
{{story_key}}: done # was: ready-for-dev
```
### 3. Pre-Commit Verification (BLOCKER)
**BEFORE YOU COMMIT, VERIFY STORY FILE WAS UPDATED:**
```bash
# Check 1: Count checked tasks (must be > 0)
CHECKED_COUNT=$(grep -c "^\- \[x\]" docs/sprint-artifacts/{{story_key}}.md)
echo "Checked tasks: $CHECKED_COUNT"
# Check 2: Verify Dev Agent Record filled (must be 1)
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" docs/sprint-artifacts/{{story_key}}.md | grep -c "Agent Model")
echo "Dev Agent Record filled: $RECORD_FILLED"
# BLOCKER: If either check fails, STOP
if [ "$CHECKED_COUNT" -eq 0 ] || [ "$RECORD_FILLED" -eq 0 ]; then
echo "❌ BLOCKER: Story file NOT updated"
echo "You MUST update the story file before committing."
echo "Go back to Step 1 and complete the story reconciliation."
exit 1
fi
echo "✅ Story file verification passed"
```
### 4. Commit Changes
**Only proceed if Step 3 verification passed:**
```bash ```bash
git add . git add .
@ -247,21 +136,8 @@ All tests passing, type check clean, lint clean."
- ✅ Build: PASS - ✅ Build: PASS
- ✅ Tests: 48/48 passing (96% coverage) - ✅ Tests: 48/48 passing (96% coverage)
**Story File Updates (MANDATORY):**
- ✅ Tasks checked off: X/Y tasks marked complete
- ✅ Dev Agent Record filled with files and notes
- ✅ Verified with grep (counts > 0)
**Git:** **Git:**
- ✅ Commit created: a1b2c3d - ✅ Commit created: a1b2c3d
- ✅ Sprint status updated to "done"
**Pre-Commit Verification:**
- ✅ Checked tasks count: X (must be > 0)
- ✅ Dev Agent Record filled: YES (must be 1)
- ✅ BLOCKER passed
**Story Status:** COMPLETE
``` ```
--- ---
@ -288,4 +164,47 @@ All tests passing, type check clean, lint clean."
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** fixer
**Story:** {{story_key}}
**Status:** SUCCESS | PARTIAL | FAILED
### Issues Fixed
- **CRITICAL:** X/Y fixed
- **HIGH:** X/Y fixed
- **Total:** X issues resolved
### Fixes Applied
1. [CRITICAL] file.ts:45 - Fixed SQL injection with parameterized query
2. [HIGH] file.ts:89 - Added null check
### Files Modified
- path/to/file1.ts
- path/to/file2.ts
### Quality Checks
- **Type Check:** PASS | FAIL
- **Lint:** PASS | FAIL
- **Tests:** X passing, Y failing
### Git Commit
- **Hash:** abc123
- **Message:** fix({{story_key}}): address code review findings
### Deferred Issues
- MEDIUM: X issues (defer to follow-up)
- LOW: X issues (skip as gold-plating)
### Ready For
Orchestrator reconciliation (story file updates)
```
**Note:** Story checkboxes and sprint-status updates are done by the orchestrator, not you.
---
**Remember:** You are the FIXER. Fix real problems, skip gold-plating, commit when done. **Remember:** You are the FIXER. Fix real problems, skip gold-plating, commit when done.

View File

@ -150,4 +150,35 @@ Cannot proceed to code review until these are fixed.
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** inspector
**Story:** {{story_key}}
**Status:** PASS | FAIL
### Evidence
- **Type Check:** PASS (0 errors) | FAIL (X errors)
- **Lint:** PASS (0 warnings) | FAIL (X warnings)
- **Build:** PASS | FAIL
- **Tests:** X passing, Y failing, Z% coverage
### Files Verified
- path/to/file1.ts ✓
- path/to/file2.ts ✓
- path/to/missing.ts ✗ (NOT FOUND)
### Failures (if FAIL status)
1. Specific failure with file:line reference
2. Another specific failure
### Ready For
- If PASS: Reviewer (next phase)
- If FAIL: Builder needs to fix before proceeding
```
---
**Remember:** You are the INSPECTOR. Your job is to find the truth, not rubber-stamp the Builder's work. If something is wrong, say so with evidence. **Remember:** You are the INSPECTOR. Your job is to find the truth, not rubber-stamp the Builder's work. If something is wrong, say so with evidence.

View File

@ -1,226 +0,0 @@
# Reconciler Agent - Story File Update (MANDATORY)
**Role:** Update story file with implementation results
**Step:** 10 (final - runs after Fixer completes)
**Trust Level:** HIGH (simple, focused task)
**Mandatory:** YES (cannot be skipped)
---
## Your Mission
You are the **RECONCILER** agent. Your ONLY job is to update the story file to reflect what was built.
🚨 **THIS IS THE MOST IMPORTANT STEP** 🚨
Without this step, no one knows what was built. The story file is the source of truth.
---
## What You Must Do
### Step 1: Read the Git Commit
```bash
# Get the commit message for this story
git log -1 --pretty=format:"%H %s %b" | head -20
# Get files changed
git diff HEAD~1 --name-only | grep -v "^test/" | grep -v "__tests__"
```
**Extract:**
- Commit SHA
- Files created/modified (production code only, exclude tests for now)
- What was built (from commit message)
---
### Step 2: Read the Story File
```bash
# Read the full story file
cat docs/sprint-artifacts/{{story_key}}.md
```
**Find:**
- Tasks section (look for `## Tasks`)
- Dev Agent Record section (look for `### Dev Agent Record`)
- Current completion status
---
### Step 3: Check Off Completed Tasks
**For EACH task in the Tasks section:**
1. **Read the task description**
2. **Check if related code exists in git diff**
- Does the task mention a file that was created/modified?
- Does the task mention a function/service that now exists?
3. **If YES: Use Edit tool to check it off**
- Change `- [ ]` to `- [x]`
- Use exact string matching
4. **Verify the edit worked:**
```bash
grep "^\- \[x\].*{{task keyword}}" docs/sprint-artifacts/{{story_key}}.md
```
**Example:**
Task: `- [ ] Create BillingWorker service`
Check if it exists:
```bash
git diff HEAD~1 --name-only | grep -i "worker"
# Returns: lib/billing/worker.ts
```
Edit the story file:
```typescript
old_string: "- [ ] Create BillingWorker service"
new_string: "- [x] Create BillingWorker service"
```
Verify:
```bash
grep "^\- \[x\].*BillingWorker" docs/sprint-artifacts/{{story_key}}.md
# Should return the checked line
```
---
### Step 4: Fill Dev Agent Record
Find the Dev Agent Record section and replace it with actual data:
**BEFORE:**
```markdown
### Dev Agent Record
- **Agent Model Used:** [Not set]
- **Implementation Date:** [Not set]
- **Files Created/Modified:** [Not set]
- **Tests Added:** [Not set]
- **Completion Notes:** [Not set]
```
**AFTER:**
```markdown
### Dev Agent Record
- **Agent Model Used:** Claude Sonnet 4.5 (multi-agent: Builder + Inspector + Reviewer + Fixer + Reconciler)
- **Implementation Date:** 2026-01-26
- **Files Created/Modified:**
- lib/billing/worker.ts
- lib/billing/payment-processor.ts
- lib/billing/retry-scheduler.ts
- [ALL files from git diff --name-only HEAD~1]
- **Tests Added:**
- lib/billing/__tests__/worker.test.ts
- lib/billing/__tests__/payment-processor.test.ts
- lib/billing/__tests__/retry-scheduler.test.ts
- **Completion Notes:**
- Implemented retry logic with exponential backoff
- Fixed 8 CRITICAL/HIGH code review findings
- All type checks passing, lint clean
- Tests: [status from Inspector report]
```
Use the Edit tool to replace the entire Dev Agent Record section.
---
### Step 5: Verify Your Work (BLOCKER)
🚨 **THIS VERIFICATION IS MANDATORY. YOU MUST RUN IT.** 🚨
```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 RECONCILIATION VERIFICATION"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Check 1: Count checked tasks
CHECKED_COUNT=$(grep -c "^\- \[x\]" docs/sprint-artifacts/{{story_key}}.md)
echo "Checked tasks: $CHECKED_COUNT"
if [ "$CHECKED_COUNT" -eq 0 ]; then
echo ""
echo "❌ RECONCILIATION FAILED"
echo "Story file has ZERO checked tasks."
echo "You MUST go back to Step 3 and check off tasks."
echo ""
exit 1
fi
# Check 2: Verify Dev Agent Record filled
RECORD_FILLED=$(grep -A 20 "^### Dev Agent Record" docs/sprint-artifacts/{{story_key}}.md | grep -c "Claude Sonnet")
echo "Dev Agent Record filled: $RECORD_FILLED"
if [ "$RECORD_FILLED" -eq 0 ]; then
echo ""
echo "❌ RECONCILIATION FAILED"
echo "Dev Agent Record NOT filled."
echo "You MUST go back to Step 4 and fill it in."
echo ""
exit 1
fi
echo ""
echo "✅ RECONCILIATION SUCCESSFUL"
echo " - Checked tasks: $CHECKED_COUNT"
echo " - Dev Agent Record: FILLED"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
```
**If verification fails:**
- STOP immediately
- Fix the issue
- Re-run verification
- DO NOT report "COMPLETE" until verification passes
**If verification passes:**
- Report success with task count
- Story is now officially complete
---
## Output Requirements
**Provide Reconciliation Summary:**
```markdown
## Reconciliation Complete
**Story File Updated:**
- ✅ Tasks checked: X/Y tasks marked complete
- ✅ Dev Agent Record filled with implementation details
- ✅ Verification passed
**What Was Built:**
- File 1: lib/billing/worker.ts (BillingWorker service)
- File 2: lib/billing/payment-processor.ts (Payment processing)
- File 3: lib/billing/retry-scheduler.ts (Retry scheduling)
- [List ALL production files from git diff]
**Tests:**
- X tests added
- Y tests passing
- Coverage: Z%
**Story Status:** READY FOR COMPLETION
```
---
## Remember
🚨 **Your job is RECONCILIATION, not implementation** 🚨
- Don't write code
- Don't fix bugs
- Don't run tests
- ONLY update the story file
- ONLY verify it worked
If you do this right, the user will know EXACTLY what was built and can mark the story done with confidence.
**This is the last step. Make it count.**

View File

@ -187,4 +187,37 @@ Before completing review, check:
--- ---
## When Complete, Return This Format
```markdown
## AGENT COMPLETE
**Agent:** reviewer
**Story:** {{story_key}}
**Status:** ISSUES_FOUND | CLEAN
### Issue Summary
- **CRITICAL:** X issues (security, data loss)
- **HIGH:** X issues (production bugs)
- **MEDIUM:** X issues (tech debt)
- **LOW:** X issues (nice-to-have)
- **TOTAL:** X issues
### Must Fix (CRITICAL + HIGH)
1. [CRITICAL] file.ts:45 - SQL injection in user query
2. [HIGH] file.ts:89 - Missing null check causes crash
### Should Fix (MEDIUM)
1. file.ts:123 - No error handling for API call
### Files Reviewed
- path/to/file1.ts ✓
- path/to/file2.ts ✓
### Ready For
Fixer agent to address CRITICAL and HIGH issues
```
---
**Remember:** You are the ADVERSARIAL REVIEWER. Your success is measured by finding legitimate issues. Don't be nice - be thorough. **Remember:** You are the ADVERSARIAL REVIEWER. Your success is measured by finding legitimate issues. Don't be nice - be thorough.

View File

@ -1,16 +1,19 @@
# Super-Dev-Pipeline v2.0 - Multi-Agent Architecture # Super-Dev-Pipeline v2.1 - Multi-Agent Architecture
**Version:** 2.0.0 **Version:** 2.1.0
**Architecture:** GSDMAD (GSD + BMAD) **Architecture:** GSDMAD (GSD + BMAD)
**Philosophy:** Trust but verify, separation of concerns **Philosophy:** Agents do creative work, orchestrator does bookkeeping
--- ---
## Overview ## Overview
This workflow implements a story using **4 independent agents** with external validation at each phase. This workflow implements a story using **4 independent agents** with orchestrator-driven reconciliation.
**Key Innovation:** Each agent has single responsibility and fresh context. No agent validates its own work. **Key Innovation:**
- Each agent has single responsibility and fresh context
- No agent validates its own work
- **Orchestrator does bookkeeping** (story file updates, verification) - not agents
--- ---
@ -22,44 +25,45 @@ This workflow implements a story using **4 independent agents** with external va
│ - Loads story │ │ - Loads story │
│ - Spawns agents sequentially │ │ - Spawns agents sequentially │
│ - Verifies each phase │ │ - Verifies each phase │
│ - DOES RECONCILIATION DIRECTLY (not via agent) │
│ - Final quality gate │ │ - Final quality gate │
└─────────────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────────────┘
├──> Phase 1: Builder (Steps 1-4) ├──> Phase 1: Builder (Steps 1-4) [AGENT]
│ - Load story, analyze gaps │ - Load story, analyze gaps
│ - Write tests (TDD) │ - Write tests (TDD)
│ - Implement code │ - Implement code
│ - Report what was built (NO VALIDATION) │ - Report what was built (NO VALIDATION)
├──> Phase 2: Inspector (Steps 5-6) ├──> Phase 2: Inspector (Steps 5-6) [AGENT]
│ - Fresh context, no Builder knowledge │ - Fresh context, no Builder knowledge
│ - Verify files exist │ - Verify files exist
│ - Run tests independently │ - Run tests independently
│ - Run quality checks │ - Run quality checks
│ - PASS or FAIL verdict │ - PASS or FAIL verdict
├──> Phase 3: Reviewer (Step 7) ├──> Phase 3: Reviewer (Step 7) [AGENT]
│ - Fresh context, adversarial stance │ - Fresh context, adversarial stance
│ - Find security vulnerabilities │ - Find security vulnerabilities
│ - Find performance problems │ - Find performance problems
│ - Find logic bugs │ - Find logic bugs
│ - Report issues with severity │ - Report issues with severity
├──> Phase 4: Fixer (Steps 8-9) ├──> Phase 4: Fixer (Steps 8-9) [AGENT]
│ - Fix CRITICAL issues (all) │ - Fix CRITICAL issues (all)
│ - Fix HIGH issues (all) │ - Fix HIGH issues (all)
│ - Fix MEDIUM issues (if time) │ - Fix MEDIUM issues (if time)
│ - Skip LOW issues (gold-plating) │ - Skip LOW issues (gold-plating)
│ - Commit code changes │ - Commit code changes
├──> Phase 5: Reconciler (Step 10) 🚨 MANDATORY ├──> Phase 5: Reconciliation (Step 10) [ORCHESTRATOR] 🔧
│ - Read git commit to see what was built │ - Orchestrator uses Bash/Read/Edit tools directly
│ - Check off completed tasks in story file │ - Check off completed tasks in story file
│ - Fill Dev Agent Record with details │ - Fill Dev Agent Record with details
│ - VERIFY updates with bash commands │ - Verify updates with bash commands
│ - BLOCKER: Exit 1 if verification fails │ - BLOCKER if verification fails
└──> Final Verification (Main) └──> Final Verification [ORCHESTRATOR]
- Check git commits exist - Check git commits exist
- Check story checkboxes updated (count > 0) - Check story checkboxes updated (count > 0)
- Check Dev Agent Record filled - Check Dev Agent Record filled
@ -190,52 +194,89 @@ Task({
**Wait for Fixer to complete.** **Wait for Fixer to complete.**
### Phase 5: Spawn Reconciler (MANDATORY) ### Phase 5: Orchestrator Reconciliation (MANDATORY)
🚨 **THIS PHASE IS MANDATORY. ALWAYS RUN. CANNOT BE SKIPPED.** 🚨 🚨 **THIS PHASE IS MANDATORY. ORCHESTRATOR DOES THIS DIRECTLY. NO AGENT SPAWN.** 🚨
```javascript **Why orchestrator, not agent?** Agents ignore instructions. The orchestrator has the context
Task({ and can use tools directly. This is bookkeeping work, not creative work.
subagent_type: "general-purpose",
description: "Reconcile story {{story_key}}",
prompt: `
You are the RECONCILER agent for story {{story_key}}.
Load and execute: {agents_path}/reconciler.md **YOU (the orchestrator) must execute these commands directly:**
Story file: {{story_file}} **Step 5.1: Get what was built**
Story key: {{story_key}} ```bash
# Get commit for this story
COMMIT_INFO=$(git log -5 --oneline | grep "{{story_key}}" | head -1)
echo "Commit: $COMMIT_INFO"
Complete Step 10 - Story Reconciliation: # Get files changed (production code only)
FILES_CHANGED=$(git diff HEAD~1 --name-only | grep -v "__tests__" | grep -v "\.test\." | grep -v "\.spec\.")
Your ONLY job: echo "Files changed:"
1. Read git commit to see what was built echo "$FILES_CHANGED"
2. Check off completed tasks in story file (Edit tool)
3. Fill Dev Agent Record with files/dates/notes
4. Verify updates worked (bash grep commands)
5. Exit 1 if verification fails
DO NOT:
- Write code
- Fix bugs
- Run tests
- Do anything except update the story file
This is the LAST step. The story cannot be marked complete
without your verification passing.
Output: Reconciliation summary with checked task count.
`
});
``` ```
**Wait for Reconciler to complete. Verification MUST pass.** **Step 5.2: Read story file tasks**
Use Read tool: `{{story_file}}`
**If Reconciler verification fails (exit 1):** Find the Tasks section and identify which tasks relate to the files changed.
- DO NOT proceed
- DO NOT mark story complete **Step 5.3: Check off completed tasks**
- Fix the reconciliation immediately Use Edit tool for EACH task that was completed:
- Re-run Reconciler until it passes ```
old_string: "- [ ] Task description here"
new_string: "- [x] Task description here"
```
**Step 5.4: Fill Dev Agent Record**
Use Edit tool to update the Dev Agent Record section:
```
old_string: "### Dev Agent Record
- **Agent Model Used:** [Not set]
- **Implementation Date:** [Not set]
- **Files Created/Modified:** [Not set]
- **Tests Added:** [Not set]
- **Completion Notes:** [Not set]"
new_string: "### Dev Agent Record
- **Agent Model Used:** Claude Sonnet 4 (multi-agent: Builder + Inspector + Reviewer + Fixer)
- **Implementation Date:** {{date}}
- **Files Created/Modified:**
{{#each files_changed}}
- {{this}}
{{/each}}
- **Tests Added:** [count from Inspector report]
- **Completion Notes:** [brief summary of what was implemented]"
```
**Step 5.5: Verify updates (BLOCKER)**
```bash
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🔍 RECONCILIATION VERIFICATION"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Count checked tasks
CHECKED=$(grep -c "^- \[x\]" {{story_file}})
echo "Checked tasks: $CHECKED"
if [ "$CHECKED" -eq 0 ]; then
echo "❌ BLOCKER: Zero checked tasks"
echo "Go back to Step 5.3 and check off tasks"
exit 1
fi
# Verify Dev Agent Record
RECORD=$(grep -A 5 "### Dev Agent Record" {{story_file}} | grep -c "Implementation Date:")
if [ "$RECORD" -eq 0 ]; then
echo "❌ BLOCKER: Dev Agent Record not filled"
echo "Go back to Step 5.4 and fill it"
exit 1
fi
echo "✅ Reconciliation verified: $CHECKED tasks checked"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
```
**If verification fails:** DO NOT proceed. Fix immediately using Edit tool, then re-verify.
--- ---

View File

@ -67,15 +67,7 @@ agents:
trust_level: "medium" # Incentive to minimize work trust_level: "medium" # Incentive to minimize work
timeout: 2400 # 40 minutes timeout: 2400 # 40 minutes
reconciler: # Reconciliation: orchestrator does this directly (see workflow.md Phase 5)
description: "Story reconciliation - MANDATORY story file updates"
steps: [10]
subagent_type: "general-purpose"
prompt_file: "{agents_path}/reconciler.md"
trust_level: "high" # Simple, focused task
timeout: 600 # 10 minutes
mandatory: true # Cannot be skipped
runs_after: "fixer"
# Complexity level (determines which steps to execute) # Complexity level (determines which steps to execute)
complexity_level: "standard" # micro | standard | complex complexity_level: "standard" # micro | standard | complex