cclaw-cli 7.0.1 → 7.0.2
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/skills.js
CHANGED
|
@@ -183,13 +183,37 @@ export function tddTopOfSkillBlock(stage) {
|
|
|
183
183
|
return "";
|
|
184
184
|
return `## TDD orchestration primer
|
|
185
185
|
|
|
186
|
-
**
|
|
186
|
+
**MANDATE — controller never implements.** In TDD the controller plans, dispatches, and reconciles. **NEVER edit production code, tests, or run cargo/npm/pytest yourself in the controller chat.** Every slice's RED → GREEN → REFACTOR → DOC cycle MUST happen inside an isolated \`slice-builder\` span dispatched via the harness Task tool. Inline code edits in the controller chat are a protocol violation that defeats parallelism, evidence isolation, and the audit ledger.
|
|
187
187
|
|
|
188
|
-
**
|
|
188
|
+
**Step 1 — Wave status (always first):**
|
|
189
|
+
\`node .cclaw/cli.mjs internal wave-status --json\`
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
The output names: \`waves[]\` (closed/open), \`nextDispatch.waveId\`, \`nextDispatch.mode\` (\`wave-fanout\` or \`single-slice\`), \`nextDispatch.readyToDispatch\` (slice ids), and \`nextDispatch.pathConflicts\` (overlapping \`claimedPaths\` between members).
|
|
191
192
|
|
|
192
|
-
**
|
|
193
|
+
**Step 2 — Decide automatically (no user question when paths disjoint):**
|
|
194
|
+
|
|
195
|
+
| \`mode\` | \`pathConflicts\` | Action |
|
|
196
|
+
|------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
|
|
197
|
+
| \`wave-fanout\` | \`[]\` | **Fan out the entire wave in one tool batch.** Emit one \`Task\` per ready slice in a single controller message. Do NOT ask the user. |
|
|
198
|
+
| \`wave-fanout\` | non-empty | Issue exactly one AskQuestion (resolve the overlap, drop the conflicting slice, or downgrade to single-slice for the disputed member). |
|
|
199
|
+
| \`single-slice\` | — | One \`Task\` for the next ready slice. |
|
|
200
|
+
|
|
201
|
+
**Step 3 — Dispatch protocol per slice:** in the SAME controller message that issues the \`Task\` call:
|
|
202
|
+
|
|
203
|
+
1. Append \`delegation-record --status=scheduled\` for the \`slice-builder\` span (one row per slice; reuse the same \`spanId\` across the entire RED → GREEN → REFACTOR → DOC lifecycle).
|
|
204
|
+
2. Append \`delegation-record --status=launched\` immediately after.
|
|
205
|
+
3. Issue the harness Task call: \`Task(subagent_type=<harness slice-builder mapping>, description="slice-builder <slice-id>", prompt="<full slice context, claimedPaths, plan-row, AC ids, paths to source/tests, slice-card path>")\`.
|
|
206
|
+
4. The slice-builder span ACKs locally (\`delegation-record --status=acknowledged\`) and runs the **complete** RED → GREEN → REFACTOR → DOC cycle inside the span — including writing \`tdd-slices/S-<id>.md\` and emitting \`--phase=red\`, \`--phase=green\`, \`--phase=refactor\` (or \`--phase=refactor-deferred\` with rationale), and \`--phase=doc\` rows on its own.
|
|
207
|
+
5. The controller waits for ALL parallel spans to terminate before reconciling. Do not page back into the controller chat between spans.
|
|
208
|
+
|
|
209
|
+
**Step 4 — Wave closeout:** after all in-flight slices report \`completed\`:
|
|
210
|
+
|
|
211
|
+
1. Re-run \`wave-status --json\`. Confirm the wave is \`closed\` and the next dispatch is the following wave (or \`closeout\`).
|
|
212
|
+
2. If \`integrationCheckRequired\` is true, dispatch \`integration-overseer\` (proactive) and append the \`cclaw_integration_overseer_skipped\` audit kind only when the contract waives it.
|
|
213
|
+
3. If \`wave-status\` reports another \`wave-fanout\` next dispatch with disjoint paths, **immediately repeat Step 2 — do not pause for \"continue\"**.
|
|
214
|
+
4. When all waves are closed and no more slices remain ready, run \`stage-complete tdd\`.
|
|
215
|
+
|
|
216
|
+
**Step 5 — Auto-advance after stage-complete:** when \`stage-complete\` returns \`ok\` with a new \`currentStage\`, immediately load the next stage skill and continue. The user does NOT need to retype \`/cc\`. Announce \"Stage tdd complete → entering <next>. Continuing.\" and proceed.
|
|
193
217
|
|
|
194
218
|
Wave resume: reuse \`wave-status\` outputs and parallelize unfinished members instead of restarting finished slices.
|
|
195
219
|
|
|
@@ -115,7 +115,13 @@ If during any stage the agent discovers evidence that contradicts the initial Ph
|
|
|
115
115
|
2. If flow state is missing → guide the user to run \`npx cclaw-cli init\` and stop.
|
|
116
116
|
3. If flow state is only a fresh init placeholder (\`completedStages: []\`, all \`passed\` arrays empty, and no \`00-idea.md\`) → stop and ask for \`/cc <prompt>\` to start a tracked run. Do not create a brainstorm state implicitly.
|
|
117
117
|
4. Otherwise check current stage gates, resume if incomplete, and advance if complete.
|
|
118
|
-
5. **TDD wave dispatch:** When \`currentStage\` is \`tdd\`, run \`node .cclaw/cli.mjs internal wave-status --json\` first, then read the managed **Parallel Execution Plan** block inside \`${RUNTIME_ROOT}/artifacts/05-plan.md\` plus \`${RUNTIME_ROOT}/artifacts/wave-plans/\` for detail. Resume partial waves on remaining members only.
|
|
118
|
+
5. **TDD wave dispatch:** When \`currentStage\` is \`tdd\`, run \`node .cclaw/cli.mjs internal wave-status --json\` first, then read the managed **Parallel Execution Plan** block inside \`${RUNTIME_ROOT}/artifacts/05-plan.md\` plus \`${RUNTIME_ROOT}/artifacts/wave-plans/\` for detail. Resume partial waves on remaining members only.
|
|
119
|
+
|
|
120
|
+
**The controller never edits production code in TDD.** When \`mode: wave-fanout\` and \`pathConflicts: []\`, fan out the entire wave in a SINGLE controller message: one harness \`Task(subagent_type=…, description="slice-builder S-<id>", prompt=<full slice context>)\` call per ready slice, **side by side in the same tool batch**. Each \`slice-builder\` span owns the full RED → GREEN → REFACTOR → DOC cycle for its slice and emits its own \`delegation-record --phase=red|green|refactor|refactor-deferred|doc\` rows. RED-before-GREEN is enforced per-slice by the linter.
|
|
121
|
+
|
|
122
|
+
When \`mode: wave-fanout\` reports \`pathConflicts\`, surface exactly one AskQuestion that lets the user resolve the overlap (drop / split / serialize). When \`mode: single-slice\`, dispatch one \`Task\` for the next ready slice.
|
|
123
|
+
|
|
124
|
+
6. **Auto-advance after stage-complete:** when \`stage-complete\` returns \`ok\` with a new \`currentStage\`, immediately load the next stage skill and continue without waiting for the user to retype \`/cc\`. Announce \`Stage <prev> complete → entering <next>. Continuing.\` and proceed.
|
|
119
125
|
|
|
120
126
|
## Headless mode (CI/automation only)
|
|
121
127
|
|
|
@@ -208,10 +214,10 @@ Progress the tracked flow only when one exists:
|
|
|
208
214
|
2. If missing, guide the user to run \`npx cclaw-cli init\` and stop.
|
|
209
215
|
3. If it is only a fresh init placeholder (\`completedStages: []\`, no passed gates, and no \`${RUNTIME_ROOT}/artifacts/00-idea.md\`), stop and ask for \`/cc <prompt>\` to start a tracked run. Do not silently create a brainstorm run.
|
|
210
216
|
4. Check gates for \`currentStage\`.
|
|
211
|
-
5. **TDD:** When \`currentStage\` is \`tdd\`, run \`wave-status --json\`, then reconcile the managed **Parallel Execution Plan** in \`05-plan.md\` with \`wave-plans/wave-NN.md\`
|
|
217
|
+
5. **TDD:** When \`currentStage\` is \`tdd\`, run \`wave-status --json\`, then reconcile the managed **Parallel Execution Plan** in \`05-plan.md\` with \`wave-plans/wave-NN.md\`. **The controller never edits production code in TDD.** When \`mode: wave-fanout\` and \`pathConflicts: []\`, fan out the wave in a SINGLE controller message — one \`Task\` per ready slice, side by side. Each \`slice-builder\` span owns its full RED → GREEN → REFACTOR → DOC cycle. Mirror plan \`dependsOn\` ordering between waves.
|
|
212
218
|
6. **Wave resume:** Parallelize unfinished members; never restart completed lanes. Integration-overseer follows \`integrationCheckRequired\`; when skipped, emit \`cclaw_integration_overseer_skipped\` per the hook contract.
|
|
213
219
|
7. If incomplete → load current stage skill and execute.
|
|
214
|
-
8. If complete → advance to next stage and execute.
|
|
220
|
+
8. If complete → advance to next stage and execute. **Auto-advance:** when \`stage-complete\` returns \`ok\`, immediately load the next stage skill and continue without waiting for the user to retype \`/cc\`.
|
|
215
221
|
9. If flow is done → report completion.
|
|
216
222
|
|
|
217
223
|
## Public flow habit
|
|
@@ -395,11 +395,11 @@ This document bridges **Superpowers-style task isolation** with the **gstack “
|
|
|
395
395
|
## HARD-GATE
|
|
396
396
|
|
|
397
397
|
${conversationLanguagePolicyMarkdown()}
|
|
398
|
-
**
|
|
398
|
+
**Default rule:** parallel implementation agents are SAFE for investigation, analysis, review, and the **TDD wave-fanout** path; otherwise keep implementation sequential.
|
|
399
399
|
|
|
400
|
-
|
|
400
|
+
**TDD wave-fanout is the supported parallel-implementation path.** When \`cclaw-cli internal wave-status --json\` reports \`mode: wave-fanout\` and \`pathConflicts: []\`, fan out one \`slice-builder\` span per ready slice in a single controller message. Each span owns its disjoint \`claimedPaths\`; the dispatcher rejects overlapping spans with \`DispatchOverlapError\` inline, so the disjoint-paths invariant is enforced for you.
|
|
401
401
|
|
|
402
|
-
|
|
402
|
+
**Outside wave-fanout** — for ad-hoc parallel implementation that touches shared source trees — keep work **sequential** unless you have proven disjoint filesystem ownership and an explicit merge protocol.
|
|
403
403
|
|
|
404
404
|
## When to Use
|
|
405
405
|
|
|
@@ -424,7 +424,7 @@ When explicit bounded TDD fan-out is approved with parallel \`slice-builder\` la
|
|
|
424
424
|
## Dispatch Protocol
|
|
425
425
|
|
|
426
426
|
1. **Identify independent problem domains** (no file overlap; no shared mutable working assumptions).
|
|
427
|
-
2. **Author cohesion contract
|
|
427
|
+
2. **Author a cohesion contract** only when fan-out touches **shared interfaces or shared types** between slices in the same wave. For TDD wave-fanout where every member's \`claimedPaths\` are disjoint, a cohesion contract is NOT required — the disjoint-paths invariant plus the \`integration-overseer\` post-fan-in audit cover the integration risk.
|
|
428
428
|
3. **Craft one prompt per domain** with **full context pasted** — same HARD-GATE as SDD: no “go read X to learn why.”
|
|
429
429
|
4. **Launch ALL agents in a single controller message** (multiple Task tool calls) so they start with comparable timelines.
|
|
430
430
|
5. **Wait for all to return** before synthesis (avoid incremental confirmation bias).
|