gsdd-cli 0.16.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 (47) hide show
  1. package/README.md +109 -60
  2. package/agents/README.md +1 -1
  3. package/bin/adapters/claude.mjs +8 -1
  4. package/bin/adapters/codex.mjs +5 -1
  5. package/bin/adapters/opencode.mjs +7 -1
  6. package/bin/gsdd.mjs +6 -4
  7. package/bin/lib/evidence-contract.mjs +112 -0
  8. package/bin/lib/health-truth.mjs +29 -31
  9. package/bin/lib/health.mjs +32 -80
  10. package/bin/lib/init-runtime.mjs +44 -24
  11. package/bin/lib/init.mjs +3 -7
  12. package/bin/lib/lifecycle-preflight.mjs +333 -0
  13. package/bin/lib/lifecycle-state.mjs +293 -0
  14. package/bin/lib/phase.mjs +81 -26
  15. package/bin/lib/provenance.mjs +20 -1
  16. package/bin/lib/rendering.mjs +8 -0
  17. package/bin/lib/runtime-freshness.mjs +239 -0
  18. package/bin/lib/session-fingerprint.mjs +106 -0
  19. package/distilled/DESIGN.md +398 -12
  20. package/distilled/EVIDENCE-INDEX.md +105 -0
  21. package/distilled/README.md +44 -28
  22. package/distilled/SKILL.md +4 -4
  23. package/distilled/templates/agents.block.md +1 -1
  24. package/distilled/workflows/audit-milestone.md +50 -0
  25. package/distilled/workflows/complete-milestone.md +38 -2
  26. package/distilled/workflows/execute.md +13 -0
  27. package/distilled/workflows/map-codebase.md +14 -3
  28. package/distilled/workflows/new-milestone.md +13 -0
  29. package/distilled/workflows/new-project.md +3 -1
  30. package/distilled/workflows/plan.md +3 -1
  31. package/distilled/workflows/progress.md +68 -13
  32. package/distilled/workflows/quick.md +15 -8
  33. package/distilled/workflows/resume.md +14 -1
  34. package/distilled/workflows/verify.md +52 -17
  35. package/docs/BROWNFIELD-PROOF.md +95 -0
  36. package/docs/RUNTIME-SUPPORT.md +77 -0
  37. package/docs/USER-GUIDE.md +439 -0
  38. package/docs/VERIFICATION-DISCIPLINE.md +59 -0
  39. package/docs/claude/context-monitor.md +98 -0
  40. package/docs/proof/consumer-node-cli/README.md +37 -0
  41. package/docs/proof/consumer-node-cli/ROADMAP.md +14 -0
  42. package/docs/proof/consumer-node-cli/SPEC.md +17 -0
  43. package/docs/proof/consumer-node-cli/brief.md +9 -0
  44. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md +34 -0
  45. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-SUMMARY.md +10 -0
  46. package/docs/proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md +30 -0
  47. package/package.json +34 -27
@@ -1,21 +1,27 @@
1
- # Northline
1
+ # Workspine
2
2
 
3
- A repo-native workflow kernel for long-horizon AI software delivery.
3
+ A repo-native delivery spine for planning, checking, execution, verification, and handoff of long-horizon AI-assisted work.
4
4
 
5
- Northline gives long-horizon AI-assisted software work a durable repo spine for planning, execution, verification, and handoff. The package and CLI remain `gsdd-cli` / `gsdd`.
5
+ Workspine keeps planning, execution, verification, handoff, and progress state in the repo so work survives cold starts, runtime switches, and session loss. The retained package and CLI contracts remain `gsdd-cli` / `gsdd`.
6
6
 
7
7
  ## What This Is
8
8
 
9
- Northline is a small set of workflow sources plus a CLI (`gsdd`) that:
9
+ Workspine is a small set of workflow sources plus a CLI (`gsdd`) that:
10
10
  - scaffolds a project planning workspace (`.planning/`)
11
11
  - generates portable workflow entrypoints as skills (`.agents/skills/gsdd-*/SKILL.md`)
12
12
  - optionally generates tool-specific adapters for runtimes that need extra native surfaces (root `AGENTS.md`, Claude skills + plan-command alias + native agents, OpenCode commands + native agents)
13
13
 
14
- It gives serious AI-assisted software work one durable repo workflow spine for planning, execution, verification, and handoff without pretending to be a hosted orchestration layer.
14
+ It gives serious AI-assisted work one durable repo workflow spine for planning, checking, execution, verification, and handoff without pretending to be a hosted orchestration layer.
15
15
 
16
- Launch proof posture:
17
- - Directly validated in repo truth: Claude Code, Codex CLI, OpenCode
18
- - Qualified support only: Cursor, Copilot, Gemini CLI via the shared `.agents/skills/` surface plus optional governance
16
+ Workspine is the product name. The package, CLI commands, workflow prefixes, and workspace directory remain `gsdd-cli`, `gsdd`, `gsdd-*`, and `.planning/` — these are retained technical contracts, not rename residue.
17
+
18
+ Workspine began as a fork of Get Shit Done, whose long-horizon delivery spine proved the problem was real. Since the fork, upstream GSD has continued evolving into a broad multi-runtime framework. Workspine took a different path: a smaller repo-native delivery spine with fewer public workflow surfaces, generated runtime surfaces from a portable core, evidence-gated closure, and provenance-aware continuity.
19
+
20
+ Launch proof posture:
21
+ - Directly validated in repo truth: Claude Code, Codex CLI, OpenCode
22
+ - Qualified support only: Cursor, Copilot, Gemini CLI support the same core workflow via the shared `.agents/skills/` surface plus optional governance; proof and ergonomics differ from the directly validated runtimes
23
+ - Installed generated runtime surfaces are renderer-checked locally through `gsdd health`, with deterministic repair through `gsdd update`
24
+ - Public proof entrypoints: `docs/BROWNFIELD-PROOF.md`, `docs/proof/consumer-node-cli/README.md`, `docs/RUNTIME-SUPPORT.md`, `docs/VERIFICATION-DISCIPLINE.md`
19
25
 
20
26
  ## Quick Start
21
27
 
@@ -63,32 +69,41 @@ gsdd init -> bootstrap (create .planning/, copy templates, gene
63
69
  /gsdd-progress -> show status, route to next action
64
70
  ```
65
71
 
66
- ## Current Status (updated 2026-04-10)
67
-
68
- | Workflow | Status | Notes |
69
- |----------|--------|-------|
70
- | `new-project.md` | [OK] Defined, source-audited | Covers greenfield + brownfield + milestone context |
71
- | `plan.md` | [OK] Defined, source-audited | Portable workflow defines the planner contract and supports independent plan checking through generated native adapters |
72
- | `execute.md` | [OK] Source-audited | Mandatory read enforcement, auth-gate routing, deviation-rule examples, and substantive summary quality gate |
73
- | `verify.md` | [OK] Source-audited | 5 gap closures against hardened verifier role contract: grouped-gap guidance, orphan detection, frontmatter enforcement, verification basis emphasis, requirements coverage chain |
74
- | `audit-milestone.md` | [OK] Defined, source-audited | Aggregates phase verification, cross-phase integration audit, auth protection checks, requirement reconciliation, and orphan detection into `MILESTONE-AUDIT.md` |
75
- | `complete-milestone.md` | [OK] Defined | Archives milestone, evolves SPEC.md, collapses ROADMAP.md — no gsd-tools.cjs dependency |
76
- | `new-milestone.md` | [OK] Defined | Brownfield milestone continuation: goals, SPEC.md requirements, ROADMAP.md phases |
77
- | `plan-milestone-gaps.md` | [OK] Defined (unvalidated) | Gap closure phases from MILESTONE-AUDIT.md results |
78
- | `quick.md` | [OK] | Quick-work lane for sub-hour tasks outside the phase cycle (D11) |
79
- | `pause.md` | [OK] Source-audited | Session checkpoint writer with conversational handoff (D12) |
80
- | `resume.md` | [OK] Source-audited | Session context restorer with priority-ordered routing (D12) |
81
- | `progress.md` | [OK] Source-audited | Read-only status reporter with 6 named route branches, recent work, between-milestones detection (D12) |
82
- | `map-codebase.md` | [OK] Defined, source-audited | Standalone codebase mapping/refresh |
83
- | `verify-work.md` | [OK] Defined | Conversational UAT validation with structured gap tracking |
72
+ ## Brownfield Entry Contract
73
+
74
+ Use the same three-way routing everywhere:
75
+
76
+ - `gsdd-new-project` is the full initializer for greenfield work, fuzzy brownfield scope, or milestone-shaped work. Users do not need to pre-run `map-codebase`; `new-project` does that internally when needed.
77
+ - `gsdd-quick` is the bounded brownfield lane when the change is already concrete. It uses existing codebase maps when present and otherwise builds a just-enough inline baseline.
78
+ - `gsdd-map-codebase` is the deeper orientation pass for unfamiliar or higher-risk repos before choosing between `quick` and `new-project`.
79
+
80
+ ## Workflow Surface (updated 2026-04-19)
81
+
82
+ | Workflow | What ships |
83
+ |----------|------------|
84
+ | `new-project.md` | Greenfield + brownfield + milestone initialization |
85
+ | `plan.md` | Portable planner contract with independent plan checking through generated native adapters |
86
+ | `execute.md` | Mandatory reads, auth-gate routing, deviation rules, and substantive summary quality gate |
87
+ | `verify.md` | Phase verification with orphan detection, frontmatter enforcement, and requirements coverage chain |
88
+ | `audit-milestone.md` | Cross-phase integration audit, auth protection checks, requirement reconciliation, and orphan detection into `MILESTONE-AUDIT.md` |
89
+ | `complete-milestone.md` | Milestone archive, spec evolution, and roadmap collapse |
90
+ | `new-milestone.md` | Brownfield milestone continuation: goals, requirements, and roadmap phases |
91
+ | `plan-milestone-gaps.md` | Gap-closure phases from `MILESTONE-AUDIT.md` results |
92
+ | `quick.md` | Quick-work lane for sub-hour tasks outside the phase cycle |
93
+ | `pause.md` | Session checkpoint writer with conversational handoff |
94
+ | `resume.md` | Session context restorer with priority-ordered routing |
95
+ | `progress.md` | Read-only status reporter with recent work, archived-milestone detection, and non-phase brownfield routing |
96
+ | `map-codebase.md` | Standalone codebase mapping/refresh and deeper brownfield orientation |
97
+ | `verify-work.md` | Conversational UAT validation with structured gap tracking |
84
98
 
85
99
  Architecture notes:
86
100
  - `bin/gsdd.mjs` remains the thin generator entrypoint, while vendor-specific rendering lives in adapter modules.
87
101
  - Codex CLI uses the always-generated `.agents/skills/gsdd-*` surface as its entry path and can add a native `.codex/agents/gsdd-plan-checker.toml` checker agent.
102
+ - `gsdd health` now compares any installed generated runtime surfaces against current render output and routes repairs back through `gsdd update`.
88
103
  - Portable lifecycle contracts now align to the roadmap template status grammar: `[ ]`, `[-]`, `[x]`.
89
104
  - Phase verification and milestone integration audit are treated as separate concerns.
90
105
  - Canonical role contracts use bounded sections, typed output examples, and checklist-driven completion where those structures materially improve downstream reliability.
91
- - Public launch wording is conservative by design: direct proof is claimed only for runtimes with recorded lifecycle evidence in `.planning/research/09-RESEARCH.md`.
106
+ - Public launch wording is conservative by design: direct proof is claimed only for runtimes with recorded lifecycle evidence in the repo.
92
107
 
93
108
  ## Init Workflow Agent Count (by config)
94
109
 
@@ -149,7 +164,7 @@ Note: `parallelization: false` keeps the same mapper/researcher set but runs the
149
164
 
150
165
  ```
151
166
  distilled/
152
- DESIGN.md # design decisions and rationale (39 decisions, evidence-backed)
167
+ DESIGN.md # design decisions and rationale (52 decisions, evidence-backed)
153
168
  EVIDENCE-INDEX.md # source-to-decision index for durable research-backed claims
154
169
  SKILL.md # primary entry point (plain markdown)
155
170
  workflows/
@@ -178,6 +193,7 @@ distilled/
178
193
  mapper-quality.md
179
194
  mapper-concerns.md
180
195
  plan-checker.md
196
+ approach-explorer.md
181
197
  researcher-stack.md
182
198
  researcher-features.md
183
199
  researcher-architecture.md
@@ -1,10 +1,10 @@
1
1
  ---
2
- name: GSDD (Spec-Driven Development)
3
- description: Disciplined, lightweight workflow for AI-assisted development. Spec first, then build, then verify.
2
+ name: Workspine (published as gsdd-cli)
3
+ description: Disciplined repo-native workflow for AI-assisted development. Spec first, then build, then verify.
4
4
  ---
5
5
 
6
6
  <role>
7
- You are an AI agent following the GSDD workflow. You are a disciplined engineer, not a code generator.
7
+ You are an AI agent following the Workspine workflow. You are a disciplined engineer, not a code generator.
8
8
  Your mandate: understand the problem deeply, specify what "done" looks like, implement with precision, and verify with rigor.
9
9
  </role>
10
10
 
@@ -45,7 +45,7 @@ Mandatory:
45
45
  </governance>
46
46
 
47
47
  <project_structure>
48
- GSDD uses `.planning/` as the durable workspace:
48
+ Workspine uses `.planning/` as the durable workspace:
49
49
 
50
50
  ```
51
51
  .planning/
@@ -7,7 +7,7 @@ Lifecycle: `new-project -> plan -> execute -> verify -> audit-milestone`.
7
7
  Core skills: `gsdd-new-project`, `gsdd-plan`, `gsdd-execute`, `gsdd-verify`, `gsdd-progress`.
8
8
  Planning state: `.planning/`. Portable workflows: `.agents/skills/gsdd-*/SKILL.md`.
9
9
 
10
- Invoke: `/gsdd-plan` (Claude, OpenCode, Cursor, Copilot, Gemini) · `$gsdd-plan` (Codex) · open SKILL.md directly elsewhere.
10
+ Invoke: `/gsdd-plan` (Claude, OpenCode, Cursor, Copilot, Gemini) · `$gsdd-plan` (Codex, plan-only until `$gsdd-execute`) · open SKILL.md directly elsewhere.
11
11
 
12
12
  Rules:
13
13
  1. Read before writing roadmap work: `.planning/SPEC.md`, `.planning/ROADMAP.md`, `.planning/config.json`, and the relevant phase plan when one exists.
@@ -13,6 +13,45 @@ Before starting, read these files:
13
13
  5. `.planning/AUTH_MATRIX.md` (if it exists) — authorization matrix for matrix-driven auth verification
14
14
  </load_context>
15
15
 
16
+ <lifecycle_preflight>
17
+ Before determining milestone scope or spawning the integration checker, run:
18
+
19
+ - `gsdd lifecycle-preflight audit-milestone`
20
+
21
+ If the preflight result is `blocked`, STOP and report the blocker instead of inferring milestone eligibility from workflow-local prose.
22
+
23
+ Treat the preflight as an authorization seam over shared repo truth only:
24
+ - it may authorize or reject milestone audit
25
+ - it does not archive or mutate milestone state
26
+ - the owned write for this workflow remains `.planning/v{version}-MILESTONE-AUDIT.md`
27
+ </lifecycle_preflight>
28
+
29
+ <evidence_contract>
30
+ Use the same fixed closure evidence kinds as verification:
31
+ - `code`
32
+ - `test`
33
+ - `runtime`
34
+ - `delivery`
35
+ - `human`
36
+
37
+ Determine milestone `delivery_posture` before grading requirements or flows:
38
+ - `repo_only` — the milestone claim is still repo-local and does not depend on shipped runtime or release proof
39
+ - `delivery_sensitive` — the milestone claims shipped UX, release/install behavior, published proof, or other externally consumed runtime outcomes
40
+
41
+ Apply the shared `audit-milestone` matrix:
42
+
43
+ | delivery_posture | required evidence | recommended evidence | cannot carry closure alone |
44
+ | -------------------- | -------------------------------- | -------------------- | -------------------------- |
45
+ | `repo_only` | `code`, `test` | `runtime`, `human` | `human`, `delivery` |
46
+ | `delivery_sensitive` | `code`, `test`, `runtime`, `delivery` | `human` | `code`, `human` |
47
+
48
+ Rules:
49
+ - repo-only milestones must not invent `runtime` or `delivery` proof just because the audit template mentions them
50
+ - delivery-sensitive audits must not pass on phase prose, code inspection, or tests alone; required `runtime` and `delivery` evidence must be explicitly present
51
+ - `human` evidence is supportive only at audit level unless the audit is already otherwise satisfied
52
+ - record the selected `delivery_posture`, `required_kinds`, `observed_kinds`, and `missing_kinds` in audit frontmatter so completion inherits the same closure contract
53
+ </evidence_contract>
54
+
16
55
  <process>
17
56
 
18
57
  ## 1. Determine Milestone Scope
@@ -70,6 +109,7 @@ Either way, the integration check happens. The quality level is documented.
70
109
  Combine:
71
110
  - Phase-level gaps and tech debt (from step 2)
72
111
  - Integration checker's report (wiring gaps, auth gaps, broken flows, requirements integration map)
112
+ - Evidence observations by kind (`code`, `test`, `runtime`, `delivery`, `human`) from phase verifications, summaries, integration findings, and delivery metadata
73
113
 
74
114
  ## 5. 3-Source Cross-Reference
75
115
 
@@ -125,6 +165,11 @@ milestone: v{version}
125
165
  audited: {ISO-8601 timestamp}
126
166
  status: passed | gaps_found | tech_debt
127
167
  reduced_assurance: false
168
+ delivery_posture: repo_only | delivery_sensitive
169
+ evidence_contract:
170
+ required_kinds: [code, test]
171
+ observed_kinds: [code, test]
172
+ missing_kinds: []
128
173
  scores:
129
174
  requirements: N/M
130
175
  phases: N/M
@@ -160,6 +205,11 @@ Plus full markdown report body with tables for requirements, phases, integration
160
205
  - `gaps_found` - critical blockers exist (unsatisfied requirements, unprotected sensitive flows, broken flows, or missing verifications)
161
206
  - `tech_debt` - no blockers but accumulated deferred items need review
162
207
 
208
+ Evidence gate:
209
+ - a `passed` audit must have no `missing_kinds` for the selected `delivery_posture`
210
+ - `delivery_sensitive` audits cannot pass without explicit `runtime` and `delivery` evidence
211
+ - `repo_only` audits cannot be downgraded merely because `runtime` or `delivery` evidence was never relevant
212
+
163
213
  **MANDATORY: The milestone audit report must exist at `.planning/v{version}-MILESTONE-AUDIT.md` on disk before presenting results. If the file was not written, STOP and report the write failure. Do NOT present audit results from conversation context alone — this is the highest-cost artifact to regenerate. Do NOT downgrade a write failure into "results shown inline anyway."**
164
214
 
165
215
  ## 7. Present Results
@@ -25,6 +25,41 @@ Before starting, read these files:
25
25
  6. Most recent `.planning/v*-MILESTONE-AUDIT.md` — audit status (passed / gaps_found)
26
26
  </load_context>
27
27
 
28
+ <lifecycle_preflight>
29
+ Before verifying readiness or gathering archive stats, run:
30
+
31
+ - `gsdd lifecycle-preflight complete-milestone`
32
+
33
+ If the preflight result is `blocked`, STOP and report the blocker instead of inferring milestone-close eligibility from workflow-local prose.
34
+
35
+ Treat the preflight as an authorization seam over shared repo truth only:
36
+ - it may authorize or reject milestone completion
37
+ - it does not mutate lifecycle state by itself
38
+ - owned writes remain the archive artifacts, `MILESTONES.md`, `.planning/SPEC.md`, and the retained `ROADMAP.md` collapse
39
+ </lifecycle_preflight>
40
+
41
+ <evidence_contract>
42
+ Milestone completion inherits the closure posture proven by the passed milestone audit.
43
+
44
+ Stable evidence kinds carried forward from audit:
45
+ - `code`
46
+ - `test`
47
+ - `runtime`
48
+ - `delivery`
49
+ - `human`
50
+
51
+ Read the audit frontmatter and preserve:
52
+ - `delivery_posture`
53
+ - `evidence_contract.required_kinds`
54
+ - `evidence_contract.observed_kinds`
55
+ - `evidence_contract.missing_kinds`
56
+
57
+ Shared closure rules:
58
+ - `repo_only` completion may proceed with repo-local closure evidence only; do not invent `runtime` or `delivery` proof
59
+ - `delivery_sensitive` completion must not proceed on code/prose-only evidence; the audit must already show required `code`, `test`, `runtime`, and `delivery` evidence with no missing required kinds
60
+ - if the audit omits the evidence contract or still has missing required kinds, STOP and route back to `/gsdd-audit-milestone` or `/gsdd-plan-milestone-gaps` instead of silently closing the milestone
61
+ </evidence_contract>
62
+
28
63
  <process>
29
64
 
30
65
  ## 1. Verify Readiness
@@ -32,10 +67,11 @@ Before starting, read these files:
32
67
  Check:
33
68
  - **Phase completion**: Are all ROADMAP.md phases for this milestone marked `[x]`? List any that are not.
34
69
  - **Audit status**: Does a MILESTONE-AUDIT.md exist and have status `passed`? If it has status `gaps_found`, the milestone has open gaps.
70
+ - **Audit evidence posture**: Does the passed audit frontmatter include `delivery_posture` and an `evidence_contract` block with no missing required kinds?
35
71
  - **Spent-branch guard**: Run `git branch --merged origin/main` (substitute `master` or the configured default branch from `config.json → gitProtocol.branch` if different) and verify HEAD is not a spent/already-merged branch. If the current branch already backs a merged PR, STOP - do not instruct any commit or tag operations. Prompt the user to check out a fresh active branch before continuing.
36
72
  - **Integration-surface warning pass**: Inspect staged, unstaged, untracked, unpushed, and PR-less local truth separately from the milestone artifacts. Warn if the archive is being attempted from a mixed-scope or stale branch even when the milestone documents themselves look complete.
37
73
 
38
- **If phases incomplete or audit not passed:**
74
+ **If phases incomplete, audit not passed, or the audit evidence contract is missing/insufficient:**
39
75
 
40
76
  Present options:
41
77
  1. **Proceed anyway** — archive with known gaps noted in MILESTONES.md
@@ -47,7 +83,7 @@ Present options:
47
83
 
48
84
  Exception: if `config.json -> mode` is `yolo`, skip the stop gate and proceed with a note about any gaps.
49
85
 
50
- **If all phases complete and audit passed:** Proceed.
86
+ **If all phases complete, audit passed, and the audit evidence contract is satisfied:** Proceed.
51
87
 
52
88
  ## 2. Determine Version
53
89
 
@@ -17,6 +17,19 @@ CRITICAL: Read every file below before performing any other actions. This is you
17
17
  7. **Session-boundary fallback:** If no prior completed phase SUMMARY.md with a `<judgment>` section was found in step 6, check whether `.planning/.continue-here.bak` exists. If it does, read its `<judgment>` section. Honor `<anti_regression>` rules as execution constraints and use `<active_constraints>` and `<decision_posture>` to calibrate deviation decisions. After reading, run `gsdd file-op delete .planning/.continue-here.bak --missing ok` (auto-clean).
18
18
  </load_context>
19
19
 
20
+ <lifecycle_preflight>
21
+ Before implementing or mutating any lifecycle artifact, run:
22
+
23
+ - `gsdd lifecycle-preflight execute {phase_num} --expects-mutation phase-status`
24
+
25
+ If the preflight result is `blocked`, STOP and surface the blocker instead of inferring eligibility from workflow-local prose.
26
+
27
+ Treat the preflight as an authorization seam over shared repo truth only:
28
+ - it may authorize or reject execution
29
+ - it does not mutate `.planning/ROADMAP.md` by itself
30
+ - owned writes remain execution artifacts, and ROADMAP mutation stays explicit in `<state_updates>` via `gsdd phase-status`
31
+ </lifecycle_preflight>
32
+
20
33
  <runtime_contract>
21
34
  Execution uses the same `Runtime` and `Assurance` types as planning and verification.
22
35
  Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
@@ -1,5 +1,5 @@
1
1
  <role>
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 summarize.
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
4
  Output: `.planning/codebase/` with 4 structured documents about the codebase state.
5
5
  </role>
@@ -9,11 +9,13 @@ Use this workflow when:
9
9
  - Starting work on a brownfield (existing) codebase for the first time
10
10
  - Codebase maps are missing or stale (major refactors, dependency upgrades, new modules)
11
11
  - Explicitly requested as a standalone re-mapping
12
+ - You want a deeper brownfield orientation pass before choosing between bounded `quick` work and full `new-project` setup
12
13
 
13
14
  Do NOT use when:
14
15
  - Greenfield project with no existing code
15
16
  - Maps already exist and are fresh (use Skip)
16
17
  - You are in the middle of a plan/execute/verify cycle (use existing maps)
18
+ - You only need a small bounded brownfield change and the repo is already familiar enough for `quick` to build an inline baseline safely
17
19
  </when_to_use>
18
20
 
19
21
  <load_context>
@@ -146,6 +148,7 @@ These 4 documents are consumed by downstream GSDD workflows:
146
148
  | `plan` (future) | ARCHITECTURE + CONVENTIONS for implementation planning |
147
149
  | `execute` (future) | CONVENTIONS for code style, ARCHITECTURE for file placement |
148
150
  | `verify` (future) | CONCERNS for regression awareness |
151
+ | `/gsdd-quick` | All 4 -- bounded brownfield context for safe feature work |
149
152
 
150
153
  **What this means for mapper output quality:**
151
154
 
@@ -230,9 +233,17 @@ Report to the user what was accomplished, then present the next step:
230
233
  ---
231
234
  **Completed:** Codebase mapping — 4 documents written to `.planning/codebase/` (STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md).
232
235
 
236
+ **Brownfield routing summary:** Synthesize this directly from the 4 generated documents before recommending the next workflow.
237
+ - Safest next change lane — which module or surface looks cheapest and safest to modify first
238
+ - Highest-risk zones — areas to avoid or isolate unless the task explicitly needs them
239
+ - Must-know traps — convention, dependency, or architecture constraints likely to cause mistakes
240
+ - Recommended next workflow — choose `/gsdd-quick` for bounded brownfield work or `/gsdd-new-project` for full lifecycle setup, and say why
241
+
242
+ Use only the 4 generated documents for this synthesis. Do NOT create a fifth persistent artifact or write an additional routing-summary file.
243
+
233
244
  **Next step:** Choose based on what you need:
234
- - `/gsdd-new-project` — full project initialization (spec, roadmap, phased delivery)
235
- - `/gsdd-quick` — brownfield feature work without full ceremony (bug fixes, small features, one-off tasks)
245
+ - `/gsdd-new-project` — full project initialization (spec, roadmap, phased delivery), especially if you have not yet defined the bounded change
246
+ - `/gsdd-quick` — bounded brownfield feature work without full ceremony (bug fixes, small features, one-off tasks)
236
247
 
237
248
  Also available:
238
249
  - `/gsdd-map-codebase` — re-map if results need refinement
@@ -23,6 +23,19 @@ Before starting, read these files:
23
23
  4. `.planning/config.json` — `workflow.research`, `researchDepth`, `gitProtocol`
24
24
  </load_context>
25
25
 
26
+ <lifecycle_preflight>
27
+ Before presenting the last milestone or gathering new milestone goals, run:
28
+
29
+ - `gsdd lifecycle-preflight new-milestone`
30
+
31
+ If the preflight result is `blocked`, STOP and report the blocker instead of inferring milestone-start eligibility from workflow-local prose.
32
+
33
+ Treat the preflight as an authorization seam over shared repo truth only:
34
+ - it may authorize or reject new milestone creation
35
+ - it does not mutate milestone or roadmap state by itself
36
+ - owned writes remain the new milestone requirements, roadmap entries, and phase-directory scaffolding
37
+ </lifecycle_preflight>
38
+
26
39
  <integration_surface_check>
27
40
  Before mutating milestone truth, inspect the current branch/worktree as a separate provenance surface:
28
41
  - current branch
@@ -83,6 +83,8 @@ Check whether `.planning/codebase/STACK.md`, `.planning/codebase/ARCHITECTURE.md
83
83
 
84
84
  Inform the user: "No codebase maps found. Running codebase mapping before continuing."
85
85
 
86
+ This is an internal prerequisite of `new-project`, not a user-facing routing requirement. If the user started with `/gsdd-new-project` on a brownfield repo, do not bounce them out and tell them to restart with `/gsdd-map-codebase`. Run the mapping dependency, then continue this workflow.
87
+
86
88
  Read and follow `.agents/skills/gsdd-map-codebase/SKILL.md` now. Execute its full flow (check existing, spawn mappers, validate, secrets scan). When map-codebase completes, return here and continue from Brownfield Validated Requirements Inference below.
87
89
 
88
90
  ### Brownfield Validated Requirements Inference
@@ -415,7 +417,7 @@ Report to the user what was accomplished, then present the next step:
415
417
 
416
418
  Also available:
417
419
  - `/gsdd-progress` — check overall project status
418
- - `/gsdd-map-codebase` — map existing codebase (if not already done)
420
+ - `/gsdd-map-codebase` — deeper brownfield baseline or refresh (optional; `new-project` already runs it when needed)
419
421
 
420
422
  Consider clearing context before starting the next workflow for best results.
421
423
  ---
@@ -506,8 +506,10 @@ Report to the user what was accomplished, then present the next step:
506
506
 
507
507
  ---
508
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.
509
511
 
510
- **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
511
513
 
512
514
  Also available:
513
515
  - `/gsdd-plan` — create additional plans for the same phase (if multi-wave)
@@ -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,11 +60,22 @@ 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
 
@@ -81,12 +111,16 @@ Project: [name from SPEC.md]
81
111
  Phase: [current] of [total] — [phase name]
82
112
  Completed: [N] phases done
83
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
+
84
118
  Recent Work:
85
119
  - Phase [X]: [one-liner from SUMMARY.md]
86
120
  - Phase [Y]: [one-liner from SUMMARY.md]
87
121
 
88
122
  [If .continue-here.md exists:]
89
- 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
90
124
 
91
125
  [If PLAN without SUMMARY found:]
92
126
  Incomplete execution: Phase [N] has PLAN but no SUMMARY
@@ -102,8 +136,11 @@ Unmerged commits: [N] commit(s) on this branch not yet merged to main
102
136
  → Merge or push this branch before closing the milestone, or verify
103
137
  these commits are intentional working-branch state.
104
138
 
105
- [If all phases [x]:]
139
+ [If all phases [x] and the current milestone is not yet archived:]
106
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
107
144
  ```
108
145
 
109
146
  **Filled-in example** (fabricated but realistic):
@@ -131,7 +168,7 @@ No ASCII art, no progress bars. Keep it scannable.
131
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.
132
169
 
133
170
  **Branch A: Resume checkpoint**
134
- Condition: `.continue-here.md` exists.
171
+ Condition: `.continue-here.md` exists and its `workflow` is `phase` or `quick`.
135
172
 
136
173
  ```
137
174
  Suggested next action:
@@ -139,6 +176,8 @@ Suggested next action:
139
176
  Also available: /gsdd-execute (ignore checkpoint, continue current phase), /gsdd-progress (refresh)
140
177
  ```
141
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
+
142
181
  **Branch B: Execute (PLAN without SUMMARY in current phase)**
143
182
  Condition: Current phase has a PLAN file but no matching SUMMARY.
144
183
 
@@ -166,8 +205,8 @@ Suggested next action:
166
205
  Also available: /gsdd-execute (continue to next phase), /gsdd-plan (plan next phase)
167
206
  ```
168
207
 
169
- **Branch E: Audit milestone (all phases [x])**
170
- 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.
171
210
 
172
211
  ```
173
212
  Suggested next action:
@@ -175,8 +214,11 @@ Suggested next action:
175
214
  Also available: /gsdd-verify (re-verify a specific phase), /gsdd-quick (sub-hour task)
176
215
  ```
177
216
 
178
- **Branch F: Between milestones (SPEC.md exists, ROADMAP.md absent)**
179
- 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
180
222
 
181
223
  Check `.planning/MILESTONES.md`:
182
224
  - If MILESTONES.md exists and has at least one milestone entry → this is a subsequent milestone
@@ -191,6 +233,18 @@ Suggested next action (incomplete milestone state — SPEC.md exists but no mile
191
233
  Inspect .planning/ manually — a milestone is likely still in progress.
192
234
  If a ROADMAP.md was deleted prematurely, re-run /gsdd-new-milestone to restore it.
193
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)
194
248
  ```
195
249
 
196
250
  If none of the above conditions match, report that the project is in a clean state with no obvious next action.
@@ -200,7 +254,8 @@ If none of the above conditions match, report that the project is in a clean sta
200
254
  Handle compound states:
201
255
 
202
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.
203
- - **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.
204
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).
205
260
  - **No matching condition:** If the project state does not match any branch, report it clearly and suggest the user inspect `.planning/` manually.
206
261
  </edge_cases>