gsdd-cli 0.3.1 → 0.16.1
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.
- package/README.md +44 -29
- package/agents/DISTILLATION.md +15 -13
- package/agents/planner.md +2 -0
- package/bin/adapters/agents.mjs +1 -0
- package/bin/adapters/claude.mjs +12 -3
- package/bin/adapters/codex.mjs +4 -0
- package/bin/adapters/opencode.mjs +13 -4
- package/bin/gsdd.mjs +20 -5
- package/bin/lib/cli-utils.mjs +1 -1
- package/bin/lib/file-ops.mjs +161 -0
- package/bin/lib/health-truth.mjs +188 -0
- package/bin/lib/health.mjs +65 -12
- package/bin/lib/init-flow.mjs +50 -3
- package/bin/lib/init-prompts.mjs +22 -83
- package/bin/lib/init-runtime.mjs +9 -7
- package/bin/lib/init.mjs +5 -1
- package/bin/lib/models.mjs +19 -4
- package/bin/lib/phase.mjs +100 -14
- package/bin/lib/plan-constants.mjs +30 -0
- package/bin/lib/provenance.mjs +146 -0
- package/bin/lib/templates.mjs +17 -0
- package/distilled/DESIGN.md +345 -47
- package/distilled/EVIDENCE-INDEX.md +297 -0
- package/distilled/README.md +44 -20
- package/distilled/SKILL.md +89 -85
- package/distilled/templates/agents.block.md +13 -84
- package/distilled/templates/agents.md +0 -7
- package/distilled/templates/delegates/plan-checker.md +6 -3
- package/distilled/workflows/audit-milestone.md +6 -6
- package/distilled/workflows/complete-milestone.md +297 -0
- package/distilled/workflows/execute.md +188 -19
- package/distilled/workflows/map-codebase.md +5 -3
- package/distilled/workflows/new-milestone.md +249 -0
- package/distilled/workflows/new-project.md +5 -6
- package/distilled/workflows/pause.md +40 -6
- package/distilled/workflows/plan-milestone-gaps.md +183 -0
- package/distilled/workflows/plan.md +75 -11
- package/distilled/workflows/progress.md +42 -19
- package/distilled/workflows/quick.md +14 -10
- package/distilled/workflows/resume.md +121 -11
- package/distilled/workflows/verify-work.md +260 -0
- package/distilled/workflows/verify.md +124 -33
- package/package.json +7 -5
|
@@ -12,6 +12,12 @@ Scope boundary: you write a checkpoint file. You do not route, present status, o
|
|
|
12
12
|
If `.planning/` does not exist, stop and tell the user to run `gsdd init` first.
|
|
13
13
|
</prerequisites>
|
|
14
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
|
+
|
|
15
21
|
<process>
|
|
16
22
|
|
|
17
23
|
<detect_work>
|
|
@@ -27,6 +33,8 @@ Store the detected work type as `$WORK_TYPE` (one of: `phase`, `quick`, `generic
|
|
|
27
33
|
</detect_work>
|
|
28
34
|
|
|
29
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
|
+
|
|
30
38
|
Ask the user conversationally to fill in the gaps the artifacts cannot answer:
|
|
31
39
|
|
|
32
40
|
1. **What was completed** this session
|
|
@@ -35,14 +43,24 @@ Ask the user conversationally to fill in the gaps the artifacts cannot answer:
|
|
|
35
43
|
4. **Key decisions** — any decisions made and their rationale
|
|
36
44
|
5. **Blockers** — anything stuck or waiting on external input
|
|
37
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.
|
|
38
47
|
|
|
39
|
-
Read the relevant artifacts to pre-fill what you can:
|
|
48
|
+
Read the relevant artifacts and current integration surface to pre-fill what you can:
|
|
40
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
|
|
41
50
|
- For quick tasks: read the quick task PLAN and LOG.md entry — same pre-fill approach
|
|
42
|
-
- For generic work:
|
|
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
|
|
43
57
|
</gather_state>
|
|
44
58
|
|
|
45
59
|
<write_checkpoint>
|
|
60
|
+
Before writing the new checkpoint, run `gsdd 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
|
+
|
|
46
64
|
Write `.planning/.continue-here.md` with the following structure:
|
|
47
65
|
|
|
48
66
|
```markdown
|
|
@@ -50,6 +68,7 @@ Write `.planning/.continue-here.md` with the following structure:
|
|
|
50
68
|
workflow: $WORK_TYPE
|
|
51
69
|
phase: $PHASE_NAME_OR_NULL
|
|
52
70
|
timestamp: $ISO_8601_TIMESTAMP
|
|
71
|
+
runtime: $INFERRED_RUNTIME
|
|
53
72
|
---
|
|
54
73
|
|
|
55
74
|
<current_state>
|
|
@@ -75,6 +94,21 @@ timestamp: $ISO_8601_TIMESTAMP
|
|
|
75
94
|
<next_action>
|
|
76
95
|
[The specific first thing to do when resuming — concrete enough for a fresh session to act on immediately]
|
|
77
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>
|
|
78
112
|
```
|
|
79
113
|
|
|
80
114
|
The checkpoint is project-scoped (lives at `.planning/.continue-here.md`, not inside a phase directory) so resume always knows where to look.
|
|
@@ -94,7 +128,7 @@ Example suggestion: "You may want to commit your current changes as a WIP before
|
|
|
94
128
|
Report to the user:
|
|
95
129
|
- Checkpoint location: `.planning/.continue-here.md`
|
|
96
130
|
- Work type captured (phase/quick/generic)
|
|
97
|
-
- How to resume: run the `/gsdd
|
|
131
|
+
- How to resume: run the `/gsdd-resume` workflow in the next session
|
|
98
132
|
</confirm>
|
|
99
133
|
|
|
100
134
|
</process>
|
|
@@ -102,7 +136,7 @@ Report to the user:
|
|
|
102
136
|
<success_criteria>
|
|
103
137
|
- [ ] Active work context detected (phase, quick, or generic)
|
|
104
138
|
- [ ] User provided missing context via conversation
|
|
105
|
-
- [ ] `.planning/.continue-here.md` created with frontmatter
|
|
139
|
+
- [ ] `.planning/.continue-here.md` created with frontmatter, all 6 sections, and <judgment> block
|
|
106
140
|
- [ ] Advisory git suggestion presented (not mandated)
|
|
107
141
|
- [ ] User informed of checkpoint location and resume instructions
|
|
108
142
|
</success_criteria>
|
|
@@ -113,10 +147,10 @@ Report to the user what was accomplished, then present the next step:
|
|
|
113
147
|
---
|
|
114
148
|
**Completed:** Session paused — created `.planning/.continue-here.md` (checkpoint file).
|
|
115
149
|
|
|
116
|
-
**Next step (next session):** `/gsdd
|
|
150
|
+
**Next step (next session):** `/gsdd-resume` — restore context and continue where you left off
|
|
117
151
|
|
|
118
152
|
Also available:
|
|
119
|
-
- `/gsdd
|
|
153
|
+
- `/gsdd-progress` — check project status without restoring checkpoint context
|
|
120
154
|
|
|
121
155
|
Consider clearing context before starting the next workflow for best results.
|
|
122
156
|
---
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are the GAP CLOSURE PLANNER. Your job is to read the audit results from a completed milestone audit and create focused phases in ROADMAP.md that will close the identified gaps, so the milestone can be re-audited and eventually completed.
|
|
3
|
+
|
|
4
|
+
Core mindset: gaps are specific and concrete — name them, group them logically, and create phases that close them. Do not create vague "cleanup" phases.
|
|
5
|
+
|
|
6
|
+
Scope boundary: you create gap closure phases in ROADMAP.md. You do not plan the phases — that is `/gsdd-plan` territory. You do not close the gaps yourself.
|
|
7
|
+
</role>
|
|
8
|
+
|
|
9
|
+
<prerequisites>
|
|
10
|
+
`.planning/ROADMAP.md` must exist.
|
|
11
|
+
`.planning/SPEC.md` must exist.
|
|
12
|
+
A `.planning/v*-MILESTONE-AUDIT.md` file must exist with `status: gaps_found`.
|
|
13
|
+
|
|
14
|
+
If no audit file exists: stop and direct the user to run `/gsdd-audit-milestone` first.
|
|
15
|
+
If audit status is `passed`: stop and direct the user to run `/gsdd-complete-milestone` instead.
|
|
16
|
+
</prerequisites>
|
|
17
|
+
|
|
18
|
+
<load_context>
|
|
19
|
+
Before starting, read these files:
|
|
20
|
+
|
|
21
|
+
1. `.planning/v*-MILESTONE-AUDIT.md` (most recent) — gap details, requirement failures, integration issues, broken flows
|
|
22
|
+
2. `.planning/SPEC.md` — requirement priorities (v1/v2), requirement descriptions
|
|
23
|
+
3. `.planning/ROADMAP.md` — existing phases (to determine phase numbering continuation)
|
|
24
|
+
</load_context>
|
|
25
|
+
|
|
26
|
+
<process>
|
|
27
|
+
|
|
28
|
+
## 1. Load Audit Gaps
|
|
29
|
+
|
|
30
|
+
Parse the MILESTONE-AUDIT.md. Extract all gap objects:
|
|
31
|
+
- **Requirement gaps** — requirements marked unsatisfied with reason and missing evidence
|
|
32
|
+
- **Integration gaps** — cross-phase wiring failures (e.g., module A exports not consumed by module B)
|
|
33
|
+
- **Flow gaps** — E2E user flows broken at specific steps
|
|
34
|
+
|
|
35
|
+
For each gap, note:
|
|
36
|
+
- Gap type (requirement / integration / flow)
|
|
37
|
+
- Priority: derive from SPEC.md (`v1` requirement = must close, `v2` = optional)
|
|
38
|
+
- What is missing or broken
|
|
39
|
+
|
|
40
|
+
If no gaps are found after parsing, stop and direct the user to `/gsdd-complete-milestone`.
|
|
41
|
+
|
|
42
|
+
## 2. Prioritize Gaps
|
|
43
|
+
|
|
44
|
+
Sort gaps into two buckets:
|
|
45
|
+
|
|
46
|
+
**Must close** (v1 requirements, or integration/flow gaps affecting v1 requirements):
|
|
47
|
+
- These must become phases. The milestone cannot complete until they are resolved.
|
|
48
|
+
|
|
49
|
+
**Optional** (v2 requirements, low-severity integration gaps):
|
|
50
|
+
- Present to user: include in this milestone or defer?
|
|
51
|
+
|
|
52
|
+
Present the gap summary:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
## Gap Analysis
|
|
56
|
+
|
|
57
|
+
Must close ([N] gaps):
|
|
58
|
+
- [REQ-ID]: [description] — [reason it failed]
|
|
59
|
+
- Integration [Phase X → Phase Y]: [what is missing]
|
|
60
|
+
- Flow "[flow name]": broken at [step]
|
|
61
|
+
|
|
62
|
+
Optional ([M] gaps):
|
|
63
|
+
- [REQ-ID]: [description] (v2 priority)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**STOP. Ask the user which optional gaps to include.**
|
|
67
|
+
|
|
68
|
+
Exception: if `config.json -> mode` is `yolo`, include all must-close gaps and skip optional gaps.
|
|
69
|
+
|
|
70
|
+
## 3. Group Gaps into Phases
|
|
71
|
+
|
|
72
|
+
Cluster the selected gaps into logical phases using these rules:
|
|
73
|
+
- Same affected phase or subsystem → combine into one gap closure phase
|
|
74
|
+
- Dependency order: fix broken foundations before wiring dependents
|
|
75
|
+
- Keep phases focused: 2-4 tasks each
|
|
76
|
+
- Name phases after what they fix, not just "Gap Closure"
|
|
77
|
+
|
|
78
|
+
**Example grouping:**
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Gaps:
|
|
82
|
+
- AUTH-03 unsatisfied (password reset flow missing)
|
|
83
|
+
- Integration: Session → Dashboard (auth header not passed)
|
|
84
|
+
- Flow "Reset password" broken at email dispatch
|
|
85
|
+
|
|
86
|
+
→ Phase N: "Auth Reset Flow"
|
|
87
|
+
- Implement password reset email dispatch
|
|
88
|
+
- Wire session auth header to dashboard API calls
|
|
89
|
+
- Test reset flow end-to-end
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 4. Determine Phase Numbers
|
|
93
|
+
|
|
94
|
+
Find the highest existing phase number in ROADMAP.md. New gap closure phases continue from there.
|
|
95
|
+
|
|
96
|
+
Example: if ROADMAP.md has Phases 1–5, gap closure phases start at Phase 6.
|
|
97
|
+
|
|
98
|
+
## 5. Present Gap Closure Plan
|
|
99
|
+
|
|
100
|
+
Present the proposed gap closure phases for confirmation:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
## Gap Closure Plan
|
|
104
|
+
|
|
105
|
+
Milestone: v[X.Y]
|
|
106
|
+
Gaps to close: [N] requirement, [M] integration, [K] flow
|
|
107
|
+
|
|
108
|
+
**Phase [N]: [Name]**
|
|
109
|
+
Closes:
|
|
110
|
+
- [REQ-ID]: [description]
|
|
111
|
+
- Integration: [from] → [to]
|
|
112
|
+
Estimated tasks: [2-4]
|
|
113
|
+
|
|
114
|
+
**Phase [N+1]: [Name]**
|
|
115
|
+
Closes:
|
|
116
|
+
- [REQ-ID]: [description]
|
|
117
|
+
Estimated tasks: [2-4]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**STOP. Wait for user confirmation before writing to ROADMAP.md.**
|
|
121
|
+
|
|
122
|
+
If the user requests adjustments, revise and re-present.
|
|
123
|
+
|
|
124
|
+
## 6. Add Phases to ROADMAP.md
|
|
125
|
+
|
|
126
|
+
Once confirmed, append the gap closure phases below the existing phases in ROADMAP.md:
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
### v[X.Y] Gap Closure
|
|
130
|
+
|
|
131
|
+
- [ ] **Phase [N]: [Name]** — [goal]
|
|
132
|
+
- [ ] **Phase [N+1]: [Name]** — [goal]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If the current ROADMAP.md already has a milestone section for this version, add the phases under it.
|
|
136
|
+
|
|
137
|
+
## 7. Create Phase Directories
|
|
138
|
+
|
|
139
|
+
Create a directory for each gap closure phase:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
.planning/phases/[NN]-[phase-name-kebab]/
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
No files inside — `/gsdd-plan` populates them.
|
|
146
|
+
|
|
147
|
+
</process>
|
|
148
|
+
|
|
149
|
+
<success_criteria>
|
|
150
|
+
- [ ] MILESTONE-AUDIT.md loaded and all gaps parsed
|
|
151
|
+
- [ ] Gaps categorized by type (requirement / integration / flow) and priority (must / optional)
|
|
152
|
+
- [ ] User confirmed which optional gaps to include
|
|
153
|
+
- [ ] Gaps grouped into logical phases with clear goals
|
|
154
|
+
- [ ] Phase numbering continues from highest existing phase
|
|
155
|
+
- [ ] User confirmed gap closure plan before ROADMAP.md was updated
|
|
156
|
+
- [ ] ROADMAP.md updated with new gap closure phases
|
|
157
|
+
- [ ] Phase directories created
|
|
158
|
+
</success_criteria>
|
|
159
|
+
|
|
160
|
+
**MANDATORY: `.planning/ROADMAP.md` must be updated on disk before this workflow is complete. If the write fails, STOP and report the failure. Without the updated ROADMAP, the phase cycle cannot begin.**
|
|
161
|
+
|
|
162
|
+
<completion>
|
|
163
|
+
Report to the user what was created, then present the next step:
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
**Completed:** Gap closure plan created.
|
|
167
|
+
|
|
168
|
+
Created:
|
|
169
|
+
- [N] gap closure phases in `ROADMAP.md` (Phases [start]–[end])
|
|
170
|
+
- Phase directories in `.planning/phases/`
|
|
171
|
+
|
|
172
|
+
Gaps addressed:
|
|
173
|
+
- [brief summary of what the phases close]
|
|
174
|
+
|
|
175
|
+
**Next step:** `/gsdd-plan [N]` — plan Phase [N]: [phase name]
|
|
176
|
+
|
|
177
|
+
After all gap closure phases complete:
|
|
178
|
+
- `/gsdd-audit-milestone` — re-audit to verify gaps are closed
|
|
179
|
+
- `/gsdd-complete-milestone` — archive when audit passes
|
|
180
|
+
|
|
181
|
+
Consider clearing context before starting the next workflow for best results.
|
|
182
|
+
---
|
|
183
|
+
</completion>
|
|
@@ -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
|
|
@@ -443,11 +507,11 @@ Report to the user what was accomplished, then present the next step:
|
|
|
443
507
|
---
|
|
444
508
|
**Completed:** Phase planning — created `.planning/phases/{phase_dir}/{plan_id}-PLAN.md`.
|
|
445
509
|
|
|
446
|
-
**Next step:** `/gsdd
|
|
510
|
+
**Next step:** `/gsdd-execute` — execute the plan
|
|
447
511
|
|
|
448
512
|
Also available:
|
|
449
|
-
- `/gsdd
|
|
450
|
-
- `/gsdd
|
|
513
|
+
- `/gsdd-plan` — create additional plans for the same phase (if multi-wave)
|
|
514
|
+
- `/gsdd-progress` — check overall project status
|
|
451
515
|
|
|
452
516
|
Consider clearing context before starting the next workflow for best results.
|
|
453
517
|
---
|
|
@@ -18,7 +18,7 @@ This is a read-only workflow. No files are created, modified, or deleted. If `.p
|
|
|
18
18
|
Check for project artifacts in order:
|
|
19
19
|
|
|
20
20
|
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
|
|
21
|
+
2. **No `.planning/ROADMAP.md` AND no `.planning/SPEC.md`** — project has no artifacts. Suggest running the `/gsdd-new-project` workflow. Stop.
|
|
22
22
|
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
23
|
4. **Both exist** — proceed to derive status.
|
|
24
24
|
</check_existence>
|
|
@@ -51,6 +51,14 @@ Scan `.planning/phases/` for:
|
|
|
51
51
|
|
|
52
52
|
**Quick task log:**
|
|
53
53
|
If `.planning/quick/LOG.md` exists, check the last entry for a non-terminal status.
|
|
54
|
+
|
|
55
|
+
<unmerged_commits_check>
|
|
56
|
+
Run `git log main..HEAD --oneline` to detect commits on the current branch that have not been merged to `main`.
|
|
57
|
+
|
|
58
|
+
- If the command exits non-zero or `main` does not exist, skip silently — do not surface an error or any output.
|
|
59
|
+
- If the output is empty, record nothing — the silent path; no status line is added.
|
|
60
|
+
- If the output is non-empty, record the commit lines and count them. This will be surfaced in the status block.
|
|
61
|
+
</unmerged_commits_check>
|
|
54
62
|
</derive_status>
|
|
55
63
|
|
|
56
64
|
<recent_work>
|
|
@@ -78,7 +86,7 @@ Recent Work:
|
|
|
78
86
|
- Phase [Y]: [one-liner from SUMMARY.md]
|
|
79
87
|
|
|
80
88
|
[If .continue-here.md exists:]
|
|
81
|
-
Checkpoint: paused work found — run /gsdd
|
|
89
|
+
Checkpoint: paused work found — run /gsdd-resume to restore context
|
|
82
90
|
|
|
83
91
|
[If PLAN without SUMMARY found:]
|
|
84
92
|
Incomplete execution: Phase [N] has PLAN but no SUMMARY
|
|
@@ -89,6 +97,11 @@ Unverified: Phase [N] has SUMMARY but no VERIFICATION
|
|
|
89
97
|
[If incomplete quick task found:]
|
|
90
98
|
Incomplete quick task: [description]
|
|
91
99
|
|
|
100
|
+
[If unmerged commits found (git log main..HEAD --oneline returned output):]
|
|
101
|
+
Unmerged commits: [N] commit(s) on this branch not yet merged to main
|
|
102
|
+
→ Merge or push this branch before closing the milestone, or verify
|
|
103
|
+
these commits are intentional working-branch state.
|
|
104
|
+
|
|
92
105
|
[If all phases [x]:]
|
|
93
106
|
All phases complete — ready for milestone audit
|
|
94
107
|
```
|
|
@@ -107,8 +120,8 @@ Recent Work:
|
|
|
107
120
|
Incomplete execution: Phase 3 has PLAN but no SUMMARY
|
|
108
121
|
|
|
109
122
|
Suggested next action:
|
|
110
|
-
Run /gsdd
|
|
111
|
-
Also available: /gsdd
|
|
123
|
+
Run /gsdd-execute to continue Phase 3 execution
|
|
124
|
+
Also available: /gsdd-plan (re-plan), /gsdd-progress (refresh status)
|
|
112
125
|
```
|
|
113
126
|
|
|
114
127
|
No ASCII art, no progress bars. Keep it scannable.
|
|
@@ -122,8 +135,8 @@ Condition: `.continue-here.md` exists.
|
|
|
122
135
|
|
|
123
136
|
```
|
|
124
137
|
Suggested next action:
|
|
125
|
-
Run /gsdd
|
|
126
|
-
Also available: /gsdd
|
|
138
|
+
Run /gsdd-resume to restore paused session context
|
|
139
|
+
Also available: /gsdd-execute (ignore checkpoint, continue current phase), /gsdd-progress (refresh)
|
|
127
140
|
```
|
|
128
141
|
|
|
129
142
|
**Branch B: Execute (PLAN without SUMMARY in current phase)**
|
|
@@ -131,8 +144,8 @@ Condition: Current phase has a PLAN file but no matching SUMMARY.
|
|
|
131
144
|
|
|
132
145
|
```
|
|
133
146
|
Suggested next action:
|
|
134
|
-
Run /gsdd
|
|
135
|
-
Also available: /gsdd
|
|
147
|
+
Run /gsdd-execute to continue Phase [N] execution
|
|
148
|
+
Also available: /gsdd-plan (re-plan current phase), /gsdd-verify (if prior phase needs verification)
|
|
136
149
|
```
|
|
137
150
|
|
|
138
151
|
**Branch C: Plan (no PLAN for current phase)**
|
|
@@ -140,8 +153,8 @@ Condition: Current phase has no PLAN files.
|
|
|
140
153
|
|
|
141
154
|
```
|
|
142
155
|
Suggested next action:
|
|
143
|
-
Run /gsdd
|
|
144
|
-
Also available: /gsdd
|
|
156
|
+
Run /gsdd-plan to create a plan for Phase [N]: [phase name]
|
|
157
|
+
Also available: /gsdd-quick (sub-hour task outside phases), /gsdd-map-codebase (refresh codebase maps)
|
|
145
158
|
```
|
|
146
159
|
|
|
147
160
|
**Branch D: Verify (SUMMARY without VERIFICATION)**
|
|
@@ -149,8 +162,8 @@ Condition: Current phase has SUMMARY but no VERIFICATION file (verifier enabled)
|
|
|
149
162
|
|
|
150
163
|
```
|
|
151
164
|
Suggested next action:
|
|
152
|
-
Run /gsdd
|
|
153
|
-
Also available: /gsdd
|
|
165
|
+
Run /gsdd-verify to validate Phase [N]
|
|
166
|
+
Also available: /gsdd-execute (continue to next phase), /gsdd-plan (plan next phase)
|
|
154
167
|
```
|
|
155
168
|
|
|
156
169
|
**Branch E: Audit milestone (all phases [x])**
|
|
@@ -158,17 +171,26 @@ Condition: All phases in ROADMAP.md are marked `[x]`.
|
|
|
158
171
|
|
|
159
172
|
```
|
|
160
173
|
Suggested next action:
|
|
161
|
-
Run /gsdd
|
|
162
|
-
Also available: /gsdd
|
|
174
|
+
Run /gsdd-audit-milestone to audit the completed milestone
|
|
175
|
+
Also available: /gsdd-verify (re-verify a specific phase), /gsdd-quick (sub-hour task)
|
|
163
176
|
```
|
|
164
177
|
|
|
165
178
|
**Branch F: Between milestones (SPEC.md exists, ROADMAP.md absent)**
|
|
166
179
|
Condition: `.planning/SPEC.md` exists but `.planning/ROADMAP.md` does not — a milestone was completed and archived.
|
|
167
180
|
|
|
181
|
+
Check `.planning/MILESTONES.md`:
|
|
182
|
+
- If MILESTONES.md exists and has at least one milestone entry → this is a subsequent milestone
|
|
183
|
+
- If MILESTONES.md does not exist or is empty → this is the first milestone setup
|
|
184
|
+
|
|
168
185
|
```
|
|
169
|
-
Suggested next action:
|
|
170
|
-
Run /gsdd
|
|
171
|
-
Also available: /gsdd
|
|
186
|
+
Suggested next action (subsequent milestone):
|
|
187
|
+
Run /gsdd-new-milestone to start the next milestone cycle (gather goals, define requirements, create ROADMAP.md)
|
|
188
|
+
Also available: /gsdd-progress (refresh after milestone setup)
|
|
189
|
+
|
|
190
|
+
Suggested next action (incomplete milestone state — SPEC.md exists but no milestone archived yet):
|
|
191
|
+
Inspect .planning/ manually — a milestone is likely still in progress.
|
|
192
|
+
If a ROADMAP.md was deleted prematurely, re-run /gsdd-new-milestone to restore it.
|
|
193
|
+
Do NOT run /gsdd-new-project — SPEC.md already exists and re-running would overwrite it.
|
|
172
194
|
```
|
|
173
195
|
|
|
174
196
|
If none of the above conditions match, report that the project is in a clean state with no obvious next action.
|
|
@@ -178,7 +200,7 @@ If none of the above conditions match, report that the project is in a clean sta
|
|
|
178
200
|
Handle compound states:
|
|
179
201
|
|
|
180
202
|
- **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
|
|
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.
|
|
182
204
|
- **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
205
|
- **No matching condition:** If the project state does not match any branch, report it clearly and suggest the user inspect `.planning/` manually.
|
|
184
206
|
</edge_cases>
|
|
@@ -193,7 +215,8 @@ Handle compound states:
|
|
|
193
215
|
- [ ] Routing suggestion is specific (includes phase number and branch-specific output block)
|
|
194
216
|
- [ ] Named branch output format used with "Also available" alternatives
|
|
195
217
|
- [ ] No files created, modified, or deleted (read-only workflow)
|
|
196
|
-
- [ ] All workflow references use portable `/gsdd
|
|
218
|
+
- [ ] All workflow references use portable `/gsdd-*` command format
|
|
197
219
|
- [ ] No interactive menus, no numbered option lists, no waiting for user selection
|
|
198
220
|
- [ ] Edge cases handled for compound states
|
|
221
|
+
- [ ] Unmerged-commit warning only appears when `git log main..HEAD --oneline` returns output; silent when empty
|
|
199
222
|
</success_criteria>
|