feat(execute-phase): add --gaps-only flag for gap closure execution

After verify-work diagnoses issues and creates fix plans, the next
command now explicitly signals intent with --gaps-only. This eliminates
redundant state discovery where execute-phase had to figure out why it
was being asked to run on an already-complete phase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-01-17 02:03:29 -06:00
parent 9654a8b370
commit 200e004781
5 changed files with 19 additions and 9 deletions

View File

@@ -1296,7 +1296,7 @@ Execute: `/gsd:execute-phase {phase}`
### Next Steps ### Next Steps
Execute: `/gsd:execute-phase {phase}` Execute: `/gsd:execute-phase {phase} --gaps-only`
``` ```
## Revision Complete ## Revision Complete

View File

@@ -1,7 +1,7 @@
--- ---
name: gsd:execute-phase name: gsd:execute-phase
description: Execute all plans in a phase with wave-based parallelization description: Execute all plans in a phase with wave-based parallelization
argument-hint: "<phase-number>" argument-hint: "<phase-number> [--gaps-only]"
allowed-tools: allowed-tools:
- Read - Read
- Write - Write
@@ -30,6 +30,9 @@ Context budget: ~15% orchestrator, 100% fresh per subagent.
<context> <context>
Phase: $ARGUMENTS Phase: $ARGUMENTS
**Flags:**
- `--gaps-only` — Execute only gap closure plans (plans with `gap_closure: true` in frontmatter). Use after verify-work creates fix plans.
@.planning/ROADMAP.md @.planning/ROADMAP.md
@.planning/STATE.md @.planning/STATE.md
</context> </context>
@@ -43,6 +46,7 @@ Phase: $ARGUMENTS
2. **Discover plans** 2. **Discover plans**
- List all *-PLAN.md files in phase directory - List all *-PLAN.md files in phase directory
- Check which have *-SUMMARY.md (already complete) - Check which have *-SUMMARY.md (already complete)
- If `--gaps-only`: filter to only plans with `gap_closure: true`
- Build list of incomplete plans - Build list of incomplete plans
3. **Group by wave** 3. **Group by wave**

View File

@@ -156,7 +156,7 @@ Fix plans verified ✓
**Execute fix plans** — run diagnosed fixes **Execute fix plans** — run diagnosed fixes
/gsd:execute-phase {Z} /gsd:execute-phase {Z} --gaps-only
<sub>/clear first → fresh context window</sub> <sub>/clear first → fresh context window</sub>

View File

@@ -71,15 +71,21 @@ ls -1 "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null | sort
For each plan, read frontmatter to extract: For each plan, read frontmatter to extract:
- `wave: N` - Execution wave (pre-computed) - `wave: N` - Execution wave (pre-computed)
- `autonomous: true/false` - Whether plan has checkpoints - `autonomous: true/false` - Whether plan has checkpoints
- `gap_closure: true/false` - Whether plan closes gaps from verification/UAT
Build plan inventory: Build plan inventory:
- Plan path - Plan path
- Plan ID (e.g., "03-01") - Plan ID (e.g., "03-01")
- Wave number - Wave number
- Autonomous flag - Autonomous flag
- Gap closure flag
- Completion status (SUMMARY exists = complete) - Completion status (SUMMARY exists = complete)
Skip completed plans. If all complete, report "Phase already executed" and exit. **Filtering:**
- Skip completed plans (have SUMMARY.md)
- If `--gaps-only` flag: also skip plans where `gap_closure` is not `true`
If all plans filtered out, report "No matching incomplete plans" and exit.
</step> </step>
<step name="group_by_wave"> <step name="group_by_wave">
@@ -433,9 +439,9 @@ Present gaps and offer next command:
User runs `/gsd:plan-phase {X} --gaps` which: User runs `/gsd:plan-phase {X} --gaps` which:
1. Reads VERIFICATION.md gaps 1. Reads VERIFICATION.md gaps
2. Creates additional plans (04, 05, etc.) to close gaps 2. Creates additional plans (04, 05, etc.) with `gap_closure: true` to close gaps
3. User then runs `/gsd:execute-phase {X}` again 3. User then runs `/gsd:execute-phase {X} --gaps-only`
4. Execute-phase runs incomplete plans (04-05) 4. Execute-phase runs only gap closure plans (04-05)
5. Verifier runs again after new plans complete 5. Verifier runs again after new plans complete
User stays in control at each decision point. User stays in control at each decision point.

View File

@@ -505,7 +505,7 @@ Plans verified and ready for execution.
**Execute fixes** — run fix plans **Execute fixes** — run fix plans
`/clear` then `/gsd:execute-phase {phase}` `/clear` then `/gsd:execute-phase {phase} --gaps-only`
─────────────────────────────────────────────────────────────── ───────────────────────────────────────────────────────────────
``` ```
@@ -559,5 +559,5 @@ Default to **major** if unclear. User can correct if needed.
- [ ] If issues: gsd-planner creates fix plans (gap_closure mode) - [ ] If issues: gsd-planner creates fix plans (gap_closure mode)
- [ ] If issues: gsd-plan-checker verifies fix plans - [ ] If issues: gsd-plan-checker verifies fix plans
- [ ] If issues: revision loop until plans pass (max 3 iterations) - [ ] If issues: revision loop until plans pass (max 3 iterations)
- [ ] Ready for `/gsd:execute-phase` when complete - [ ] Ready for `/gsd:execute-phase --gaps-only` when complete
</success_criteria> </success_criteria>