gsdd-cli 0.18.5 → 0.19.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 (100) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +609 -608
  3. package/agents/DISTILLATION.md +421 -421
  4. package/agents/README.md +62 -62
  5. package/agents/approach-explorer.md +361 -361
  6. package/agents/debugger.md +82 -82
  7. package/agents/executor.md +394 -394
  8. package/agents/integration-checker.md +318 -318
  9. package/agents/mapper.md +103 -103
  10. package/agents/planner.md +313 -313
  11. package/agents/researcher.md +84 -84
  12. package/agents/roadmapper.md +296 -296
  13. package/agents/synthesizer.md +236 -236
  14. package/agents/verifier.md +337 -337
  15. package/bin/adapters/agents.mjs +34 -34
  16. package/bin/adapters/claude.mjs +191 -191
  17. package/bin/adapters/codex.mjs +85 -85
  18. package/bin/adapters/index.mjs +20 -20
  19. package/bin/adapters/opencode.mjs +278 -278
  20. package/bin/gsdd.mjs +123 -116
  21. package/bin/lib/cli-utils.mjs +28 -28
  22. package/bin/lib/evidence-contract.mjs +112 -112
  23. package/bin/lib/file-ops.mjs +186 -144
  24. package/bin/lib/health-truth.mjs +181 -178
  25. package/bin/lib/health.mjs +246 -226
  26. package/bin/lib/init-flow.mjs +247 -231
  27. package/bin/lib/init-prompts.mjs +248 -247
  28. package/bin/lib/init-runtime.mjs +191 -190
  29. package/bin/lib/init.mjs +17 -17
  30. package/bin/lib/lifecycle-preflight.mjs +347 -325
  31. package/bin/lib/lifecycle-state.mjs +351 -267
  32. package/bin/lib/manifest.mjs +116 -114
  33. package/bin/lib/models.mjs +411 -411
  34. package/bin/lib/phase.mjs +360 -358
  35. package/bin/lib/plan-constants.mjs +30 -30
  36. package/bin/lib/provenance.mjs +109 -106
  37. package/bin/lib/rendering.mjs +115 -83
  38. package/bin/lib/runtime-freshness.mjs +214 -214
  39. package/bin/lib/templates.mjs +225 -224
  40. package/bin/lib/workspace-root.mjs +2 -1
  41. package/distilled/DESIGN.md +2333 -2323
  42. package/distilled/EVIDENCE-INDEX.md +394 -392
  43. package/distilled/README.md +196 -193
  44. package/distilled/SKILL.md +86 -85
  45. package/distilled/templates/agents.block.md +21 -21
  46. package/distilled/templates/agents.md +6 -6
  47. package/distilled/templates/approach.md +232 -232
  48. package/distilled/templates/auth-matrix.md +78 -78
  49. package/distilled/templates/brownfield-change/CHANGE.md +99 -0
  50. package/distilled/templates/brownfield-change/HANDOFF.md +38 -0
  51. package/distilled/templates/brownfield-change/VERIFICATION.md +56 -0
  52. package/distilled/templates/codebase/architecture.md +110 -110
  53. package/distilled/templates/codebase/concerns.md +95 -95
  54. package/distilled/templates/codebase/conventions.md +193 -193
  55. package/distilled/templates/codebase/stack.md +96 -96
  56. package/distilled/templates/delegates/approach-explorer.md +25 -25
  57. package/distilled/templates/delegates/mapper-arch.md +26 -26
  58. package/distilled/templates/delegates/mapper-concerns.md +27 -27
  59. package/distilled/templates/delegates/mapper-quality.md +28 -28
  60. package/distilled/templates/delegates/mapper-tech.md +25 -25
  61. package/distilled/templates/delegates/plan-checker.md +68 -68
  62. package/distilled/templates/delegates/researcher-architecture.md +30 -30
  63. package/distilled/templates/delegates/researcher-features.md +30 -30
  64. package/distilled/templates/delegates/researcher-pitfalls.md +30 -30
  65. package/distilled/templates/delegates/researcher-stack.md +30 -30
  66. package/distilled/templates/delegates/researcher-synthesizer.md +31 -31
  67. package/distilled/templates/research/architecture.md +57 -57
  68. package/distilled/templates/research/features.md +23 -23
  69. package/distilled/templates/research/pitfalls.md +46 -46
  70. package/distilled/templates/research/stack.md +45 -45
  71. package/distilled/templates/research/summary.md +67 -67
  72. package/distilled/templates/roadmap.md +74 -62
  73. package/distilled/templates/spec.md +110 -110
  74. package/distilled/workflows/audit-milestone.md +275 -271
  75. package/distilled/workflows/complete-milestone.md +336 -332
  76. package/distilled/workflows/execute.md +454 -449
  77. package/distilled/workflows/map-codebase.md +253 -253
  78. package/distilled/workflows/new-milestone.md +242 -238
  79. package/distilled/workflows/new-project.md +398 -398
  80. package/distilled/workflows/pause.md +160 -156
  81. package/distilled/workflows/plan-milestone-gaps.md +183 -183
  82. package/distilled/workflows/plan.md +451 -447
  83. package/distilled/workflows/progress.md +227 -223
  84. package/distilled/workflows/quick.md +351 -347
  85. package/distilled/workflows/resume.md +220 -212
  86. package/distilled/workflows/verify-work.md +260 -260
  87. package/distilled/workflows/verify.md +431 -429
  88. package/docs/BROWNFIELD-PROOF.md +95 -95
  89. package/docs/RUNTIME-SUPPORT.md +80 -69
  90. package/docs/USER-GUIDE.md +394 -386
  91. package/docs/VERIFICATION-DISCIPLINE.md +59 -59
  92. package/docs/claude/context-monitor.md +98 -98
  93. package/docs/proof/consumer-node-cli/README.md +37 -37
  94. package/docs/proof/consumer-node-cli/ROADMAP.md +14 -14
  95. package/docs/proof/consumer-node-cli/SPEC.md +17 -17
  96. package/docs/proof/consumer-node-cli/brief.md +9 -9
  97. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md +34 -34
  98. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-SUMMARY.md +10 -10
  99. package/docs/proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md +30 -30
  100. package/package.json +62 -61
@@ -1,157 +1,161 @@
1
- <role>
2
- You are the SESSION HANDOFF WRITER. Your job is to capture the current work context into a checkpoint file so a fresh session can resume seamlessly.
3
-
4
- Core mindset: write for a stranger. The next session has zero memory of what happened here. Every implicit assumption must become explicit text.
5
-
6
- Scope boundary: you write a checkpoint file. You do not route, present status, or clean up anything. That is resume.md and progress.md territory.
7
- </role>
8
-
9
- <prerequisites>
10
- `.planning/` must exist (from `gsdd init`).
11
-
12
- If `.planning/` does not exist, stop and tell the user to run `gsdd init` first.
13
- </prerequisites>
14
-
15
- <runtime_contract>
16
- Use the `Runtime` type from `.planning/SPEC.md`.
17
- Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
18
- Checkpoints record `runtime` only — assurance does not apply to state snapshots.
19
- </runtime_contract>
20
-
21
- <process>
22
-
23
- <detect_work>
24
- Scan for active work in priority order:
25
-
26
- 1. **Active phase work** — look in `.planning/phases/` for directories containing a PLAN file but no SUMMARY file (execution started but not completed).
27
- 2. **Active quick task** — read `.planning/quick/LOG.md` if it exists. Check the last entry: if its status is not `done`/`passed`, there is an incomplete quick task.
28
- 3. **Generic work** if neither of the above, ask the user what they were working on.
29
-
30
- If no active work is detected and the user confirms nothing is in progress, inform them there is nothing to pause and exit.
31
-
32
- Store the detected work type as `$WORK_TYPE` (one of: `phase`, `quick`, `generic`).
33
- </detect_work>
34
-
35
- <gather_state>
36
- Build a draft checkpoint from artifact truth before asking the user to restate work. The user should correct the draft, not rewrite obvious repo state from scratch.
37
-
38
- Ask the user conversationally to fill in the gaps the artifacts cannot answer:
39
-
40
- 1. **What was completed** this session
41
- 2. **Current approach** — the strategy or mental model driving the work
42
- 3. **Remaining work** what tasks or steps are still outstanding
43
- 4. **Key decisions** — any decisions made and their rationale
44
- 5. **Blockers** anything stuck or waiting on external input
45
- 6. **What to do first** when resuming
46
- 7. **Judgment context** — active constraints currently governing the work, any unresolved uncertainty or open questions, the current decision posture (what approach was chosen and why), and anti-regression rules (invariants that must not break). Pre-fill from SPEC.md constraints and APPROACH.md decisions where applicable; ask the user for what is session-specific or undocumented.
47
-
48
- Read the relevant artifacts and current integration surface to pre-fill what you can:
49
- - For phase work: read the PLAN file and any partial SUMMARY — use these to pre-fill remaining_work and decisions where possible; only ask the user for gaps
50
- - For quick tasks: read the quick task PLAN and LOG.md entry same pre-fill approach
51
- - For generic work: derive everything you can from repo state first, then ask only for what remains unknown
52
-
53
- Question budget:
54
- - Ask at most 3 high-signal questions total
55
- - Prefer confirmation/correction prompts over open-ended recap prompts
56
- - If repo/artifact truth already answers a point, do not ask the user to repeat it
57
- </gather_state>
58
-
59
- <write_checkpoint>
1
+ <role>
2
+ You are the SESSION HANDOFF WRITER. Your job is to capture the current work context into a checkpoint file so a fresh session can resume seamlessly.
3
+
4
+ Core mindset: write for a stranger. The next session has zero memory of what happened here. Every implicit assumption must become explicit text.
5
+
6
+ Scope boundary: you write a checkpoint file. You do not route, present status, or clean up anything. That is resume.md and progress.md territory.
7
+ </role>
8
+
9
+ <prerequisites>
10
+ `.planning/` must exist (from `npx -y gsdd-cli init`, or `gsdd init` when globally installed).
11
+
12
+ If `.planning/` does not exist, stop and tell the user to run `npx -y gsdd-cli init` first.
13
+ </prerequisites>
14
+
15
+ <repo_root_helper_contract>
16
+ 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.
17
+ </repo_root_helper_contract>
18
+
19
+ <runtime_contract>
20
+ Use the `Runtime` type from `.planning/SPEC.md`.
21
+ Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
22
+ Checkpoints record `runtime` only — assurance does not apply to state snapshots.
23
+ </runtime_contract>
24
+
25
+ <process>
26
+
27
+ <detect_work>
28
+ Scan for active work in priority order:
29
+
30
+ 1. **Active phase work** look in `.planning/phases/` for directories containing a PLAN file but no SUMMARY file (execution started but not completed).
31
+ 2. **Active quick task** — read `.planning/quick/LOG.md` if it exists. Check the last entry: if its status is not `done`/`passed`, there is an incomplete quick task.
32
+ 3. **Generic work** — if neither of the above, ask the user what they were working on.
33
+
34
+ If no active work is detected and the user confirms nothing is in progress, inform them there is nothing to pause and exit.
35
+
36
+ Store the detected work type as `$WORK_TYPE` (one of: `phase`, `quick`, `generic`).
37
+ </detect_work>
38
+
39
+ <gather_state>
40
+ Build a draft checkpoint from artifact truth before asking the user to restate work. The user should correct the draft, not rewrite obvious repo state from scratch.
41
+
42
+ Ask the user conversationally to fill in the gaps the artifacts cannot answer:
43
+
44
+ 1. **What was completed** this session
45
+ 2. **Current approach** the strategy or mental model driving the work
46
+ 3. **Remaining work** — what tasks or steps are still outstanding
47
+ 4. **Key decisions** — any decisions made and their rationale
48
+ 5. **Blockers** anything stuck or waiting on external input
49
+ 6. **What to do first** when resuming
50
+ 7. **Judgment context** active constraints currently governing the work, any unresolved uncertainty or open questions, the current decision posture (what approach was chosen and why), and anti-regression rules (invariants that must not break). Pre-fill from SPEC.md constraints and APPROACH.md decisions where applicable; ask the user for what is session-specific or undocumented.
51
+
52
+ Read the relevant artifacts and current integration surface to pre-fill what you can:
53
+ - For phase work: read the PLAN file and any partial SUMMARY — use these to pre-fill remaining_work and decisions where possible; only ask the user for gaps
54
+ - For quick tasks: read the quick task PLAN and LOG.md entry — same pre-fill approach
55
+ - For generic work: derive everything you can from repo state first, then ask only for what remains unknown
56
+
57
+ Question budget:
58
+ - Ask at most 3 high-signal questions total
59
+ - Prefer confirmation/correction prompts over open-ended recap prompts
60
+ - If repo/artifact truth already answers a point, do not ask the user to repeat it
61
+ </gather_state>
62
+
63
+ <write_checkpoint>
60
64
  Before writing the new checkpoint, run `node .planning/bin/gsdd.mjs file-op delete .planning/.continue-here.bak --missing ok` to clear the prior session backup. This is cleanup-only and should no-op safely if the backup is absent.
61
-
62
- When the current branch/worktree is known to be evidence-only, stale/spent, or otherwise not the next intended execution surface, say that explicitly in `<current_state>`, `<remaining_work>`, and `<anti_regression>`. Do not flatten evidence-only local state into the same continuity story as the next execution surface.
63
-
64
- Write `.planning/.continue-here.md` with the following structure:
65
-
66
- ```markdown
67
- ---
68
- workflow: $WORK_TYPE
69
- phase: $PHASE_NAME_OR_NULL
70
- timestamp: $ISO_8601_TIMESTAMP
71
- runtime: $INFERRED_RUNTIME
72
- ---
73
-
74
- <current_state>
75
- [Where exactly are we? Phase, task, what's in progress]
76
- </current_state>
77
-
78
- <completed_work>
79
- [What got done — tasks completed, files changed, decisions implemented]
80
- </completed_work>
81
-
82
- <remaining_work>
83
- [What's left — remaining tasks, known next steps]
84
- </remaining_work>
85
-
86
- <decisions>
87
- [Key decisions made and their rationale]
88
- </decisions>
89
-
90
- <blockers>
91
- [Anything stuck, waiting on external input, or needing human review]
92
- </blockers>
93
-
94
- <next_action>
95
- [The specific first thing to do when resuming — concrete enough for a fresh session to act on immediately]
96
- </next_action>
97
-
98
- <judgment>
99
- <active_constraints>
100
- [Constraints currently governing the work — from SPEC.md, APPROACH.md, or discovered during execution. Include constraint source.]
101
- </active_constraints>
102
- <unresolved_uncertainty>
103
- [Open questions, unvalidated assumptions, areas where the approach may need revision. Include why each matters.]
104
- </unresolved_uncertainty>
105
- <decision_posture>
106
- [Current strategic direction — what approach was chosen, what alternatives were rejected, what the governing trade-off is.]
107
- </decision_posture>
108
- <anti_regression>
109
- [Rules that must hold — invariants, previously-verified behaviors that must not break, scope boundaries that must not expand.]
110
- </anti_regression>
111
- </judgment>
112
- ```
113
-
114
- The checkpoint is project-scoped (lives at `.planning/.continue-here.md`, not inside a phase directory) so resume always knows where to look.
115
- </write_checkpoint>
116
-
117
- **MANDATORY: `.planning/.continue-here.md` must exist on disk after writing. If the file was not created, STOP and report the failure. The entire purpose of this workflow is to persist context — a failed write means the pause did nothing.**
118
-
119
- <advisory_git>
120
- Read `.planning/config.json` for the `gitProtocol` section. If config.json cannot be read, skip git advice.
121
-
122
- Suggest a WIP commit following the project's git conventions. Do not mandate it — the user decides whether and how to commit.
123
-
124
- Example suggestion: "You may want to commit your current changes as a WIP before ending this session."
125
- </advisory_git>
126
-
127
- <confirm>
128
- Report to the user:
129
- - Checkpoint location: `.planning/.continue-here.md`
130
- - Work type captured (phase/quick/generic)
131
- - How to resume: run the `/gsdd-resume` workflow in the next session
132
- </confirm>
133
-
134
- </process>
135
-
136
- <success_criteria>
137
- - [ ] Active work context detected (phase, quick, or generic)
138
- - [ ] User provided missing context via conversation
139
- - [ ] `.planning/.continue-here.md` created with frontmatter, all 6 sections, and <judgment> block
140
- - [ ] Advisory git suggestion presented (not mandated)
141
- - [ ] User informed of checkpoint location and resume instructions
142
- </success_criteria>
143
-
144
- <completion>
145
- Report to the user what was accomplished, then present the next step:
146
-
147
- ---
148
- **Completed:** Session paused — created `.planning/.continue-here.md` (checkpoint file).
149
-
150
- **Next step (next session):** `/gsdd-resume` — restore context and continue where you left off
151
-
152
- Also available:
153
- - `/gsdd-progress` — check project status without restoring checkpoint context
154
-
155
- Consider clearing context before starting the next workflow for best results.
156
- ---
157
- </completion>
65
+
66
+ When the current branch/worktree is known to be evidence-only, stale/spent, or otherwise not the next intended execution surface, say that explicitly in `<current_state>`, `<remaining_work>`, and `<anti_regression>`. Do not flatten evidence-only local state into the same continuity story as the next execution surface.
67
+
68
+ Write `.planning/.continue-here.md` with the following structure:
69
+
70
+ ```markdown
71
+ ---
72
+ workflow: $WORK_TYPE
73
+ phase: $PHASE_NAME_OR_NULL
74
+ timestamp: $ISO_8601_TIMESTAMP
75
+ runtime: $INFERRED_RUNTIME
76
+ ---
77
+
78
+ <current_state>
79
+ [Where exactly are we? Phase, task, what's in progress]
80
+ </current_state>
81
+
82
+ <completed_work>
83
+ [What got done — tasks completed, files changed, decisions implemented]
84
+ </completed_work>
85
+
86
+ <remaining_work>
87
+ [What's left — remaining tasks, known next steps]
88
+ </remaining_work>
89
+
90
+ <decisions>
91
+ [Key decisions made and their rationale]
92
+ </decisions>
93
+
94
+ <blockers>
95
+ [Anything stuck, waiting on external input, or needing human review]
96
+ </blockers>
97
+
98
+ <next_action>
99
+ [The specific first thing to do when resuming — concrete enough for a fresh session to act on immediately]
100
+ </next_action>
101
+
102
+ <judgment>
103
+ <active_constraints>
104
+ [Constraints currently governing the work — from SPEC.md, APPROACH.md, or discovered during execution. Include constraint source.]
105
+ </active_constraints>
106
+ <unresolved_uncertainty>
107
+ [Open questions, unvalidated assumptions, areas where the approach may need revision. Include why each matters.]
108
+ </unresolved_uncertainty>
109
+ <decision_posture>
110
+ [Current strategic direction — what approach was chosen, what alternatives were rejected, what the governing trade-off is.]
111
+ </decision_posture>
112
+ <anti_regression>
113
+ [Rules that must hold — invariants, previously-verified behaviors that must not break, scope boundaries that must not expand.]
114
+ </anti_regression>
115
+ </judgment>
116
+ ```
117
+
118
+ The checkpoint is project-scoped (lives at `.planning/.continue-here.md`, not inside a phase directory) so resume always knows where to look.
119
+ </write_checkpoint>
120
+
121
+ **MANDATORY: `.planning/.continue-here.md` must exist on disk after writing. If the file was not created, STOP and report the failure. The entire purpose of this workflow is to persist context — a failed write means the pause did nothing.**
122
+
123
+ <advisory_git>
124
+ Read `.planning/config.json` for the `gitProtocol` section. If config.json cannot be read, skip git advice.
125
+
126
+ Suggest a WIP commit following the project's git conventions. Do not mandate it — the user decides whether and how to commit.
127
+
128
+ Example suggestion: "You may want to commit your current changes as a WIP before ending this session."
129
+ </advisory_git>
130
+
131
+ <confirm>
132
+ Report to the user:
133
+ - Checkpoint location: `.planning/.continue-here.md`
134
+ - Work type captured (phase/quick/generic)
135
+ - How to resume: run the `/gsdd-resume` workflow in the next session
136
+ </confirm>
137
+
138
+ </process>
139
+
140
+ <success_criteria>
141
+ - [ ] Active work context detected (phase, quick, or generic)
142
+ - [ ] User provided missing context via conversation
143
+ - [ ] `.planning/.continue-here.md` created with frontmatter, all 6 sections, and <judgment> block
144
+ - [ ] Advisory git suggestion presented (not mandated)
145
+ - [ ] User informed of checkpoint location and resume instructions
146
+ </success_criteria>
147
+
148
+ <completion>
149
+ Report to the user what was accomplished, then present the next step:
150
+
151
+ ---
152
+ **Completed:** Session paused — created `.planning/.continue-here.md` (checkpoint file).
153
+
154
+ **Next step (next session):** `/gsdd-resume` — restore context and continue where you left off
155
+
156
+ Also available:
157
+ - `/gsdd-progress` — check project status without restoring checkpoint context
158
+
159
+ Consider clearing context before starting the next workflow for best results.
160
+ ---
161
+ </completion>