cclaw-cli 0.48.27 → 0.48.29
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/dist/artifact-linter.js +16 -5
- package/dist/artifact-paths.d.ts +28 -0
- package/dist/artifact-paths.js +261 -0
- package/dist/content/contracts.js +3 -2
- package/dist/content/stage-schema.d.ts +1 -1
- package/dist/content/stage-schema.js +71 -15
- package/dist/content/stages/_lint-metadata/index.d.ts +2 -0
- package/dist/content/stages/_lint-metadata/index.js +79 -0
- package/dist/content/stages/brainstorm.js +140 -139
- package/dist/content/stages/design.js +243 -242
- package/dist/content/stages/plan.js +1 -2
- package/dist/content/stages/review.js +0 -1
- package/dist/content/stages/schema-types.d.ts +22 -3
- package/dist/content/stages/scope.js +215 -207
- package/dist/content/stages/ship.js +0 -7
- package/dist/content/stages/spec.js +2 -3
- package/dist/content/stages/tdd.d.ts +2 -2
- package/dist/content/stages/tdd.js +1 -3
- package/dist/gate-evidence.js +7 -17
- package/dist/internal/advance-stage.js +9 -3
- package/package.json +1 -1
|
@@ -70,7 +70,10 @@ export interface StageReviewLens {
|
|
|
70
70
|
outputs: string[];
|
|
71
71
|
reviewSections: ReviewSection[];
|
|
72
72
|
mandatoryDelegations: string[];
|
|
73
|
-
|
|
73
|
+
}
|
|
74
|
+
export interface StageReviewLensInput {
|
|
75
|
+
outputs: string[];
|
|
76
|
+
reviewSections: ReviewSection[];
|
|
74
77
|
}
|
|
75
78
|
export interface StageSchema {
|
|
76
79
|
schemaShape: "v2";
|
|
@@ -114,7 +117,6 @@ export interface StageSchema {
|
|
|
114
117
|
* near-duplicate entries and forced downstream code to merge them anyway.
|
|
115
118
|
*/
|
|
116
119
|
commonRationalizations: string[];
|
|
117
|
-
policyNeedles: string[];
|
|
118
120
|
artifactFile: string;
|
|
119
121
|
next: FlowStage | "done";
|
|
120
122
|
checklist: string[];
|
|
@@ -129,6 +131,23 @@ export interface StageSchema {
|
|
|
129
131
|
/** Agent names that MUST be dispatched (or waived) before stage transition — derived from mandatory auto-subagent rows. */
|
|
130
132
|
mandatoryDelegations: string[];
|
|
131
133
|
}
|
|
132
|
-
export type
|
|
134
|
+
export type StageSchemaLegacyInput = Omit<StageSchema, "schemaShape" | "philosophy" | "executionModel" | "artifactRules" | "reviewLens" | "mandatoryDelegations" | "complexityTier"> & {
|
|
135
|
+
schemaShape?: "legacy";
|
|
133
136
|
complexityTier?: StageComplexityTier;
|
|
134
137
|
};
|
|
138
|
+
export interface StageSchemaV2Input {
|
|
139
|
+
schemaShape: "v2";
|
|
140
|
+
stage: FlowStage;
|
|
141
|
+
skillFolder: string;
|
|
142
|
+
skillName: string;
|
|
143
|
+
skillDescription: string;
|
|
144
|
+
complexityTier?: StageComplexityTier;
|
|
145
|
+
philosophy: StagePhilosophy;
|
|
146
|
+
executionModel: StageExecutionModel;
|
|
147
|
+
artifactRules: StageArtifactRules;
|
|
148
|
+
reviewLens: StageReviewLensInput;
|
|
149
|
+
next: FlowStage | "done";
|
|
150
|
+
/** When true, stage skill includes batch auto-execute guidance (tdd). */
|
|
151
|
+
batchExecutionAllowed?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export type StageSchemaInput = StageSchemaLegacyInput | StageSchemaV2Input;
|
|
@@ -2,218 +2,226 @@
|
|
|
2
2
|
// SCOPE — reference: gstack CEO review
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
export const SCOPE = {
|
|
5
|
+
schemaShape: "v2",
|
|
5
6
|
stage: "scope",
|
|
6
7
|
complexityTier: "standard",
|
|
7
8
|
skillFolder: "scope-shaping",
|
|
8
9
|
skillName: "scope-shaping",
|
|
9
10
|
skillDescription: "Strategic scope stage. Challenge premise and lock explicit in-scope/out-of-scope boundaries using CEO-level thinking.",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
],
|
|
140
|
-
stopGate: true
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
title: "Deferred Items Review",
|
|
144
|
-
evaluationPoints: [
|
|
145
|
-
"Does each deferred item have a one-line rationale?",
|
|
146
|
-
"Are any deferred items actually blockers for the core scope?",
|
|
147
|
-
"Will deferring these items create technical debt that is expensive to unwind?"
|
|
148
|
-
],
|
|
149
|
-
stopGate: true
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
title: "Risk and Reversibility Check",
|
|
153
|
-
evaluationPoints: [
|
|
154
|
-
"For each major scope decision: is it reversible?",
|
|
155
|
-
"What is the blast radius if this decision is wrong?",
|
|
156
|
-
"Are there hidden dependencies between in-scope and out-of-scope items?"
|
|
157
|
-
],
|
|
158
|
-
stopGate: true
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
title: "Existing-Code Reuse Check",
|
|
162
|
-
evaluationPoints: [
|
|
163
|
-
"Has every sub-problem been mapped to existing code?",
|
|
164
|
-
"Is the plan rebuilding anything that already exists?",
|
|
165
|
-
"Are there integration opportunities that reduce new code?",
|
|
166
|
-
"Have you searched for built-in or library solutions before scoping custom work?"
|
|
167
|
-
],
|
|
168
|
-
stopGate: true
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
title: "Error & Rescue Scope Check",
|
|
172
|
-
evaluationPoints: [
|
|
173
|
-
"For every new capability: what breaks if it fails?",
|
|
174
|
-
"Is failure detection in scope or deferred? If deferred, is that acceptable?",
|
|
175
|
-
"Are there rescue/fallback paths for critical user journeys?",
|
|
176
|
-
"Is observability (logging, metrics, alerts) explicitly in or out of scope?"
|
|
177
|
-
],
|
|
178
|
-
stopGate: true
|
|
11
|
+
philosophy: {
|
|
12
|
+
hardGate: "Do NOT begin architecture, design, or code. This stage produces scope decisions only. Do not silently add or remove scope — every change is an explicit user opt-in.",
|
|
13
|
+
ironLaw: "EVERY SCOPE CHANGE IS AN EXPLICIT USER OPT-IN — NEVER A SILENT ENLARGEMENT OR TRIM.",
|
|
14
|
+
purpose: "Decide the right scope before technical lock-in using explicit mode selection and rigorous premise challenge.",
|
|
15
|
+
whenToUse: [
|
|
16
|
+
"After brainstorm approval",
|
|
17
|
+
"Before architecture/design lock-in",
|
|
18
|
+
"When ambition vs feasibility trade-off is unclear"
|
|
19
|
+
],
|
|
20
|
+
whenNotToUse: [
|
|
21
|
+
"Brainstorm has not been approved yet",
|
|
22
|
+
"Scope boundaries are already locked and user requested no scope changes",
|
|
23
|
+
"The work is a pure implementation or debugging pass within existing scope"
|
|
24
|
+
],
|
|
25
|
+
commonRationalizations: [
|
|
26
|
+
"Skipping pre-scope audit because the task looks small",
|
|
27
|
+
"Scope silently expanded during discussion",
|
|
28
|
+
"No explicit out-of-scope section",
|
|
29
|
+
"Premise accepted without challenge",
|
|
30
|
+
"Sycophantic agreement without evidence-based pushback",
|
|
31
|
+
"Hedged recommendations that avoid taking a position",
|
|
32
|
+
"Batching multiple scope issues into one question",
|
|
33
|
+
"Re-arguing for smaller scope after user rejects reduction",
|
|
34
|
+
"Using scope-reduction placeholders (`v1`, `for now`, `we can do later`) instead of explicit user-approved boundaries",
|
|
35
|
+
"No selected mode in artifact",
|
|
36
|
+
"Mode selected without heuristic justification",
|
|
37
|
+
"No discretion section (or explicit `None`) in artifact",
|
|
38
|
+
"No deferred/not-in-scope section",
|
|
39
|
+
"No user approval marker",
|
|
40
|
+
"Missing Locked Decisions section or decisions without D-XX IDs",
|
|
41
|
+
"Skipping outside-voice review loop and treating first draft as final"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
executionModel: {
|
|
45
|
+
checklist: [
|
|
46
|
+
"**Pre-Scope System Audit** — before premise challenge, gather reality snapshot: recent commits (`git log -30 --oneline`), current diff (`git diff --stat`), stash state (`git stash list`), and deferred debt markers (`rg -n 'TODO|FIXME|XXX|HACK'`). Record findings in scope artifact.",
|
|
47
|
+
"**Assess complexity** — Read the brainstorm artifact. If project is simple (single component, clear architecture, personal/prototype), run light-touch scope: mode selection, 3-5 key in/out boundaries, deferred items. Skip Dream State Mapping and Temporal Interrogation. If project is complex (multi-component, team delivery, production), run the full checklist.",
|
|
48
|
+
"**Prime Directives** — Zero silent failures. For each in-scope capability, name concrete failure modes, the exact error surface, and trace all four data-flow paths (happy, nil, empty, upstream error). Include interaction edge cases (double-click, navigate-away, stale state), observability commitments, and explicit deferred-item logging.",
|
|
49
|
+
"**Premise Challenge** — Is this the right problem? What if we do nothing? What are we optimizing for?",
|
|
50
|
+
"**Landscape Check** — for EXPAND/SELECTIVE candidates, perform a brief external scan of comparable products/patterns to calibrate ambition and avoid local maxima.",
|
|
51
|
+
"**Existing Code Leverage** — Search for existing solutions before deciding to build new.",
|
|
52
|
+
"**Taste Calibration** — identify 2-3 high-quality files/modules in this codebase and explicitly align scope quality bar to them.",
|
|
53
|
+
"**Dream State Mapping** — (complex projects only) describe the ideal state 12 months out using `CURRENT STATE -> THIS PLAN -> 12-MONTH IDEAL`, then verify this scope moves toward that target.",
|
|
54
|
+
"**Implementation Alternatives** — Produce 2-3 distinct approaches. For each: Name, Summary, Effort (S/M/L/XL), Risk (Low/Med/High), 2-3 Pros, 2-3 Cons, and explicit Reuses. One option must be minimal viable, one must be ideal architecture.",
|
|
55
|
+
"**Temporal Interrogation** — (complex projects only) simulate implementation timeline: HOUR 1 foundations, HOUR 2-3 core logic, HOUR 4-5 integration surprises, HOUR 6+ polish/tests. Decide what must be locked now vs safely deferred.",
|
|
56
|
+
"**Mode Selection** — Present expand/selective/hold/reduce with recommendation and default heuristic: greenfield -> expand, feature enhancement -> selective, bugfix/hotfix/refactor -> hold, broad blast radius (>15 files or multi-team impact) -> reduce.",
|
|
57
|
+
"**Mode-Specific Analysis** — After mode is selected, run the matching analysis: EXPAND (10x and delight opportunities), SELECTIVE (hold-scope rigor then cherry-picked expansions), HOLD (minimum-change-set hardening), REDUCE (ruthless cuts and follow-up split).",
|
|
58
|
+
"**Outside Voice + Spec Review Loop** — run an adversarial second-opinion pass on the scope artifact, reconcile findings, and iterate up to 3 cycles or until quality score >= 0.8.",
|
|
59
|
+
"**Error and Rescue Registry** — For each capability: what breaks, how detected, what fallback."
|
|
60
|
+
],
|
|
61
|
+
interactionProtocol: [
|
|
62
|
+
"For scope mode selection: use the Decision Protocol — present expand/selective/hold/reduce as labeled options with trade-offs and mark one as (recommended). Do NOT use a numeric Completeness rubric; recommend the option that best covers the prime-directive failure modes, four data-flow paths, observability, and deferred handling for the in-scope set with the smallest blast radius. Base your recommendation on default heuristics: greenfield -> expand, enhancement -> selective, bugfix/hotfix/refactor -> hold, broad blast radius -> reduce. If the harness's native structured-ask tool is available (`AskUserQuestion` / `AskQuestion` / `question` / `request_user_input`), send exactly ONE question per call, validate fields against the runtime schema, and on schema error immediately fall back to a plain-text lettered list instead of retrying guessed payloads.",
|
|
63
|
+
"Walk through the scope checklist interactively. Each checklist item that surfaces a decision should be presented to the user as a question, not as a monologue. Do not dump all items at once.",
|
|
64
|
+
"Challenge premise and verify the problem framing before anything else.",
|
|
65
|
+
"Take a position on every scope decision. Avoid hedging phrases like 'this could work' or 'there are many ways'; state your recommendation and one concrete condition that would change it.",
|
|
66
|
+
"Use pushback patterns when framing is weak: vague scope -> force a specific user/problem, platform vision -> force a narrowest viable wedge, social proof -> demand behavioral evidence.",
|
|
67
|
+
"Present one structural scope issue at a time for decision. Do NOT batch. Use structured options for each scope boundary question.",
|
|
68
|
+
"Record explicit in-scope and out-of-scope contract.",
|
|
69
|
+
"Once the user accepts or rejects a recommendation, commit fully. Do not re-argue.",
|
|
70
|
+
"Before final scope approval, run an adversarial outside-voice review and reconcile every finding explicitly (accept/reject/defer with rationale).",
|
|
71
|
+
"Bound review-loop retries: max 3 iterations or early stop at quality score >= 0.8.",
|
|
72
|
+
"Produce a clean scope summary after all issues are resolved.",
|
|
73
|
+
"**STOP.** Wait for explicit user approval of scope contract before advancing to design.",
|
|
74
|
+
"**STOP BEFORE ADVANCE.** Mandatory delegation `planner` must be marked completed or explicitly waived in `.cclaw/state/delegation-log.json`. Then close the stage via `node .cclaw/hooks/stage-complete.mjs scope` (do not hand-edit `.cclaw/state/flow-state.json`)."
|
|
75
|
+
],
|
|
76
|
+
process: [
|
|
77
|
+
"Run pre-scope system audit (git log/diff/stash/debt markers).",
|
|
78
|
+
"Run premise challenge and existing-solution leverage check.",
|
|
79
|
+
"When mode is EXPAND/SELECTIVE, run brief landscape check before final scope lock.",
|
|
80
|
+
"Calibrate quality bar against 2-3 strong existing modules/files.",
|
|
81
|
+
"Produce 2-3 scope alternatives in a structured format (Name, Summary, Effort, Risk, Pros, Cons, Reuses) with minimum viable and ideal architecture options included.",
|
|
82
|
+
"Choose scope mode with user approval.",
|
|
83
|
+
"Run mode-specific analysis that matches the selected scope mode.",
|
|
84
|
+
"Walk through scope review sections one at a time.",
|
|
85
|
+
"Run outside-voice spec review loop (up to 3 iterations, quality score target >= 0.8).",
|
|
86
|
+
"Write explicit scope contract, discretion areas, and deferred items.",
|
|
87
|
+
"Freeze non-negotiable boundaries as stable Locked Decisions (D-XX IDs).",
|
|
88
|
+
"Produce scope summary plus completion dashboard (section status, critical gaps, resolved decisions, unresolved items or `None`)."
|
|
89
|
+
],
|
|
90
|
+
requiredGates: [
|
|
91
|
+
{ id: "scope_mode_selected", description: "One scope mode was explicitly selected." },
|
|
92
|
+
{ id: "scope_contract_written", description: "In-scope/out-of-scope contract is documented." },
|
|
93
|
+
{ id: "scope_user_approved", description: "User approved the final scope direction." }
|
|
94
|
+
],
|
|
95
|
+
requiredEvidence: [
|
|
96
|
+
"Artifact written to `.cclaw/artifacts/02-scope-<slug>.md`.",
|
|
97
|
+
"Pre-Scope System Audit findings are captured (git log/diff/stash/debt markers).",
|
|
98
|
+
"In-scope and out-of-scope lists are explicit.",
|
|
99
|
+
"Discretion areas are explicit (or marked as `None`).",
|
|
100
|
+
"Selected mode and rationale are documented.",
|
|
101
|
+
"Locked Decisions section lists stable D-XX IDs for non-negotiable boundaries.",
|
|
102
|
+
"Premise challenge findings documented.",
|
|
103
|
+
"Outside Voice findings and dispositions are recorded (accept/reject/defer with rationale).",
|
|
104
|
+
"Spec review loop summary includes iteration count and quality score trajectory.",
|
|
105
|
+
"Deferred items list with one-line rationale for each.",
|
|
106
|
+
"Completion dashboard lists per-section status, critical/open gaps, decision count, and unresolved items (or `None`)."
|
|
107
|
+
],
|
|
108
|
+
inputs: ["brainstorm artifact", "timeline constraints", "product priorities"],
|
|
109
|
+
requiredContext: [
|
|
110
|
+
"approved brainstorm direction",
|
|
111
|
+
"existing capabilities and reusable components",
|
|
112
|
+
"delivery deadlines and risk tolerance"
|
|
113
|
+
],
|
|
114
|
+
researchPlaybooks: [
|
|
115
|
+
"research/git-history.md"
|
|
116
|
+
],
|
|
117
|
+
blockers: [
|
|
118
|
+
"scope mode not selected",
|
|
119
|
+
"in/out boundaries ambiguous",
|
|
120
|
+
"discretion areas undefined",
|
|
121
|
+
"critical premise disagreement unresolved"
|
|
122
|
+
],
|
|
123
|
+
exitCriteria: [
|
|
124
|
+
"scope contract approved by user",
|
|
125
|
+
"discretion areas recorded explicitly",
|
|
126
|
+
"required gates marked satisfied",
|
|
127
|
+
"deferred list recorded explicitly",
|
|
128
|
+
"locked decisions captured with stable D-XX IDs",
|
|
129
|
+
"completion dashboard produced",
|
|
130
|
+
"scope summary produced"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
artifactRules: {
|
|
134
|
+
artifactFile: "02-scope-<slug>.md",
|
|
135
|
+
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
136
|
+
crossStageTrace: {
|
|
137
|
+
readsFrom: [".cclaw/artifacts/01-brainstorm-<slug>.md"],
|
|
138
|
+
writesTo: [".cclaw/artifacts/02-scope-<slug>.md"],
|
|
139
|
+
traceabilityRule: "Every scope boundary must be traceable to a brainstorm decision. Every downstream design choice must stay within the scope contract."
|
|
179
140
|
},
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
141
|
+
artifactValidation: [
|
|
142
|
+
{ section: "Pre-Scope System Audit", required: false, validationRule: "Must capture git log/diff/stash/debt-marker findings before premise challenge." },
|
|
143
|
+
{ section: "Prime Directives", required: false, validationRule: "For each scoped capability: named failure modes, explicit error surface, four data-flow paths, interaction edge cases, observability expectations, and deferred-item handling." },
|
|
144
|
+
{ section: "Premise Challenge", required: false, validationRule: "Must contain explicit answers to: right problem? direct path? what if nothing?" },
|
|
145
|
+
{ section: "Landscape Check", required: false, validationRule: "When mode is EXPAND/SELECTIVE, include at least one external reference insight and its impact on scope." },
|
|
146
|
+
{ section: "Taste Calibration", required: false, validationRule: "Must reference 2-3 strong in-repo modules/files that define the quality bar or explicitly justify omission." },
|
|
147
|
+
{ section: "Requirements", required: false, validationRule: "Table of stable requirement IDs (R1, R2, R3…) one per row with observable outcome, priority, and source. IDs are assigned once and never renumbered across scope/design/spec/plan/review; dropped requirements stay with Priority `DROPPED`." },
|
|
148
|
+
{ section: "Locked Decisions (D-XX)", required: false, validationRule: "List of stable locked decisions with IDs D-01, D-02... Each ID appears once, includes rationale, and is intended for downstream cross-stage traceability." },
|
|
149
|
+
{ section: "Implementation Alternatives", required: false, validationRule: "2-3 options with Name, Summary, Effort, Risk, Pros, Cons, and Reuses. Must include minimal viable and ideal architecture options." },
|
|
150
|
+
{ section: "Scope Mode", required: true, validationRule: "Must state selected mode and rationale with default heuristic justification." },
|
|
151
|
+
{ section: "Mode-Specific Analysis", required: false, validationRule: "Must document the analysis matching the selected scope mode: EXPAND (10x and delight opportunities), SELECTIVE (hold-scope baseline then cherry-picked expansions), HOLD (minimum-change-set hardening), REDUCE (ruthless cuts and follow-up split)." },
|
|
152
|
+
{ section: "In Scope / Out of Scope", required: true, validationRule: "Two separate explicit lists. Out-of-scope must not be empty." },
|
|
153
|
+
{ section: "Discretion Areas", required: false, validationRule: "Explicit list of implementer decision zones, or 'None' if scope is fully locked." },
|
|
154
|
+
{ section: "Deferred Items", required: false, validationRule: "Each item has one-line rationale. If empty, state 'None' explicitly." },
|
|
155
|
+
{ section: "Error & Rescue Registry", required: false, validationRule: "Each scoped capability has: failure mode, detection method, fallback decision." },
|
|
156
|
+
{ section: "Outside Voice Findings", required: false, validationRule: "Must list external/adversarial findings and disposition (accept/reject/defer) with rationale." },
|
|
157
|
+
{ section: "Spec Review Loop", required: false, validationRule: "Must record iterations (max 3), quality score per iteration, stop reason, and unresolved concerns." },
|
|
158
|
+
{ section: "Completion Dashboard", required: true, validationRule: "Lists per-review-section status, count of critical/open gaps, resolved decisions, and unresolved decisions (or 'None')." },
|
|
159
|
+
{ section: "Scope Summary", required: true, validationRule: "Clean summary: mode, strongest challenges, recommended path, accepted scope, deferred, excluded." },
|
|
160
|
+
{ section: "Dream State Mapping", required: false, validationRule: "If present (complex projects): CURRENT STATE, THIS PLAN, 12-MONTH IDEAL, and alignment verdict." },
|
|
161
|
+
{ section: "Temporal Interrogation", required: false, validationRule: "If present (complex projects): timeline simulation table with decision pressures and lock-now vs defer verdicts." }
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
reviewLens: {
|
|
165
|
+
outputs: ["scope mode decision", "scope contract", "discretion areas list", "deferred scope list", "scope summary", "scope completion dashboard"],
|
|
166
|
+
reviewSections: [
|
|
167
|
+
{
|
|
168
|
+
title: "Scope Boundary Audit",
|
|
169
|
+
evaluationPoints: [
|
|
170
|
+
"Are all in-scope items justified by the problem statement?",
|
|
171
|
+
"Are any in-scope items actually solving a proxy problem instead of the real one?",
|
|
172
|
+
"Could any in-scope item be deferred without blocking the core objective?"
|
|
173
|
+
],
|
|
174
|
+
stopGate: true
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
title: "Deferred Items Review",
|
|
178
|
+
evaluationPoints: [
|
|
179
|
+
"Does each deferred item have a one-line rationale?",
|
|
180
|
+
"Are any deferred items actually blockers for the core scope?",
|
|
181
|
+
"Will deferring these items create technical debt that is expensive to unwind?"
|
|
182
|
+
],
|
|
183
|
+
stopGate: true
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
title: "Risk and Reversibility Check",
|
|
187
|
+
evaluationPoints: [
|
|
188
|
+
"For each major scope decision: is it reversible?",
|
|
189
|
+
"What is the blast radius if this decision is wrong?",
|
|
190
|
+
"Are there hidden dependencies between in-scope and out-of-scope items?"
|
|
191
|
+
],
|
|
192
|
+
stopGate: true
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
title: "Existing-Code Reuse Check",
|
|
196
|
+
evaluationPoints: [
|
|
197
|
+
"Has every sub-problem been mapped to existing code?",
|
|
198
|
+
"Is the plan rebuilding anything that already exists?",
|
|
199
|
+
"Are there integration opportunities that reduce new code?",
|
|
200
|
+
"Have you searched for built-in or library solutions before scoping custom work?"
|
|
201
|
+
],
|
|
202
|
+
stopGate: true
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
title: "Error & Rescue Scope Check",
|
|
206
|
+
evaluationPoints: [
|
|
207
|
+
"For every new capability: what breaks if it fails?",
|
|
208
|
+
"Is failure detection in scope or deferred? If deferred, is that acceptable?",
|
|
209
|
+
"Are there rescue/fallback paths for critical user journeys?",
|
|
210
|
+
"Is observability (logging, metrics, alerts) explicitly in or out of scope?"
|
|
211
|
+
],
|
|
212
|
+
stopGate: true
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
title: "Outside Voice Reconciliation",
|
|
216
|
+
evaluationPoints: [
|
|
217
|
+
"Were adversarial findings categorized as accept/reject/defer with rationale?",
|
|
218
|
+
"Did any rejected finding still expose a real gap in assumptions?",
|
|
219
|
+
"Is quality score trajectory improving across iterations?",
|
|
220
|
+
"Did the review loop stop because quality threshold was met (>=0.8) or because retry budget was exhausted?"
|
|
221
|
+
],
|
|
222
|
+
stopGate: true
|
|
223
|
+
}
|
|
224
|
+
]
|
|
196
225
|
},
|
|
197
|
-
|
|
198
|
-
{ section: "Pre-Scope System Audit", required: false, validationRule: "Must capture git log/diff/stash/debt-marker findings before premise challenge." },
|
|
199
|
-
{ section: "Prime Directives", required: false, validationRule: "For each scoped capability: named failure modes, explicit error surface, four data-flow paths, interaction edge cases, observability expectations, and deferred-item handling." },
|
|
200
|
-
{ section: "Premise Challenge", required: false, validationRule: "Must contain explicit answers to: right problem? direct path? what if nothing?" },
|
|
201
|
-
{ section: "Landscape Check", required: false, validationRule: "When mode is EXPAND/SELECTIVE, include at least one external reference insight and its impact on scope." },
|
|
202
|
-
{ section: "Taste Calibration", required: false, validationRule: "Must reference 2-3 strong in-repo modules/files that define the quality bar or explicitly justify omission." },
|
|
203
|
-
{ section: "Requirements", required: false, validationRule: "Table of stable requirement IDs (R1, R2, R3…) one per row with observable outcome, priority, and source. IDs are assigned once and never renumbered across scope/design/spec/plan/review; dropped requirements stay with Priority `DROPPED`." },
|
|
204
|
-
{ section: "Locked Decisions (D-XX)", required: false, validationRule: "List of stable locked decisions with IDs D-01, D-02... Each ID appears once, includes rationale, and is intended for downstream cross-stage traceability." },
|
|
205
|
-
{ section: "Implementation Alternatives", required: false, validationRule: "2-3 options with Name, Summary, Effort, Risk, Pros, Cons, and Reuses. Must include minimal viable and ideal architecture options." },
|
|
206
|
-
{ section: "Scope Mode", required: true, validationRule: "Must state selected mode and rationale with default heuristic justification." },
|
|
207
|
-
{ section: "Mode-Specific Analysis", required: false, validationRule: "Must document the analysis matching the selected scope mode: EXPAND (10x and delight opportunities), SELECTIVE (hold-scope baseline then cherry-picked expansions), HOLD (minimum-change-set hardening), REDUCE (ruthless cuts and follow-up split)." },
|
|
208
|
-
{ section: "In Scope / Out of Scope", required: true, validationRule: "Two separate explicit lists. Out-of-scope must not be empty." },
|
|
209
|
-
{ section: "Discretion Areas", required: false, validationRule: "Explicit list of implementer decision zones, or 'None' if scope is fully locked." },
|
|
210
|
-
{ section: "Deferred Items", required: false, validationRule: "Each item has one-line rationale. If empty, state 'None' explicitly." },
|
|
211
|
-
{ section: "Error & Rescue Registry", required: false, validationRule: "Each scoped capability has: failure mode, detection method, fallback decision." },
|
|
212
|
-
{ section: "Outside Voice Findings", required: false, validationRule: "Must list external/adversarial findings and disposition (accept/reject/defer) with rationale." },
|
|
213
|
-
{ section: "Spec Review Loop", required: false, validationRule: "Must record iterations (max 3), quality score per iteration, stop reason, and unresolved concerns." },
|
|
214
|
-
{ section: "Completion Dashboard", required: true, validationRule: "Lists per-review-section status, count of critical/open gaps, resolved decisions, and unresolved decisions (or 'None')." },
|
|
215
|
-
{ section: "Scope Summary", required: true, validationRule: "Clean summary: mode, strongest challenges, recommended path, accepted scope, deferred, excluded." },
|
|
216
|
-
{ section: "Dream State Mapping", required: false, validationRule: "If present (complex projects): CURRENT STATE, THIS PLAN, 12-MONTH IDEAL, and alignment verdict." },
|
|
217
|
-
{ section: "Temporal Interrogation", required: false, validationRule: "If present (complex projects): timeline simulation table with decision pressures and lock-now vs defer verdicts." }
|
|
218
|
-
]
|
|
226
|
+
next: "design"
|
|
219
227
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SHIP_FINALIZATION_MODES } from "../../constants.js";
|
|
2
1
|
// ---------------------------------------------------------------------------
|
|
3
2
|
// SHIP — reference: superpowers finishing-a-development-branch + gstack /ship
|
|
4
3
|
// ---------------------------------------------------------------------------
|
|
@@ -90,12 +89,6 @@ export const SHIP = {
|
|
|
90
89
|
"Finalization not executed, only planned",
|
|
91
90
|
"Selecting git-dependent finalization mode when `.git` is unavailable"
|
|
92
91
|
],
|
|
93
|
-
policyNeedles: [
|
|
94
|
-
"Pre-Ship Checks",
|
|
95
|
-
"Release Notes",
|
|
96
|
-
"Rollback Plan",
|
|
97
|
-
...SHIP_FINALIZATION_MODES
|
|
98
|
-
],
|
|
99
92
|
artifactFile: "08-ship.md",
|
|
100
93
|
// `done` exits the stage pipeline. Archive semantics are handled by the
|
|
101
94
|
// closeout substate machine (`idle` -> ... -> `archived`) in flow-state.
|
|
@@ -87,7 +87,6 @@ export const SPEC = {
|
|
|
87
87
|
"No testability mapping",
|
|
88
88
|
"Edge cases missing or deferred"
|
|
89
89
|
],
|
|
90
|
-
policyNeedles: ["Acceptance Criteria", "Constraints", "Testability", "approved spec", "Edge Cases"],
|
|
91
90
|
artifactFile: "04-spec.md",
|
|
92
91
|
next: "plan",
|
|
93
92
|
reviewSections: [
|
|
@@ -116,12 +115,12 @@ export const SPEC = {
|
|
|
116
115
|
],
|
|
117
116
|
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
118
117
|
crossStageTrace: {
|
|
119
|
-
readsFrom: [".cclaw/artifacts/03-design
|
|
118
|
+
readsFrom: [".cclaw/artifacts/03-design-<slug>.md", ".cclaw/artifacts/02-scope-<slug>.md"],
|
|
120
119
|
writesTo: [".cclaw/artifacts/04-spec.md"],
|
|
121
120
|
traceabilityRule: "Every acceptance criterion must trace to a design decision. Every downstream plan task must trace to a spec criterion."
|
|
122
121
|
},
|
|
123
122
|
artifactValidation: [
|
|
124
|
-
{ section: "Acceptance Criteria", required: true, validationRule: "Each criterion is observable, measurable, and falsifiable. Table must include a Requirement Ref column linking to R# IDs in 02-scope.md and a Design Decision Ref column tracing back to design artifact. AC IDs (AC-1, AC-2…) are stable across revisions — dropped ACs stay with Priority `DROPPED`." },
|
|
123
|
+
{ section: "Acceptance Criteria", required: true, validationRule: "Each criterion is observable, measurable, and falsifiable. Table must include a Requirement Ref column linking to R# IDs in 02-scope-<slug>.md (legacy 02-scope.md is accepted during migration) and a Design Decision Ref column tracing back to design artifact. AC IDs (AC-1, AC-2…) are stable across revisions — dropped ACs stay with Priority `DROPPED`." },
|
|
125
124
|
{ section: "Edge Cases", required: true, validationRule: "At least one boundary and one error condition per criterion." },
|
|
126
125
|
{ section: "Constraints and Assumptions", required: false, validationRule: "All implicit assumptions surfaced. Constraints have sources." },
|
|
127
126
|
{ section: "Testability Map", required: true, validationRule: "Each criterion maps to a concrete test description with verification approach (unit, integration, e2e, manual) and command or manual steps." },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StageSchemaInput } from "./schema-types.js";
|
|
1
|
+
import type { StageSchemaInput, StageSchemaLegacyInput } from "./schema-types.js";
|
|
2
2
|
import type { FlowTrack } from "../../types.js";
|
|
3
|
-
export declare const TDD:
|
|
3
|
+
export declare const TDD: StageSchemaLegacyInput;
|
|
4
4
|
export declare function tddStageForTrack(track: FlowTrack): StageSchemaInput;
|
|
@@ -100,7 +100,6 @@ export const TDD = {
|
|
|
100
100
|
"No full-suite GREEN evidence",
|
|
101
101
|
"Multiple tasks implemented in one pass without justification"
|
|
102
102
|
],
|
|
103
|
-
policyNeedles: ["RED", "GREEN", "REFACTOR", "failing test", "full test suite", "acceptance criteria", "traceable to plan slice"],
|
|
104
103
|
artifactFile: "06-tdd.md",
|
|
105
104
|
next: "review",
|
|
106
105
|
reviewSections: [
|
|
@@ -169,7 +168,7 @@ export const TDD = {
|
|
|
169
168
|
],
|
|
170
169
|
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
171
170
|
crossStageTrace: {
|
|
172
|
-
readsFrom: [".cclaw/artifacts/05-plan.md", ".cclaw/artifacts/04-spec.md", ".cclaw/artifacts/03-design
|
|
171
|
+
readsFrom: [".cclaw/artifacts/05-plan.md", ".cclaw/artifacts/04-spec.md", ".cclaw/artifacts/03-design-<slug>.md"],
|
|
173
172
|
writesTo: [".cclaw/artifacts/06-tdd.md"],
|
|
174
173
|
traceabilityRule: "Every RED test traces to a plan task. Every GREEN change traces to a RED test. Every plan task traces to a spec criterion. Design decisions inform test strategy. Evidence chain must be unbroken."
|
|
175
174
|
},
|
|
@@ -216,7 +215,6 @@ function tddQuickTrackVariant() {
|
|
|
216
215
|
requiredEvidence: TDD.requiredEvidence.map(quickTrackText),
|
|
217
216
|
inputs: TDD.inputs.map(quickTrackText),
|
|
218
217
|
requiredContext: ["spec artifact", "existing test patterns"],
|
|
219
|
-
policyNeedles: TDD.policyNeedles.map(quickTrackText),
|
|
220
218
|
reviewSections: TDD.reviewSections.map((section) => ({
|
|
221
219
|
...section,
|
|
222
220
|
evaluationPoints: section.evaluationPoints.map(quickTrackText)
|