gsdd-cli 0.3.1 → 0.18.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 (62) hide show
  1. package/README.md +131 -67
  2. package/agents/DISTILLATION.md +15 -13
  3. package/agents/README.md +1 -1
  4. package/agents/planner.md +2 -0
  5. package/bin/adapters/agents.mjs +1 -0
  6. package/bin/adapters/claude.mjs +20 -4
  7. package/bin/adapters/codex.mjs +9 -1
  8. package/bin/adapters/opencode.mjs +20 -5
  9. package/bin/gsdd.mjs +24 -7
  10. package/bin/lib/cli-utils.mjs +1 -1
  11. package/bin/lib/evidence-contract.mjs +112 -0
  12. package/bin/lib/file-ops.mjs +161 -0
  13. package/bin/lib/health-truth.mjs +186 -0
  14. package/bin/lib/health.mjs +72 -67
  15. package/bin/lib/init-flow.mjs +50 -3
  16. package/bin/lib/init-prompts.mjs +22 -83
  17. package/bin/lib/init-runtime.mjs +47 -25
  18. package/bin/lib/init.mjs +3 -3
  19. package/bin/lib/lifecycle-preflight.mjs +333 -0
  20. package/bin/lib/lifecycle-state.mjs +293 -0
  21. package/bin/lib/models.mjs +19 -4
  22. package/bin/lib/phase.mjs +159 -18
  23. package/bin/lib/plan-constants.mjs +30 -0
  24. package/bin/lib/provenance.mjs +165 -0
  25. package/bin/lib/rendering.mjs +8 -0
  26. package/bin/lib/runtime-freshness.mjs +239 -0
  27. package/bin/lib/session-fingerprint.mjs +106 -0
  28. package/bin/lib/templates.mjs +17 -0
  29. package/distilled/DESIGN.md +733 -49
  30. package/distilled/EVIDENCE-INDEX.md +402 -0
  31. package/distilled/README.md +73 -33
  32. package/distilled/SKILL.md +89 -85
  33. package/distilled/templates/agents.block.md +13 -84
  34. package/distilled/templates/agents.md +0 -7
  35. package/distilled/templates/delegates/plan-checker.md +6 -3
  36. package/distilled/workflows/audit-milestone.md +56 -6
  37. package/distilled/workflows/complete-milestone.md +333 -0
  38. package/distilled/workflows/execute.md +201 -19
  39. package/distilled/workflows/map-codebase.md +17 -4
  40. package/distilled/workflows/new-milestone.md +262 -0
  41. package/distilled/workflows/new-project.md +7 -6
  42. package/distilled/workflows/pause.md +40 -6
  43. package/distilled/workflows/plan-milestone-gaps.md +183 -0
  44. package/distilled/workflows/plan.md +77 -11
  45. package/distilled/workflows/progress.md +107 -29
  46. package/distilled/workflows/quick.md +23 -12
  47. package/distilled/workflows/resume.md +135 -12
  48. package/distilled/workflows/verify-work.md +260 -0
  49. package/distilled/workflows/verify.md +159 -33
  50. package/docs/BROWNFIELD-PROOF.md +95 -0
  51. package/docs/RUNTIME-SUPPORT.md +77 -0
  52. package/docs/USER-GUIDE.md +439 -0
  53. package/docs/VERIFICATION-DISCIPLINE.md +59 -0
  54. package/docs/claude/context-monitor.md +98 -0
  55. package/docs/proof/consumer-node-cli/README.md +37 -0
  56. package/docs/proof/consumer-node-cli/ROADMAP.md +14 -0
  57. package/docs/proof/consumer-node-cli/SPEC.md +17 -0
  58. package/docs/proof/consumer-node-cli/brief.md +9 -0
  59. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md +34 -0
  60. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-SUMMARY.md +10 -0
  61. package/docs/proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md +30 -0
  62. package/package.json +38 -29
@@ -13,17 +13,42 @@ Before starting, read these files:
13
13
  4. `.planning/phases/*-APPROACH.md` - approach decisions from user discussion (if exists)
14
14
  5. `.planning/phases/*-PLAN.md` - any previous plans that affect this phase
15
15
  6. Relevant source code - if this phase builds on existing code, read the key files
16
-
16
+ 7. `.planning/phases/*-SUMMARY.md` for the prior completed phase - if a `<judgment>` section is present, read all four sub-sections. The `<judgment>` carries forward active constraints, unresolved uncertainty, decision posture, and anti-regression rules from the prior phase. Honor these as input context alongside SPEC.md decisions and APPROACH.md choices.
17
+ 8. **Session-boundary fallback:** If no prior completed phase SUMMARY.md with a `<judgment>` section was found in step 7, check whether `.planning/.continue-here.bak` exists. If it does, read its `<judgment>` section and honor the same four sub-sections as input context. After reading, run `gsdd file-op delete .planning/.continue-here.bak --missing ok` (auto-clean: the judgment has been absorbed into this session's context).
17
18
  Identify the target phase: the first phase with status `[ ]` or `[-]` in `ROADMAP.md`.
18
19
  </load_context>
19
20
 
21
+ <integration_surface_check>
22
+ Before planning roadmap work, inspect the live integration surface separately from checkpoint or planning artifacts:
23
+ - current branch name
24
+ - divergence from `main` when available
25
+ - staged, unstaged, and untracked local truth
26
+ - whether the current branch appears stale/spent or mixed-scope
27
+
28
+ If the planning truth says "next phase is X" but the git/worktree truth says the current branch is a stale or mixed execution surface, warn explicitly and treat the dirty branch as evidence only. Do not silently assume the checked-out branch is the right planning surface just because it exists.
29
+ </integration_surface_check>
30
+
31
+ <runtime_contract>
32
+ Use the `Runtime` and `Assurance` types from `.planning/SPEC.md`.
33
+ Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
34
+ Assurance is ordered: `unreviewed` -> `self_checked` -> `cross_runtime_checked`.
35
+ Same-runtime helpers never count as cross-runtime evidence.
36
+ </runtime_contract>
37
+
38
+ <assurance_check>
39
+ After `<load_context>`, compare the current planning pass against the strongest upstream artifact available: same-phase prior plan first, otherwise prior completed phase SUMMARY or VERIFICATION.
40
+ Use `unreviewed` before any checker result, `self_checked` for planner self-check or same-runtime checker, and `cross_runtime_checked` only for a different runtime/vendor checker.
41
+ If current assurance is lower, write a structured `<assurance_check>` near the top of the plan body with `source_artifact`, `source_runtime`, `source_assurance`, `current_runtime`, `current_assurance`, `status`, and `warning`.
42
+ If upstream runtime/assurance is missing, use `status: unknown`.
43
+ </assurance_check>
44
+
20
45
  <context_fidelity>
21
46
  Before planning, acknowledge what is locked:
22
-
23
47
  - Decisions in `.planning/SPEC.md` "Key Decisions" - do not revisit them.
24
48
  - Decisions in APPROACH.md "Implementation Decisions" - these are user-validated choices. Implement the chosen approaches, not alternatives. "Agent's Discretion" items give you flexibility.
25
49
  - Patterns from previous phases - match existing conventions. Do not introduce new patterns without cause.
26
50
  - Deferred items - items marked v2, nice-to-have, or out of scope in SPEC.md or APPROACH.md. Do not plan for them.
51
+ - Cross-check: if SPEC.md and APPROACH.md disagree on whether an item is must-have or deferred, stop and ask the user before planning. Do not silently adopt one classification over the other.
27
52
 
28
53
  If you need to challenge a locked decision: stop, ask the developer, and document the new decision explicitly.
29
54
  </context_fidelity>
@@ -58,9 +83,30 @@ Write to `.planning/research/{phase_number}-RESEARCH.md` with sections:
58
83
  - Research for this phase already exists and is still fresh
59
84
  - The phase uses only technologies already established in previous phases
60
85
 
61
- Quality gate: do not proceed to goal-backward planning if you have unresolved uncertainties about the implementation approach.
86
+ Quality gate: do not proceed to goal-backward planning if you have unresolved uncertainties about the implementation approach. If research was skipped (skip conditions above apply), document the skip reason in the plan Notes section so the plan checker can verify the skip was justified.
62
87
  </research_check>
63
88
 
89
+ <spec_quality_check>
90
+ ### When This Runs
91
+ After research_check, before goal_backward_planning.
92
+
93
+ ### Classify Each Phase Requirement and Success Criterion
94
+ For each requirement and success criterion in this phase, assign one of:
95
+ - **Resolved**: the behavior is testable, the Done-When is unambiguous, and the decision is locked (codebase fact or explicit SPEC.md/APPROACH.md decision). Proceed.
96
+ - **Open**: the requirement depends on a product or UX decision that has not been made. Cannot proceed.
97
+ - **Ambiguous**: there are two or more reasonable interpretations of what "done" means. Cannot proceed.
98
+
99
+ Trigger questions per item:
100
+ - Is the Done-When criterion specific enough to write a verify command for?
101
+ - Does this require a product or UX decision that is absent from SPEC.md, APPROACH.md, or ROADMAP.md?
102
+ - Would two different developers reasonably implement this differently based only on the requirement text?
103
+
104
+ ### Quality Gate
105
+ - If all items are **Resolved**: proceed to goal_backward_planning.
106
+ - If any item is **Open** or **Ambiguous**: STOP. Report each item with the specific question that would resolve it. Do not produce an execution-ready plan until the user resolves these items.
107
+ - Exception — **minor technical ambiguity** (e.g., exact error message wording, logging format) that does not change user-facing behavior: note it as a warning in the plan Notes section and proceed. Do not use this exception for behavioral or acceptance-criteria ambiguity.
108
+ </spec_quality_check>
109
+
64
110
  <goal_backward_planning>
65
111
  Plan backward from success criteria.
66
112
 
@@ -96,6 +142,8 @@ phase: 01-foundation
96
142
  plan: 01
97
143
  type: execute
98
144
  wave: 1
145
+ runtime: claude-code
146
+ assurance: self_checked
99
147
  depends_on: []
100
148
  files-modified:
101
149
  - src/lib/auth.ts
@@ -196,6 +244,8 @@ phase: 01-foundation
196
244
  plan: 01
197
245
  type: execute
198
246
  wave: 1
247
+ runtime: claude-code
248
+ assurance: self_checked
199
249
  depends_on: []
200
250
  files-modified:
201
251
  - src/routes/users.ts
@@ -231,6 +281,16 @@ must_haves:
231
281
  1. [Observable truth from ROADMAP.md]
232
282
  2. [Observable truth from ROADMAP.md]
233
283
 
284
+ <checks>
285
+ <plan_check>
286
+ checker: self | cross_runtime
287
+ checker_runtime: claude-code
288
+ status: passed | issues_found | skipped
289
+ blocking: false
290
+ notes: [What the checker actually validated or why it was skipped]
291
+ </plan_check>
292
+ </checks>
293
+
234
294
  ## Tasks
235
295
 
236
296
  <task id="01-01" type="auto">
@@ -250,6 +310,8 @@ must_haves:
250
310
  ## Notes
251
311
  [Gotchas, implementation notes, or explicit assumptions]
252
312
  ```
313
+
314
+ **MANDATORY: You MUST write PLAN.md to disk at `.planning/phases/{phase_dir}/{plan_id}-PLAN.md`. Output to conversation alone is NOT sufficient. If this file is not written to disk, planning is NOT complete.**
253
315
  </plan_structure>
254
316
 
255
317
  <approach_exploration>
@@ -342,9 +404,7 @@ After the planner produces a draft plan, an independent checker reviews it in fr
342
404
  7. `context_compliance` - locked decisions are honored and deferred ideas stay out of scope
343
405
  8. `goal_achievement` - the plan, if executed perfectly, actually achieves the stated phase goal: goal addressed (tasks deliver the goal), success criteria reachable (each criterion traceable to a task verify output), and outcome observable (a human or automated check can confirm the goal was met)
344
406
  9. `approach_alignment` - when APPROACH.md exists, plans implement the chosen approaches, not alternatives. Blocker if plan contradicts an explicit user choice. Warning if plan drifts from recommendation without justification. Skipped when no APPROACH.md is provided.
345
-
346
407
  ### Invoking the Checker
347
-
348
408
  1. If `.planning/config.json` has `workflow.planCheck: false`, skip the independent checker. Perform the planner self-check below and report `reduced_assurance`.
349
409
  2. If plan checking is enabled, check if your runtime provides a `gsdd-plan-checker` agent.
350
410
  3. If a native checker agent is available, invoke it in a fresh context with only these explicit inputs:
@@ -375,9 +435,12 @@ After the planner produces a draft plan, an independent checker reviews it in fr
375
435
  6. If the checker returns `issues_found`, revise the existing plan files only where needed, then invoke the checker again.
376
436
  7. Maximum 3 checker cycles total. If blockers remain after cycle 3, stop and escalate to the user instead of pretending the plan is ready.
377
437
  8. If no native checker agent is available in your runtime, perform the planner self-check below and explicitly report `reduced_assurance` rather than claiming an independent checker ran.
378
-
438
+ When the checker outcome is finalized, write the result into the plan artifact:
439
+ - checker ran in same runtime or planner self-check only -> set frontmatter `assurance: self_checked`
440
+ - checker ran in a different runtime/vendor and passed -> set frontmatter `assurance: cross_runtime_checked`
441
+ - draft exists before any checker result is recorded -> keep `assurance: unreviewed`
442
+ - record the structured outcome in the plan's `<checks>` block; do not leave the checker result only in chat context
379
443
  ### Orchestration Summary
380
-
381
444
  After plan checking completes, report:
382
445
  - target phase
383
446
  - whether independent plan checking ran
@@ -401,7 +464,6 @@ For every success criterion from `ROADMAP.md`:
401
464
  - [ ] At least one task produces an artifact that satisfies it
402
465
  - [ ] The task's `<verify>` section checks it specifically
403
466
  - [ ] The criterion is covered explicitly, not only implied
404
-
405
467
  ### Check Task Completeness
406
468
  For each task:
407
469
  - [ ] The `<files>` section lists every file to create or modify
@@ -430,6 +492,8 @@ Planning is done when all of these are true:
430
492
  - [ ] Success criteria from `ROADMAP.md` are represented as must-haves
431
493
  - [ ] Goal-backward derivation from criteria to artifacts to key links to tasks is explicit
432
494
  - [ ] Every plan has frontmatter with `phase`, `plan`, `type`, `wave`, `depends_on`, `files-modified`, `autonomous`, `requirements`, and `must_haves`
495
+ - [ ] Every plan frontmatter records `runtime` and `assurance`
496
+ - [ ] Every plan records checker outcome in a structured `<checks>` block
433
497
  - [ ] Every task has XML structure with `id`, `type`, `files`, `action`, `verify`, and `done`
434
498
  - [ ] Every task has at least one runnable verify command
435
499
  - [ ] Plan sizing stays within 2-5 tasks, preferring 2-3
@@ -442,12 +506,14 @@ Report to the user what was accomplished, then present the next step:
442
506
 
443
507
  ---
444
508
  **Completed:** Phase planning — created `.planning/phases/{phase_dir}/{plan_id}-PLAN.md`.
509
+ **Planning stops here:** `gsdd-plan` ends after the plan artifact is written. Do not start implementation in this same run, and do not treat imperative handoff text as execution authorization.
510
+ Installed generated runtime surfaces are trusted through rendering, not reviewer memory: `gsdd health` compares any local generated skill/adapter surfaces against current render output, and `gsdd update` regenerates them when they drift.
445
511
 
446
- **Next step:** `/gsdd:execute` — execute the plan
512
+ **Next workflow:** `/gsdd-execute` — start execution in a separate run when the user explicitly wants implementation to begin
447
513
 
448
514
  Also available:
449
- - `/gsdd:plan` — create additional plans for the same phase (if multi-wave)
450
- - `/gsdd:progress` — check overall project status
515
+ - `/gsdd-plan` — create additional plans for the same phase (if multi-wave)
516
+ - `/gsdd-progress` — check overall project status
451
517
 
452
518
  Consider clearing context before starting the next workflow for best results.
453
519
  ---
@@ -12,25 +12,44 @@ Scope boundary: you are NOT resume.md. You do not wait for user input, clean up
12
12
  This is a read-only workflow. No files are created, modified, or deleted. If `.planning/` does not exist, tell the user to run `gsdd init` and stop.
13
13
  </prerequisites>
14
14
 
15
+ <lifecycle_boundary>
16
+ `progress` stays read-only.
17
+
18
+ - Derive lifecycle posture from repo truth only; do not mutate phase or milestone state from this workflow.
19
+ - Do not call `gsdd phase-status` here.
20
+ - If you recommend a next step that crosses a lifecycle boundary, the downstream mutating workflow must rerun its own `gsdd lifecycle-preflight ...` gate before acting.
21
+ </lifecycle_boundary>
22
+
15
23
  <process>
16
24
 
17
25
  <check_existence>
18
26
  Check for project artifacts in order:
19
27
 
20
28
  1. **No `.planning/` directory** — tell the user to run `gsdd init`. Stop.
21
- 2. **No `.planning/ROADMAP.md` AND no `.planning/SPEC.md`** — project has no artifacts. Suggest running the `/gsdd:new-project` workflow. Stop.
29
+ 2. **No `.planning/ROADMAP.md` AND no `.planning/SPEC.md`** — check for non-phase brownfield artifacts:
30
+ - if `.planning/codebase/` has substantive map documents, or `.planning/quick/` has LOG/task artifacts, treat this as a non-phase brownfield state. Go to Branch F.
31
+ - otherwise the project has no artifacts. Suggest running the `/gsdd-new-project` workflow. Stop.
22
32
  3. **No `.planning/ROADMAP.md` BUT `.planning/SPEC.md` exists** — this is a between-milestones state (milestone was completed and archived). Go to Branch F.
23
- 4. **Both exist** — proceed to derive status.
33
+ 4. **Both exist** — proceed to derive status, including whether a retained `ROADMAP.md` already represents an archived milestone rather than an audit-ready one.
24
34
  </check_existence>
25
35
 
26
36
  <derive_status>
27
37
  Read the following and extract state:
28
38
 
29
39
  **Project identity:**
30
- Read `.planning/SPEC.md`. Extract the project name from the first heading.
40
+ - If `.planning/SPEC.md` exists, read it and extract the project name from the first heading.
41
+ - If `.planning/SPEC.md` does not exist, derive the project name from the repo root directory name.
42
+
43
+ **Non-phase brownfield state:**
44
+ If `.planning/ROADMAP.md` does not exist, determine whether the repo is currently in one of these Branch F states:
45
+ - `between_milestones` — `.planning/SPEC.md` exists
46
+ - `codebase_only` — `.planning/codebase/` has substantive map documents but `.planning/SPEC.md` does not exist
47
+ - `quick_lane` — `.planning/quick/LOG.md` or quick task directories exist but `.planning/SPEC.md` and `.planning/ROADMAP.md` do not
48
+
49
+ For `codebase_only` and `quick_lane`, there is no active phase count. Record the non-phase state instead of trying to infer current milestone progress.
31
50
 
32
51
  **Phase statuses:**
33
- Read `.planning/ROADMAP.md`. Parse phase statuses:
52
+ If `.planning/ROADMAP.md` exists, read it and parse phase statuses:
34
53
  - `[ ]` = not started
35
54
  - `[-]` = in progress
36
55
  - `[x]` = done
@@ -41,16 +60,35 @@ Determine:
41
60
  - Current phase: first `[-]` phase, or first `[ ]` if none in progress
42
61
  - Current phase name
43
62
 
63
+ **Archived milestone evidence:**
64
+ If `ROADMAP.md` exists and all phases in the current milestone are `[x]`, determine whether this is still audit-ready or already archived-with-`ROADMAP.md`:
65
+ - derive the current milestone/version from the active milestone heading in `ROADMAP.md`
66
+ - check `.planning/MILESTONES.md` for a shipped entry matching that same milestone/version
67
+ - check for the matching archived milestone audit artifact for that same milestone/version (for example `.planning/v1.1-MILESTONE-AUDIT.md`)
68
+ - if both the shipped ledger entry and the matching archived audit artifact exist, treat the retained `ROADMAP.md` as archived milestone evidence and route to Branch F instead of Branch E
69
+ - if either one is missing, keep the milestone in the audit-ready Branch E state
70
+
44
71
  **Checkpoint:**
45
72
  Check if `.planning/.continue-here.md` exists. If yes, note the `workflow` and `phase` frontmatter and the `next_action` section.
73
+ - Treat checkpoint routing classes explicitly:
74
+ - `phase` and `quick` checkpoints remain blocking resume-owned surfaces for routing.
75
+ - `generic` checkpoints are informational-only for this read-only reporter: show the checkpoint and its `next_action`, but keep evaluating the real lifecycle recommendation instead of routing Branch A back through `/gsdd-resume`.
46
76
 
47
77
  **Incomplete work:**
48
- Scan `.planning/phases/` for:
78
+ If `.planning/phases/` exists, scan it for:
49
79
  - PLAN files without a matching SUMMARY file (incomplete execution)
50
80
  - SUMMARY files without a matching VERIFICATION file (unverified, only relevant if `workflow.verifier` is enabled in `.planning/config.json`; if config.json cannot be read, assume verifier is disabled)
51
81
 
52
82
  **Quick task log:**
53
83
  If `.planning/quick/LOG.md` exists, check the last entry for a non-terminal status.
84
+
85
+ <unmerged_commits_check>
86
+ Run `git log main..HEAD --oneline` to detect commits on the current branch that have not been merged to `main`.
87
+
88
+ - If the command exits non-zero or `main` does not exist, skip silently — do not surface an error or any output.
89
+ - If the output is empty, record nothing — the silent path; no status line is added.
90
+ - If the output is non-empty, record the commit lines and count them. This will be surfaced in the status block.
91
+ </unmerged_commits_check>
54
92
  </derive_status>
55
93
 
56
94
  <recent_work>
@@ -73,12 +111,16 @@ Project: [name from SPEC.md]
73
111
  Phase: [current] of [total] — [phase name]
74
112
  Completed: [N] phases done
75
113
 
114
+ [If no active roadmap and Branch F is handling a non-phase state:]
115
+ State: [between milestones | codebase map only | quick lane only]
116
+ Completed: no active roadmap
117
+
76
118
  Recent Work:
77
119
  - Phase [X]: [one-liner from SUMMARY.md]
78
120
  - Phase [Y]: [one-liner from SUMMARY.md]
79
121
 
80
122
  [If .continue-here.md exists:]
81
- Checkpoint: paused work found — run /gsdd:resume to restore context
123
+ Checkpoint: paused work found — `phase`/`quick` checkpoints still route through /gsdd-resume; `generic` checkpoints stay visible as informational context only
82
124
 
83
125
  [If PLAN without SUMMARY found:]
84
126
  Incomplete execution: Phase [N] has PLAN but no SUMMARY
@@ -89,8 +131,16 @@ Unverified: Phase [N] has SUMMARY but no VERIFICATION
89
131
  [If incomplete quick task found:]
90
132
  Incomplete quick task: [description]
91
133
 
92
- [If all phases [x]:]
134
+ [If unmerged commits found (git log main..HEAD --oneline returned output):]
135
+ Unmerged commits: [N] commit(s) on this branch not yet merged to main
136
+ → Merge or push this branch before closing the milestone, or verify
137
+ these commits are intentional working-branch state.
138
+
139
+ [If all phases [x] and the current milestone is not yet archived:]
93
140
  All phases complete — ready for milestone audit
141
+
142
+ [If all phases [x] and the current milestone is already archived-with-`ROADMAP.md`: ]
143
+ All phases complete — archived milestone retained on disk; ready for the next milestone
94
144
  ```
95
145
 
96
146
  **Filled-in example** (fabricated but realistic):
@@ -107,8 +157,8 @@ Recent Work:
107
157
  Incomplete execution: Phase 3 has PLAN but no SUMMARY
108
158
 
109
159
  Suggested next action:
110
- Run /gsdd:execute to continue Phase 3 execution
111
- Also available: /gsdd:plan (re-plan), /gsdd:progress (refresh status)
160
+ Run /gsdd-execute to continue Phase 3 execution
161
+ Also available: /gsdd-plan (re-plan), /gsdd-progress (refresh status)
112
162
  ```
113
163
 
114
164
  No ASCII art, no progress bars. Keep it scannable.
@@ -118,21 +168,23 @@ No ASCII art, no progress bars. Keep it scannable.
118
168
  Evaluate in priority order. Present the single best next step as a suggestion with a formatted output block. Do not wait for user selection, do not present numbered menus, do not clean up files. This is purely informational.
119
169
 
120
170
  **Branch A: Resume checkpoint**
121
- Condition: `.continue-here.md` exists.
171
+ Condition: `.continue-here.md` exists and its `workflow` is `phase` or `quick`.
122
172
 
123
173
  ```
124
174
  Suggested next action:
125
- Run /gsdd:resume to restore paused session context
126
- Also available: /gsdd:execute (ignore checkpoint, continue current phase), /gsdd:progress (refresh)
175
+ Run /gsdd-resume to restore paused session context
176
+ Also available: /gsdd-execute (ignore checkpoint, continue current phase), /gsdd-progress (refresh)
127
177
  ```
128
178
 
179
+ If `.continue-here.md` exists and its `workflow` is `generic`, do **not** route back through Branch A from this read-only reporter. Show the checkpoint in the status block, surface its `next_action`, and keep evaluating Branch B-F so the primary recommendation can advance toward the real next phase, verification, or milestone-close action.
180
+
129
181
  **Branch B: Execute (PLAN without SUMMARY in current phase)**
130
182
  Condition: Current phase has a PLAN file but no matching SUMMARY.
131
183
 
132
184
  ```
133
185
  Suggested next action:
134
- Run /gsdd:execute to continue Phase [N] execution
135
- Also available: /gsdd:plan (re-plan current phase), /gsdd:verify (if prior phase needs verification)
186
+ Run /gsdd-execute to continue Phase [N] execution
187
+ Also available: /gsdd-plan (re-plan current phase), /gsdd-verify (if prior phase needs verification)
136
188
  ```
137
189
 
138
190
  **Branch C: Plan (no PLAN for current phase)**
@@ -140,8 +192,8 @@ Condition: Current phase has no PLAN files.
140
192
 
141
193
  ```
142
194
  Suggested next action:
143
- Run /gsdd:plan to create a plan for Phase [N]: [phase name]
144
- Also available: /gsdd:quick (sub-hour task outside phases), /gsdd:map-codebase (refresh codebase maps)
195
+ Run /gsdd-plan to create a plan for Phase [N]: [phase name]
196
+ Also available: /gsdd-quick (sub-hour task outside phases), /gsdd-map-codebase (refresh codebase maps)
145
197
  ```
146
198
 
147
199
  **Branch D: Verify (SUMMARY without VERIFICATION)**
@@ -149,26 +201,50 @@ Condition: Current phase has SUMMARY but no VERIFICATION file (verifier enabled)
149
201
 
150
202
  ```
151
203
  Suggested next action:
152
- Run /gsdd:verify to validate Phase [N]
153
- Also available: /gsdd:execute (continue to next phase), /gsdd:plan (plan next phase)
204
+ Run /gsdd-verify to validate Phase [N]
205
+ Also available: /gsdd-execute (continue to next phase), /gsdd-plan (plan next phase)
154
206
  ```
155
207
 
156
- **Branch E: Audit milestone (all phases [x])**
157
- Condition: All phases in ROADMAP.md are marked `[x]`.
208
+ **Branch E: Audit milestone (all phases [x], not yet archived)**
209
+ Condition: All phases in the current milestone are marked `[x]`, and the current roadmap milestone/version does **not** yet have both a shipped entry in `.planning/MILESTONES.md` and the matching archived milestone audit artifact.
158
210
 
159
211
  ```
160
212
  Suggested next action:
161
- Run /gsdd:audit-milestone to audit the completed milestone
162
- Also available: /gsdd:verify (re-verify a specific phase), /gsdd:quick (sub-hour task)
213
+ Run /gsdd-audit-milestone to audit the completed milestone
214
+ Also available: /gsdd-verify (re-verify a specific phase), /gsdd-quick (sub-hour task)
163
215
  ```
164
216
 
165
- **Branch F: Between milestones (SPEC.md exists, ROADMAP.md absent)**
166
- Condition: `.planning/SPEC.md` exists but `.planning/ROADMAP.md` does not — a milestone was completed and archived.
217
+ **Branch F: Non-phase state (no active roadmap, or retained roadmap already archived)**
218
+ Condition:
219
+ - `.planning/SPEC.md` exists but `.planning/ROADMAP.md` does not, **or**
220
+ - `.planning/codebase/` or `.planning/quick/` exists while both `.planning/SPEC.md` and `.planning/ROADMAP.md` are absent, **or**
221
+ - `.planning/ROADMAP.md` still exists, but the current roadmap milestone/version already has both a shipped entry in `.planning/MILESTONES.md` and the matching archived milestone audit artifact — this is the archived-with-`ROADMAP.md` state, not a second trip through audit
222
+
223
+ Check `.planning/MILESTONES.md`:
224
+ - If MILESTONES.md exists and has at least one milestone entry → this is a subsequent milestone
225
+ - If MILESTONES.md does not exist or is empty → this is the first milestone setup
167
226
 
168
227
  ```
169
- Suggested next action:
170
- Run /gsdd:new-project to start the next milestone cycle (create a new ROADMAP.md)
171
- Also available: /gsdd:progress (refresh after milestone setup)
228
+ Suggested next action (subsequent milestone):
229
+ Run /gsdd-new-milestone to start the next milestone cycle (gather goals, define requirements, create ROADMAP.md)
230
+ Also available: /gsdd-progress (refresh after milestone setup)
231
+
232
+ Suggested next action (incomplete milestone state — SPEC.md exists but no milestone archived yet):
233
+ Inspect .planning/ manually — a milestone is likely still in progress.
234
+ If a ROADMAP.md was deleted prematurely, re-run /gsdd-new-milestone to restore it.
235
+ Do NOT run /gsdd-new-project — SPEC.md already exists and re-running would overwrite it.
236
+
237
+ Suggested next action (codebase-only brownfield state):
238
+ Run /gsdd-quick if the bounded change is already concrete.
239
+ Also available: /gsdd-new-project (define broader lifecycle work), /gsdd-map-codebase (refresh or deepen the baseline)
240
+
241
+ Suggested next action (quick-lane brownfield state with incomplete quick work):
242
+ Run /gsdd-quick to continue or finish the current bounded change.
243
+ Also available: /gsdd-new-project (switch to full lifecycle setup), /gsdd-progress (refresh after the quick task is updated)
244
+
245
+ Suggested next action (quick-lane brownfield state with no incomplete quick work):
246
+ Run /gsdd-quick for the next bounded change.
247
+ Also available: /gsdd-new-project (if you now need SPEC.md + ROADMAP.md), /gsdd-map-codebase (if the repo baseline feels stale)
172
248
  ```
173
249
 
174
250
  If none of the above conditions match, report that the project is in a clean state with no obvious next action.
@@ -178,7 +254,8 @@ If none of the above conditions match, report that the project is in a clean sta
178
254
  Handle compound states:
179
255
 
180
256
  - **Checkpoint + unexecuted plan:** Both `.continue-here.md` exists and a PLAN lacks a SUMMARY. Prioritize checkpoint (Branch A) but mention the unexecuted plan in the status block.
181
- - **All phases complete + checkpoint:** All phases `[x]` but a checkpoint exists. Mention both suggest clearing the stale checkpoint via `/gsdd:resume`, then routing to milestone audit.
257
+ - **Generic checkpoint + current phase work:** A `workflow: generic` checkpoint may coexist with an incomplete plan, unverified phase, or completed milestone. Keep the checkpoint visible in the status block, but let Branch B-F supply the primary recommendation instead of bouncing back to `/gsdd-resume`.
258
+ - **All phases complete + checkpoint:** All phases `[x]` but a checkpoint exists. If the checkpoint is `phase` or `quick`, mention both and suggest `/gsdd-resume` before continuing. If the checkpoint is `generic`, keep it visible as informational context and still route the primary recommendation to milestone audit.
182
259
  - **Phase done but next unplanned:** Current phase has both PLAN and SUMMARY, but the next phase has no PLAN. Show the current phase as complete and suggest planning the next phase (Branch C targeting the next phase).
183
260
  - **No matching condition:** If the project state does not match any branch, report it clearly and suggest the user inspect `.planning/` manually.
184
261
  </edge_cases>
@@ -193,7 +270,8 @@ Handle compound states:
193
270
  - [ ] Routing suggestion is specific (includes phase number and branch-specific output block)
194
271
  - [ ] Named branch output format used with "Also available" alternatives
195
272
  - [ ] No files created, modified, or deleted (read-only workflow)
196
- - [ ] All workflow references use portable `/gsdd:*` command format
273
+ - [ ] All workflow references use portable `/gsdd-*` command format
197
274
  - [ ] No interactive menus, no numbered option lists, no waiting for user selection
198
275
  - [ ] Edge cases handled for compound states
276
+ - [ ] Unmerged-commit warning only appears when `git log main..HEAD --oneline` returns output; silent when empty
199
277
  </success_criteria>
@@ -8,7 +8,7 @@ They reuse the same planner, executor, and verifier roles but skip research and
8
8
  <anti_patterns>
9
9
  - Do not execute before the user sees the plan preview (Step 3.7 must complete before Step 4)
10
10
  - Do not proceed past file verification gates if the expected file does not exist on disk — a plan that exists only in conversation context will be lost on compaction
11
- - Do not ask more than 2 approach clarification questions — if 3+ grey areas exist, recommend /gsdd:plan instead
11
+ - Do not ask more than 2 approach clarification questions — if the bounded change is still undefined, recommend `/gsdd-new-project`; if the change is defined but 3+ grey areas remain, recommend `/gsdd-plan` instead
12
12
  - Do not create APPROACH.md for quick tasks — use inline $APPROACH_CONTEXT only
13
13
  - Do not update ROADMAP.md or SPEC.md from quick tasks — these are phase-level artifacts
14
14
  - Do not skip config.json reads — workflow toggles (discuss, planCheck, verifier) control flow
@@ -37,6 +37,10 @@ Store the response as `$DESCRIPTION`. If empty, re-prompt.
37
37
  2. Scan `.planning/quick/` for existing task directories. Calculate `$NEXT_NUM` as the next 3-digit number (001, 002, ...).
38
38
  3. Generate `$SLUG` from `$DESCRIPTION` (lowercase, hyphens, max 40 chars).
39
39
  4. Create `.planning/quick/$NEXT_NUM-$SLUG/`.
40
+ 5. If `.planning/codebase/` exists, read whichever of `.planning/codebase/ARCHITECTURE.md`, `.planning/codebase/STACK.md`, `.planning/codebase/CONVENTIONS.md`, and `.planning/codebase/CONCERNS.md` are present. Summarize key findings from available docs in <=500 words as `$CODEBASE_CONTEXT`, emphasizing: safest surfaces to touch, risky zones to avoid, must-know conventions/traps, and what must be re-verified after change. Note any missing docs in the summary.
41
+ 6. If `.planning/codebase/` does not exist, build a just-enough inline brownfield baseline instead of stopping. Read the repo root guidance that is cheap and stable (`README.md`, root manifest such as `package.json` / `pyproject.toml` / `Cargo.toml` when present, top-level app entrypoints, and any obviously relevant config or module files surfaced by `$DESCRIPTION`). Summarize the findings in <=500 words as `$CODEBASE_CONTEXT`, explicitly labeling it as a provisional baseline and calling out unknowns. Emphasize: likely implementation surface, likely dependency boundaries, conventions already visible, risky areas to avoid touching blindly, and what must be re-verified after the change. If the repo is still too unclear after this pass, keep that uncertainty explicit so Step 3.6 can recommend `/gsdd-map-codebase`.
42
+ 7. **Session-boundary fallback:** If `.planning/.continue-here.bak` exists, read its `<judgment>` section. Use `<active_constraints>` and `<anti_regression>` rules as task-scoping context (do not violate active constraints; do not regress on listed invariants). After reading, run `gsdd file-op delete .planning/.continue-here.bak --missing ok` (auto-clean).
43
+ 8. Inspect the live branch/worktree surface separately from checkpoint or planning artifacts. If the current branch appears stale/spent, PR-less with overlapping write scope, or otherwise like the wrong execution surface, warn before proceeding. This is advisory for quick tasks unless the mismatch makes the task description materially misleading.
40
44
 
41
45
  If `.planning/quick/` does not exist, create it along with an empty `LOG.md`:
42
46
 
@@ -76,7 +80,7 @@ For each grey area, present 2-3 concrete options with a recommended default:
76
80
 
77
81
  - If user says "go ahead" / "your call" / presses Enter → use the recommendation.
78
82
  - If user specifies a preference → record it.
79
- - Maximum 2 questions. If the task has 3+ grey areas, it's not a quick task.
83
+ - Maximum 2 questions. If the bounded change is still undefined after clarification, recommend `/gsdd-new-project`. If the change is defined but the task still has 3+ grey areas, it's not a quick task — recommend `/gsdd-plan`.
80
84
 
81
85
  ### Output
82
86
 
@@ -98,6 +102,7 @@ Delegate to the planner role in quick mode.
98
102
  **Context to provide:**
99
103
  - Task description: `$DESCRIPTION`
100
104
  - Approach context: `$APPROACH_CONTEXT` (user-confirmed decisions from Step 2.5 — treat as locked constraints, do not revisit)
105
+ - Codebase context: `$CODEBASE_CONTEXT` (existing brownfield codebase summary from codebase maps when they exist, otherwise the inline brownfield baseline from Step 2 — use for orientation and risk awareness, not as hard constraints)
101
106
  - Mode: quick (single plan, 1-3 tasks, no research phase)
102
107
  - Output path: `.planning/quick/$NEXT_NUM-$SLUG/$NEXT_NUM-PLAN.md`
103
108
 
@@ -171,11 +176,13 @@ Evaluate the plan against quick-scope boundaries. Read the plan file and check:
171
176
 
172
177
  | Signal | Threshold | `$SCOPE_WARNING` text |
173
178
  |--------|-----------|----------------------|
174
- | Files modified | >8 distinct files in plan | "This task touches {N} files — consider `/gsdd:plan` for full ceremony." |
175
- | Architecture keywords in `$DESCRIPTION` | contains: `refactor`, `migration`, `security`, `auth`, `API design`, `schema`, `database` | "This looks like architectural work — consider `/gsdd:plan` for approach exploration." |
176
- | New public APIs | Plan tasks create new route files, API endpoints, or exported interfaces | "New public surface area detected — consider `/gsdd:plan` for approach exploration." |
179
+ | Files modified | >8 distinct files in plan | "This task touches {N} files — consider `/gsdd-plan` for full ceremony." |
180
+ | Architecture keywords in `$DESCRIPTION` | contains: `refactor`, `migration`, `security`, `auth`, `API design`, `schema`, `database` | "This looks like architectural work — consider `/gsdd-plan` for approach exploration." |
181
+ | New public APIs | Plan tasks create new route files, API endpoints, or exported interfaces | "New public surface area detected — consider `/gsdd-plan` for approach exploration." |
182
+ | Orientation gap | No `.planning/codebase/` exists AND the inline brownfield baseline still cannot name a clear implementation surface, dependency boundary, or safe-to-touch module | "This repo still needs deeper orientation — consider `/gsdd-map-codebase` before changing code." |
183
+ | Undefined bounded change | `$DESCRIPTION` still does not identify a concrete bug, feature, target surface, or observable outcome after clarification | "This does not yet describe a bounded change — use `/gsdd-new-project` to define the work first." |
177
184
 
178
- If any signal fires, set `$SCOPE_WARNING` to the first matching advisory text. Multiple signals concatenate.
185
+ If any signals fire, concatenate the matching advisory text in the listed order as `$SCOPE_WARNING`. If the undefined bounded change signal fires, keep that advisory first so the routing recommendation stays explicit.
179
186
  If no signals fire, `$SCOPE_WARNING` is empty.
180
187
 
181
188
  This is advisory only — it does NOT block execution.
@@ -212,12 +219,16 @@ Plan check issues: {$CHECKER_ISSUES}
212
219
 
213
220
  Present options (default-yes — pressing Enter proceeds):
214
221
  - If `$SCOPE_WARNING` is empty: `[Enter to proceed / edit description / abort]`
215
- - If `$SCOPE_WARNING` is non-empty: `[Enter to proceed / switch to /gsdd:plan / edit description / abort]`
222
+ - If `$SCOPE_WARNING` contains `/gsdd-new-project`: `[Enter to proceed / switch to /gsdd-new-project / edit description / abort]`
223
+ - Otherwise if `$SCOPE_WARNING` contains `/gsdd-map-codebase`: `[Enter to proceed / switch to /gsdd-map-codebase / edit description / abort]`
224
+ - Otherwise if `$SCOPE_WARNING` is non-empty: `[Enter to proceed / switch to /gsdd-plan / edit description / abort]`
216
225
 
217
226
  Handle response:
218
227
  - **Enter (or "yes"):** proceed to Step 4.
219
228
  - **"edit description":** clean up the task directory, then return to Step 1 with `$DESCRIPTION` pre-filled as the starting point.
220
- - **"switch to /gsdd:plan":** clean up the task directory, then stop quick workflow and report: "Use `/gsdd:plan` for full ceremony with approach exploration. Task description: {$DESCRIPTION}"
229
+ - **"switch to /gsdd-new-project":** clean up the task directory, then stop quick workflow and report: "Use `/gsdd-new-project` to define the bounded work first. Task description: {$DESCRIPTION}"
230
+ - **"switch to /gsdd-map-codebase":** clean up the task directory, then stop quick workflow and report: "Use `/gsdd-map-codebase` for a deeper brownfield baseline before quick work. Task description: {$DESCRIPTION}"
231
+ - **"switch to /gsdd-plan":** clean up the task directory, then stop quick workflow and report: "Use `/gsdd-plan` for full ceremony with approach exploration. Task description: {$DESCRIPTION}"
221
232
  - **"abort":** clean up the task directory, report cancellation, stop.
222
233
 
223
234
  ---
@@ -334,12 +345,12 @@ Created:
334
345
  - `.planning/quick/{next_num}-{slug}/{next_num}-VERIFICATION.md` (if verifier enabled)
335
346
  - Updated `.planning/quick/LOG.md`
336
347
 
337
- **Next step:** `/gsdd:progress` — check project status and continue phase work
348
+ **Next step:** `/gsdd-progress` — check project status and continue phase work
338
349
 
339
350
  Also available:
340
- - `/gsdd:quick` — run another quick task
341
- - `/gsdd:plan` — plan the next phase
342
- - `/gsdd:pause` — save context for later if stopping work
351
+ - `/gsdd-quick` — run another quick task
352
+ - `/gsdd-plan` — plan the next phase
353
+ - `/gsdd-pause` — save context for later if stopping work
343
354
 
344
355
  Consider clearing context before starting the next workflow for best results.
345
356
  ---