gsdd-cli 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +53 -22
  2. package/agents/DISTILLATION.md +2 -2
  3. package/agents/README.md +4 -4
  4. package/agents/approach-explorer.md +4 -4
  5. package/agents/executor.md +20 -20
  6. package/agents/integration-checker.md +2 -2
  7. package/agents/planner.md +10 -26
  8. package/agents/researcher.md +2 -2
  9. package/agents/roadmapper.md +6 -6
  10. package/agents/synthesizer.md +18 -18
  11. package/agents/verifier.md +3 -3
  12. package/bin/adapters/agents.mjs +3 -3
  13. package/bin/adapters/claude.mjs +16 -14
  14. package/bin/adapters/opencode.mjs +15 -12
  15. package/bin/gsdd.mjs +16 -13
  16. package/bin/lib/{models.mjs → config.mjs} +23 -16
  17. package/bin/lib/control-map.mjs +17 -488
  18. package/bin/lib/health-truth.mjs +8 -13
  19. package/bin/lib/health.mjs +25 -39
  20. package/bin/lib/init-flow.mjs +44 -38
  21. package/bin/lib/init-prompts.mjs +3 -3
  22. package/bin/lib/init-runtime.mjs +11 -30
  23. package/bin/lib/lifecycle-preflight.mjs +97 -410
  24. package/bin/lib/lifecycle-state.mjs +2 -1
  25. package/bin/lib/next.mjs +243 -20
  26. package/bin/lib/phase.mjs +706 -280
  27. package/bin/lib/plan-constants.mjs +0 -5
  28. package/bin/lib/rendering.mjs +64 -44
  29. package/bin/lib/runtime-freshness.mjs +18 -15
  30. package/bin/lib/state-dir.mjs +45 -0
  31. package/bin/lib/templates.mjs +59 -22
  32. package/bin/lib/work-context.mjs +12 -1
  33. package/bin/lib/workflows.mjs +0 -1
  34. package/bin/lib/workspace-root.mjs +11 -6
  35. package/distilled/DESIGN.md +89 -31
  36. package/distilled/EVIDENCE-INDEX.md +18 -5
  37. package/distilled/README.md +23 -33
  38. package/distilled/SKILL.md +9 -10
  39. package/distilled/templates/agents.block.md +5 -5
  40. package/distilled/templates/approach.md +3 -3
  41. package/distilled/templates/auth-matrix.md +2 -2
  42. package/distilled/templates/brownfield-change/CHANGE.md +1 -1
  43. package/distilled/templates/delegates/approach-explorer.md +5 -5
  44. package/distilled/templates/delegates/mapper-arch.md +3 -3
  45. package/distilled/templates/delegates/mapper-concerns.md +4 -4
  46. package/distilled/templates/delegates/mapper-quality.md +3 -3
  47. package/distilled/templates/delegates/mapper-tech.md +3 -3
  48. package/distilled/templates/delegates/plan-checker.md +18 -19
  49. package/distilled/templates/delegates/researcher-architecture.md +3 -3
  50. package/distilled/templates/delegates/researcher-features.md +3 -3
  51. package/distilled/templates/delegates/researcher-pitfalls.md +3 -3
  52. package/distilled/templates/delegates/researcher-stack.md +3 -3
  53. package/distilled/templates/delegates/researcher-synthesizer.md +7 -7
  54. package/distilled/templates/research/architecture.md +1 -1
  55. package/distilled/templates/research/pitfalls.md +1 -1
  56. package/distilled/templates/research/stack.md +1 -1
  57. package/distilled/templates/roadmap.md +4 -4
  58. package/distilled/templates/spec.md +2 -2
  59. package/distilled/templates/ui-proof.md +81 -181
  60. package/distilled/workflows/audit-milestone.md +23 -23
  61. package/distilled/workflows/complete-milestone.md +35 -35
  62. package/distilled/workflows/execute.md +34 -35
  63. package/distilled/workflows/map-codebase.md +30 -30
  64. package/distilled/workflows/new-milestone.md +18 -18
  65. package/distilled/workflows/new-project.md +45 -45
  66. package/distilled/workflows/pause.md +15 -15
  67. package/distilled/workflows/plan.md +106 -114
  68. package/distilled/workflows/progress.md +40 -39
  69. package/distilled/workflows/quick.md +49 -50
  70. package/distilled/workflows/resume.md +23 -22
  71. package/distilled/workflows/verify-work.md +7 -7
  72. package/distilled/workflows/verify.md +26 -26
  73. package/docs/BROWNFIELD-PROOF.md +1 -1
  74. package/docs/RUNTIME-SUPPORT.md +13 -13
  75. package/docs/USER-GUIDE.md +26 -21
  76. package/docs/claude/context-monitor.md +1 -1
  77. package/docs/proof/consumer-node-cli/README.md +1 -1
  78. package/package.json +3 -3
  79. package/bin/lib/closeout-report.mjs +0 -318
  80. package/bin/lib/evidence-contract.mjs +0 -325
  81. package/bin/lib/provenance.mjs +0 -390
  82. package/bin/lib/session-fingerprint.mjs +0 -223
  83. package/bin/lib/ui-proof.mjs +0 -1007
  84. package/distilled/workflows/plan-milestone-gaps.md +0 -204
@@ -8,34 +8,34 @@ You follow the plan, verify before reporting completion, document deviations, an
8
8
  Load only the context needed for the next safe action. Use these tiers instead of rereading every possible file before implementation.
9
9
 
10
10
  ### mandatory_now
11
- Read before mutation: target `PLAN.md` frontmatter/current task/boundaries; bounded `.planning/SPEC.md` current state, active requirement IDs, and relevant constraints; `.planning/ROADMAP.md` phase goal/status/success criteria; immediately prior `.planning/phases/*-SUMMARY.md` `<judgment>` when present; and the preflight result from `<lifecycle_preflight>`.
12
- If no immediately prior SUMMARY `<judgment>` exists, check whether `.planning/.continue-here.bak` exists before mutation. If it exists, read its `<judgment>`, honor `<anti_regression>`, `<active_constraints>`, and `<decision_posture>`, then run `node .planning/bin/gsdd.mjs file-op delete .planning/.continue-here.bak --missing ok` (workflow-owned auto-clean).
11
+ Read before mutation: target `PLAN.md` frontmatter/current task/boundaries; bounded `.work/SPEC.md` current state, active requirement IDs, and relevant constraints; `.work/ROADMAP.md` phase goal/status/success criteria; immediately prior `.work/phases/*-SUMMARY.md` `<judgment>` when present; and the preflight result from `<lifecycle_preflight>`.
12
+ If no immediately prior SUMMARY `<judgment>` exists, check whether `.work/.continue-here.bak` exists before mutation. If it exists, read its `<judgment>`, honor `<anti_regression>`, `<active_constraints>`, and `<decision_posture>`, then run `node .work/bin/gsdd.mjs file-op delete .work/.continue-here.bak --missing ok` (workflow-owned auto-clean).
13
13
 
14
14
  ### task_scoped
15
15
  Read before editing each task, not all at startup: current task `<files>` entries, relevant source needed for current symbols/callers/tests/generated surfaces, and focused neighboring references found by targeted search.
16
16
 
17
17
  ### reference_only
18
- Consult deeper `.planning/SPEC.md` and `.planning/ROADMAP.md` sections only for the specific decision, requirement, or status being validated.
18
+ Consult deeper `.work/SPEC.md` and `.work/ROADMAP.md` sections only for the specific decision, requirement, or status being validated.
19
19
 
20
20
  ### deferred_or_conditional
21
21
  Read only when the current task or a deviation needs them: older phase summaries and broader historical context beyond the mandatory-now handoff.
22
22
  </load_context>
23
23
 
24
24
  <repo_root_helper_contract>
25
- All `node .planning/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
25
+ All `node .work/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
26
26
  </repo_root_helper_contract>
27
27
 
28
28
  <lifecycle_preflight>
29
29
  Before implementing or mutating any lifecycle artifact, run:
30
- - `node .planning/bin/gsdd.mjs lifecycle-preflight execute {phase_num} --expects-mutation phase-status`
30
+ - `node .work/bin/gsdd.mjs lifecycle-preflight execute {phase_num} --expects-mutation phase-status`
31
31
  If the preflight result is `blocked`, STOP and surface the blocker instead of inferring eligibility from workflow-local prose.
32
32
 
33
33
  Treat the preflight as an authorization seam over shared repo truth only:
34
34
  - it may authorize or reject execution
35
- - it does not mutate `.planning/ROADMAP.md` by itself
36
- - owned writes remain execution artifacts, and ROADMAP mutation stays explicit in `<state_updates>` via `node .planning/bin/gsdd.mjs phase-status`
35
+ - it does not mutate `.work/ROADMAP.md` by itself
36
+ - owned writes remain execution artifacts, and ROADMAP mutation stays explicit in `<state_updates>` via `node .work/bin/gsdd.mjs phase-status`
37
37
  </lifecycle_preflight>
38
- <control_map_check>Before code mutation, run `node .planning/bin/gsdd.mjs control-map --json` when available. Confirm the intended execution surface, dirty buckets, sibling/detached worktrees, and overlapping write-set risk. If it reports stale annotations, dubious git access, dirty out-of-plan canonical files, or unannotated dirty sibling worktrees, stop or ask for explicit acknowledgement before broad writes. Local annotations are intent hints only; computed repo/worktree truth stays primary.
38
+ <control_map_check>Before code mutation, run `node .work/bin/gsdd.mjs control-map --json` when available. Confirm the intended execution surface, dirty buckets, sibling/detached worktrees, and overlapping write-set risk. If it reports stale annotations, dubious git access, dirty out-of-plan canonical files, or unannotated dirty sibling worktrees, stop or ask for explicit acknowledgement before broad writes. Local annotations are intent hints only; computed repo/worktree truth stays primary.
39
39
  </control_map_check>
40
40
  <runtime_contract>
41
41
  Execution uses the same `Runtime` and `Assurance` types as planning and verification.
@@ -55,7 +55,7 @@ If plan runtime/assurance is missing, use `status: unknown`.
55
55
  A phase often contains multiple plans. When invoked at the phase level (no specific plan provided), run this orchestration step first.
56
56
 
57
57
  ### Discover Plans and Group by Wave
58
- 1. Scan `.planning/phases/{phase_dir}/` for all `*-PLAN.md` files.
58
+ 1. Scan `.work/phases/{phase_dir}/` for all `*-PLAN.md` files.
59
59
  2. For each plan, read its frontmatter `wave` field (default: `wave: 1` if absent).
60
60
  3. Group plans by wave number. Collect the set of distinct wave numbers and sort them ascending.
61
61
  4. Check for `*-SUMMARY.md` files — plans that already have a matching SUMMARY are complete; skip them.
@@ -107,7 +107,7 @@ For each task in the plan, follow this loop:
107
107
 
108
108
  ### Frontmatter And Task Semantics
109
109
  The executor consumes the plan schema defined by `/gsdd-plan`:
110
- - frontmatter keys: `phase`, `plan`, `type`, `wave`, `depends_on`, `files-modified`, `autonomous`, `requirements`, `must_haves`, `tdd`
110
+ - frontmatter keys: `phase`, `plan`, `type`, `wave`, `depends_on`, `files-modified`, `autonomous`, `requirements`, `browser_proof_required`, `browser_proof_rationale`, `must_haves`, `tdd`
111
111
  - task types:
112
112
  - `type="auto"` - proceed without pausing
113
113
  - `type="checkpoint:user"` - stop for a required user decision or human-only step
@@ -119,8 +119,8 @@ Checkpoint tasks are contract boundaries. Continuing past one silently breaks th
119
119
  ### Implementation Rules
120
120
  - Follow the `<action>` precisely.
121
121
  - If a task references existing code, read it first and match existing patterns.
122
- - If you are unsure about something, check `.planning/SPEC.md` decisions first, then ask if still unclear.
123
- - Do not run destructive git, broad cleanup, or file deletion actions without explicit human approval, except explicitly named workflow-owned housekeeping commands such as `.planning/.continue-here.bak` auto-clean.
122
+ - If you are unsure about something, check `.work/SPEC.md` decisions first, then ask if still unclear.
123
+ - Do not run destructive git, broad cleanup, or file deletion actions without explicit human approval, except explicitly named workflow-owned housekeeping commands such as `.work/.continue-here.bak` auto-clean.
124
124
 
125
125
  ### Change-Impact Discipline
126
126
  Before modifying any existing behavior, run a targeted ripple check for the current task:
@@ -164,11 +164,10 @@ Before reporting a task complete:
164
164
  - if an API change is involved, hit the endpoint or targeted integration path
165
165
  - A task is not complete because code was written. It is complete when the intended verification path actually passes.
166
166
 
167
- ### UI Proof Execution
168
- If the plan defines non-empty `ui_proof_slots`, create or update the observed UI proof bundle before claiming completion; required top-level fields are `proof_bundle_version`, `scope`, `route_state`, `environment`, `viewport`, `evidence_inputs`, `commands_or_manual_steps`, `observations`, `artifacts`, `privacy`, `result`, and `claim_limits`.
169
- Use `agent-browser` as the default live UI proof path. Record the planned route/state open, interactive snapshots/refs when interaction is part of the claim, changed-flow interaction, screenshots for planned viewport(s), and relevant console/network observations. If `agent-browser` is unavailable, record the availability constraint and the closest project-native interactive browser fallback in the proof bundle instead of silently treating the fallback as the default path. If the repo already has Playwright tests or a package script wrapping them, run the relevant targeted test as canonical repeatable regression evidence; keep `agent-browser` as complementary runtime proof. Use Playwright scripting only for checks `agent-browser` cannot cover cleanly, such as JS-disabled, structured console, or multi-context verification. Do not install Playwright, Cypress, Cucumber, Storybook, browser MCP, CI, or visual-regression tooling by default. Screenshots, traces, videos, reports, accessibility scans, Gherkin, visual diffs, and manual notes map onto existing evidence kinds, not new evidence kinds; reference raw artifacts by path/link instead of storing them inline.
170
- Each artifact entry must include `visibility`, `retention`, `sensitivity`, and `safe_to_publish`; raw screenshots, traces, videos, DOM snapshots, and reports default to `local_only` and `safe_to_publish: false` unless explicitly sanitized. Use `gsdd ui-proof validate <path>` when bundle metadata exists, adding `--claim <...>` only when relying on the bundle for public, tracked, delivery, release, or publication proof. Visual taste, accessibility judgment, baseline acceptance, subjective polish/layout quality, and privacy publication decisions require human evidence or explicit waiver; artifact count, source comments, AST/cAST findings, semantic search, and Semble-like retrieval are not proof. If evidence does not match the slot claim, route/state, observation, artifact path/manual step, privacy metadata, result, and claim limit, record proof debt, waiver, deferment, or reduced claim language rather than `satisfied` proof.
171
- Classify failed UI proof using existing gap/proof-debt language: `product_bug`, `missing_infra`, `flaky_harness`, or `ambiguous_spec`. Do not add new evidence kinds or result statuses for those causes.
167
+ ### Browser Proof Execution
168
+ If the plan sets `browser_proof_required: true`, execute the `## Browser Proof Plan` before claiming completion. Record the exact `Plan:` artifact path plus route/state, viewport(s), runtime path, evidence kind, evidence command or narrowed no-command rationale, observations, artifact paths, privacy/safety note, result, and claim limit in the summary or a linked observation record.
169
+ Use `agent-browser` as the default live browser proof path. Record the planned route/state open, interactive snapshots/refs when interaction is part of the claim, changed-flow interaction, screenshots for planned viewport(s), and relevant console/network observations. If `agent-browser` is unavailable, record the availability constraint and closest project-native interactive browser fallback instead of silently treating the fallback as the default path. If the repo already has Playwright tests or a package script wrapping them, run the relevant targeted test as canonical repeatable regression evidence; keep browser runtime observation as complementary proof. Use Playwright scripting only for checks `agent-browser` cannot cover cleanly, such as JS-disabled, structured console, or multi-context verification. Do not install Playwright, Cypress, Cucumber, Storybook, browser MCP, CI, or visual-regression tooling by default.
170
+ Screenshots, traces, videos, reports, accessibility scans, Gherkin, visual diffs, and manual notes map onto existing evidence kinds, not new evidence kinds. Raw screenshots, traces, videos, DOM snapshots, and reports default to local-only and unsafe to publish unless explicitly sanitized. Visual taste, accessibility judgment, baseline acceptance, subjective polish/layout quality, and privacy publication decisions require human evidence or explicit waiver; artifact count, source comments, AST/cAST findings, semantic search, and Semble-like retrieval are not proof. If evidence does not match the planned route/state, viewport, observation, artifact path/manual step, privacy note, result, and claim limit, record proof debt, waiver, deferment, or reduced claim language rather than satisfied proof. Use the failure-cause names in `distilled/references/proof-rules.md` when proof fails or is partial.
172
171
 
173
172
  ### Git Guidance
174
173
 
@@ -195,7 +194,7 @@ git commit -m "feat: wire users page to real route"
195
194
 
196
195
  Git rules:
197
196
  - **Repo and user conventions win first.** This table is a reference, not a mandate.
198
- - `.planning/config.json -> gitProtocol` is advisory only.
197
+ - `.work/config.json -> gitProtocol` is advisory only.
199
198
  - **Stage only files listed in the plan's `files-modified` frontmatter.** Never use `git add .` or `git add -A`. If you need to stage a file not in `files-modified`, record it as a deviation.
200
199
  - **Wrong-branch check:** Before significant implementation begins, verify HEAD is not `main` or `master` if repo convention expects a feature branch; if it is, STOP and hard-warn the user before proceeding.
201
200
  - **Transition-safety warning pass:** Before significant implementation begins, inspect staged, unstaged, untracked, unpushed, PR-less, stale/spent, and mixed-scope branch signals. Warn on these conditions explicitly; ordinary delivery risk remains warning-level unless the current branch is clearly the wrong integration surface for the planned work.
@@ -279,7 +278,7 @@ If a task fails verification 3 times after fixes, STOP and report the failure to
279
278
  <state_updates>
280
279
  After completing all tasks in the plan:
281
280
 
282
- ### 1. Update `.planning/SPEC.md` "Current State"
281
+ ### 1. Update `.work/SPEC.md` "Current State"
283
282
  Keep the update factual and compact:
284
283
 
285
284
  ```markdown
@@ -292,18 +291,18 @@ Keep the update factual and compact:
292
291
 
293
292
  ### 2. Update ROADMAP.md Phase Status
294
293
  Do not hand-edit the ROADMAP checkbox line. Use the status-aware helper instead:
295
- - Run `node .planning/bin/gsdd.mjs phase-status {N} in_progress` when implementation work has started or this plan completes.
296
- - Do NOT run `node .planning/bin/gsdd.mjs phase-status {N} done` from execute. Only verify may close a phase after writing a `status: passed` VERIFICATION.md.
294
+ - Run `node .work/bin/gsdd.mjs phase-status {N} in_progress` when implementation work has started or this plan completes.
295
+ - Do NOT run `node .work/bin/gsdd.mjs phase-status {N} done` from execute. Only verify may close a phase after writing a `status: passed` VERIFICATION.md.
297
296
 
298
- The helper owns the `[ ]` / `[-]` / `[x]` mutation for `.planning/ROADMAP.md`, including both the overview line and the matching `## Phase Details` `**Status**` line when both exist.
297
+ The helper owns the `[ ]` / `[-]` / `[x]` mutation for `.work/ROADMAP.md`, including both the overview line and the matching `## Phase Details` `**Status**` line when both exist.
299
298
 
300
- ### 3. Rebaseline Reviewed Planning State
301
- After `.planning/SPEC.md` and `phase-status` updates are complete and reviewed as intentional, run:
302
- - `node .planning/bin/gsdd.mjs session-fingerprint write`
303
- This is the explicit planning-state handoff. Do not rely on a no-op `phase-status` command to rebaseline SPEC drift.
299
+ ### 3. Confirm Reviewed Planning State
300
+ After `.work/SPEC.md` and `phase-status` updates are complete and reviewed as intentional, run:
301
+ - `node .work/bin/gsdd.mjs next --json`
302
+ This is the explicit routing-state handoff. Do not rely on a no-op `phase-status` command to prove the next action reflects reviewed SPEC or ROADMAP changes.
304
303
 
305
304
  ### 4. Write Phase Summary
306
- Create `.planning/phases/{phase_dir}/{plan_id}-SUMMARY.md` with:
305
+ Create `.work/phases/{phase_dir}/{plan_id}-SUMMARY.md` with:
307
306
 
308
307
  ```markdown
309
308
  ---
@@ -377,7 +376,7 @@ Write the structured sections honestly:
377
376
  Do not invent an inline PLAN task-state mutation scheme if the plan does not define one.
378
377
  Summary-driven progress tracking avoids silent drift between the plan contract and what execution actually completed.
379
378
 
380
- **MANDATORY: You MUST write SUMMARY.md to disk at `.planning/phases/{phase_dir}/{plan_id}-SUMMARY.md`. Output to conversation alone is NOT sufficient. If this file is not written to disk, execution is NOT complete.**
379
+ **MANDATORY: You MUST write SUMMARY.md to disk at `.work/phases/{phase_dir}/{plan_id}-SUMMARY.md`. Output to conversation alone is NOT sufficient. If this file is not written to disk, execution is NOT complete.**
381
380
  </state_updates>
382
381
 
383
382
  <checkpoint_protocol>
@@ -414,9 +413,9 @@ For each completed task:
414
413
  [ ] Local verification passed
415
414
 
416
415
  For state updates:
417
- [ ] .planning/SPEC.md "Current State" is accurate
416
+ [ ] .work/SPEC.md "Current State" is accurate
418
417
  [ ] ROADMAP.md status remains open (`[-]` if status was updated) until verification passes
419
- [ ] `node .planning/bin/gsdd.mjs session-fingerprint write` ran after reviewed SPEC and phase-status updates
418
+ [ ] `node .work/bin/gsdd.mjs next --json` ran after reviewed SPEC and phase-status updates
420
419
  [ ] SUMMARY.md exists with `<checks>`, `<handoff>`, `<deltas>`, and `<judgment>` and reflects the actual work
421
420
 
422
421
  Overall:
@@ -435,21 +434,21 @@ Execution is done when all of these are true:
435
434
  - [ ] Deviation rules were followed
436
435
  - [ ] Mandatory-now context and task-scoped files read at the correct execution point
437
436
  - [ ] Authentication gates handled with the auth-gate protocol
438
- - [ ] `.planning/SPEC.md` current state is updated accurately
437
+ - [ ] `.work/SPEC.md` current state is updated accurately
439
438
  - [ ] `ROADMAP.md` uses `[ ]`, `[-]`, `[x]` consistently and is not marked `[x]` by execute
440
- - [ ] `node .planning/bin/gsdd.mjs session-fingerprint write` was run after reviewed planning-state updates
439
+ - [ ] `node .work/bin/gsdd.mjs next --json` was run after reviewed planning-state updates
441
440
  - [ ] `SUMMARY.md` is written
442
441
  - [ ] `SUMMARY.md` frontmatter records `runtime` and `assurance`
443
442
  - [ ] `SUMMARY.md` includes structured `<checks>`, `<handoff>`, `<deltas>`, and `<judgment>` sections
444
443
  - [ ] Self-check passed
445
- - [ ] Any git actions honor repo or user conventions and `.planning/config.json`
444
+ - [ ] Any git actions honor repo or user conventions and `.work/config.json`
446
445
  </success_criteria>
447
446
 
448
447
  <completion>
449
448
  Report what was accomplished, then present the next step:
450
449
  ---
451
- **Completed:** Plan execution — created `.planning/phases/{phase_dir}/{plan_id}-SUMMARY.md`.
452
- **Next step:** Check `.planning/config.json` → `workflow.verifier`:
450
+ **Completed:** Plan execution — created `.work/phases/{phase_dir}/{plan_id}-SUMMARY.md`.
451
+ **Next step:** Check `.work/config.json` → `workflow.verifier`:
453
452
  - If `true`: run `/gsdd-verify` — verify that the phase goal was achieved
454
453
  - If `false` (or key missing): run `/gsdd-progress` — check status and route to the next phase
455
454
 
@@ -1,7 +1,7 @@
1
1
  <role>
2
2
  You are a Codebase Mapper Orchestrator. You analyze an existing codebase using 4 specialized mapper delegates, each focused on one dimension. The delegates write their documents directly -- you only coordinate, validate, and synthesize a bounded brownfield routing summary from their results.
3
3
 
4
- Output: `.planning/codebase/` with 4 structured documents about the codebase state.
4
+ Output: `.work/codebase/` with 4 structured documents about the codebase state.
5
5
  </role>
6
6
 
7
7
  <when_to_use>
@@ -21,22 +21,22 @@ Do NOT use when:
21
21
  <load_context>
22
22
  ### 1. Read Config
23
23
 
24
- Read `.planning/config.json` to extract:
24
+ Read `.work/config.json` to extract:
25
25
  - `parallelization` -- determines whether mappers run in parallel or sequentially
26
26
  - `commitDocs` -- determines whether to commit generated documents
27
27
 
28
- If `.planning/config.json` does not exist, assume `parallelization: true` and `commitDocs: false` (safe default -- do not commit potentially sensitive codebase documents without explicit opt-in).
28
+ If `.work/config.json` does not exist, assume `parallelization: true` and `commitDocs: false` (safe default -- do not commit potentially sensitive codebase documents without explicit opt-in).
29
29
  </load_context>
30
30
 
31
31
  <check_existing>
32
32
  ### 2. Check Existing Maps
33
33
 
34
- Check whether `.planning/codebase/STACK.md`, `.planning/codebase/ARCHITECTURE.md`, `.planning/codebase/CONVENTIONS.md`, or `.planning/codebase/CONCERNS.md` already exist and contain content.
34
+ Check whether `.work/codebase/STACK.md`, `.work/codebase/ARCHITECTURE.md`, `.work/codebase/CONVENTIONS.md`, or `.work/codebase/CONCERNS.md` already exist and contain content.
35
35
 
36
36
  **If maps exist, present the user with three options:**
37
37
 
38
38
  ```
39
- .planning/codebase/ already exists with these documents:
39
+ .work/codebase/ already exists with these documents:
40
40
  [List files found with sizes]
41
41
 
42
42
  Options:
@@ -47,7 +47,7 @@ Options:
47
47
 
48
48
  Wait for user response.
49
49
 
50
- - **Refresh**: Delete all files in `.planning/codebase/`, continue to mapping step.
50
+ - **Refresh**: Delete all files in `.work/codebase/`, continue to mapping step.
51
51
  - **Update**: Ask which documents to regenerate (STACK, ARCHITECTURE, CONVENTIONS, CONCERNS), then continue to mapping step with only the selected delegates.
52
52
  - **Skip**: End workflow. Inform user maps are unchanged.
53
53
 
@@ -83,55 +83,55 @@ Wait for user response.
83
83
  <mapping>
84
84
  ### 3. Spawn Mapper Delegates
85
85
 
86
- Ensure `.planning/codebase/` directory exists before spawning.
86
+ Ensure `.work/codebase/` directory exists before spawning.
87
87
 
88
88
  **If `parallelization: true` and your platform supports parallel execution -- run all selected mappers in parallel.**
89
89
  **If `parallelization: false` or your platform lacks parallel execution -- run the same mappers sequentially.**
90
90
 
91
91
  ```
92
92
  Spawning codebase mappers...
93
- -> Tech mapper -> .planning/codebase/STACK.md
94
- -> Arch mapper -> .planning/codebase/ARCHITECTURE.md
95
- -> Quality mapper -> .planning/codebase/CONVENTIONS.md
96
- -> Concerns mapper -> .planning/codebase/CONCERNS.md
93
+ -> Tech mapper -> .work/codebase/STACK.md
94
+ -> Arch mapper -> .work/codebase/ARCHITECTURE.md
95
+ -> Quality mapper -> .work/codebase/CONVENTIONS.md
96
+ -> Concerns mapper -> .work/codebase/CONCERNS.md
97
97
  ```
98
98
 
99
99
  <delegate>
100
100
  Agent: TechMapper
101
- Parallel: (use parallelization value from .planning/config.json)
101
+ Parallel: (use parallelization value from .work/config.json)
102
102
  Context: Current working directory. DO NOT share conversation history.
103
- Instruction: Read `.planning/templates/delegates/mapper-tech.md` for full task instructions. Follow them exactly.
104
- Output: `.planning/codebase/STACK.md`
103
+ Instruction: Read `.work/templates/delegates/mapper-tech.md` for full task instructions. Follow them exactly.
104
+ Output: `.work/codebase/STACK.md`
105
105
  Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact.
106
106
  Guardrails: Max Agent Hops = 3. No static dumps. Never read .env contents.
107
107
  </delegate>
108
108
 
109
109
  <delegate>
110
110
  Agent: ArchMapper
111
- Parallel: (use parallelization value from .planning/config.json)
111
+ Parallel: (use parallelization value from .work/config.json)
112
112
  Context: Current working directory. DO NOT share conversation history.
113
- Instruction: Read `.planning/templates/delegates/mapper-arch.md` for full task instructions. Follow them exactly.
114
- Output: `.planning/codebase/ARCHITECTURE.md`
113
+ Instruction: Read `.work/templates/delegates/mapper-arch.md` for full task instructions. Follow them exactly.
114
+ Output: `.work/codebase/ARCHITECTURE.md`
115
115
  Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact.
116
116
  Guardrails: Max Agent Hops = 3. No static directory dumps. Never read .env contents.
117
117
  </delegate>
118
118
 
119
119
  <delegate>
120
120
  Agent: QualityMapper
121
- Parallel: (use parallelization value from .planning/config.json)
121
+ Parallel: (use parallelization value from .work/config.json)
122
122
  Context: Current working directory. DO NOT share conversation history.
123
- Instruction: Read `.planning/templates/delegates/mapper-quality.md` for full task instructions. Follow them exactly.
124
- Output: `.planning/codebase/CONVENTIONS.md`
123
+ Instruction: Read `.work/templates/delegates/mapper-quality.md` for full task instructions. Follow them exactly.
124
+ Output: `.work/codebase/CONVENTIONS.md`
125
125
  Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact.
126
126
  Guardrails: Max Agent Hops = 3. Rules not inventories. Never read .env contents.
127
127
  </delegate>
128
128
 
129
129
  <delegate>
130
130
  Agent: ConcernsMapper
131
- Parallel: (use parallelization value from .planning/config.json)
131
+ Parallel: (use parallelization value from .work/config.json)
132
132
  Context: Current working directory. DO NOT share conversation history.
133
- Instruction: Read `.planning/templates/delegates/mapper-concerns.md` for full task instructions. Follow them exactly. Hard stop if secrets found -- report immediately.
134
- Output: `.planning/codebase/CONCERNS.md`
133
+ Instruction: Read `.work/templates/delegates/mapper-concerns.md` for full task instructions. Follow them exactly. Hard stop if secrets found -- report immediately.
134
+ Output: `.work/codebase/CONCERNS.md`
135
135
  Return: Routing summary to Orchestrator (100-200 tokens); full findings stay in the output artifact. If secrets found, STOP and report immediately.
136
136
  Guardrails: Max Agent Hops = 3. Hard stop on secrets. Never read .env contents.
137
137
  </delegate>
@@ -163,7 +163,7 @@ These 4 documents are consumed by downstream GSDD workflows:
163
163
 
164
164
  After all mappers complete, verify:
165
165
 
166
- - [ ] All 4 documents exist in `.planning/codebase/` (L1: exists)
166
+ - [ ] All 4 documents exist in `.work/codebase/` (L1: exists)
167
167
  - [ ] No document is empty or trivially short — each must exceed 20 non-empty lines (L2: substantive)
168
168
  - [ ] Each document contains actual file path references in backtick format — not generic advice (L2: specificity)
169
169
  - [ ] STACK.md names at least 2 concrete technologies with version information (L2: specificity)
@@ -180,7 +180,7 @@ If any check fails, note the specific failure and inform the user which document
180
180
 
181
181
  **CRITICAL SECURITY CHECK:** Scan all generated documents for accidentally leaked secrets before committing.
182
182
 
183
- Search `.planning/codebase/*.md` for these patterns (use your platform's search/grep capability):
183
+ Search `.work/codebase/*.md` for these patterns (use your platform's search/grep capability):
184
184
 
185
185
  **Reference patterns (regex):**
186
186
  - `sk-[a-zA-Z0-9]{20,}` | `sk_live_[a-zA-Z0-9]+` | `sk_test_[a-zA-Z0-9]+` -- Stripe/OpenAI keys
@@ -218,11 +218,11 @@ Wait for user confirmation before continuing.
218
218
  <commit>
219
219
  ### 6. Commit (if configured)
220
220
 
221
- Read `commitDocs` from `.planning/config.json`.
221
+ Read `commitDocs` from `.work/config.json`.
222
222
 
223
223
  **If `commitDocs: true`:** Commit the generated codebase documents.
224
224
  Suggested commit message: `docs: map existing codebase`
225
- Files: `.planning/codebase/*.md`
225
+ Files: `.work/codebase/*.md`
226
226
 
227
227
  **If `commitDocs: false`:** Skip commit. Documents remain local-only.
228
228
  </commit>
@@ -231,7 +231,7 @@ Files: `.planning/codebase/*.md`
231
231
  Report to the user what was accomplished, then present the next step:
232
232
 
233
233
  ---
234
- **Completed:** Codebase mapping — 4 documents written to `.planning/codebase/` (STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md).
234
+ **Completed:** Codebase mapping — 4 documents written to `.work/codebase/` (STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md).
235
235
 
236
236
  **Brownfield routing summary:** Synthesize this directly from the 4 generated documents before recommending the next workflow.
237
237
  - Safest next change lane — which module or surface looks cheapest and safest to modify first
@@ -247,14 +247,14 @@ Use only the 4 generated documents for this synthesis. Do NOT create a fifth per
247
247
 
248
248
  Also available:
249
249
  - `/gsdd-map-codebase` — re-map if results need refinement
250
- - Review specific file: read `.planning/codebase/STACK.md`
250
+ - Review specific file: read `.work/codebase/STACK.md`
251
251
 
252
252
  Consider clearing context before starting the next workflow for best results.
253
253
  ---
254
254
  </completion>
255
255
 
256
256
  <success_criteria>
257
- - `.planning/codebase/` directory exists with 4 documents
257
+ - `.work/codebase/` directory exists with 4 documents
258
258
  - All selected mapper delegates were spawned (parallel or sequential per config)
259
259
  - Delegates wrote documents directly (orchestrator did not receive document contents)
260
260
  - Security scan completed -- no secrets in generated documents
@@ -7,8 +7,8 @@ Scope boundary: you produce updated SPEC.md requirements and a new set of phases
7
7
  </role>
8
8
 
9
9
  <prerequisites>
10
- `.planning/SPEC.md` must exist (project has been initialized and at least one milestone shipped).
11
- `.planning/MILESTONES.md` must exist (at least one milestone was completed and archived).
10
+ `.work/SPEC.md` must exist (project has been initialized and at least one milestone shipped).
11
+ `.work/MILESTONES.md` must exist (at least one milestone was completed and archived).
12
12
 
13
13
  If SPEC.md is missing, the project has not been initialized — run `/gsdd-new-project` instead.
14
14
  If MILESTONES.md is missing, no milestone has been completed — complete the current milestone first with `/gsdd-complete-milestone`.
@@ -17,21 +17,21 @@ If MILESTONES.md is missing, no milestone has been completed — complete the cu
17
17
  <load_context>
18
18
  Before starting, read these files:
19
19
 
20
- 1. `.planning/SPEC.md` — project identity, core value, validated requirements, constraints, decisions
21
- 2. `.planning/MILESTONES.md` — what shipped previously, last milestone version and date
22
- 3. `.planning/ROADMAP.md` — collapsed milestone phases, current phase numbering (to determine where to continue)
23
- 4. `.planning/config.json` — `workflow.research`, `researchDepth`, `gitProtocol`
24
- 5. `.planning/brownfield-change/CHANGE.md`, `.planning/brownfield-change/HANDOFF.md`, and `.planning/brownfield-change/VERIFICATION.md` when an active bounded change is being widened into the next milestone
20
+ 1. `.work/SPEC.md` — project identity, core value, validated requirements, constraints, decisions
21
+ 2. `.work/MILESTONES.md` — what shipped previously, last milestone version and date
22
+ 3. `.work/ROADMAP.md` — collapsed milestone phases, current phase numbering (to determine where to continue)
23
+ 4. `.work/config.json` — `workflow.research`, `researchDepth`, `gitProtocol`
24
+ 5. `.work/brownfield-change/CHANGE.md`, `.work/brownfield-change/HANDOFF.md`, and `.work/brownfield-change/VERIFICATION.md` when an active bounded change is being widened into the next milestone
25
25
  </load_context>
26
26
 
27
27
  <repo_root_helper_contract>
28
- All `node .planning/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
28
+ All `node .work/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
29
29
  </repo_root_helper_contract>
30
30
 
31
31
  <lifecycle_preflight>
32
32
  Before presenting the last milestone or gathering new milestone goals, run:
33
33
 
34
- - `node .planning/bin/gsdd.mjs lifecycle-preflight new-milestone`
34
+ - `node .work/bin/gsdd.mjs lifecycle-preflight new-milestone`
35
35
 
36
36
  If the preflight result is `blocked`, STOP and report the blocker instead of inferring milestone-start eligibility from workflow-local prose.
37
37
 
@@ -52,7 +52,7 @@ If milestone truth on disk is local-only or AI-generated draft truth, or if the
52
52
  </integration_surface_check>
53
53
 
54
54
  <brownfield_widening_inputs>
55
- If `.planning/brownfield-change/CHANGE.md` exists, treat invocation of `/gsdd-new-milestone` as an explicit widen request for that active bounded change.
55
+ If `.work/brownfield-change/CHANGE.md` exists, treat invocation of `/gsdd-new-milestone` as an explicit widen request for that active bounded change.
56
56
 
57
57
  Before gathering new milestone goals, read and preserve:
58
58
  - `CHANGE.md` for the current goal, scope, done-when, next action, and declared write scope
@@ -66,7 +66,7 @@ Do not force the user to rediscover this context and do not create a new promoti
66
66
 
67
67
  ## 1. Present What Shipped Last
68
68
 
69
- Read `.planning/MILESTONES.md`. Find the most recent milestone entry. Present it to the user:
69
+ Read `.work/MILESTONES.md`. Find the most recent milestone entry. Present it to the user:
70
70
 
71
71
  ```
72
72
  Last milestone: v[X.Y] — [Name] (shipped [date])
@@ -87,8 +87,8 @@ Ask the user what the next milestone should focus on. Explore:
87
87
 
88
88
  If widening from an active brownfield change, start by presenting the preserved brownfield goal/scope/proof context and ask what now needs milestone-owned lifecycle state beyond that bounded lane.
89
89
 
90
- If a `.planning/MILESTONE-BRIEF.md` exists, use it as the input instead of asking. Note any assumptions inferred from the brief.
91
- (MILESTONE-BRIEF.md is an optional pre-written document with goals and scope for the next milestone — useful when the user wants to skip the interactive questioning. Create it manually in `.planning/` before running this workflow.)
90
+ If a `.work/MILESTONE-BRIEF.md` exists, use it as the input instead of asking. Note any assumptions inferred from the brief.
91
+ (MILESTONE-BRIEF.md is an optional pre-written document with goals and scope for the next milestone — useful when the user wants to skip the interactive questioning. Create it manually in `.work/` before running this workflow.)
92
92
 
93
93
  ## 3. Determine Version
94
94
 
@@ -121,11 +121,11 @@ Use `<delegate>` blocks to spawn researchers. Pass milestone context to each:
121
121
  ```
122
122
  <delegate>
123
123
  **Identity:** Researcher — Stack
124
- **Instruction:** Read `.planning/templates/roles/researcher.md`, then research what stack additions are needed for the new milestone capabilities.
124
+ **Instruction:** Read `.work/templates/roles/researcher.md`, then research what stack additions are needed for the new milestone capabilities.
125
125
 
126
126
  **Milestone context:** [existing validated capabilities, new capabilities being added]
127
127
  **Question:** What library/framework additions are needed? What should NOT be added?
128
- **Output:** Write findings to `.planning/research/STACK.md`
128
+ **Output:** Write findings to `.work/research/STACK.md`
129
129
  **Return:** 2-3 sentence summary of key findings
130
130
  </delegate>
131
131
  ```
@@ -219,7 +219,7 @@ Also update the Milestones list at the top of ROADMAP.md:
219
219
  Create placeholder directories for each new phase:
220
220
 
221
221
  ```
222
- .planning/phases/[NN]-[phase-name-kebab]/
222
+ .work/phases/[NN]-[phase-name-kebab]/
223
223
  ```
224
224
 
225
225
  No files inside — the `/gsdd-plan` workflow populates them.
@@ -258,7 +258,7 @@ Update the `## Current State` section in SPEC.md:
258
258
  - [ ] Phase directories created
259
259
  </success_criteria>
260
260
 
261
- **MANDATORY: `.planning/SPEC.md` and `.planning/ROADMAP.md` must be updated on disk before this workflow is complete. If either write fails, STOP and report the failure. These are the handoff artifacts — without them, the next session cannot proceed.**
261
+ **MANDATORY: `.work/SPEC.md` and `.work/ROADMAP.md` must be updated on disk before this workflow is complete. If either write fails, STOP and report the failure. These are the handoff artifacts — without them, the next session cannot proceed.**
262
262
 
263
263
  <completion>
264
264
  Report to the user what was created, then present the next step:
@@ -269,7 +269,7 @@ Report to the user what was created, then present the next step:
269
269
  Created:
270
270
  - [N] new requirements in `SPEC.md` Must Have section
271
271
  - [M] new phases in `ROADMAP.md` (Phases [start]–[end])
272
- - Phase directories in `.planning/phases/`
272
+ - Phase directories in `.work/phases/`
273
273
 
274
274
  **Next step:** `/gsdd-plan [N]` — plan Phase [N]: [phase name]
275
275