From 365c04163c36a00f2840695f4a504df95422358f Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Thu, 15 Jan 2026 00:20:00 -0600 Subject: [PATCH] refactor: move requirements status update to commands (orchestrator) Subagents can't determine if phase is complete. The orchestrator (execute-plan and execute-phase commands) runs in main context, can count plans vs summaries, and updates REQUIREMENTS.md when phase completes. - execute-plan: Step 2.5 updates requirements when summaries = plans - execute-phase: Step 6 updates requirements (phase always complete) - Removed duplicate from workflow (subagent can't run it anyway) --- commands/gsd/execute-phase.md | 12 +++++- commands/gsd/execute-plan.md | 16 +++++++- get-shit-done/workflows/execute-plan.md | 49 +------------------------ 3 files changed, 28 insertions(+), 49 deletions(-) diff --git a/commands/gsd/execute-phase.md b/commands/gsd/execute-phase.md index 21215c5b3..a3eb47694 100644 --- a/commands/gsd/execute-phase.md +++ b/commands/gsd/execute-phase.md @@ -64,7 +64,16 @@ Phase: $ARGUMENTS - Report phase completion status - Update ROADMAP.md -6. **Offer next steps** +6. **Update requirements** + Phase is complete, so mark its requirements as Complete: + - Read ROADMAP.md, find this phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02") + - Read REQUIREMENTS.md traceability table + - For each REQ-ID in this phase: change Status from "Pending" to "Complete" + - Write updated REQUIREMENTS.md + - Stage for commit: `git add .planning/REQUIREMENTS.md` + - Skip if: REQUIREMENTS.md doesn't exist, or phase has no Requirements line + +7. **Offer next steps** - Route to next action (see ``) @@ -207,5 +216,6 @@ After all tasks complete: - [ ] Each plan has SUMMARY.md - [ ] STATE.md reflects phase completion - [ ] ROADMAP.md updated +- [ ] REQUIREMENTS.md updated (phase requirements marked Complete) - [ ] User informed of next steps diff --git a/commands/gsd/execute-plan.md b/commands/gsd/execute-plan.md index 01220ddb6..9a1f9e7c7 100644 --- a/commands/gsd/execute-plan.md +++ b/commands/gsd/execute-plan.md @@ -108,7 +108,20 @@ ls -1 .planning/phases/[phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l | Condition | Action | |-----------|--------| | summaries < plans | More plans remain → Route A | -| summaries = plans | Phase complete → Check milestone (Step 3) | +| summaries = plans | Phase complete → Update requirements, then Step 3 | + +**Step 2.5: Update requirements (only when phase complete)** + +When summaries = plans, update REQUIREMENTS.md before presenting completion: + +1. Get phase number from completed plan path +2. Read ROADMAP.md, find the phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02") +3. Read REQUIREMENTS.md traceability table +4. For each REQ-ID in this phase: change Status from "Pending" to "Complete" +5. Write updated REQUIREMENTS.md +6. Stage for commit: `git add .planning/REQUIREMENTS.md` + +**Skip if:** REQUIREMENTS.md doesn't exist, or phase has no Requirements line in ROADMAP.md. --- @@ -322,5 +335,6 @@ Templates for checkpoint handling: - [ ] Plan executed (SUMMARY.md created) - [ ] All checkpoints handled +- [ ] If phase complete: REQUIREMENTS.md updated (phase requirements marked Complete) - [ ] User informed of completion and next steps diff --git a/get-shit-done/workflows/execute-plan.md b/get-shit-done/workflows/execute-plan.md index 3de023012..171ca7477 100644 --- a/get-shit-done/workflows/execute-plan.md +++ b/get-shit-done/workflows/execute-plan.md @@ -1493,49 +1493,6 @@ ROADMAP_FILE=".planning/ROADMAP.md" - Add completion date - -**Only run when phase is complete (all plans have SUMMARYs).** - -When a phase completes, mark its requirements as Complete in REQUIREMENTS.md. - -**1. Get phase number from completed plan:** -```bash -# Extract phase number from plan path (e.g., 03-auth/03-02-PLAN.md → 03) -PHASE_NUM=$(echo "$PLAN_PATH" | grep -oE '[0-9]+' | head -1) -``` - -**2. Find requirements for this phase in ROADMAP.md:** -```bash -# Look for Requirements: line in phase section -grep -A5 "Phase ${PHASE_NUM}:" .planning/ROADMAP.md | grep "Requirements:" -``` - -Extract the REQ-IDs (e.g., "AUTH-01, AUTH-02, AUTH-03"). - -**3. Update REQUIREMENTS.md traceability table:** - -For each REQ-ID covered by this phase: -- Find the row in the Traceability table -- Change Status from "Pending" to "Complete" - -Example before: -```markdown -| AUTH-01 | Phase 1 | Pending | -| AUTH-02 | Phase 1 | Pending | -``` - -Example after: -```markdown -| AUTH-01 | Phase 1 | Complete | -| AUTH-02 | Phase 1 | Complete | -``` - -**4. Skip if:** -- REQUIREMENTS.md doesn't exist (older projects without requirements tracking) -- Phase has no Requirements: line in ROADMAP.md -- More plans remain in phase (not yet complete) - - Commit execution metadata (SUMMARY + STATE + ROADMAP): @@ -1549,19 +1506,17 @@ git add .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md git add .planning/STATE.md ``` -**2. Stage roadmap and requirements (if updated):** +**2. Stage roadmap:** ```bash git add .planning/ROADMAP.md -# Only if phase completed and requirements were updated: -[ -f .planning/REQUIREMENTS.md ] && git add .planning/REQUIREMENTS.md ``` **3. Verify staging:** ```bash git status -# Should show only execution artifacts (SUMMARY, STATE, ROADMAP, REQUIREMENTS), no code files +# Should show only execution artifacts (SUMMARY, STATE, ROADMAP), no code files ``` **4. Commit metadata:**