cclaw-cli 0.48.26 → 0.48.28
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/content/contracts.js +3 -2
- package/dist/content/stage-schema.d.ts +3 -3
- package/dist/content/stage-schema.js +106 -4
- 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 +141 -139
- package/dist/content/stages/design.js +244 -242
- package/dist/content/stages/plan.js +0 -1
- package/dist/content/stages/review.js +0 -1
- package/dist/content/stages/schema-types.d.ts +68 -2
- package/dist/content/stages/scope.js +216 -207
- package/dist/content/stages/ship.js +0 -7
- package/dist/content/stages/spec.js +0 -1
- package/dist/content/stages/tdd.d.ts +2 -2
- package/dist/content/stages/tdd.js +0 -2
- package/package.json +1 -1
|
@@ -27,17 +27,65 @@ export interface StageAutoSubagentDispatch {
|
|
|
27
27
|
* - `proactive` — should be dispatched automatically when context matches `when`.
|
|
28
28
|
*/
|
|
29
29
|
mode: "mandatory" | "proactive";
|
|
30
|
+
/**
|
|
31
|
+
* Minimum complexity tier where this dispatch policy applies.
|
|
32
|
+
* Defaults to `standard` for mandatory dispatches when omitted.
|
|
33
|
+
*/
|
|
34
|
+
requiredAtTier?: StageComplexityTier;
|
|
30
35
|
when: string;
|
|
31
36
|
purpose: string;
|
|
32
37
|
requiresUserGate: boolean;
|
|
33
38
|
/** Optional skill folder the dispatched agent should load as additional context. */
|
|
34
39
|
skill?: string;
|
|
35
40
|
}
|
|
41
|
+
export type StageComplexityTier = "lightweight" | "standard" | "deep";
|
|
42
|
+
export interface StagePhilosophy {
|
|
43
|
+
hardGate: string;
|
|
44
|
+
ironLaw: string;
|
|
45
|
+
purpose: string;
|
|
46
|
+
whenToUse: string[];
|
|
47
|
+
whenNotToUse: string[];
|
|
48
|
+
commonRationalizations: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface StageExecutionModel {
|
|
51
|
+
interactionProtocol: string[];
|
|
52
|
+
process: string[];
|
|
53
|
+
checklist: string[];
|
|
54
|
+
requiredGates: StageGate[];
|
|
55
|
+
requiredEvidence: string[];
|
|
56
|
+
inputs: string[];
|
|
57
|
+
requiredContext: string[];
|
|
58
|
+
researchPlaybooks?: string[];
|
|
59
|
+
blockers: string[];
|
|
60
|
+
exitCriteria: string[];
|
|
61
|
+
}
|
|
62
|
+
export interface StageArtifactRules {
|
|
63
|
+
artifactFile: string;
|
|
64
|
+
completionStatus: string[];
|
|
65
|
+
crossStageTrace: CrossStageTrace;
|
|
66
|
+
artifactValidation: ArtifactValidation[];
|
|
67
|
+
trivialOverrideSections?: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface StageReviewLens {
|
|
70
|
+
outputs: string[];
|
|
71
|
+
reviewSections: ReviewSection[];
|
|
72
|
+
mandatoryDelegations: string[];
|
|
73
|
+
}
|
|
74
|
+
export interface StageReviewLensInput {
|
|
75
|
+
outputs: string[];
|
|
76
|
+
reviewSections: ReviewSection[];
|
|
77
|
+
}
|
|
36
78
|
export interface StageSchema {
|
|
79
|
+
schemaShape: "v2";
|
|
37
80
|
stage: FlowStage;
|
|
38
81
|
skillFolder: string;
|
|
39
82
|
skillName: string;
|
|
40
83
|
skillDescription: string;
|
|
84
|
+
complexityTier: StageComplexityTier;
|
|
85
|
+
philosophy: StagePhilosophy;
|
|
86
|
+
executionModel: StageExecutionModel;
|
|
87
|
+
artifactRules: StageArtifactRules;
|
|
88
|
+
reviewLens: StageReviewLens;
|
|
41
89
|
hardGate: string;
|
|
42
90
|
/**
|
|
43
91
|
* One-line "Iron Law" punchcard — the single rule that, if broken,
|
|
@@ -69,7 +117,6 @@ export interface StageSchema {
|
|
|
69
117
|
* near-duplicate entries and forced downstream code to merge them anyway.
|
|
70
118
|
*/
|
|
71
119
|
commonRationalizations: string[];
|
|
72
|
-
policyNeedles: string[];
|
|
73
120
|
artifactFile: string;
|
|
74
121
|
next: FlowStage | "done";
|
|
75
122
|
checklist: string[];
|
|
@@ -84,4 +131,23 @@ export interface StageSchema {
|
|
|
84
131
|
/** Agent names that MUST be dispatched (or waived) before stage transition — derived from mandatory auto-subagent rows. */
|
|
85
132
|
mandatoryDelegations: string[];
|
|
86
133
|
}
|
|
87
|
-
export type
|
|
134
|
+
export type StageSchemaLegacyInput = Omit<StageSchema, "schemaShape" | "philosophy" | "executionModel" | "artifactRules" | "reviewLens" | "mandatoryDelegations" | "complexityTier"> & {
|
|
135
|
+
schemaShape?: "legacy";
|
|
136
|
+
complexityTier?: StageComplexityTier;
|
|
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,217 +2,226 @@
|
|
|
2
2
|
// SCOPE — reference: gstack CEO review
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
export const SCOPE = {
|
|
5
|
+
schemaShape: "v2",
|
|
5
6
|
stage: "scope",
|
|
7
|
+
complexityTier: "standard",
|
|
6
8
|
skillFolder: "scope-shaping",
|
|
7
9
|
skillName: "scope-shaping",
|
|
8
10
|
skillDescription: "Strategic scope stage. Challenge premise and lock explicit in-scope/out-of-scope boundaries using CEO-level thinking.",
|
|
9
|
-
|
|
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
|
-
stopGate: true
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
title: "Deferred Items Review",
|
|
143
|
-
evaluationPoints: [
|
|
144
|
-
"Does each deferred item have a one-line rationale?",
|
|
145
|
-
"Are any deferred items actually blockers for the core scope?",
|
|
146
|
-
"Will deferring these items create technical debt that is expensive to unwind?"
|
|
147
|
-
],
|
|
148
|
-
stopGate: true
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
title: "Risk and Reversibility Check",
|
|
152
|
-
evaluationPoints: [
|
|
153
|
-
"For each major scope decision: is it reversible?",
|
|
154
|
-
"What is the blast radius if this decision is wrong?",
|
|
155
|
-
"Are there hidden dependencies between in-scope and out-of-scope items?"
|
|
156
|
-
],
|
|
157
|
-
stopGate: true
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
title: "Existing-Code Reuse Check",
|
|
161
|
-
evaluationPoints: [
|
|
162
|
-
"Has every sub-problem been mapped to existing code?",
|
|
163
|
-
"Is the plan rebuilding anything that already exists?",
|
|
164
|
-
"Are there integration opportunities that reduce new code?",
|
|
165
|
-
"Have you searched for built-in or library solutions before scoping custom work?"
|
|
166
|
-
],
|
|
167
|
-
stopGate: true
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
title: "Error & Rescue Scope Check",
|
|
171
|
-
evaluationPoints: [
|
|
172
|
-
"For every new capability: what breaks if it fails?",
|
|
173
|
-
"Is failure detection in scope or deferred? If deferred, is that acceptable?",
|
|
174
|
-
"Are there rescue/fallback paths for critical user journeys?",
|
|
175
|
-
"Is observability (logging, metrics, alerts) explicitly in or out of scope?"
|
|
176
|
-
],
|
|
177
|
-
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.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.md",
|
|
135
|
+
completionStatus: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED"],
|
|
136
|
+
crossStageTrace: {
|
|
137
|
+
readsFrom: [".cclaw/artifacts/01-brainstorm.md"],
|
|
138
|
+
writesTo: [".cclaw/artifacts/02-scope.md"],
|
|
139
|
+
traceabilityRule: "Every scope boundary must be traceable to a brainstorm decision. Every downstream design choice must stay within the scope contract."
|
|
178
140
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
+
]
|
|
195
225
|
},
|
|
196
|
-
|
|
197
|
-
{ section: "Pre-Scope System Audit", required: false, validationRule: "Must capture git log/diff/stash/debt-marker findings before premise challenge." },
|
|
198
|
-
{ 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." },
|
|
199
|
-
{ section: "Premise Challenge", required: false, validationRule: "Must contain explicit answers to: right problem? direct path? what if nothing?" },
|
|
200
|
-
{ section: "Landscape Check", required: false, validationRule: "When mode is EXPAND/SELECTIVE, include at least one external reference insight and its impact on scope." },
|
|
201
|
-
{ section: "Taste Calibration", required: false, validationRule: "Must reference 2-3 strong in-repo modules/files that define the quality bar or explicitly justify omission." },
|
|
202
|
-
{ 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`." },
|
|
203
|
-
{ 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." },
|
|
204
|
-
{ 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." },
|
|
205
|
-
{ section: "Scope Mode", required: true, validationRule: "Must state selected mode and rationale with default heuristic justification." },
|
|
206
|
-
{ 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)." },
|
|
207
|
-
{ section: "In Scope / Out of Scope", required: true, validationRule: "Two separate explicit lists. Out-of-scope must not be empty." },
|
|
208
|
-
{ section: "Discretion Areas", required: false, validationRule: "Explicit list of implementer decision zones, or 'None' if scope is fully locked." },
|
|
209
|
-
{ section: "Deferred Items", required: false, validationRule: "Each item has one-line rationale. If empty, state 'None' explicitly." },
|
|
210
|
-
{ section: "Error & Rescue Registry", required: false, validationRule: "Each scoped capability has: failure mode, detection method, fallback decision." },
|
|
211
|
-
{ section: "Outside Voice Findings", required: false, validationRule: "Must list external/adversarial findings and disposition (accept/reject/defer) with rationale." },
|
|
212
|
-
{ section: "Spec Review Loop", required: false, validationRule: "Must record iterations (max 3), quality score per iteration, stop reason, and unresolved concerns." },
|
|
213
|
-
{ section: "Completion Dashboard", required: true, validationRule: "Lists per-review-section status, count of critical/open gaps, resolved decisions, and unresolved decisions (or 'None')." },
|
|
214
|
-
{ section: "Scope Summary", required: true, validationRule: "Clean summary: mode, strongest challenges, recommended path, accepted scope, deferred, excluded." },
|
|
215
|
-
{ section: "Dream State Mapping", required: false, validationRule: "If present (complex projects): CURRENT STATE, THIS PLAN, 12-MONTH IDEAL, and alignment verdict." },
|
|
216
|
-
{ section: "Temporal Interrogation", required: false, validationRule: "If present (complex projects): timeline simulation table with decision pressures and lock-now vs defer verdicts." }
|
|
217
|
-
]
|
|
226
|
+
next: "design"
|
|
218
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: [
|
|
@@ -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;
|