feat: workstream namespacing for parallel milestone work
Enable multiple Claude Code instances to work on the same codebase
simultaneously by scoping .planning/ state into workstreams.
Core changes:
- planningDir(cwd, ws?) and planningPaths(cwd, ws?) are now workstream-aware
via GSD_WORKSTREAM env var (auto-detected from --ws flag or active-workstream file)
- All bin/lib modules use planningDir(cwd) for scoped paths (STATE.md, ROADMAP.md,
phases/, REQUIREMENTS.md) and planningRoot(cwd) for shared paths (milestones/,
PROJECT.md, config.json, codebase/)
- New workstream.cjs module: create, list, status, complete, set, get, progress
- gsd-tools.cjs: --ws flag parsing with priority chain
(--ws > GSD_WORKSTREAM env > active-workstream file > flat mode)
- Collision detection: transition.md checks for other active workstreams before
suggesting next-milestone continuation (prevents WS A from trampling WS B)
- ${GSD_WS} routing propagation across all 9 workflow files ensures workstream
scope chains automatically through the workflow lifecycle
New files:
- get-shit-done/bin/lib/workstream.cjs (CRUD + collision detection)
- get-shit-done/commands/gsd/workstreams.md (slash command)
- get-shit-done/references/workstream-flag.md (documentation)
- tests/workstream.test.cjs (20 tests covering CRUD, env var routing, --ws flag)
All 1062 tests passing (1042 existing + 20 new workstream tests).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -142,7 +142,7 @@ Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phas
|
||||
```
|
||||
Phase [X] not found in roadmap.
|
||||
|
||||
Use /gsd:progress to see available phases.
|
||||
Use /gsd:progress ${GSD_WS} to see available phases.
|
||||
```
|
||||
Exit workflow.
|
||||
|
||||
@@ -189,7 +189,7 @@ Check `has_plans` and `plan_count` from init. **If `has_plans` is true:**
|
||||
- header: "Plans exist"
|
||||
- question: "Phase [X] already has {plan_count} plan(s) created without user context. Your decisions here won't affect existing plans unless you replan."
|
||||
- options:
|
||||
- "Continue and replan after" — Capture context, then run /gsd:plan-phase {X} to replan
|
||||
- "Continue and replan after" — Capture context, then run /gsd:plan-phase {X} ${GSD_WS} to replan
|
||||
- "View existing plans" — Show plans before deciding
|
||||
- "Cancel" — Skip discuss-phase
|
||||
|
||||
@@ -871,15 +871,15 @@ Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
|
||||
|
||||
**Phase ${PHASE}: [Name]** — [Goal from ROADMAP.md]
|
||||
|
||||
`/gsd:plan-phase ${PHASE}`
|
||||
`/gsd:plan-phase ${PHASE} ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:plan-phase ${PHASE} --skip-research` — plan without research
|
||||
- `/gsd:ui-phase ${PHASE}` — generate UI design contract before planning (if phase has frontend work)
|
||||
- `/gsd:plan-phase ${PHASE} --skip-research ${GSD_WS}` — plan without research
|
||||
- `/gsd:ui-phase ${PHASE} ${GSD_WS}` — generate UI design contract before planning (if phase has frontend work)
|
||||
- Review/edit CONTEXT.md before continuing
|
||||
|
||||
---
|
||||
@@ -990,7 +990,7 @@ Context captured. Launching plan-phase...
|
||||
|
||||
Launch plan-phase using the Skill tool to avoid nested Task sessions (which cause runtime freezes due to deep agent nesting — see #686):
|
||||
```
|
||||
Skill(skill="gsd:plan-phase", args="${PHASE} --auto")
|
||||
Skill(skill="gsd:plan-phase", args="${PHASE} --auto ${GSD_WS}")
|
||||
```
|
||||
|
||||
This keeps the auto-advance chain flat — discuss, plan, and execute all run at the same nesting level rather than spawning increasingly deep Task agents.
|
||||
@@ -1004,23 +1004,23 @@ This keeps the auto-advance chain flat — discuss, plan, and execute all run at
|
||||
|
||||
Auto-advance pipeline finished: discuss → plan → execute
|
||||
|
||||
Next: /gsd:discuss-phase ${NEXT_PHASE} --auto
|
||||
Next: /gsd:discuss-phase ${NEXT_PHASE} --auto ${GSD_WS}
|
||||
<sub>/clear first → fresh context window</sub>
|
||||
```
|
||||
- **PLANNING COMPLETE** → Planning done, execution didn't complete:
|
||||
```
|
||||
Auto-advance partial: Planning complete, execution did not finish.
|
||||
Continue: /gsd:execute-phase ${PHASE}
|
||||
Continue: /gsd:execute-phase ${PHASE} ${GSD_WS}
|
||||
```
|
||||
- **PLANNING INCONCLUSIVE / CHECKPOINT** → Stop chain:
|
||||
```
|
||||
Auto-advance stopped: Planning needs input.
|
||||
Continue: /gsd:plan-phase ${PHASE}
|
||||
Continue: /gsd:plan-phase ${PHASE} ${GSD_WS}
|
||||
```
|
||||
- **GAPS FOUND** → Stop chain:
|
||||
```
|
||||
Auto-advance stopped: Gaps found during execution.
|
||||
Continue: /gsd:plan-phase ${PHASE} --gaps
|
||||
Continue: /gsd:plan-phase ${PHASE} --gaps ${GSD_WS}
|
||||
```
|
||||
|
||||
**If neither `--auto` nor config enabled:**
|
||||
|
||||
@@ -456,8 +456,8 @@ Apply the same "incomplete" filtering rules as earlier:
|
||||
|
||||
Selected wave finished successfully. This phase still has incomplete plans, so phase-level verification and completion were intentionally skipped.
|
||||
|
||||
/gsd:execute-phase {phase} # Continue remaining waves
|
||||
/gsd:execute-phase {phase} --wave {next} # Run the next wave explicitly
|
||||
/gsd:execute-phase {phase} ${GSD_WS} # Continue remaining waves
|
||||
/gsd:execute-phase {phase} --wave {next} ${GSD_WS} # Run the next wave explicitly
|
||||
```
|
||||
|
||||
**If no incomplete plans remain after the selected wave finishes:**
|
||||
@@ -602,7 +602,7 @@ grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
|
||||
|--------|--------|
|
||||
| `passed` | → update_roadmap |
|
||||
| `human_needed` | Present items for human testing, get approval or feedback |
|
||||
| `gaps_found` | Present gap summary, offer `/gsd:plan-phase {phase} --gaps` |
|
||||
| `gaps_found` | Present gap summary, offer `/gsd:plan-phase {phase} --gaps ${GSD_WS}` |
|
||||
|
||||
**If human_needed:**
|
||||
|
||||
@@ -679,15 +679,15 @@ Items saved to `{phase_num}-HUMAN-UAT.md` — they will appear in `/gsd:progress
|
||||
---
|
||||
## ▶ Next Up
|
||||
|
||||
`/gsd:plan-phase {X} --gaps`
|
||||
`/gsd:plan-phase {X} --gaps ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
Also: `cat {phase_dir}/{phase_num}-VERIFICATION.md` — full report
|
||||
Also: `/gsd:verify-work {X}` — manual testing first
|
||||
Also: `/gsd:verify-work {X} ${GSD_WS}` — manual testing first
|
||||
```
|
||||
|
||||
Gap closure cycle: `/gsd:plan-phase {X} --gaps` reads VERIFICATION.md → creates gap plans with `gap_closure: true` → user runs `/gsd:execute-phase {X} --gaps-only` → verifier re-runs.
|
||||
Gap closure cycle: `/gsd:plan-phase {X} --gaps ${GSD_WS}` reads VERIFICATION.md → creates gap plans with `gap_closure: true` → user runs `/gsd:execute-phase {X} --gaps-only ${GSD_WS}` → verifier re-runs.
|
||||
</step>
|
||||
|
||||
<step name="update_roadmap">
|
||||
@@ -801,10 +801,10 @@ Read and follow `~/.claude/get-shit-done/workflows/transition.md`, passing throu
|
||||
```
|
||||
## ✓ Phase {X}: {Name} Complete
|
||||
|
||||
/gsd:progress — see updated roadmap
|
||||
/gsd:discuss-phase {next} — discuss next phase before planning
|
||||
/gsd:plan-phase {next} — plan next phase
|
||||
/gsd:execute-phase {next} — execute next phase
|
||||
/gsd:progress ${GSD_WS} — see updated roadmap
|
||||
/gsd:discuss-phase {next} ${GSD_WS} — discuss next phase before planning
|
||||
/gsd:plan-phase {next} ${GSD_WS} — plan next phase
|
||||
/gsd:execute-phase {next} ${GSD_WS} — execute next phase
|
||||
```
|
||||
|
||||
Only suggest the commands listed above. Do not invent or hallucinate command names.
|
||||
|
||||
@@ -161,7 +161,7 @@ Then verify `.planning/phases/` no longer contains old milestone directories bef
|
||||
|
||||
If `phase_dir_count > 0` but `phase_archive_path` is missing:
|
||||
- Stop and explain that reset numbering is unsafe without a completed milestone archive target.
|
||||
- Tell the user to complete/archive the previous milestone first, then rerun `/gsd:new-milestone --reset-phase-numbers`.
|
||||
- Tell the user to complete/archive the previous milestone first, then rerun `/gsd:new-milestone --reset-phase-numbers ${GSD_WS}`.
|
||||
|
||||
## 8. Research Decision
|
||||
|
||||
@@ -442,11 +442,11 @@ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: create milest
|
||||
|
||||
**Phase [N]: [Phase Name]** — [Goal]
|
||||
|
||||
`/gsd:discuss-phase [N]` — gather context and clarify approach
|
||||
`/gsd:discuss-phase [N] ${GSD_WS}` — gather context and clarify approach
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
Also: `/gsd:plan-phase [N]` — skip discussion, plan directly
|
||||
Also: `/gsd:plan-phase [N] ${GSD_WS}` — skip discussion, plan directly
|
||||
```
|
||||
|
||||
</process>
|
||||
@@ -463,7 +463,7 @@ Also: `/gsd:plan-phase [N]` — skip discussion, plan directly
|
||||
- [ ] User feedback incorporated (if any)
|
||||
- [ ] Phase numbering mode respected (continued or reset)
|
||||
- [ ] All commits made (if planning docs committed)
|
||||
- [ ] User knows next step: `/gsd:discuss-phase [N]`
|
||||
- [ ] User knows next step: `/gsd:discuss-phase [N] ${GSD_WS}`
|
||||
|
||||
**Atomic commits:** Each phase commits its artifacts immediately.
|
||||
</success_criteria>
|
||||
|
||||
@@ -208,9 +208,9 @@ If "Run discuss-phase first":
|
||||
does not work correctly in nested subcontexts (#1009). Instead, display the command
|
||||
and exit so the user runs it as a top-level command:
|
||||
```
|
||||
Run this command first, then re-run /gsd:plan-phase {X}:
|
||||
Run this command first, then re-run /gsd:plan-phase {X} ${GSD_WS}:
|
||||
|
||||
/gsd:discuss-phase {X}
|
||||
/gsd:discuss-phase {X} ${GSD_WS}
|
||||
```
|
||||
**Exit the plan-phase workflow. Do not continue.**
|
||||
|
||||
@@ -363,7 +363,7 @@ Use AskUserQuestion:
|
||||
- header: "UI Design Contract"
|
||||
- question: "Phase {N} has frontend indicators but no UI-SPEC.md. Generate a design contract before planning?"
|
||||
- options:
|
||||
- "Generate UI-SPEC first" → Display: "Run `/gsd:ui-phase {N}` then re-run `/gsd:plan-phase {N}`". Exit workflow.
|
||||
- "Generate UI-SPEC first" → Display: "Run `/gsd:ui-phase {N} ${GSD_WS}` then re-run `/gsd:plan-phase {N} ${GSD_WS}`". Exit workflow.
|
||||
- "Continue without UI-SPEC" → Continue to step 6.
|
||||
- "Not a frontend phase" → Continue to step 6.
|
||||
|
||||
@@ -411,7 +411,7 @@ VALIDATION_EXISTS=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
|
||||
```
|
||||
|
||||
If missing and Nyquist is still enabled/applicable — ask user:
|
||||
1. Re-run: `/gsd:plan-phase {PHASE} --research`
|
||||
1. Re-run: `/gsd:plan-phase {PHASE} --research ${GSD_WS}`
|
||||
2. Disable Nyquist with the exact command:
|
||||
`node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow.nyquist_validation false`
|
||||
3. Continue anyway (plans fail Dimension 8)
|
||||
@@ -703,7 +703,7 @@ Plans ready. Launching execute-phase...
|
||||
|
||||
Launch execute-phase using the Skill tool to avoid nested Task sessions (which cause runtime freezes due to deep agent nesting):
|
||||
```
|
||||
Skill(skill="gsd:execute-phase", args="${PHASE} --auto --no-transition")
|
||||
Skill(skill="gsd:execute-phase", args="${PHASE} --auto --no-transition ${GSD_WS}")
|
||||
```
|
||||
|
||||
The `--no-transition` flag tells execute-phase to return status after verification instead of chaining further. This keeps the auto-advance chain flat — each phase runs at the same nesting level rather than spawning deeper Task agents.
|
||||
@@ -717,14 +717,14 @@ The `--no-transition` flag tells execute-phase to return status after verificati
|
||||
|
||||
Auto-advance pipeline finished.
|
||||
|
||||
Next: /gsd:discuss-phase ${NEXT_PHASE} --auto
|
||||
Next: /gsd:discuss-phase ${NEXT_PHASE} --auto ${GSD_WS}
|
||||
```
|
||||
- **GAPS FOUND / VERIFICATION FAILED** → Display result, stop chain:
|
||||
```
|
||||
Auto-advance stopped: Execution needs review.
|
||||
|
||||
Review the output above and continue manually:
|
||||
/gsd:execute-phase ${PHASE}
|
||||
/gsd:execute-phase ${PHASE} ${GSD_WS}
|
||||
```
|
||||
|
||||
**If neither `--auto` nor config enabled:**
|
||||
@@ -755,7 +755,7 @@ Verification: {Passed | Passed with override | Skipped}
|
||||
|
||||
**Execute Phase {X}** — run all {N} plans
|
||||
|
||||
/gsd:execute-phase {X}
|
||||
/gsd:execute-phase {X} ${GSD_WS}
|
||||
|
||||
<sub>/clear first → fresh context window</sub>
|
||||
|
||||
|
||||
@@ -185,8 +185,8 @@ Track: `outstanding_debt` — `summary.total_items` from the audit.
|
||||
| {phase} | {filename} | {pending_count} pending, {skipped_count} skipped, {blocked_count} blocked |
|
||||
| {phase} | {filename} | human_needed — {count} items |
|
||||
|
||||
Review: `/gsd:audit-uat` — full cross-phase audit
|
||||
Resume testing: `/gsd:verify-work {phase}` — retest specific phase
|
||||
Review: `/gsd:audit-uat ${GSD_WS}` — full cross-phase audit
|
||||
Resume testing: `/gsd:verify-work {phase} ${GSD_WS}` — retest specific phase
|
||||
```
|
||||
|
||||
This is a WARNING, not a blocker — routing proceeds normally. The debt is visible so the user can make an informed choice.
|
||||
@@ -215,7 +215,7 @@ Read its `<objective>` section.
|
||||
|
||||
**{phase}-{plan}: [Plan Name]** — [objective summary from PLAN.md]
|
||||
|
||||
`/gsd:execute-phase {phase}`
|
||||
`/gsd:execute-phase {phase} ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
@@ -238,7 +238,7 @@ Check if `{phase_num}-CONTEXT.md` exists in phase directory.
|
||||
**Phase {N}: {Name}** — {Goal from ROADMAP.md}
|
||||
<sub>✓ Context gathered, ready to plan</sub>
|
||||
|
||||
`/gsd:plan-phase {phase-number}`
|
||||
`/gsd:plan-phase {phase-number} ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
@@ -254,15 +254,15 @@ Check if `{phase_num}-CONTEXT.md` exists in phase directory.
|
||||
|
||||
**Phase {N}: {Name}** — {Goal from ROADMAP.md}
|
||||
|
||||
`/gsd:discuss-phase {phase}` — gather context and clarify approach
|
||||
`/gsd:discuss-phase {phase} ${GSD_WS}` — gather context and clarify approach
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:plan-phase {phase}` — skip discussion, plan directly
|
||||
- `/gsd:list-phase-assumptions {phase}` — see Claude's assumptions
|
||||
- `/gsd:plan-phase {phase} ${GSD_WS}` — skip discussion, plan directly
|
||||
- `/gsd:list-phase-assumptions {phase} ${GSD_WS}` — see Claude's assumptions
|
||||
|
||||
---
|
||||
```
|
||||
@@ -280,15 +280,15 @@ UAT.md exists with gaps (diagnosed issues). User needs to plan fixes.
|
||||
|
||||
**{phase_num}-UAT.md** has {N} gaps requiring fixes.
|
||||
|
||||
`/gsd:plan-phase {phase} --gaps`
|
||||
`/gsd:plan-phase {phase} --gaps ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:execute-phase {phase}` — execute phase plans
|
||||
- `/gsd:verify-work {phase}` — run more UAT testing
|
||||
- `/gsd:execute-phase {phase} ${GSD_WS}` — execute phase plans
|
||||
- `/gsd:verify-work {phase} ${GSD_WS}` — run more UAT testing
|
||||
|
||||
---
|
||||
```
|
||||
@@ -306,15 +306,15 @@ UAT.md exists with `status: partial` — testing session ended before all items
|
||||
|
||||
**{phase_num}-UAT.md** has {N} unresolved tests (pending, blocked, or skipped).
|
||||
|
||||
`/gsd:verify-work {phase}` — resume testing from where you left off
|
||||
`/gsd:verify-work {phase} ${GSD_WS}` — resume testing from where you left off
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:audit-uat` — full cross-phase UAT audit
|
||||
- `/gsd:execute-phase {phase}` — execute phase plans
|
||||
- `/gsd:audit-uat ${GSD_WS}` — full cross-phase UAT audit
|
||||
- `/gsd:execute-phase {phase} ${GSD_WS}` — execute phase plans
|
||||
|
||||
---
|
||||
```
|
||||
@@ -353,15 +353,15 @@ Read ROADMAP.md to get the next phase's name and goal.
|
||||
|
||||
**Phase {Z+1}: {Name}** — {Goal from ROADMAP.md}
|
||||
|
||||
`/gsd:discuss-phase {Z+1}` — gather context and clarify approach
|
||||
`/gsd:discuss-phase {Z+1} ${GSD_WS}` — gather context and clarify approach
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:plan-phase {Z+1}` — skip discussion, plan directly
|
||||
- `/gsd:verify-work {Z}` — user acceptance test before continuing
|
||||
- `/gsd:plan-phase {Z+1} ${GSD_WS}` — skip discussion, plan directly
|
||||
- `/gsd:verify-work {Z} ${GSD_WS}` — user acceptance test before continuing
|
||||
|
||||
---
|
||||
```
|
||||
@@ -381,14 +381,14 @@ All {N} phases finished!
|
||||
|
||||
**Complete Milestone** — archive and prepare for next
|
||||
|
||||
`/gsd:complete-milestone`
|
||||
`/gsd:complete-milestone ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:verify-work` — user acceptance test before completing milestone
|
||||
- `/gsd:verify-work ${GSD_WS}` — user acceptance test before completing milestone
|
||||
|
||||
---
|
||||
```
|
||||
@@ -412,7 +412,7 @@ Ready to plan the next milestone.
|
||||
|
||||
**Start Next Milestone** — questioning → research → requirements → roadmap
|
||||
|
||||
`/gsd:new-milestone`
|
||||
`/gsd:new-milestone ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
@@ -424,10 +424,10 @@ Ready to plan the next milestone.
|
||||
<step name="edge_cases">
|
||||
**Handle edge cases:**
|
||||
|
||||
- Phase complete but next phase not planned → offer `/gsd:plan-phase [next]`
|
||||
- Phase complete but next phase not planned → offer `/gsd:plan-phase [next] ${GSD_WS}`
|
||||
- All work complete → offer milestone completion
|
||||
- Blockers present → highlight before offering to continue
|
||||
- Handoff file exists → mention it, offer `/gsd:resume-work`
|
||||
- Handoff file exists → mention it, offer `/gsd:resume-work ${GSD_WS}`
|
||||
</step>
|
||||
|
||||
</process>
|
||||
|
||||
@@ -691,7 +691,7 @@ Commit: ${commit_hash}
|
||||
|
||||
---
|
||||
|
||||
Ready for next task: /gsd:quick
|
||||
Ready for next task: /gsd:quick ${GSD_WS}
|
||||
```
|
||||
|
||||
**If NOT `$FULL_MODE`:**
|
||||
@@ -708,7 +708,7 @@ Commit: ${commit_hash}
|
||||
|
||||
---
|
||||
|
||||
Ready for next task: /gsd:quick
|
||||
Ready for next task: /gsd:quick ${GSD_WS}
|
||||
```
|
||||
|
||||
</process>
|
||||
|
||||
@@ -199,11 +199,11 @@ What would you like to do?
|
||||
[Primary action based on state - e.g.:]
|
||||
1. Resume interrupted agent [if interrupted agent found]
|
||||
OR
|
||||
1. Execute phase (/gsd:execute-phase {phase})
|
||||
1. Execute phase (/gsd:execute-phase {phase} ${GSD_WS})
|
||||
OR
|
||||
1. Discuss Phase 3 context (/gsd:discuss-phase 3) [if CONTEXT.md missing]
|
||||
1. Discuss Phase 3 context (/gsd:discuss-phase 3 ${GSD_WS}) [if CONTEXT.md missing]
|
||||
OR
|
||||
1. Plan Phase 3 (/gsd:plan-phase 3) [if CONTEXT.md exists or discuss option declined]
|
||||
1. Plan Phase 3 (/gsd:plan-phase 3 ${GSD_WS}) [if CONTEXT.md exists or discuss option declined]
|
||||
|
||||
[Secondary options:]
|
||||
2. Review current phase status
|
||||
@@ -234,7 +234,7 @@ Based on user selection, route to appropriate workflow:
|
||||
|
||||
**{phase}-{plan}: [Plan Name]** — [objective from PLAN.md]
|
||||
|
||||
`/gsd:execute-phase {phase}`
|
||||
`/gsd:execute-phase {phase} ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
@@ -248,15 +248,15 @@ Based on user selection, route to appropriate workflow:
|
||||
|
||||
**Phase [N]: [Name]** — [Goal from ROADMAP.md]
|
||||
|
||||
`/gsd:plan-phase [phase-number]`
|
||||
`/gsd:plan-phase [phase-number] ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:discuss-phase [N]` — gather context first
|
||||
- `/gsd:research-phase [N]` — investigate unknowns
|
||||
- `/gsd:discuss-phase [N] ${GSD_WS}` — gather context first
|
||||
- `/gsd:research-phase [N] ${GSD_WS}` — investigate unknowns
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
@@ -381,7 +381,7 @@ Resume file: None
|
||||
|
||||
The `is_last_phase` field from the phase complete result tells you directly:
|
||||
- `is_last_phase: false` → More phases remain → Go to **Route A**
|
||||
- `is_last_phase: true` → Milestone complete → Go to **Route B**
|
||||
- `is_last_phase: true` → Last phase done → **Check for workstream collisions first**
|
||||
|
||||
The `next_phase` and `next_phase_name` fields give you the next phase details.
|
||||
|
||||
@@ -394,6 +394,34 @@ This returns all phases with goals, disk status, and completion info.
|
||||
|
||||
---
|
||||
|
||||
**Workstream collision check (when `is_last_phase: true`):**
|
||||
|
||||
Before routing to Route B, check whether other workstreams are still active.
|
||||
This prevents one workstream from advancing or completing the milestone while
|
||||
other workstreams are still working on their phases.
|
||||
|
||||
**Skip this check if NOT in workstream mode** (i.e., `GSD_WORKSTREAM` is not set / flat mode).
|
||||
In flat mode, go directly to **Route B**.
|
||||
|
||||
```bash
|
||||
# Only check if we're in workstream mode
|
||||
if [ -n "$GSD_WORKSTREAM" ]; then
|
||||
WS_LIST=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" workstream list --raw)
|
||||
fi
|
||||
```
|
||||
|
||||
Parse the JSON result. The output has `{ mode, workstreams: [...] }`.
|
||||
Each workstream entry has: `name`, `status`, `current_phase`, `phase_count`, `completed_phases`.
|
||||
|
||||
Filter out the current workstream (`$GSD_WORKSTREAM`) and any workstreams with
|
||||
status containing "milestone complete" or "archived" (case-insensitive).
|
||||
The remaining entries are **other active workstreams**.
|
||||
|
||||
- **If other active workstreams exist** → Go to **Route B1**
|
||||
- **If NO other active workstreams** (or flat mode) → Go to **Route B**
|
||||
|
||||
---
|
||||
|
||||
**Route A: More phases remain in milestone**
|
||||
|
||||
Read ROADMAP.md to get the next phase's name and goal.
|
||||
@@ -418,7 +446,7 @@ Next: Phase [X+1] — [Name]
|
||||
⚡ Auto-continuing: Plan Phase [X+1] in detail
|
||||
```
|
||||
|
||||
Exit skill and invoke SlashCommand("/gsd:plan-phase [X+1] --auto")
|
||||
Exit skill and invoke SlashCommand("/gsd:plan-phase [X+1] --auto ${GSD_WS}")
|
||||
|
||||
**If CONTEXT.md does NOT exist:**
|
||||
|
||||
@@ -430,7 +458,7 @@ Next: Phase [X+1] — [Name]
|
||||
⚡ Auto-continuing: Discuss Phase [X+1] first
|
||||
```
|
||||
|
||||
Exit skill and invoke SlashCommand("/gsd:discuss-phase [X+1] --auto")
|
||||
Exit skill and invoke SlashCommand("/gsd:discuss-phase [X+1] --auto ${GSD_WS}")
|
||||
|
||||
</if>
|
||||
|
||||
@@ -447,15 +475,15 @@ Exit skill and invoke SlashCommand("/gsd:discuss-phase [X+1] --auto")
|
||||
|
||||
**Phase [X+1]: [Name]** — [Goal from ROADMAP.md]
|
||||
|
||||
`/gsd:discuss-phase [X+1]` — gather context and clarify approach
|
||||
`/gsd:discuss-phase [X+1] ${GSD_WS}` — gather context and clarify approach
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:plan-phase [X+1]` — skip discussion, plan directly
|
||||
- `/gsd:research-phase [X+1]` — investigate unknowns
|
||||
- `/gsd:plan-phase [X+1] ${GSD_WS}` — skip discussion, plan directly
|
||||
- `/gsd:research-phase [X+1] ${GSD_WS}` — investigate unknowns
|
||||
|
||||
---
|
||||
```
|
||||
@@ -472,15 +500,15 @@ Exit skill and invoke SlashCommand("/gsd:discuss-phase [X+1] --auto")
|
||||
**Phase [X+1]: [Name]** — [Goal from ROADMAP.md]
|
||||
<sub>✓ Context gathered, ready to plan</sub>
|
||||
|
||||
`/gsd:plan-phase [X+1]`
|
||||
`/gsd:plan-phase [X+1] ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:discuss-phase [X+1]` — revisit context
|
||||
- `/gsd:research-phase [X+1]` — investigate unknowns
|
||||
- `/gsd:discuss-phase [X+1] ${GSD_WS}` — revisit context
|
||||
- `/gsd:research-phase [X+1] ${GSD_WS}` — investigate unknowns
|
||||
|
||||
---
|
||||
```
|
||||
@@ -489,9 +517,68 @@ Exit skill and invoke SlashCommand("/gsd:discuss-phase [X+1] --auto")
|
||||
|
||||
---
|
||||
|
||||
**Route B1: Workstream done, other workstreams still active**
|
||||
|
||||
This route is reached when `is_last_phase: true` AND the collision check found
|
||||
other active workstreams. Do NOT suggest completing the milestone or advancing
|
||||
to the next milestone — other workstreams are still working.
|
||||
|
||||
**Clear auto-advance chain flag** — workstream boundary is the natural stopping point:
|
||||
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false
|
||||
```
|
||||
|
||||
<if mode="yolo">
|
||||
|
||||
Override auto-advance: do NOT auto-continue to milestone completion.
|
||||
Present the blocking information and stop.
|
||||
|
||||
</if>
|
||||
|
||||
Present (all modes):
|
||||
|
||||
```
|
||||
## ✓ Phase {X}: {Phase Name} Complete
|
||||
|
||||
This workstream's phases are complete. Other workstreams are still active:
|
||||
|
||||
| Workstream | Status | Phase | Progress |
|
||||
|------------|--------|-------|----------|
|
||||
| {name} | {status} | {current_phase} | {completed_phases}/{phase_count} |
|
||||
| ... | ... | ... | ... |
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
Archive this workstream:
|
||||
|
||||
`/gsd:workstreams complete {current_ws_name} ${GSD_WS}`
|
||||
|
||||
See overall milestone progress:
|
||||
|
||||
`/gsd:workstreams progress ${GSD_WS}`
|
||||
|
||||
<sub>Milestone completion will be available once all workstreams finish.</sub>
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
Do NOT suggest `/gsd:complete-milestone` or `/gsd:new-milestone`.
|
||||
Do NOT auto-invoke any further slash commands.
|
||||
|
||||
**Stop here.** The user must explicitly decide what to do next.
|
||||
|
||||
---
|
||||
|
||||
**Route B: Milestone complete (all phases done)**
|
||||
|
||||
**This route is only reached when:**
|
||||
- `is_last_phase: true` AND no other active workstreams exist (or flat mode)
|
||||
|
||||
**Clear auto-advance chain flag** — milestone boundary is the natural stopping point:
|
||||
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false
|
||||
```
|
||||
@@ -506,7 +593,7 @@ Phase {X} marked complete.
|
||||
⚡ Auto-continuing: Complete milestone and archive
|
||||
```
|
||||
|
||||
Exit skill and invoke SlashCommand("/gsd:complete-milestone {version}")
|
||||
Exit skill and invoke SlashCommand("/gsd:complete-milestone {version} ${GSD_WS}")
|
||||
|
||||
</if>
|
||||
|
||||
@@ -523,7 +610,7 @@ Exit skill and invoke SlashCommand("/gsd:complete-milestone {version}")
|
||||
|
||||
**Complete Milestone {version}** — archive and prepare for next
|
||||
|
||||
`/gsd:complete-milestone {version}`
|
||||
`/gsd:complete-milestone {version} ${GSD_WS}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
|
||||
|
||||
- **State A** (`VALIDATION_FILE` non-empty): Audit existing
|
||||
- **State B** (`VALIDATION_FILE` empty, `SUMMARY_FILES` non-empty): Reconstruct from artifacts
|
||||
- **State C** (`SUMMARY_FILES` empty): Exit — "Phase {N} not executed. Run /gsd:execute-phase {N} first."
|
||||
- **State C** (`SUMMARY_FILES` empty): Exit — "Phase {N} not executed. Run /gsd:execute-phase {N} ${GSD_WS} first."
|
||||
|
||||
## 2. Discovery
|
||||
|
||||
@@ -137,14 +137,14 @@ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs(phase-${PHASE}
|
||||
```
|
||||
GSD > PHASE {N} IS NYQUIST-COMPLIANT
|
||||
All requirements have automated verification.
|
||||
▶ Next: /gsd:audit-milestone
|
||||
▶ Next: /gsd:audit-milestone ${GSD_WS}
|
||||
```
|
||||
|
||||
**Partial:**
|
||||
```
|
||||
GSD > PHASE {N} VALIDATED (PARTIAL)
|
||||
{M} automated, {K} manual-only.
|
||||
▶ Retry: /gsd:validate-phase {N}
|
||||
▶ Retry: /gsd:validate-phase {N} ${GSD_WS}
|
||||
```
|
||||
|
||||
Display `/clear` reminder.
|
||||
|
||||
Reference in New Issue
Block a user