gsdd-cli 0.26.0 → 0.28.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.
- package/README.md +55 -23
- package/agents/DISTILLATION.md +2 -2
- package/agents/README.md +4 -4
- package/agents/approach-explorer.md +4 -4
- package/agents/executor.md +14 -14
- package/agents/integration-checker.md +2 -2
- package/agents/researcher.md +2 -2
- package/agents/roadmapper.md +6 -6
- package/agents/synthesizer.md +18 -18
- package/agents/verifier.md +2 -2
- package/bin/adapters/agents.mjs +3 -3
- package/bin/adapters/claude.mjs +16 -14
- package/bin/adapters/opencode.mjs +15 -12
- package/bin/gsdd.mjs +16 -13
- package/bin/lib/{models.mjs → config.mjs} +23 -16
- package/bin/lib/control-map.mjs +17 -488
- package/bin/lib/global-install.mjs +16 -3
- package/bin/lib/health-truth.mjs +8 -13
- package/bin/lib/health.mjs +25 -39
- package/bin/lib/init-flow.mjs +44 -38
- package/bin/lib/init-prompts.mjs +3 -3
- package/bin/lib/init-runtime.mjs +17 -33
- package/bin/lib/lifecycle-preflight.mjs +297 -404
- package/bin/lib/lifecycle-state.mjs +2 -1
- package/bin/lib/next.mjs +243 -20
- package/bin/lib/phase.mjs +10 -315
- package/bin/lib/rendering.mjs +64 -44
- package/bin/lib/runtime-freshness.mjs +18 -15
- package/bin/lib/state-dir.mjs +45 -0
- package/bin/lib/templates.mjs +59 -22
- package/bin/lib/work-context.mjs +12 -1
- package/bin/lib/workflows.mjs +0 -1
- package/bin/lib/workspace-root.mjs +11 -6
- package/distilled/DESIGN.md +58 -2
- package/distilled/EVIDENCE-INDEX.md +15 -2
- package/distilled/README.md +23 -33
- package/distilled/SKILL.md +9 -10
- package/distilled/templates/agents.block.md +5 -5
- package/distilled/templates/approach.md +3 -3
- package/distilled/templates/auth-matrix.md +2 -2
- package/distilled/templates/brownfield-change/CHANGE.md +1 -1
- package/distilled/templates/delegates/approach-explorer.md +5 -5
- package/distilled/templates/delegates/mapper-arch.md +3 -3
- package/distilled/templates/delegates/mapper-concerns.md +4 -4
- package/distilled/templates/delegates/mapper-quality.md +3 -3
- package/distilled/templates/delegates/mapper-tech.md +3 -3
- package/distilled/templates/delegates/plan-checker.md +5 -5
- package/distilled/templates/delegates/researcher-architecture.md +3 -3
- package/distilled/templates/delegates/researcher-features.md +3 -3
- package/distilled/templates/delegates/researcher-pitfalls.md +3 -3
- package/distilled/templates/delegates/researcher-stack.md +3 -3
- package/distilled/templates/delegates/researcher-synthesizer.md +7 -7
- package/distilled/templates/research/architecture.md +1 -1
- package/distilled/templates/research/pitfalls.md +1 -1
- package/distilled/templates/research/stack.md +1 -1
- package/distilled/templates/roadmap.md +4 -4
- package/distilled/templates/spec.md +2 -2
- package/distilled/workflows/audit-milestone.md +22 -22
- package/distilled/workflows/complete-milestone.md +35 -35
- package/distilled/workflows/execute.md +29 -29
- package/distilled/workflows/map-codebase.md +30 -30
- package/distilled/workflows/new-milestone.md +18 -18
- package/distilled/workflows/new-project.md +45 -45
- package/distilled/workflows/pause.md +15 -15
- package/distilled/workflows/plan.md +63 -63
- package/distilled/workflows/progress.md +40 -39
- package/distilled/workflows/quick.md +43 -43
- package/distilled/workflows/resume.md +23 -22
- package/distilled/workflows/verify-work.md +7 -7
- package/distilled/workflows/verify.md +20 -20
- package/docs/BROWNFIELD-PROOF.md +1 -1
- package/docs/RUNTIME-SUPPORT.md +16 -16
- package/docs/USER-GUIDE.md +21 -21
- package/docs/claude/context-monitor.md +1 -1
- package/docs/proof/consumer-node-cli/README.md +1 -1
- package/package.json +3 -3
- package/bin/lib/closeout-report.mjs +0 -318
- package/bin/lib/evidence-contract.mjs +0 -325
- package/bin/lib/provenance.mjs +0 -390
- package/bin/lib/session-fingerprint.mjs +0 -223
- package/bin/lib/ui-proof.mjs +0 -1007
- package/distilled/workflows/plan-milestone-gaps.md +0 -204
|
@@ -7,17 +7,17 @@ Scope boundary: you write a checkpoint file. You do not route, present status, o
|
|
|
7
7
|
</role>
|
|
8
8
|
|
|
9
9
|
<prerequisites>
|
|
10
|
-
`.
|
|
10
|
+
`.work/` must exist (from `npx -y gsdd-cli init`, or `gsdd init` when globally installed).
|
|
11
11
|
|
|
12
|
-
If `.
|
|
12
|
+
If `.work/` does not exist, stop and tell the user to run `npx -y gsdd-cli init` first.
|
|
13
13
|
</prerequisites>
|
|
14
14
|
|
|
15
15
|
<repo_root_helper_contract>
|
|
16
|
-
All `node .
|
|
16
|
+
All `node .work/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
|
|
17
17
|
</repo_root_helper_contract>
|
|
18
18
|
|
|
19
19
|
<runtime_contract>
|
|
20
|
-
Use the `Runtime` type from `.
|
|
20
|
+
Use the `Runtime` type from `.work/SPEC.md`.
|
|
21
21
|
Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
|
|
22
22
|
Checkpoints record `runtime` only — assurance does not apply to state snapshots.
|
|
23
23
|
</runtime_contract>
|
|
@@ -27,8 +27,8 @@ Checkpoints record `runtime` only — assurance does not apply to state snapshot
|
|
|
27
27
|
<detect_work>
|
|
28
28
|
Scan for active work in priority order:
|
|
29
29
|
|
|
30
|
-
1. **Active phase work** — look in `.
|
|
31
|
-
2. **Active quick task** — read `.
|
|
30
|
+
1. **Active phase work** — look in `.work/phases/` for directories containing a PLAN file but no SUMMARY file (execution started but not completed).
|
|
31
|
+
2. **Active quick task** — read `.work/quick/LOG.md` if it exists. Check the last entry: if its status is not `done`/`passed`, there is an incomplete quick task.
|
|
32
32
|
3. **Generic work** — if neither of the above, ask the user what they were working on.
|
|
33
33
|
|
|
34
34
|
If no active work is detected and the user confirms nothing is in progress, inform them there is nothing to pause and exit.
|
|
@@ -39,7 +39,7 @@ Store the detected work type as `$WORK_TYPE` (one of: `phase`, `quick`, `generic
|
|
|
39
39
|
<gather_state>
|
|
40
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
41
|
|
|
42
|
-
When available, run `node .
|
|
42
|
+
When available, run `node .work/bin/gsdd.mjs control-map --json` and use it as the draft's repo/worktree snapshot: canonical branch/HEAD, dirty tracked/untracked/ignored buckets, sibling/detached worktrees, stale annotations, planning drift, and recommended interventions. Include only a compact summary or pointer in `.work/.continue-here.md`; the checkpoint records resumability context, not a replacement for future computed repo truth.
|
|
43
43
|
|
|
44
44
|
Ask the user conversationally to fill in the gaps the artifacts cannot answer:
|
|
45
45
|
|
|
@@ -63,11 +63,11 @@ Question budget:
|
|
|
63
63
|
</gather_state>
|
|
64
64
|
|
|
65
65
|
<write_checkpoint>
|
|
66
|
-
Before writing the new checkpoint, run `node .
|
|
66
|
+
Before writing the new checkpoint, run `node .work/bin/gsdd.mjs file-op delete .work/.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.
|
|
67
67
|
|
|
68
68
|
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.
|
|
69
69
|
|
|
70
|
-
Write `.
|
|
70
|
+
Write `.work/.continue-here.md` with the following structure:
|
|
71
71
|
|
|
72
72
|
```markdown
|
|
73
73
|
---
|
|
@@ -117,13 +117,13 @@ runtime: $INFERRED_RUNTIME
|
|
|
117
117
|
</judgment>
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
The checkpoint is project-scoped (lives at `.
|
|
120
|
+
The checkpoint is project-scoped (lives at `.work/.continue-here.md`, not inside a phase directory) so resume always knows where to look.
|
|
121
121
|
</write_checkpoint>
|
|
122
122
|
|
|
123
|
-
**MANDATORY: `.
|
|
123
|
+
**MANDATORY: `.work/.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.**
|
|
124
124
|
|
|
125
125
|
<advisory_git>
|
|
126
|
-
Read `.
|
|
126
|
+
Read `.work/config.json` for the `gitProtocol` section. If config.json cannot be read, skip git advice.
|
|
127
127
|
|
|
128
128
|
Suggest a WIP commit following the project's git conventions. Do not mandate it — the user decides whether and how to commit.
|
|
129
129
|
|
|
@@ -132,7 +132,7 @@ Example suggestion: "You may want to commit your current changes as a WIP before
|
|
|
132
132
|
|
|
133
133
|
<confirm>
|
|
134
134
|
Report to the user:
|
|
135
|
-
- Checkpoint location: `.
|
|
135
|
+
- Checkpoint location: `.work/.continue-here.md`
|
|
136
136
|
- Work type captured (phase/quick/generic)
|
|
137
137
|
- How to resume: run the `/gsdd-resume` workflow in the next session
|
|
138
138
|
</confirm>
|
|
@@ -142,7 +142,7 @@ Report to the user:
|
|
|
142
142
|
<success_criteria>
|
|
143
143
|
- [ ] Active work context detected (phase, quick, or generic)
|
|
144
144
|
- [ ] User provided missing context via conversation
|
|
145
|
-
- [ ] `.
|
|
145
|
+
- [ ] `.work/.continue-here.md` created with frontmatter, all 6 sections, and <judgment> block
|
|
146
146
|
- [ ] Advisory git suggestion presented (not mandated)
|
|
147
147
|
- [ ] User informed of checkpoint location and resume instructions
|
|
148
148
|
</success_criteria>
|
|
@@ -151,7 +151,7 @@ Report to the user:
|
|
|
151
151
|
Report to the user what was accomplished, then present the next step:
|
|
152
152
|
|
|
153
153
|
---
|
|
154
|
-
**Completed:** Session paused — created `.
|
|
154
|
+
**Completed:** Session paused — created `.work/.continue-here.md` (checkpoint file).
|
|
155
155
|
|
|
156
156
|
**Next step (next session):** `/gsdd-resume` — restore context and continue where you left off
|
|
157
157
|
|
|
@@ -1,62 +1,59 @@
|
|
|
1
1
|
<role>
|
|
2
2
|
You are the PLANNER. Your job is to take a phase from the roadmap and create a precise, actionable implementation plan.
|
|
3
|
-
|
|
4
3
|
You think backward from the goal: what must be true, what artifacts prove it, and what tasks create those artifacts?
|
|
5
4
|
Your plans are specific enough that an executor can follow them without guessing.
|
|
6
5
|
</role>
|
|
7
|
-
|
|
8
6
|
<load_context>
|
|
9
7
|
Before starting, read these files:
|
|
10
|
-
1. `.
|
|
11
|
-
2. `.
|
|
12
|
-
3. `.
|
|
13
|
-
4. `.
|
|
14
|
-
5. `.
|
|
15
|
-
6.
|
|
16
|
-
7.
|
|
17
|
-
8.
|
|
18
|
-
|
|
8
|
+
1. `.work/SPEC.md` - requirements, constraints, key decisions, current state
|
|
9
|
+
2. `.work/ROADMAP.md` - find the target phase, its goal, requirements, success criteria, explicit out-of-scope, and stop/replan conditions when this is phase planning
|
|
10
|
+
3. `.work/brownfield-change/CHANGE.md`, `.work/brownfield-change/HANDOFF.md`, and `.work/brownfield-change/VERIFICATION.md` - if an active bounded brownfield change exists, classify whether the user request belongs to that lane before phase preflight
|
|
11
|
+
4. `.work/research/*.md` - if research exists and is relevant to this phase or bounded change
|
|
12
|
+
5. `.work/phases/*-APPROACH.md` - approach decisions from user discussion (if exists)
|
|
13
|
+
6. `.work/phases/*-PLAN.md` - any previous plans that affect this phase
|
|
14
|
+
7. Relevant source code - if this phase or change builds on existing code, read the key files
|
|
15
|
+
8. `.work/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.
|
|
16
|
+
9. **Session-boundary fallback:** If no prior completed phase SUMMARY.md with a `<judgment>` section was found in step 8, check whether `.work/.continue-here.bak` exists. If it does, read its `<judgment>` section and honor the same four sub-sections as input context. After reading, run `node .work/bin/gsdd.mjs file-op delete .work/.continue-here.bak --missing ok` (auto-clean: the judgment has been absorbed into this session's context).
|
|
17
|
+
10. `.work/*-MILESTONE-AUDIT.md`, `.work/milestone/AUDIT.md`, `.work/evidence/manifest.json`, and recent `*-VERIFICATION.md` files - if this planning run is triggered by audit gaps, verification gaps, user-named tech debt, brownfield lane amendments, or incident docs that may require extending the roadmap.
|
|
18
|
+
|
|
19
|
+
Classify the target before preflight:
|
|
20
|
+
- If `.work/brownfield-change/CHANGE.md` exists and the requested work fits its single active goal, scope, done-when, next action, or declared write scope, select `brownfield-change`; if it no longer fits one active stream, stop and route widening through `/gsdd-new-project` or `/gsdd-new-milestone` using the brownfield artifact family as preserved input.
|
|
21
|
+
- If audit gaps, verification gaps, user-named tech debt, brownfield amendments, incident docs, or `gsdd next` state `fix_gaps` require adding new roadmap work, select `amend` as the planning target before normal phase selection.
|
|
22
|
+
- Otherwise identify the target phase: the first phase with status `[ ]` or `[-]` in `ROADMAP.md`.
|
|
19
23
|
</load_context>
|
|
20
|
-
|
|
21
24
|
<repo_root_helper_contract>
|
|
22
|
-
All `node .
|
|
25
|
+
All `node .work/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
|
|
23
26
|
</repo_root_helper_contract>
|
|
24
|
-
|
|
25
27
|
<lifecycle_preflight>
|
|
26
|
-
Before writing or rewriting
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
If the preflight result is `blocked`, STOP and report the blocker instead of inferring planning eligibility from workflow-local prose. Read-only status checks may warn, but plan creation is an owned-write lifecycle action and must not silently proceed through material planning-state drift.
|
|
28
|
+
Before writing or rewriting planning artifacts, run the preflight for the selected authority:
|
|
29
|
+
- Phase: `node .work/bin/gsdd.mjs lifecycle-preflight plan {phase_num}`; bounded brownfield: `node .work/bin/gsdd.mjs lifecycle-preflight plan brownfield-change`; amend/extend before roadmap append: `node .work/bin/gsdd.mjs lifecycle-preflight plan amend`
|
|
30
|
+
If the preflight result is `blocked`, STOP and report the blocker instead of inferring planning eligibility from workflow-local prose. Read-only status checks may warn, but plan creation is an owned-write lifecycle action and must not silently proceed through material planning-state drift. Do not run phase preflight before target classification; an unrelated active roadmap must not force a bounded brownfield/PBI change to be added to `ROADMAP.md` just to create an approval plan.
|
|
31
31
|
</lifecycle_preflight>
|
|
32
|
-
|
|
32
|
+
<amend_extend_mode>
|
|
33
|
+
Use this entry mode of `/gsdd-plan` when audit findings, verification gaps, user-named tech debt, brownfield amendments, incident docs, or `gsdd next` state `fix_gaps` need follow-up planning without a suitable existing phase. Reconcile latest `MILESTONE-AUDIT.md`, `.work/milestone/AUDIT.md`, failed verification reports, brownfield CHANGE/HANDOFF/VERIFICATION context, and incident docs; re-check every load-bearing source before using it as planning truth.
|
|
34
|
+
If an existing open phase fits, route to normal phase planning. If a new phase is needed, run `node .work/bin/gsdd.mjs lifecycle-preflight plan amend`, append the smallest closure phase to `.work/ROADMAP.md` with requirements, success criteria, out-of-scope, and stop/replan conditions, create the phase directory, then continue normal phase planning. After appending roadmap work, run `node .work/bin/gsdd.mjs next --json`; if routing contradicts the mutation, stop and report the mismatch. Do not create a new public command, mark the milestone ready, or convert vague findings into broad scope; preserve source trail, roadmap preflight, and route back to `/gsdd-audit-milestone` after closure work executes and verifies.
|
|
35
|
+
</amend_extend_mode>
|
|
33
36
|
<integration_surface_check>
|
|
34
37
|
Before planning roadmap work, inspect the live integration surface separately from checkpoint or planning artifacts:
|
|
35
|
-
- Run `node .
|
|
36
|
-
- Use its computed branch/HEAD, divergence, tracked/untracked/ignored buckets, sibling/detached worktrees, local annotations, and interventions.
|
|
38
|
+
- Run `node .work/bin/gsdd.mjs control-map --json` when available; use its branch/HEAD, divergence, dirty buckets, sibling/detached worktrees, annotations, and interventions.
|
|
37
39
|
- If the helper is unavailable, fall back to direct git/worktree inspection.
|
|
38
|
-
|
|
39
40
|
If the planning truth says "next phase is X" but the git/worktree truth says the current branch is a stale/spent or mixed-scope 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.
|
|
40
41
|
Local annotations explain operator intent but do not outrank repo truth, planning artifacts, or checkpoint reconciliation.
|
|
41
42
|
</integration_surface_check>
|
|
42
|
-
|
|
43
43
|
<runtime_contract>
|
|
44
|
-
Use the `Runtime` and `Assurance` types from `.
|
|
44
|
+
Use the `Runtime` and `Assurance` types from `.work/SPEC.md`.
|
|
45
45
|
Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
|
|
46
|
-
Assurance is ordered: `unreviewed` -> `self_checked` -> `cross_runtime_checked
|
|
47
|
-
Same-runtime helpers never count as cross-runtime evidence.
|
|
46
|
+
Assurance is ordered: `unreviewed` -> `self_checked` -> `cross_runtime_checked`; same-runtime helpers never count as cross-runtime evidence.
|
|
48
47
|
</runtime_contract>
|
|
49
|
-
|
|
50
48
|
<assurance_check>
|
|
51
49
|
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.
|
|
52
50
|
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.
|
|
53
51
|
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`.
|
|
54
52
|
If upstream runtime/assurance is missing, use `status: unknown`.
|
|
55
53
|
</assurance_check>
|
|
56
|
-
|
|
57
54
|
<context_fidelity>
|
|
58
55
|
Before planning, acknowledge what is locked:
|
|
59
|
-
- Decisions in `.
|
|
56
|
+
- Decisions in `.work/SPEC.md` "Key Decisions" - do not revisit them.
|
|
60
57
|
- Decisions in APPROACH.md "Implementation Decisions" - these are user-validated choices. Implement the chosen approaches, not alternatives. "Agent's Discretion" items give you flexibility.
|
|
61
58
|
- Patterns from previous phases - match existing conventions. Do not introduce new patterns without cause.
|
|
62
59
|
- Deferred items - items marked v2, nice-to-have, or out of scope in SPEC.md or APPROACH.md. Do not plan for them.
|
|
@@ -64,63 +61,53 @@ Before planning, acknowledge what is locked:
|
|
|
64
61
|
|
|
65
62
|
If you need to challenge a locked decision: stop, ask the developer, and document the new decision explicitly.
|
|
66
63
|
</context_fidelity>
|
|
67
|
-
|
|
68
64
|
<research_check>
|
|
69
65
|
Before planning, check whether this phase involves unfamiliar territory.
|
|
70
|
-
|
|
71
66
|
### Trigger Questions
|
|
72
67
|
Ask yourself honestly:
|
|
73
68
|
- Am I confident about the architecture pattern for this phase?
|
|
74
69
|
- Do I know which libraries or tools to use, including their current versions?
|
|
75
70
|
- Do I understand the common failure modes in this domain?
|
|
76
71
|
- Is my knowledge verified against current docs, or am I relying on memory?
|
|
77
|
-
|
|
78
72
|
If any answer is "no" or "not sure", research before planning. Do not plan with gaps.
|
|
79
|
-
|
|
80
73
|
### What To Research At Plan Time
|
|
81
74
|
At plan time, research is about the implementation approach, not the product domain:
|
|
82
75
|
- Which specific library version solves this problem?
|
|
83
76
|
- What is the correct integration pattern today?
|
|
84
77
|
- What do people consistently get wrong with this technology?
|
|
85
78
|
- What should not be hand-rolled because a well-tested library already exists?
|
|
86
|
-
|
|
87
79
|
### Output
|
|
88
|
-
Write to `.
|
|
80
|
+
Write to `.work/research/{phase_number}-RESEARCH.md` with sections:
|
|
89
81
|
- **Standard Stack** - specific libraries and versions to use
|
|
90
82
|
- **Architecture Patterns** - how to structure the implementation
|
|
91
83
|
- **Don't Hand-Roll** - problems with existing library solutions
|
|
92
84
|
- **Common Pitfalls** - verification steps must check for these
|
|
93
|
-
|
|
94
85
|
### Skip Conditions
|
|
95
86
|
- Research for this phase already exists and is still fresh
|
|
96
87
|
- The phase uses only technologies already established in previous phases
|
|
97
|
-
|
|
98
88
|
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.
|
|
99
89
|
</research_check>
|
|
100
|
-
|
|
101
90
|
<spec_quality_check>
|
|
102
91
|
### When This Runs
|
|
103
92
|
After research_check, before goal_backward_planning.
|
|
104
|
-
|
|
105
93
|
### Classify Each Phase Requirement and Success Criterion
|
|
106
94
|
For each requirement and success criterion in this phase, assign one of:
|
|
107
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.
|
|
108
96
|
- **Open**: the requirement depends on a product or UX decision that has not been made. Cannot proceed.
|
|
109
97
|
- **Ambiguous**: there are two or more reasonable interpretations of what "done" means. Cannot proceed.
|
|
110
|
-
|
|
111
98
|
Trigger questions per item:
|
|
112
99
|
- Is the Done-When criterion specific enough to write a verify command for?
|
|
113
100
|
- Does this require a product or UX decision that is absent from SPEC.md, APPROACH.md, or ROADMAP.md?
|
|
114
101
|
- Would two different developers reasonably implement this differently based only on the requirement text?
|
|
115
|
-
|
|
116
102
|
### Quality Gate
|
|
117
103
|
- If all items are **Resolved**: proceed to goal_backward_planning.
|
|
118
104
|
- 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.
|
|
119
105
|
- 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.
|
|
120
106
|
</spec_quality_check>
|
|
121
|
-
|
|
122
107
|
<phase_contract_gate>
|
|
123
|
-
Before goal_backward_planning, verify that the
|
|
108
|
+
Before goal_backward_planning, verify that the selected authority has a strong enough contract to support execution planning.
|
|
109
|
+
|
|
110
|
+
If the selected target is a roadmap phase, verify that the target phase contract in `ROADMAP.md` is strong enough to support execution planning.
|
|
124
111
|
|
|
125
112
|
The phase entry must provide all of:
|
|
126
113
|
- assigned requirement IDs
|
|
@@ -129,10 +116,19 @@ The phase entry must provide all of:
|
|
|
129
116
|
- explicit stop/replan conditions
|
|
130
117
|
|
|
131
118
|
Also verify milestone truth is not self-contradictory across the planning surfaces you loaded:
|
|
132
|
-
- the active milestone in `.
|
|
119
|
+
- the active milestone in `.work/SPEC.md` must match the active roadmap section you are planning from
|
|
133
120
|
- the target phase number/name must match across SPEC current state and ROADMAP next-step guidance when both are present
|
|
134
121
|
|
|
135
122
|
If any of these are missing or contradictory, STOP. Report the exact missing contract field or contradiction. Do not improvise a stronger phase contract from chat context alone.
|
|
123
|
+
|
|
124
|
+
If the selected target is `brownfield-change`, do not require ROADMAP phase membership, phase success criteria, phase numbering, or roadmap checkboxes. Instead verify that `.work/brownfield-change/CHANGE.md` provides:
|
|
125
|
+
- one single active goal
|
|
126
|
+
- clear in-scope and out-of-scope boundaries
|
|
127
|
+
- concrete Done When criteria
|
|
128
|
+
- a current next action
|
|
129
|
+
- a closeout path through `.work/brownfield-change/VERIFICATION.md`
|
|
130
|
+
|
|
131
|
+
Also verify that `HANDOFF.md` is judgment-only context and does not contradict the operational status, scope, or next action in `CHANGE.md`. If any brownfield contract field is missing or contradictory, STOP and repair the brownfield contract before planning.
|
|
136
132
|
</phase_contract_gate>
|
|
137
133
|
|
|
138
134
|
<ui_proof_planning>
|
|
@@ -144,9 +140,11 @@ For live rendered UI proof, plan `agent-browser` as the default runtime evidence
|
|
|
144
140
|
Plan backward from success criteria.
|
|
145
141
|
|
|
146
142
|
### Step 1: State the must-haves
|
|
147
|
-
|
|
143
|
+
For a roadmap phase, list the success criteria from `ROADMAP.md`. These are your non-negotiable targets.
|
|
148
144
|
Also list the phase out-of-scope boundaries and stop/replan conditions. These are equally contractual: execution may not silently widen past them.
|
|
149
145
|
|
|
146
|
+
For `brownfield-change`, list the Done When criteria, in-scope boundaries, out-of-scope boundaries, current next action, and closeout path from `CHANGE.md`. These replace ROADMAP phase success criteria for this lane.
|
|
147
|
+
|
|
150
148
|
### Step 2: Derive artifacts
|
|
151
149
|
For each success criterion, what concrete artifacts must exist?
|
|
152
150
|
- Files (source code, config, tests)
|
|
@@ -299,7 +297,7 @@ Split a task if:
|
|
|
299
297
|
</task_sizing>
|
|
300
298
|
|
|
301
299
|
<plan_structure>
|
|
302
|
-
Create `.
|
|
300
|
+
Create `.work/phases/{phase_dir}/{plan_id}-PLAN.md` with this structure:
|
|
303
301
|
|
|
304
302
|
```markdown
|
|
305
303
|
---
|
|
@@ -422,12 +420,12 @@ notes: [What the checker actually validated or why it was skipped]
|
|
|
422
420
|
[Gotchas, implementation notes, or explicit assumptions]
|
|
423
421
|
```
|
|
424
422
|
|
|
425
|
-
**MANDATORY: You MUST write PLAN.md to disk at `.
|
|
423
|
+
**MANDATORY: You MUST write PLAN.md to disk at `.work/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.**
|
|
426
424
|
</plan_structure>
|
|
427
425
|
|
|
428
426
|
<approach_exploration>
|
|
429
427
|
### When This Runs
|
|
430
|
-
Check `.
|
|
428
|
+
Check `.work/config.json` for `workflow.discuss`:
|
|
431
429
|
- If `workflow.discuss: false` (or key missing): skip this section, go to `<goal_backward_planning>`. Note `reduced_alignment` in the orchestration summary.
|
|
432
430
|
- If `workflow.discuss: true`: mandatory before planning.
|
|
433
431
|
|
|
@@ -446,12 +444,12 @@ Run the approach explorer.
|
|
|
446
444
|
**Primary path — inline conversation with research subagents:**
|
|
447
445
|
The conversation with the user runs inline in the main context. For each technical gray area, a read-only research subagent is spawned to isolate heavy codebase and documentation reads, returning only compressed summaries while full detail stays out of the orchestrator context.
|
|
448
446
|
|
|
449
|
-
1. Load context: read ONLY locked decisions from `.
|
|
447
|
+
1. Load context: read ONLY locked decisions from `.work/SPEC.md` and the target phase goal/requirements from `.work/ROADMAP.md`.
|
|
450
448
|
|
|
451
449
|
2. Identify 3-4 domain-specific gray areas. Classify each as **taste** (preference, no research needed), **technical** (trade-offs, research first), or **hybrid** (both).
|
|
452
450
|
|
|
453
451
|
3. For each **technical or hybrid** gray area, spawn a read-only research subagent.
|
|
454
|
-
Use the prompt template from `.
|
|
452
|
+
Use the prompt template from `.work/templates/roles/approach-explorer.md` (`<research_subagent_prompt>` section), substituting the gray area name, classification, phase context, and relevant codebase files. Each subagent returns a structured summary and does not write implementation artifacts.
|
|
455
453
|
|
|
456
454
|
4. Present each gray area to the user individually:
|
|
457
455
|
- For taste areas: ask directly
|
|
@@ -469,7 +467,7 @@ The conversation with the user runs inline in the main context. For each technic
|
|
|
469
467
|
**Native agent optimization:**
|
|
470
468
|
|
|
471
469
|
If your runtime provides an interactive `gsdd-approach-explorer` agent:
|
|
472
|
-
- Invoke it with: target phase goal, requirement IDs, project config from `.
|
|
470
|
+
- Invoke it with: target phase goal, requirement IDs, project config from `.work/config.json` (especially `workflow.discuss`), locked decisions, phase research (if exists), relevant codebase files
|
|
473
471
|
- The native agent runs the full exploration in its own context window
|
|
474
472
|
- This is an optimization — the output (APPROACH.md) is identical to the primary path
|
|
475
473
|
|
|
@@ -484,14 +482,14 @@ If neither the primary path nor native agent is available (e.g., the runtime can
|
|
|
484
482
|
### Using APPROACH.md Decisions
|
|
485
483
|
After approach exploration completes (or existing APPROACH.md is loaded):
|
|
486
484
|
- If `workflow.discuss: true`, validate that APPROACH.md records `alignment_status: user_confirmed` or `alignment_status: approved_skip` with the canonical fields `alignment_method`, `user_confirmed_at`, `explicit_skip_approved`, `skip_scope`, `skip_rationale`, and `confirmed_decisions` before goal-backward planning begins. Stop and update the APPROACH artifact if proof is missing, unknown, agent-discretion-only, or based only on agent "No questions needed" judgment.
|
|
487
|
-
- Treat decisions from APPROACH.md as locked constraints, same priority as `.
|
|
485
|
+
- Treat decisions from APPROACH.md as locked constraints, same priority as `.work/SPEC.md` decisions
|
|
488
486
|
- "Agent's Discretion" items from APPROACH.md give the planner flexibility — do not treat them as locked
|
|
489
487
|
- Thread the APPROACH.md file path to both the planner prompt and the plan-checker prompt
|
|
490
488
|
- Deferred ideas from APPROACH.md must not appear in the plan
|
|
491
489
|
|
|
492
490
|
### Role Contract
|
|
493
491
|
|
|
494
|
-
The approach explorer's full role contract is at `.
|
|
492
|
+
The approach explorer's full role contract is at `.work/templates/roles/approach-explorer.md`. The portable workflow describes the orchestration; the role contract describes the agent's behavior.
|
|
495
493
|
</approach_exploration>
|
|
496
494
|
|
|
497
495
|
<plan_check_orchestration>
|
|
@@ -514,15 +512,15 @@ After the planner produces a draft plan, an independent checker reviews it in fr
|
|
|
514
512
|
13. `high_leverage_review` - high-leverage surfaces and second-pass obligations are recorded honestly
|
|
515
513
|
14. `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. When `workflow.discuss: true`, missing, proofless, agent-discretion-only, or invalid APPROACH.md is a blocker before a plan can be accepted.
|
|
516
514
|
### Invoking the Checker
|
|
517
|
-
1. If `.
|
|
515
|
+
1. If `.work/config.json` has `workflow.planCheck: false`, skip the independent checker. Perform the planner self-check below and report `reduced_assurance`. This does not skip the earlier alignment-proof gate when `workflow.discuss: true`.
|
|
518
516
|
2. If plan checking is enabled, check if your runtime provides a `gsdd-plan-checker` agent.
|
|
519
517
|
3. If a native checker agent is available, invoke it in a fresh context with only these explicit inputs:
|
|
520
518
|
- target phase goal and requirement IDs
|
|
521
|
-
- relevant locked decisions / deferred items from `.
|
|
522
|
-
- project config from `.
|
|
523
|
-
- approach decisions from `.
|
|
519
|
+
- relevant locked decisions / deferred items from `.work/SPEC.md`
|
|
520
|
+
- project config from `.work/config.json`, especially `workflow.discuss` and `workflow.planCheck`
|
|
521
|
+
- approach decisions from `.work/phases/*-APPROACH.md` (if exists)
|
|
524
522
|
- relevant phase research file(s)
|
|
525
|
-
- produced `.
|
|
523
|
+
- produced `.work/phases/*-PLAN.md` file(s)
|
|
526
524
|
4. Require the checker to return a single JSON object:
|
|
527
525
|
```json
|
|
528
526
|
{
|
|
@@ -608,12 +606,14 @@ For each task:
|
|
|
608
606
|
Planning is done when all of these are true:
|
|
609
607
|
|
|
610
608
|
- [ ] Target phase identified from `ROADMAP.md`
|
|
609
|
+
- [ ] Or selected target is `brownfield-change` and `CHANGE.md` provides goal, scope, done-when, next action, and closeout path without ROADMAP phase membership
|
|
611
610
|
- [ ] Approach exploration completed or explicitly skipped with `reduced_alignment` reported
|
|
612
611
|
- [ ] When `workflow.discuss: true`: user alignment confirmed via APPROACH.md before planning
|
|
613
612
|
- [ ] Research check completed where needed
|
|
614
613
|
- [ ] Roadmap phase contract includes requirements, success criteria, explicit out-of-scope, and explicit stop/replan conditions
|
|
614
|
+
- [ ] Or brownfield contract includes in-scope, out-of-scope, concrete Done When criteria, current next action, and `VERIFICATION.md` closeout path
|
|
615
615
|
- [ ] Plan self-check passed
|
|
616
|
-
- [ ] Success criteria from `ROADMAP.md` are represented as must-haves
|
|
616
|
+
- [ ] Success criteria from `ROADMAP.md`, or Done When criteria from `CHANGE.md`, are represented as must-haves
|
|
617
617
|
- [ ] Goal-backward derivation from criteria to artifacts to key links to tasks is explicit
|
|
618
618
|
- [ ] Every plan has frontmatter with `phase`, `plan`, `type`, `wave`, `depends_on`, `files-modified`, `autonomous`, `requirements`, `non_goals`, `hard_boundaries`, `escalation_triggers`, `approval_gates`, `anti_regression_targets`, `ui_proof_slots` or `no_ui_proof_rationale`, `closure_claim_limit`, `parallelism_budget`, `leverage`, and `must_haves`
|
|
619
619
|
- [ ] Every plan frontmatter records `runtime` and `assurance`
|
|
@@ -621,15 +621,15 @@ Planning is done when all of these are true:
|
|
|
621
621
|
- [ ] Every task has XML structure with `id`, `type`, `files`, `action`, `verify`, and `done`
|
|
622
622
|
- [ ] Every task has at least one runnable verify command
|
|
623
623
|
- [ ] Plan sizing stays within 2-5 tasks, preferring 2-3
|
|
624
|
-
- [ ] Locked decisions from `.
|
|
624
|
+
- [ ] Locked decisions from `.work/SPEC.md` and APPROACH.md are honored
|
|
625
625
|
- [ ] Plan body includes explicit `## Anti-Goals`, `## Hard Boundaries`, `## Evidence Contract`, `## Common Pitfalls`, `## Stop-And-Challenge`, `## Approval Gates`, and `## Leverage Review` sections
|
|
626
|
-
- [ ] Any git guidance stays repo-native and follows `.
|
|
626
|
+
- [ ] Any git guidance stays repo-native and follows `.work/config.json`
|
|
627
627
|
</success_criteria>
|
|
628
628
|
|
|
629
629
|
<completion>
|
|
630
630
|
Report to the user what was accomplished, then present the next step:
|
|
631
631
|
---
|
|
632
|
-
**Completed:** Phase planning — created `.
|
|
632
|
+
**Completed:** Phase planning — created `.work/phases/{phase_dir}/{plan_id}-PLAN.md`.
|
|
633
633
|
**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.
|
|
634
634
|
Installed generated runtime surfaces are trusted through rendering, not reviewer memory: `npx -y gsdd-cli health` compares any local generated skill/adapter surfaces against current render output, and `npx -y gsdd-cli update` regenerates them when they drift. Bare `gsdd health` / `gsdd update` are equivalent only when globally installed.
|
|
635
635
|
**Next workflow:** `/gsdd-execute` — start execution in a separate run when the user explicitly wants implementation to begin
|