fix: explicit plan count check in offer_next step

Adds bash logic to count PLAN vs SUMMARY files before deciding
whether to offer next plan or next phase. Fixes bug where GSD
would skip remaining plans in a phase.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2025-12-29 11:39:42 -06:00
parent fe48ea574e
commit f24203dc91

View File

@@ -1225,7 +1225,26 @@ Use AskUserQuestion:
</step>
<step name="offer_next">
**If more plans in this phase:**
**First, determine if more plans exist in this phase:**
```bash
# Get current phase directory from the plan we just executed
PHASE_DIR=$(dirname "$PLAN_PATH")
# Count PLAN files vs SUMMARY files
PLAN_COUNT=$(ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null | wc -l | tr -d ' ')
SUMMARY_COUNT=$(ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null | wc -l | tr -d ' ')
echo "Plans: $PLAN_COUNT, Summaries: $SUMMARY_COUNT"
if [[ $SUMMARY_COUNT -lt $PLAN_COUNT ]]; then
echo "MORE_PLANS_EXIST"
else
echo "PHASE_COMPLETE"
fi
```
**If MORE_PLANS_EXIST (more plans in this phase):**
<if mode="yolo">
```