cclaw-cli 0.3.0 → 0.4.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.
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stageSchema } from "./stage-schema.js";
|
|
2
2
|
import { stageSkillFolder } from "./skills.js";
|
|
3
3
|
export function commandContract(stage) {
|
|
4
4
|
const schema = stageSchema(stage);
|
|
5
|
-
const nextCommand = nextCclawCommand(stage);
|
|
6
5
|
const skillPath = `.cclaw/skills/${stageSkillFolder(stage)}/SKILL.md`;
|
|
7
6
|
const reads = schema.crossStageTrace.readsFrom;
|
|
8
7
|
const readsLine = reads.length > 0 ? reads.join(", ") : "(first stage)";
|
|
@@ -28,7 +27,7 @@ ${schema.hardGate}
|
|
|
28
27
|
## In / Out
|
|
29
28
|
- **Reads:** ${readsLine}
|
|
30
29
|
- **Writes:** \`.cclaw/artifacts/${schema.artifactFile}\` (canonical run copy: \`.cclaw/runs/<activeRunId>/artifacts/${schema.artifactFile}\`)
|
|
31
|
-
- **Next:**
|
|
30
|
+
- **Next:** \`/cc-next\` (updates flow-state and loads the next stage)
|
|
32
31
|
|
|
33
32
|
## Context Hydration (mandatory before stage work)
|
|
34
33
|
1. Read \`.cclaw/state/flow-state.json\` and capture \`activeRunId\`.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Command contract for /cc-next
|
|
3
|
-
*
|
|
2
|
+
* Command contract for /cc-next — the primary progression command.
|
|
3
|
+
* Reads flow-state, starts the current stage if unfinished, or advances if all gates pass.
|
|
4
4
|
*/
|
|
5
5
|
export declare function nextCommandContract(): string;
|
|
6
6
|
/**
|
|
7
|
-
* Skill body for /cc-next
|
|
7
|
+
* Skill body for /cc-next — the primary flow progression command.
|
|
8
8
|
*/
|
|
9
9
|
export declare function nextCommandSkillMarkdown(): string;
|
|
@@ -6,15 +6,12 @@ const NEXT_SKILL_NAME = "flow-next-step";
|
|
|
6
6
|
function flowStatePath() {
|
|
7
7
|
return `${RUNTIME_ROOT}/state/flow-state.json`;
|
|
8
8
|
}
|
|
9
|
-
function configPathLine() {
|
|
10
|
-
return `${RUNTIME_ROOT}/config.yaml`;
|
|
11
|
-
}
|
|
12
9
|
function delegationLogPathLine() {
|
|
13
10
|
return `${RUNTIME_ROOT}/runs/<activeRunId>/delegation-log.json`;
|
|
14
11
|
}
|
|
15
12
|
/**
|
|
16
|
-
* Command contract for /cc-next
|
|
17
|
-
*
|
|
13
|
+
* Command contract for /cc-next — the primary progression command.
|
|
14
|
+
* Reads flow-state, starts the current stage if unfinished, or advances if all gates pass.
|
|
18
15
|
*/
|
|
19
16
|
export function nextCommandContract() {
|
|
20
17
|
const flowPath = flowStatePath();
|
|
@@ -24,115 +21,133 @@ export function nextCommandContract() {
|
|
|
24
21
|
|
|
25
22
|
## Purpose
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
**The primary progression command.** Read flow state, determine what to do:
|
|
25
|
+
|
|
26
|
+
- **Current stage not started / in progress** → load its skill and execute it.
|
|
27
|
+
- **Current stage complete (all gates passed)** → advance \`currentStage\` and load the next skill.
|
|
28
|
+
- **Flow complete** → report done.
|
|
29
|
+
|
|
30
|
+
This is the only command the user needs to drive the entire flow. Individual \`/cc-<stage>\` commands are shortcuts for jumping to a specific stage.
|
|
28
31
|
|
|
29
32
|
## HARD-GATE
|
|
30
33
|
|
|
31
34
|
- **Do not** invent gate completion: use only \`${flowPath}\` plus observable evidence in repo artifacts.
|
|
32
|
-
- **Do not** skip stages:
|
|
33
|
-
-
|
|
34
|
-
- If the flow is already at the terminal stage with all ship gates satisfied, **report completion** instead of advancing.
|
|
35
|
+
- **Do not** skip stages: advance only from \`currentStage\` to its configured successor.
|
|
36
|
+
- If the flow is at the terminal stage with all ship gates satisfied, **report completion**.
|
|
35
37
|
|
|
36
38
|
## Algorithm (mandatory)
|
|
37
39
|
|
|
38
|
-
1. Read **\`${flowPath}
|
|
39
|
-
2. Parse JSON. Capture \`currentStage\`, \`activeRunId
|
|
40
|
-
3.
|
|
41
|
-
4. Let \`
|
|
42
|
-
5.
|
|
43
|
-
6.
|
|
44
|
-
7.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
1. Read **\`${flowPath}\`**. If missing → **BLOCKED** (state missing).
|
|
41
|
+
2. Parse JSON. Capture \`currentStage\`, \`activeRunId\`, and \`stageGateCatalog[currentStage]\`.
|
|
42
|
+
3. Let \`G\` = \`requiredGates\` for **\`currentStage\`** from the stage schema.
|
|
43
|
+
4. Let \`catalog\` = \`stageGateCatalog[currentStage]\` from flow state.
|
|
44
|
+
5. **Satisfied** for gate id \`g\`: \`g\` in \`catalog.passed\` and \`g\` not in \`catalog.blocked\`.
|
|
45
|
+
6. Let \`M\` = \`mandatoryDelegations\` for \`currentStage\`.
|
|
46
|
+
7. If \`M\` is non-empty, inspect **\`${delegationPath}\`**. Treat as satisfied only if the agent is **completed** or **waived**.
|
|
47
|
+
|
|
48
|
+
### Path A: Current stage is NOT complete (any gate unmet or delegation missing)
|
|
49
|
+
|
|
50
|
+
→ Load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** and **\`${RUNTIME_ROOT}/commands/<currentStage>.md\`** for the current stage.
|
|
51
|
+
→ Execute that stage's protocol. The stage skill handles the full interaction including STOP points and gate tracking.
|
|
52
|
+
→ When the stage completes, the Stage Completion Protocol in the skill updates \`flow-state.json\` automatically.
|
|
53
|
+
|
|
54
|
+
### Path B: Current stage IS complete (all gates passed, all delegations satisfied)
|
|
55
|
+
|
|
56
|
+
→ If current stage's \`next\` is **\`done\`**: report **"Flow complete. All stages finished."** and stop.
|
|
57
|
+
→ Otherwise: load **\`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`** and **\`${RUNTIME_ROOT}/commands/<nextStage>.md\`** for the successor stage. Execute that stage's protocol.
|
|
58
|
+
|
|
59
|
+
## Resume Semantics
|
|
60
|
+
|
|
61
|
+
\`/cc-next\` in a **new session** = resume from where you left off:
|
|
62
|
+
- Flow-state records \`currentStage\` and which gates have passed.
|
|
63
|
+
- The stage skill reads upstream artifacts and picks up context.
|
|
64
|
+
- No special resume command needed — \`/cc-next\` IS the resume command.
|
|
52
65
|
|
|
53
66
|
## Primary skill
|
|
54
67
|
|
|
55
|
-
**${skillRel}**
|
|
68
|
+
**${skillRel}** — full protocol and stage table.
|
|
56
69
|
`;
|
|
57
70
|
}
|
|
58
71
|
/**
|
|
59
|
-
* Skill body for /cc-next
|
|
72
|
+
* Skill body for /cc-next — the primary flow progression command.
|
|
60
73
|
*/
|
|
61
74
|
export function nextCommandSkillMarkdown() {
|
|
62
75
|
const flowPath = flowStatePath();
|
|
63
|
-
const cfgPath = configPathLine();
|
|
64
76
|
const delegationPath = delegationLogPathLine();
|
|
65
77
|
const stageRows = ["brainstorm", "scope", "design", "spec", "plan", "test", "build", "review", "ship"]
|
|
66
78
|
.map((stage) => {
|
|
67
79
|
const schema = stageSchema(stage);
|
|
68
|
-
const next = schema.next === "done" ? "(terminal)" :
|
|
80
|
+
const next = schema.next === "done" ? "(terminal)" : schema.next;
|
|
69
81
|
const skillMd = `${RUNTIME_ROOT}/skills/${stageSkillFolder(stage)}/SKILL.md`;
|
|
70
|
-
return `| \`${stage}\` |
|
|
82
|
+
return `| \`${stage}\` | \`${next}\` | \`${skillMd}\` |`;
|
|
71
83
|
})
|
|
72
84
|
.join("\n");
|
|
73
85
|
return `---
|
|
74
86
|
name: ${NEXT_SKILL_NAME}
|
|
75
|
-
description: "
|
|
87
|
+
description: "The primary progression command. Reads flow state, starts/resumes the current stage or advances to the next one."
|
|
76
88
|
---
|
|
77
89
|
|
|
78
|
-
#
|
|
90
|
+
# /cc-next — Flow Progression
|
|
91
|
+
|
|
92
|
+
## Overview
|
|
79
93
|
|
|
80
|
-
|
|
94
|
+
\`/cc-next\` is **the only command you need** to drive the entire cclaw flow.
|
|
81
95
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
**How it works:**
|
|
97
|
+
1. Reads \`flow-state.json\` to find \`currentStage\`
|
|
98
|
+
2. Checks if all gates for that stage are satisfied
|
|
99
|
+
3. If **not** → loads the stage skill and starts/resumes execution
|
|
100
|
+
4. If **yes** → advances to the next stage and loads its skill
|
|
101
|
+
|
|
102
|
+
**Resume:** \`/cc-next\` in a new session picks up from where \`flow-state.json\` says you are.
|
|
85
103
|
|
|
86
104
|
## HARD-GATE
|
|
87
105
|
|
|
88
|
-
Do **not** mark gates satisfied from memory alone. Cite **artifact evidence** (paths, excerpts)
|
|
106
|
+
Do **not** mark gates satisfied from memory alone. Cite **artifact evidence** (paths, excerpts). If evidence is missing, list the gate as **unmet**. Do **not** skip stages.
|
|
107
|
+
|
|
108
|
+
## Algorithm
|
|
89
109
|
|
|
90
|
-
|
|
110
|
+
### Step 1: Read state
|
|
91
111
|
|
|
92
112
|
1. Open **\`${flowPath}\`**.
|
|
93
|
-
2. Record \`currentStage\`, \`activeRunId\`,
|
|
94
|
-
3. If the file is missing or invalid JSON
|
|
95
|
-
4. Resolve the current delegation ledger at **\`${delegationPath}\`** using the recorded \`activeRunId\`.
|
|
113
|
+
2. Record \`currentStage\`, \`activeRunId\`, \`stageGateCatalog[currentStage]\`.
|
|
114
|
+
3. If the file is missing or invalid JSON → **BLOCKED** (report and stop).
|
|
96
115
|
|
|
97
|
-
|
|
116
|
+
### Step 2: Evaluate gates
|
|
98
117
|
|
|
99
|
-
For each gate id in
|
|
118
|
+
For each gate id in \`requiredGates\` for \`currentStage\`:
|
|
119
|
+
- **Met** if in \`catalog.passed\` and not in \`catalog.blocked\`.
|
|
120
|
+
- **Unmet** otherwise.
|
|
100
121
|
|
|
101
|
-
|
|
102
|
-
- **Blocked** if the id is in \`catalog.blocked\` (always list these first).
|
|
103
|
-
- **Unmet** if not met (explain what evidence or artifact action is still needed, using the gate's description from the schema).
|
|
122
|
+
Check \`mandatoryDelegations\` via **\`${delegationPath}\`** — satisfied only if **completed** or **waived**.
|
|
104
123
|
|
|
105
|
-
|
|
124
|
+
### Step 3: Act
|
|
106
125
|
|
|
107
|
-
|
|
108
|
-
- If any mandatory agent is required, inspect **\`${delegationPath}\`**. Treat that agent as satisfied only if the ledger records it as **completed** or explicitly **waived** by the user.
|
|
109
|
-
- Treat explicit pause rules from the current stage skill (for example \`WAIT_FOR_CONFIRM\`, \`Do NOT auto-advance\`, or "wait for explicit approval") as authoritative. **/cc-next** does not override them.
|
|
126
|
+
**Path A — stage NOT complete (any gate unmet):**
|
|
110
127
|
|
|
111
|
-
|
|
128
|
+
Load the current stage's skill and command contract:
|
|
129
|
+
- \`${RUNTIME_ROOT}/skills/<skillFolder>/SKILL.md\`
|
|
130
|
+
- \`${RUNTIME_ROOT}/commands/<currentStage>.md\`
|
|
112
131
|
|
|
113
|
-
|
|
132
|
+
Execute the stage protocol. The stage skill handles interaction, STOP points, gate tracking, and the Stage Completion Protocol (updates \`flow-state.json\` when done).
|
|
114
133
|
|
|
115
|
-
|
|
116
|
-
2. Let \`nextStage\` be the \`To\` stage. Read **\`${RUNTIME_ROOT}/commands/<nextStage>.md\`** and **\`${RUNTIME_ROOT}/skills/<folder>/SKILL.md\`** for that row.
|
|
117
|
-
3. **Continue semantics:** execute that stage's protocol **in the same session** as a natural handoff (you are now "in" \`nextStage\` until it completes or blocks).
|
|
118
|
-
4. Honor **\`${cfgPath}\`**: \`autoAdvance\` only applies where the stage skill allows it. Explicit pause / confirmation rules in either the current or next stage always win.
|
|
119
|
-
5. If the next stage reaches a confirmation gate or a "do not auto-advance" boundary, stop there and report readiness instead of claiming automatic advancement through that gate.
|
|
134
|
+
**Path B — stage IS complete (all gates met, all delegations done):**
|
|
120
135
|
|
|
121
|
-
|
|
136
|
+
If \`next\` is \`done\` → report **"Flow complete. All stages finished."** and stop.
|
|
122
137
|
|
|
123
|
-
|
|
124
|
-
|---|---|---|
|
|
125
|
-
${stageRows}
|
|
138
|
+
Otherwise load the next stage's skill and command contract, begin execution.
|
|
126
139
|
|
|
127
|
-
##
|
|
140
|
+
## Stage order
|
|
128
141
|
|
|
129
|
-
|
|
142
|
+
| Stage | Next | Skill path |
|
|
143
|
+
|---|---|---|
|
|
144
|
+
${stageRows}
|
|
130
145
|
|
|
131
146
|
## Anti-patterns
|
|
132
147
|
|
|
133
148
|
- Advancing when \`blocked\` is non-empty for the current stage.
|
|
134
149
|
- Treating \`passed\` as trusted when artifact evidence contradicts it.
|
|
135
|
-
- Using **/cc-next** to bypass \`WAIT_FOR_CONFIRM\`, explicit approval pauses, or missing mandatory delegations.
|
|
136
150
|
- Skipping **review** or **ship** because "the code looks fine".
|
|
151
|
+
- Loading a stage skill directly instead of using \`/cc-next\` for progression.
|
|
137
152
|
`;
|
|
138
153
|
}
|
package/dist/content/skills.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RUNTIME_ROOT } from "../constants.js";
|
|
2
2
|
import { stageExamples } from "./examples.js";
|
|
3
3
|
import { selfImprovementBlock } from "./learnings.js";
|
|
4
|
-
import {
|
|
4
|
+
import { QUESTION_FORMAT_SPEC, ERROR_BUDGET_SPEC, stageAutoSubagentDispatch, stageSchema } from "./stage-schema.js";
|
|
5
5
|
function artifactFileName(artifactPath) {
|
|
6
6
|
const parts = artifactPath.split("/");
|
|
7
7
|
return parts[parts.length - 1] ?? artifactPath;
|
|
@@ -145,55 +145,44 @@ After plan approval (**WAIT_FOR_CONFIRM** / \`plan_wait_for_confirm\` satisfied)
|
|
|
145
145
|
|
|
146
146
|
`;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
**STOP.** This stage requires explicit user confirmation before advancing.
|
|
175
|
-
Even if project config has \`autoAdvance: true\`, this stage's pause rule takes precedence.
|
|
176
|
-
Do NOT auto-advance after gates pass. Present a summary of completed gates and suggest \`${nextCommand}\`, then wait for explicit user approval.
|
|
177
|
-
|
|
178
|
-
`;
|
|
179
|
-
}
|
|
180
|
-
return `## Stage transition (gate chain)
|
|
181
|
-
|
|
182
|
-
After all gates pass, suggest the next command (\`${nextCommand}\`).
|
|
183
|
-
If project config at \`${RUNTIME_ROOT}/config.yaml\` has \`autoAdvance: true\`, proceed automatically.
|
|
184
|
-
Otherwise, **STOP** and wait for user confirmation before advancing.
|
|
185
|
-
|
|
148
|
+
function stageCompletionProtocol(schema) {
|
|
149
|
+
const stage = schema.stage;
|
|
150
|
+
const gateIds = schema.requiredGates.map((g) => g.id);
|
|
151
|
+
const gateList = gateIds.map((id) => `\`${id}\``).join(", ");
|
|
152
|
+
const nextStage = schema.next === "done" ? null : schema.next;
|
|
153
|
+
const stateUpdate = nextStage
|
|
154
|
+
? ` - Set \`currentStage\` to \`"${nextStage}"\`
|
|
155
|
+
- Add \`"${stage}"\` to \`completedStages\` array
|
|
156
|
+
- Move all gate IDs for this stage (${gateList}) into \`stageGateCatalog.${stage}.passed\`
|
|
157
|
+
- Clear \`stageGateCatalog.${stage}.blocked\``
|
|
158
|
+
: ` - Add \`"${stage}"\` to \`completedStages\` array
|
|
159
|
+
- Move all gate IDs for this stage (${gateList}) into \`stageGateCatalog.${stage}.passed\`
|
|
160
|
+
- Clear \`stageGateCatalog.${stage}.blocked\``;
|
|
161
|
+
const nextAction = nextStage
|
|
162
|
+
? `3. Tell the user: **"Stage \`${stage}\` complete. Next stage: \`${nextStage}\`. Run \`/cc-next\` to continue."**`
|
|
163
|
+
: `3. Tell the user: **"Flow complete. All stages finished."**`;
|
|
164
|
+
return `## Stage Completion Protocol
|
|
165
|
+
|
|
166
|
+
When all required gates are satisfied and the artifact is written:
|
|
167
|
+
|
|
168
|
+
1. **Update \`${RUNTIME_ROOT}/state/flow-state.json\`:**
|
|
169
|
+
${stateUpdate}
|
|
170
|
+
2. **Sync artifact** to \`${RUNTIME_ROOT}/runs/<activeRunId>/artifacts/${schema.artifactFile}\`
|
|
171
|
+
${nextAction}
|
|
172
|
+
|
|
173
|
+
**STOP.** Do not load the next stage skill yourself. The user will run \`/cc-next\` when ready (same session or new session).
|
|
186
174
|
`;
|
|
187
175
|
}
|
|
188
|
-
function
|
|
176
|
+
function stageTransitionAutoAdvanceBlock(schema) {
|
|
177
|
+
return stageCompletionProtocol(schema);
|
|
178
|
+
}
|
|
179
|
+
function progressiveDisclosureBlock(stage) {
|
|
189
180
|
const schema = stageSchema(stage);
|
|
190
181
|
const stageSpecificRefs = {
|
|
191
182
|
brainstorm: [
|
|
192
|
-
"- `.cclaw/skills/autoplan/SKILL.md` — when the user wants brainstorm→plan orchestration in one flow",
|
|
193
183
|
"- `.cclaw/skills/learnings/SKILL.md` — to capture durable framing insights early"
|
|
194
184
|
],
|
|
195
185
|
scope: [
|
|
196
|
-
"- `.cclaw/skills/autoplan/SKILL.md` — for coordinated premise challenge across early stages",
|
|
197
186
|
"- `.cclaw/skills/learnings/SKILL.md` — to persist rejected assumptions and constraints"
|
|
198
187
|
],
|
|
199
188
|
design: [
|
|
@@ -237,7 +226,7 @@ function progressiveDisclosureBlock(stage, nextCommand) {
|
|
|
237
226
|
- Meta routing and activation rules: \`.cclaw/skills/using-cclaw/SKILL.md\`
|
|
238
227
|
- Session continuity and checkpoint behavior: \`.cclaw/skills/session/SKILL.md\`
|
|
239
228
|
${stageSpecificRefs[stage].join("\n")}
|
|
240
|
-
-
|
|
229
|
+
- Progression command: \`/cc-next\` (reads flow-state, loads the next stage)
|
|
241
230
|
`;
|
|
242
231
|
}
|
|
243
232
|
function verificationBlock(stage) {
|
|
@@ -282,7 +271,6 @@ export function stageSkillFolder(stage) {
|
|
|
282
271
|
}
|
|
283
272
|
function quickStartBlock(stage) {
|
|
284
273
|
const schema = stageSchema(stage);
|
|
285
|
-
const nextCommand = nextCclawCommand(stage);
|
|
286
274
|
const topGates = schema.requiredGates.slice(0, 3).map((g) => `\`${g.id}\``).join(", ");
|
|
287
275
|
return `## Quick Start (minimum compliance)
|
|
288
276
|
|
|
@@ -291,12 +279,11 @@ function quickStartBlock(stage) {
|
|
|
291
279
|
> 2. Complete every checklist step in order and write the artifact to \`.cclaw/artifacts/${schema.artifactFile}\` (canonical run copy: \`.cclaw/runs/<activeRunId>/artifacts/${schema.artifactFile}\`).
|
|
292
280
|
> 3. Do not claim completion without satisfying gates: ${topGates}${schema.requiredGates.length > 3 ? ` (+${schema.requiredGates.length - 3} more)` : ""}.
|
|
293
281
|
>
|
|
294
|
-
> **
|
|
282
|
+
> **After this stage:** update \`flow-state.json\` and tell the user to run \`/cc-next\`.
|
|
295
283
|
`;
|
|
296
284
|
}
|
|
297
285
|
export function stageSkillMarkdown(stage) {
|
|
298
286
|
const schema = stageSchema(stage);
|
|
299
|
-
const nextCommand = nextCclawCommand(stage);
|
|
300
287
|
const gateList = schema.requiredGates
|
|
301
288
|
.map((g) => `- \`${g.id}\` — ${g.description}`)
|
|
302
289
|
.join("\n");
|
|
@@ -382,11 +369,11 @@ ${completionStatusBlock(stage)}
|
|
|
382
369
|
## Verification
|
|
383
370
|
${schema.exitCriteria.map((item) => `- [ ] ${item}`).join("\n")}
|
|
384
371
|
|
|
385
|
-
${stageTransitionAutoAdvanceBlock(schema
|
|
386
|
-
${progressiveDisclosureBlock(stage
|
|
372
|
+
${stageTransitionAutoAdvanceBlock(schema)}
|
|
373
|
+
${progressiveDisclosureBlock(stage)}
|
|
387
374
|
${selfImprovementBlock(stage)}
|
|
388
375
|
## Handoff
|
|
389
|
-
- Next command:
|
|
376
|
+
- Next command: \`/cc-next\` (loads whatever stage is current in flow-state)
|
|
390
377
|
- Required artifact: \`.cclaw/artifacts/${schema.artifactFile}\` (canonical: \`.cclaw/runs/<activeRunId>/artifacts/${schema.artifactFile}\`)
|
|
391
378
|
- Stage stays blocked if any required gate is unsatisfied
|
|
392
379
|
`;
|
|
@@ -44,7 +44,7 @@ const BRAINSTORM = {
|
|
|
44
44
|
"Write design doc — save to `.cclaw/artifacts/01-brainstorm.md`.",
|
|
45
45
|
"Self-review — scan for placeholders, TBDs, contradictions, ambiguity, scope creep. Fix inline.",
|
|
46
46
|
"User reviews written artifact — ask user to review before proceeding. **STOP.** Do NOT proceed until user responds.",
|
|
47
|
-
"
|
|
47
|
+
"Stage complete — update `flow-state.json` per the Stage Completion Protocol. Tell user to run `/cc-next` to continue to scope."
|
|
48
48
|
],
|
|
49
49
|
interactionProtocol: [
|
|
50
50
|
"Explore context first (files, docs, existing behavior).",
|
|
@@ -689,15 +689,15 @@ const PLAN = {
|
|
|
689
689
|
"Slice into vertical tasks — each task targets 2-5 minutes, produces one testable outcome, and touches one coherent area.",
|
|
690
690
|
"Attach verification — every task has an acceptance criterion mapping and a concrete verification command.",
|
|
691
691
|
"Define checkpoints — mark points where progress should be validated before continuing.",
|
|
692
|
-
"WAIT_FOR_CONFIRM — write plan artifact and explicitly pause. **STOP.** Do NOT proceed
|
|
692
|
+
"WAIT_FOR_CONFIRM — write plan artifact and explicitly pause. **STOP.** Do NOT proceed until user confirms. Then update `flow-state.json` and tell user to run `/cc-next`."
|
|
693
693
|
],
|
|
694
694
|
interactionProtocol: [
|
|
695
695
|
"Plan in read-only mode relative to implementation.",
|
|
696
696
|
"Split work into small vertical slices (target 2-5 minute tasks).",
|
|
697
697
|
"Publish explicit dependency waves with entry and exit checks for each wave.",
|
|
698
698
|
"Attach verification step to every task.",
|
|
699
|
-
"Enforce WAIT_FOR_CONFIRM
|
|
700
|
-
"**STOP.** Do NOT proceed
|
|
699
|
+
"Enforce WAIT_FOR_CONFIRM: present the plan summary with options (A) Approve / (B) Revise / (C) Reject.",
|
|
700
|
+
"**STOP.** Do NOT proceed until user explicitly approves. Then update `flow-state.json` and tell user to run `/cc-next`."
|
|
701
701
|
],
|
|
702
702
|
process: [
|
|
703
703
|
"Build dependency graph and ordered slices.",
|
|
@@ -793,7 +793,7 @@ const TEST = {
|
|
|
793
793
|
purpose: "Create RED evidence tied to acceptance criteria before any implementation.",
|
|
794
794
|
whenToUse: [
|
|
795
795
|
"After plan confirmation",
|
|
796
|
-
"
|
|
796
|
+
"After RED evidence from test stage (user runs /cc-next)",
|
|
797
797
|
"For every behavior change in scope"
|
|
798
798
|
],
|
|
799
799
|
whenNotToUse: [
|