From f24203dc918e06b1509bdb89d7475bc85d2620d8 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Mon, 29 Dec 2025 11:39:42 -0600 Subject: [PATCH] fix: explicit plan count check in offer_next step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- get-shit-done/workflows/execute-phase.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/get-shit-done/workflows/execute-phase.md b/get-shit-done/workflows/execute-phase.md index 78e43b22b..2bb0d8100 100644 --- a/get-shit-done/workflows/execute-phase.md +++ b/get-shit-done/workflows/execute-phase.md @@ -1225,7 +1225,26 @@ Use AskUserQuestion: -**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):** ```