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:
SalesTeamToolbox
2026-03-20 14:20:23 -07:00
parent c152d1275e
commit c83b69bbb5
23 changed files with 1436 additions and 202 deletions

View File

@@ -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>