cclaw-cli 6.14.3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/artifact-linter/brainstorm.js +1 -1
- package/dist/artifact-linter/design.js +2 -2
- package/dist/artifact-linter/findings-dedup.js +1 -1
- package/dist/artifact-linter/plan.js +6 -6
- package/dist/artifact-linter/review-army.d.ts +1 -1
- package/dist/artifact-linter/review-army.js +1 -1
- package/dist/artifact-linter/scope.js +6 -6
- package/dist/artifact-linter/shared.d.ts +37 -73
- package/dist/artifact-linter/shared.js +30 -37
- package/dist/artifact-linter/spec.js +1 -1
- package/dist/artifact-linter/tdd.d.ts +20 -33
- package/dist/artifact-linter/tdd.js +89 -617
- package/dist/artifact-linter.js +11 -32
- package/dist/cli.js +1 -1
- package/dist/config.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/content/core-agents.d.ts +8 -26
- package/dist/content/core-agents.js +48 -94
- package/dist/content/examples.d.ts +1 -1
- package/dist/content/examples.js +4 -4
- package/dist/content/hooks.js +62 -149
- package/dist/content/idea.js +2 -2
- package/dist/content/iron-laws.js +1 -1
- package/dist/content/node-hooks.js +2 -2
- package/dist/content/skills-elicitation.js +2 -2
- package/dist/content/skills.d.ts +4 -6
- package/dist/content/skills.js +14 -53
- package/dist/content/stage-schema.d.ts +3 -3
- package/dist/content/stage-schema.js +8 -46
- package/dist/content/stages/brainstorm.js +5 -5
- package/dist/content/stages/plan.js +2 -2
- package/dist/content/stages/review.js +1 -1
- package/dist/content/stages/schema-types.d.ts +1 -1
- package/dist/content/stages/scope.js +1 -1
- package/dist/content/stages/spec.js +2 -2
- package/dist/content/stages/tdd.js +43 -108
- package/dist/content/start-command.js +3 -3
- package/dist/content/subagent-context-skills.js +5 -3
- package/dist/content/subagents.js +13 -74
- package/dist/content/templates.d.ts +6 -6
- package/dist/content/templates.js +23 -24
- package/dist/content/utility-skills.d.ts +1 -1
- package/dist/content/utility-skills.js +1 -1
- package/dist/delegation.d.ts +79 -139
- package/dist/delegation.js +83 -215
- package/dist/early-loop.js +1 -1
- package/dist/flow-state.d.ts +24 -129
- package/dist/flow-state.js +5 -30
- package/dist/gate-evidence.d.ts +2 -7
- package/dist/gate-evidence.js +2 -59
- package/dist/harness-adapters.d.ts +1 -1
- package/dist/harness-adapters.js +11 -10
- package/dist/install.js +24 -459
- package/dist/internal/advance-stage/advance.d.ts +5 -5
- package/dist/internal/advance-stage/advance.js +9 -24
- package/dist/internal/advance-stage/parsers.d.ts +1 -1
- package/dist/internal/advance-stage/review-loop.d.ts +1 -1
- package/dist/internal/advance-stage/review-loop.js +3 -3
- package/dist/internal/advance-stage/start-flow.js +1 -3
- package/dist/internal/advance-stage.js +4 -23
- package/dist/internal/cohesion-contract-stub.d.ts +8 -13
- package/dist/internal/cohesion-contract-stub.js +18 -24
- package/dist/internal/flow-state-repair.d.ts +1 -1
- package/dist/internal/plan-split-waves.d.ts +44 -7
- package/dist/internal/plan-split-waves.js +113 -12
- package/dist/internal/wave-status.d.ts +3 -6
- package/dist/internal/wave-status.js +5 -27
- package/dist/policy.js +1 -1
- package/dist/run-persistence.js +10 -44
- package/dist/runtime/run-hook.mjs +3 -3
- package/dist/track-heuristics.js +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/dist/integration-fanin.d.ts +0 -44
- package/dist/integration-fanin.js +0 -180
- package/dist/internal/set-checkpoint-mode.d.ts +0 -16
- package/dist/internal/set-checkpoint-mode.js +0 -72
- package/dist/internal/set-integration-overseer-mode.d.ts +0 -14
- package/dist/internal/set-integration-overseer-mode.js +0 -69
- package/dist/internal/set-worktree-mode.d.ts +0 -10
- package/dist/internal/set-worktree-mode.js +0 -28
- package/dist/worktree-manager.d.ts +0 -50
- package/dist/worktree-manager.js +0 -136
- package/dist/worktree-types.d.ts +0 -36
- package/dist/worktree-types.js +0 -6
|
@@ -18,7 +18,7 @@ function automaticStageDelegationTable() {
|
|
|
18
18
|
|---|---|---|
|
|
19
19
|
${rows}
|
|
20
20
|
|
|
21
|
-
> **Track-aware skip
|
|
21
|
+
> **Track-aware skip:** mandatory agents are skipped entirely when \`track === "quick"\` OR \`taskClass === "software-bugfix"\`. Use \`mandatoryAgentsFor(stage, track, taskClass)\` from \`src/content/stage-schema.ts\` for the authoritative list at runtime. Proactive agents are trigger-driven opportunities, not a blanket completion gate, and lean/lightweight early-stage runs may intentionally record none.`;
|
|
22
22
|
}
|
|
23
23
|
function stageSummary(stage) {
|
|
24
24
|
return stageDelegationSummary("standard").find((row) => row.stage === stage)
|
|
@@ -37,7 +37,7 @@ description: "Orchestrate implementation via isolated subagents — one fresh ag
|
|
|
37
37
|
Use a **controller -> coder -> overseer** loop when building multi-step software work.
|
|
38
38
|
|
|
39
39
|
- **Controller (parent agent):** owns the plan, gating, sequencing, and dispatch decisions; never mixes deep implementation context with review evidence.
|
|
40
|
-
- **Coder / slice-
|
|
40
|
+
- **Coder / slice-builder (subagent):** receives a **single self-contained task** and edits code only within that scope; exits with a structured status contract.
|
|
41
41
|
- **Overseer / reviewer (subagent):** validates outputs against the specification **by reading code** and never edits during the overseer pass.
|
|
42
42
|
|
|
43
43
|
This pattern is intentionally **Superpowers-style**: cheap parallelism where it doesn’t corrupt state, strict serialization where it would.
|
|
@@ -62,14 +62,15 @@ Reconcile findings into \`.cclaw/artifacts/07-review-army.json\` with explicit s
|
|
|
62
62
|
|
|
63
63
|
### TDD evidence protocol
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Each parallel slice runs end-to-end inside one \`slice-builder\` delegation, with RED, GREEN, REFACTOR, and per-slice DOC as phase intents on a single span:
|
|
66
66
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- \`
|
|
67
|
+
- \`--phase red\`: failing tests only, no production writes
|
|
68
|
+
- \`--phase green\`: minimal production implementation that passes the matching RED
|
|
69
|
+
- \`--phase refactor\` (or \`--phase refactor-deferred --refactor-rationale "<why>"\`): behavior-preserving cleanup, only after GREEN is proven
|
|
70
|
+
- \`--phase doc\`: write \`<artifacts-dir>/tdd-slices/S-<id>.md\` for the slice
|
|
70
71
|
|
|
71
72
|
Set \`CCLAW_ACTIVE_AGENT\` to the active phase name when possible so workflow-guard
|
|
72
|
-
can enforce phase-appropriate write boundaries.
|
|
73
|
+
can enforce phase-appropriate write boundaries. The mandatory gate is the evidence-backed \`slice-builder\` row, not multiple default subagents.
|
|
73
74
|
|
|
74
75
|
## Model & Harness Routing Notes
|
|
75
76
|
|
|
@@ -111,7 +112,7 @@ The only time a \`harness_limitation\` waiver fires automatically is when every
|
|
|
111
112
|
| Tier | Use for | Example agents |
|
|
112
113
|
|---|---|---|
|
|
113
114
|
| \`deep\` | one heavy reasoning pass per stage (planner, final reconciliation) | planner |
|
|
114
|
-
| \`balanced\` | spec compliance + code/security review with enough context | reviewer, security-reviewer,
|
|
115
|
+
| \`balanced\` | spec compliance + code/security review with enough context | reviewer, security-reviewer, slice-builder |
|
|
115
116
|
| \`fast\` | bounded maintenance updates and doc hygiene | doc-updater |
|
|
116
117
|
|
|
117
118
|
**Routing rules:**
|
|
@@ -128,7 +129,7 @@ Concrete per-stage rules so the controller does not have to guess which tier fit
|
|
|
128
129
|
|---|---|---|---|---|
|
|
129
130
|
| brainstorm | planner (only if ambiguity spans >1 module) | product-discovery / critic when product value or premise is uncertain | run in-thread research playbooks | promote to \`balanced\` critic if the do-nothing path may beat the idea |
|
|
130
131
|
| scope | planner (always) | product-discovery / critic when mode changes value, trajectory, or boundaries | run \`research/git-history.md\` in-thread when churn is high | promote to \`balanced\` critic if scope mode is disputed |
|
|
131
|
-
| design | planner (always) | critic, security-reviewer
|
|
132
|
+
| design | planner (always) | critic, security-reviewer when alternatives/trust apply | run \`research/framework-docs-lookup.md\` + \`research/best-practices-lookup.md\` in-thread | escalate one specialist to \`deep\` only if a failure mode is Critical-severity |
|
|
132
133
|
| spec | — | spec-validator / spec-document-reviewer / reviewer (for long or high-risk specs) | — | escalate to \`deep\` only for spec ↔ design contradictions |
|
|
133
134
|
| plan | planner (solo, always) | — | — | never fan out at plan stage; one owner for dependency graph |
|
|
134
135
|
| tdd | — | ${formatAgentList(stageSummary("tdd").primaryAgents)} (per slice, carrying RED/GREEN/REFACTOR evidence) · reviewer (slice-local only when sliceReview triggers) | doc-updater (API surface changes) | escalate to \`deep\` only when a RED test cannot be expressed (design leak) |
|
|
@@ -139,7 +140,7 @@ Concrete per-stage rules so the controller does not have to guess which tier fit
|
|
|
139
140
|
- If a \`deep\` planner run returns low-uncertainty output (single unambiguous plan), do **not** add a second \`deep\` pass in the same stage.
|
|
140
141
|
- If a \`fast\` researcher's evidence is the only input to a decision, the consuming agent must be \`balanced\` or higher.
|
|
141
142
|
- Review-stage reviewers should default to \`balanced\`; bump to \`deep\` only when findings cite architectural contradictions.
|
|
142
|
-
- Refactor-only TDD slices (state-based, no behavioral change) can drop
|
|
143
|
+
- Refactor-only TDD slices (state-based, no behavioral change) can drop \`slice-builder\` to \`fast\` if the test pyramid stays green.
|
|
143
144
|
|
|
144
145
|
## HARD-GATE
|
|
145
146
|
|
|
@@ -398,7 +399,7 @@ ${conversationLanguagePolicyMarkdown()}
|
|
|
398
399
|
|
|
399
400
|
Implementation that touches shared source trees must remain **sequential** unless you have proven disjoint filesystem ownership (rare) and an explicit merge protocol.
|
|
400
401
|
|
|
401
|
-
When explicit bounded TDD fan-out is approved with parallel \`slice-
|
|
402
|
+
When explicit bounded TDD fan-out is approved with parallel \`slice-builder\` lanes, author \`.cclaw/artifacts/cohesion-contract.md\` + \`.json\` before launch and run \`integration-overseer\` after fan-in.
|
|
402
403
|
|
|
403
404
|
## When to Use
|
|
404
405
|
|
|
@@ -423,7 +424,7 @@ When explicit bounded TDD fan-out is approved with parallel \`slice-implementer\
|
|
|
423
424
|
## Dispatch Protocol
|
|
424
425
|
|
|
425
426
|
1. **Identify independent problem domains** (no file overlap; no shared mutable working assumptions).
|
|
426
|
-
2. **Author cohesion contract first** whenever fan-out touches shared interfaces or bounded parallel \`slice-
|
|
427
|
+
2. **Author cohesion contract first** whenever fan-out touches shared interfaces or bounded parallel \`slice-builder\` lanes.
|
|
427
428
|
3. **Craft one prompt per domain** with **full context pasted** — same HARD-GATE as SDD: no “go read X to learn why.”
|
|
428
429
|
4. **Launch ALL agents in a single controller message** (multiple Task tool calls) so they start with comparable timelines.
|
|
429
430
|
5. **Wait for all to return** before synthesis (avoid incremental confirmation bias).
|
|
@@ -666,34 +667,6 @@ Required output:
|
|
|
666
667
|
- PATCH_RECOMMENDATIONS: minimal edits to make the spec plan-ready
|
|
667
668
|
${MARKDOWN_CODE_FENCE}
|
|
668
669
|
|
|
669
|
-
`;
|
|
670
|
-
}
|
|
671
|
-
function sliceImplementerEnhancedBody() {
|
|
672
|
-
return `
|
|
673
|
-
|
|
674
|
-
## Task Tool Delegation
|
|
675
|
-
|
|
676
|
-
${MARKDOWN_CODE_FENCE}
|
|
677
|
-
You are a slice-implementer subagent.
|
|
678
|
-
|
|
679
|
-
SLICE: {single vertical slice — controller MUST dispatch you with --slice S-<id> --phase green --paths <comma-separated>}
|
|
680
|
-
RED_EVIDENCE: {failing test and expected failure}
|
|
681
|
-
ALLOWED_FILES: {explicit file boundaries — surfaced to scheduler as Files: <paths>}
|
|
682
|
-
FORBIDDEN_CHANGES: {scope/compatibility limits}
|
|
683
|
-
VERIFICATION: {commands expected}
|
|
684
|
-
|
|
685
|
-
Rules:
|
|
686
|
-
- Implement only the minimal GREEN change for the existing RED evidence.
|
|
687
|
-
- Keep REFACTOR behavior-preserving.
|
|
688
|
-
- Return the strict worker JSON schema first.
|
|
689
|
-
|
|
690
|
-
Slice phase-event contract (v6.11.0):
|
|
691
|
-
- Do NOT hand-edit \`## Watched-RED Proof\`, \`## Vertical Slice Cycle\`, \`## RED Evidence\`, or \`## GREEN Evidence\` markdown tables in 06-tdd.md. The linter auto-renders them between \`<!-- auto-start: tdd-slice-summary -->\` markers from \`delegation-events.jsonl\` slice phase rows.
|
|
692
|
-
- Your dispatch row IS the evidence: the harness-generated delegation-record hook stamps \`sliceId=S-<id>\`, \`phase=green\`, and \`completedTs\` automatically. Attach evidenceRefs (test path, span ref, or pasted-output pointer) so the linter validates the row.
|
|
693
|
-
- After REFACTOR, ask the controller to re-dispatch you with \`--phase refactor\` (or \`--phase refactor-deferred --refactor-rationale "<why>"\`); each call appends a new ledger row.
|
|
694
|
-
- Per-slice prose summary lives in \`<artifacts-dir>/tdd-slices/S-<id>.md\` and is owned by the parallel \`slice-documenter\` (or the controller). You do NOT touch that file.
|
|
695
|
-
${MARKDOWN_CODE_FENCE}
|
|
696
|
-
|
|
697
670
|
`;
|
|
698
671
|
}
|
|
699
672
|
function performanceReviewerEnhancedBody() {
|
|
@@ -913,40 +886,6 @@ Requirements:
|
|
|
913
886
|
- Close with SECURITY_VERDICT: SHIP | SHIP_WITH_HOTFIXES | NO_SHIP and cite top 3 drivers.
|
|
914
887
|
${MARKDOWN_CODE_FENCE}
|
|
915
888
|
|
|
916
|
-
`;
|
|
917
|
-
}
|
|
918
|
-
function testAuthorEnhancedBody() {
|
|
919
|
-
return `
|
|
920
|
-
|
|
921
|
-
## Task Tool Delegation
|
|
922
|
-
|
|
923
|
-
Delegate TDD loops carefully — one behavioral slice per subagent to avoid clobbering tests.
|
|
924
|
-
This agent runs in two explicit stage modes to respect cclaw hard-gates:
|
|
925
|
-
- \`TEST_RED_ONLY\` (only failing tests + evidence; no production edits)
|
|
926
|
-
- \`BUILD_GREEN_REFACTOR\` (implementation + full-suite green + refactor notes)
|
|
927
|
-
|
|
928
|
-
${MARKDOWN_CODE_FENCE}
|
|
929
|
-
You are a TDD implementer subagent.
|
|
930
|
-
|
|
931
|
-
STAGE_MODE: {TEST_RED_ONLY | BUILD_GREEN_REFACTOR}
|
|
932
|
-
FEATURE SLICE: {single behavior expressed as a user-observable outcome}
|
|
933
|
-
CURRENT TEST COMMANDS: {exact command names + cwd assumptions}
|
|
934
|
-
FIXTURES / PATTERNS: {links to helper modules by path + naming conventions}
|
|
935
|
-
|
|
936
|
-
Process (mandatory):
|
|
937
|
-
1) If STAGE_MODE=TEST_RED_ONLY:
|
|
938
|
-
- Controller dispatched you with \`--slice S-<id> --phase red\`. Add failing tests proving the gap (show failing output excerpt).
|
|
939
|
-
- Do NOT edit production code.
|
|
940
|
-
- Do NOT hand-edit \`## Watched-RED Proof\` / \`## RED Evidence\` markdown tables in 06-tdd.md — the linter auto-renders them from your dispatch row in \`delegation-events.jsonl\`. Just ensure your worker return includes evidenceRefs (test path, span ref, or pasted-output pointer) so the harness can stamp them on the ledger row.
|
|
941
|
-
- Report: TESTS_ADDED, RED_COMMAND_RUN, RED_EVIDENCE, STATUS: DONE|BLOCKED.
|
|
942
|
-
2) If STAGE_MODE=BUILD_GREEN_REFACTOR:
|
|
943
|
-
- Controller dispatched you with \`--slice S-<id> --phase green\` (and later \`--phase refactor\` or \`--phase refactor-deferred --refactor-rationale "<why>"\`).
|
|
944
|
-
- GREEN — minimal production code to satisfy existing RED tests, rerun full suite.
|
|
945
|
-
- REFACTOR — only after full suite is green; preserve behavior.
|
|
946
|
-
- Do NOT hand-edit \`## Vertical Slice Cycle\` / \`## GREEN Evidence\` markdown tables — auto-rendered from your dispatch row.
|
|
947
|
-
- Report: FILES_EDITED, GREEN_COMMAND_RUN, REFACTOR_NOTES, STATUS: DONE|BLOCKED.
|
|
948
|
-
${MARKDOWN_CODE_FENCE}
|
|
949
|
-
|
|
950
889
|
`;
|
|
951
890
|
}
|
|
952
891
|
function implementerEnhancedBody() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared investigation discipline block
|
|
2
|
+
* Shared investigation discipline block. Rendered once per
|
|
3
3
|
* elicitation/spec stage skill (brainstorm, scope, design, spec, plan, tdd,
|
|
4
4
|
* review). The block enforces a four-step ladder before drafting and a
|
|
5
5
|
* path-passing rule for delegations so token cost and "jumped into code"
|
|
@@ -12,15 +12,15 @@ export declare const RULEBOOK_MARKDOWN = "# Cclaw Rulebook\n\n## MUST_ALWAYS\n-
|
|
|
12
12
|
/**
|
|
13
13
|
* Always-on baseline rule materialized at `.cursor/rules/cclaw-guidelines.mdc`.
|
|
14
14
|
* Independent of skill activation — kicks in even when the agent skips
|
|
15
|
-
* loading skills. Three hard rules cover the most common
|
|
15
|
+
* loading skills. Three hard rules cover the most common regressions
|
|
16
16
|
* (premature draft, premature subagent dispatch, command-line echo to chat).
|
|
17
17
|
*/
|
|
18
|
-
export declare const CURSOR_GUIDELINES_RULE_MDC = "---\ndescription: cclaw zero-install behavior baseline (always-on)\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-guidelines-rule -->\n\n# Cclaw Baseline Guidelines\n\nThese three rules apply to every Cursor agent session in this project,\nregardless of whether stage skills loaded.\n\n## 1. Q&A floor before drafting (brainstorm/scope/design)\n\nBefore drafting any `.cclaw/artifacts/01-brainstorm-*.md`,\n`02-scope-*.md`, or `03-design-*.md`, verify that the artifact's\n`## Q&A Log` table demonstrates Ralph-Loop convergence: every\nforcing-question topic id is tagged `[topic:<id>]` on at least one row\n(see the stage's forcing-questions checklist for the id list), the last\n2 turns produce no new decision-changing impact, OR an explicit user\nstop-signal row is recorded. Walk the stage forcing questions one at a\ntime via the `AskQuestion` tool. If you find yourself proposing a\ndraft after 1-2 questions while forcing topic ids remain untagged, STOP\nand continue the loop.\n\nThe `qa_log_unconverged` linter rule will block `stage-complete` when\nconvergence has not been reached.
|
|
18
|
+
export declare const CURSOR_GUIDELINES_RULE_MDC = "---\ndescription: cclaw zero-install behavior baseline (always-on)\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-guidelines-rule -->\n\n# Cclaw Baseline Guidelines\n\nThese three rules apply to every Cursor agent session in this project,\nregardless of whether stage skills loaded.\n\n## 1. Q&A floor before drafting (brainstorm/scope/design)\n\nBefore drafting any `.cclaw/artifacts/01-brainstorm-*.md`,\n`02-scope-*.md`, or `03-design-*.md`, verify that the artifact's\n`## Q&A Log` table demonstrates Ralph-Loop convergence: every\nforcing-question topic id is tagged `[topic:<id>]` on at least one row\n(see the stage's forcing-questions checklist for the id list), the last\n2 turns produce no new decision-changing impact, OR an explicit user\nstop-signal row is recorded. Walk the stage forcing questions one at a\ntime via the `AskQuestion` tool. If you find yourself proposing a\ndraft after 1-2 questions while forcing topic ids remain untagged, STOP\nand continue the loop.\n\nThe `qa_log_unconverged` linter rule will block `stage-complete` when\nconvergence has not been reached. `[topic:<id>]` tagging is mandatory:\nEnglish keyword detection is intentionally absent because it mis-reports\nconvergence on RU/UA Q&A logs.\n\n## 2. Mandatory subagents run after Q&A approval\n\nFor brainstorm / scope / design, mandatory subagents (\n`product-discovery`, `critic`, `planner`, `architect`) run **only\nAFTER the user approves the elicitation outcome**, never before the Q&A\nloop converges. Dispatching them early preempts the user dialogue and\nviolates the elicitation contract \u2014 the linter will block stage-complete.\n\nSee each stage's \"Run Phase: post-elicitation\" rows in the materialized\nAutomatic Subagent Dispatch table.\n\n## 3. Never echo cclaw command lines to chat\n\nThe user does not run cclaw helpers (`node .cclaw/hooks/...`) manually.\nNEVER paste full command lines, `--evidence-json '{...}'` payloads,\n`--waive-delegation=...`, or shell hash commands (`shasum`,\n`sha256sum`, `Get-FileHash`, `certutil`, etc.) into chat. Run the\nhelper via the tool layer and report only the resulting summary. On\nfailure, report a compact human-readable summary plus the helper JSON in\na single fenced `json` block.\n";
|
|
19
19
|
export declare const CURSOR_WORKFLOW_RULE_MDC = "---\ndescription: cclaw workflow guardrails for Cursor agent sessions\nglobs:\n - \"**/*\"\nalwaysApply: true\n---\n\n<!-- cclaw-managed-cursor-workflow-rule -->\n\n# Cclaw Workflow Guardrails\n\n## Activation Rule\n\nBefore responding to coding work:\n1. Read `.cclaw/state/flow-state.json`.\n2. Start with `/cc` or continue with `/cc`.\n3. If no software-stage flow applies, respond normally.\n\n## Stage Order\n\n`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship`\n\nTrack-specific skips are allowed only when `flow-state.track` + `skippedStages` explicitly say so.\n\n## Task Classification\n\n| Class | Route |\n|---|---|\n| non-trivial software work | `/cc <idea>` |\n| trivial software fix | `/cc <idea>` (quick track) |\n| bugfix with repro | `/cc <idea>` and enforce RED-first in tdd |\n| pure question / non-software | direct answer (no stage flow) |\n\n## Command Surface\n\n- `/cc` = entry and resume.\n- `/cc` = only progression path.\n- Knowledge capture and recall use the `learnings` skill when requested.\n\n## Verification Discipline\n\n- No completion claim without fresh command evidence in this turn.\n- Stage completion claim requires `stage-complete` exit 0 in the current turn. Quote the single-line success JSON printed to stdout (e.g. `{\"ok\":true,\"command\":\"stage-complete\",...}`); do not paraphrase, do not infer success from empty stdout or from skipped retries.\n\n## Protocol label hygiene\n\n`skip` wording means different things depending on phase: brainstorm/scope/design Q&A stop-signals may still literal **skip**/enough/move-on wording; structured ship closeout retros and compound clustering prompts should expose **no changes** (or accept-as-is language) rather than labeling the passive path as skip. Keep the verbs aligned with the harness question copy you present to the human.\n- Do not mark gates passed from memory.\n- Keep evidence in `.cclaw/artifacts/`; archive through closeout via `/cc` or cancel early via `node .cclaw/hooks/cancel-run.mjs`.\n\n## Delegation And Approvals\n\n- Machine-only checks in design/plan/tdd/review/ship should auto-dispatch when tooling supports it.\n- **For brainstorm / scope / design stages**: ask user input continuously via adaptive elicitation (one question per turn through the harness-native question tool \u2014 `AskQuestion` in Cursor). Walk the stage forcing-questions list one-by-one. **Tag each Q&A Log row's `Decision impact` cell with `[topic:<id>]`** (the id is given in the stage's forcing-questions checklist) so the linter can verify coverage in any natural language. Do NOT batch and do NOT defer to a single approval gate at the end. The `qa_log_unconverged` linter rule will block `stage-complete` when convergence is not reached (forcing topic ids untagged AND last 2 turns still produce decision-changing rows AND no stop-signal).\n- **For other stages** (spec/plan/tdd/build/review/ship): ask user input only at explicit approval gates (scope mode, plan approval, challenge resolution, ship finalization), not for routine progress updates.\n- If you find yourself proposing a draft after 1-2 questions in brainstorm/scope/design, STOP \u2014 go back to the forcing-questions list and continue.\n- Mandatory subagents in brainstorm/scope/design run only AFTER the user approves the elicitation outcome (see each stage's \"Run Phase: post-elicitation\" rows). Dispatching them before the Q&A loop converges violates the contract.\n- Never echo cclaw command lines (`node .cclaw/hooks/...`, `--evidence-json '{...}'`) to chat \u2014 the user does not run cclaw manually. Run helpers via the tool layer; report only the resulting summary.\n- If harness capabilities are partial, record waiver reasons in delegation logs.\n\n## Routing Source Of Truth\n\n- Primary router: `.cclaw/skills/using-cclaw/SKILL.md`.\n- Stage behavior: current stage skill plus `.cclaw/state/flow-state.json`.\n- Preamble budget: keep role/status announcements brief and avoid repeating\n them unless the stage or role changes.\n";
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Per-slice prose file written by `slice-builder` (or the controller)
|
|
22
|
+
* to `<artifacts-dir>/tdd-slices/S-<id>.md`. The main `06-tdd.md` is
|
|
23
|
+
* auto-indexed via `## Slices Index`.
|
|
24
24
|
*/
|
|
25
25
|
export declare function tddSliceFileTemplate(sliceId: string): string;
|
|
26
26
|
export declare function buildRulesJson(): Record<string, unknown>;
|
|
@@ -19,7 +19,7 @@ const SEED_SHELF_SECTION = `## Seed Shelf Candidates (optional)
|
|
|
19
19
|
|---|---|---|---|
|
|
20
20
|
| .cclaw/seeds/SEED-YYYY-MM-DD-<slug>.md | | | |`;
|
|
21
21
|
/**
|
|
22
|
-
* Shared investigation discipline block
|
|
22
|
+
* Shared investigation discipline block. Rendered once per
|
|
23
23
|
* elicitation/spec stage skill (brainstorm, scope, design, spec, plan, tdd,
|
|
24
24
|
* review). The block enforces a four-step ladder before drafting and a
|
|
25
25
|
* path-passing rule for delegations so token cost and "jumped into code"
|
|
@@ -116,7 +116,7 @@ ${renderBehaviorAnchorTemplateLine("brainstorm")}
|
|
|
116
116
|
| 1 | | | scope-shaping [topic:pain] |
|
|
117
117
|
|
|
118
118
|
> Append-only by turn. Add one row after each user answer; do not rewrite prior rows.
|
|
119
|
-
> **Topic tag is MANDATORY for forcing-question rows.** Stamp \`[topic:<id>]\` in the \`Decision impact\` cell so the linter can verify coverage in any natural language (RU/EN/UA/etc.). Brainstorm IDs: \`pain\`, \`direct-path\`, \`operator\`, \`no-go\`. Multiple tags allowed when one answer covers several topics. Stop-signal rows do NOT need a tag.
|
|
119
|
+
> **Topic tag is MANDATORY for forcing-question rows.** Stamp \`[topic:<id>]\` in the \`Decision impact\` cell so the linter can verify coverage in any natural language (RU/EN/UA/etc.). Brainstorm IDs: \`pain\`, \`direct-path\`, \`operator\`, \`no-go\`. Multiple tags allowed when one answer covers several topics. Stop-signal rows do NOT need a tag. The counterfactual \`do-nothing\` topic is intentionally absent — Do-nothing consequence lives in the Problem Decision Record.
|
|
120
120
|
|
|
121
121
|
## Approach Tier
|
|
122
122
|
- Tier: lite | standard | deep
|
|
@@ -242,7 +242,7 @@ ${renderBehaviorAnchorTemplateLine("scope")}
|
|
|
242
242
|
| 1 | | | scope-shaping [topic:in-out] |
|
|
243
243
|
|
|
244
244
|
> Append-only by turn. Add one row after each user answer; do not rewrite prior rows.
|
|
245
|
-
> **Topic tag is MANDATORY for forcing-question rows.** Stamp \`[topic:<id>]\` in the \`Decision impact\` cell so the linter can verify coverage in any natural language (RU/EN/UA/etc.). Scope IDs: \`in-out\`, \`locked-upstream\`, \`rollback\`, \`failure-modes\`. Multiple tags allowed when one answer covers several topics. Stop-signal rows do NOT need a tag.
|
|
245
|
+
> **Topic tag is MANDATORY for forcing-question rows.** Stamp \`[topic:<id>]\` in the \`Decision impact\` cell so the linter can verify coverage in any natural language (RU/EN/UA/etc.). Scope IDs: \`in-out\`, \`locked-upstream\`, \`rollback\`, \`failure-modes\`. Multiple tags allowed when one answer covers several topics. Stop-signal rows do NOT need a tag.
|
|
246
246
|
|
|
247
247
|
## Pre-Scope System Audit
|
|
248
248
|
| Check | Command | Findings |
|
|
@@ -346,7 +346,7 @@ ${renderBehaviorAnchorTemplateLine("scope")}
|
|
|
346
346
|
> scope/design/spec/plan/review/ship; downstream artifacts reference these IDs
|
|
347
347
|
> verbatim. If a decision is later dropped, keep the row and mark it
|
|
348
348
|
> \`(superseded by D-Y)\`; if a new one is added mid-flow, append with the next
|
|
349
|
-
> free D-number.
|
|
349
|
+
> free D-number. The earlier LD#<sha8> hash anchor is gone —
|
|
350
350
|
> existing artifacts with LD# anchors remain valid markdown but the linter only
|
|
351
351
|
> tracks D-XX IDs.
|
|
352
352
|
|
|
@@ -483,7 +483,7 @@ ${renderBehaviorAnchorTemplateLine("design")}
|
|
|
483
483
|
| 1 | | | architecture-shaping [topic:data-flow] |
|
|
484
484
|
|
|
485
485
|
> Append-only by turn. Add one row after each user answer; do not rewrite prior rows.
|
|
486
|
-
> **Topic tag is MANDATORY for forcing-question rows.** Stamp \`[topic:<id>]\` in the \`Decision impact\` cell so the linter can verify coverage in any natural language (RU/EN/UA/etc.). Design IDs: \`data-flow\`, \`seams\`, \`invariants\`, \`not-refactor\`. Multiple tags allowed when one answer covers several topics. Stop-signal rows do NOT need a tag.
|
|
486
|
+
> **Topic tag is MANDATORY for forcing-question rows.** Stamp \`[topic:<id>]\` in the \`Decision impact\` cell so the linter can verify coverage in any natural language (RU/EN/UA/etc.). Design IDs: \`data-flow\`, \`seams\`, \`invariants\`, \`not-refactor\`. Multiple tags allowed when one answer covers several topics. Stop-signal rows do NOT need a tag.
|
|
487
487
|
|
|
488
488
|
## Codebase Investigation
|
|
489
489
|
| File | Current responsibility | Patterns discovered | Existing fit / reuse candidate |
|
|
@@ -743,7 +743,7 @@ ${renderBehaviorAnchorTemplateLine("spec")}
|
|
|
743
743
|
|---|---|---|---|---|---|
|
|
744
744
|
| AC-1 | R1 | | | false | |
|
|
745
745
|
|
|
746
|
-
> Standard ACs reference at least one \`R#\` from \`02-scope.md\`. Quick-track ACs may instead put \`Quick Reproduction Contract\` / bug-slice refs in the Requirement Ref column and \`N/A\` for Design Decision Ref. ACs are stable (never renumber): dropped ACs stay with Priority \`DROPPED\`; new ones append with the next free \`AC-#\`.
|
|
746
|
+
> Standard ACs reference at least one \`R#\` from \`02-scope.md\`. Quick-track ACs may instead put \`Quick Reproduction Contract\` / bug-slice refs in the Requirement Ref column and \`N/A\` for Design Decision Ref. ACs are stable (never renumber): dropped ACs stay with Priority \`DROPPED\`; new ones append with the next free \`AC-#\`. \`parallelSafe\` states whether this AC can be proven in parallel with others; \`touchSurface\` lists repo-relative globs or modules this AC is expected to touch (scheduler + slice planning).
|
|
747
747
|
|
|
748
748
|
## Quick Reproduction Contract
|
|
749
749
|
> Required for quick bug-fix specs; use \`N/A\` for non-bugfix or standard/medium tracks. TDD turns this contract into the RED reproduction test.
|
|
@@ -985,7 +985,7 @@ ${renderBehaviorAnchorTemplateLine("tdd")}
|
|
|
985
985
|
<!-- auto-start: slices-index -->
|
|
986
986
|
## Slices Index
|
|
987
987
|
|
|
988
|
-
_Auto-rendered from \`tdd-slices/S-*.md\` once slice-
|
|
988
|
+
_Auto-rendered from \`tdd-slices/S-*.md\` once \`slice-builder\` or the controller writes per-slice files. Do not edit by hand._
|
|
989
989
|
<!-- auto-end: slices-index -->
|
|
990
990
|
|
|
991
991
|
## Test Discovery
|
|
@@ -997,17 +997,17 @@ _Auto-rendered from \`tdd-slices/S-*.md\` once slice-documenter or controller wr
|
|
|
997
997
|
| S-1 | | covered/out-of-scope because |
|
|
998
998
|
|
|
999
999
|
## RED Evidence
|
|
1000
|
-
>
|
|
1000
|
+
> Per-slice RED rows are auto-satisfied by \`phase=red\` events in \`delegation-events.jsonl\` (controller dispatches \`slice-builder --slice S-<id> --phase red\`). Use \`Evidence: <path>\` or \`Evidence: spanId:<id>\` pointers if you prefer a manual reference.
|
|
1001
1001
|
|
|
1002
1002
|
## Acceptance & Failure Map
|
|
1003
1003
|
| Slice | Source ID | AC ID | Expected behavior | RED-link |
|
|
1004
1004
|
|---|---|---|---|---|
|
|
1005
1005
|
| S-1 | SRC-1 | AC-1 | | |
|
|
1006
1006
|
|
|
1007
|
-
> Each slice maps to the active track's source item (plan slice on standard/medium, or the \`Quick Reproduction Contract\` bug slice / spec acceptance item on quick) and to a spec criterion. The RED-link column is satisfied by either a \`spanId:<id>\` from the delegation ledger or an \`<artifacts-dir>/<file>\` evidence pointer.
|
|
1007
|
+
> Each slice maps to the active track's source item (plan slice on standard/medium, or the \`Quick Reproduction Contract\` bug slice / spec acceptance item on quick) and to a spec criterion. The RED-link column is satisfied by either a \`spanId:<id>\` from the delegation ledger or an \`<artifacts-dir>/<file>\` evidence pointer. The column is also auto-derivable: a \`phase=red\` event in \`delegation-events.jsonl\` with non-empty evidenceRefs auto-satisfies the row.
|
|
1008
1008
|
|
|
1009
1009
|
## GREEN Evidence
|
|
1010
|
-
>
|
|
1010
|
+
> GREEN rows are auto-satisfied by \`phase=green\` events in \`delegation-events.jsonl\` (controller dispatches \`slice-builder --slice S-<id> --phase green\`). Use \`Evidence: <path>\` or \`Evidence: spanId:<id>\` pointers if you prefer a manual reference.
|
|
1011
1011
|
|
|
1012
1012
|
## REFACTOR Notes
|
|
1013
1013
|
- What changed:
|
|
@@ -1027,7 +1027,7 @@ _Auto-rendered from \`tdd-slices/S-*.md\` once slice-documenter or controller wr
|
|
|
1027
1027
|
<!-- auto-start: tdd-slice-summary -->
|
|
1028
1028
|
## Vertical Slice Cycle
|
|
1029
1029
|
|
|
1030
|
-
_Auto-rendered from \`delegation-events.jsonl\` once \`
|
|
1030
|
+
_Auto-rendered from \`delegation-events.jsonl\` once \`slice-builder\` is dispatched per slice with \`--slice <id> --phase red|green|refactor|refactor-deferred\`. Do not edit by hand._
|
|
1031
1031
|
<!-- auto-end: tdd-slice-summary -->
|
|
1032
1032
|
|
|
1033
1033
|
## Assertion Correctness Notes
|
|
@@ -1219,7 +1219,7 @@ ${renderBehaviorAnchorTemplateLine("review")}
|
|
|
1219
1219
|
| AC-1 | PASS/FAIL | |
|
|
1220
1220
|
|
|
1221
1221
|
## Layer 2 Findings
|
|
1222
|
-
>
|
|
1222
|
+
> Layer 2 categories OWNED by review = cross-slice correctness, security, dependency/version, observability, external-safety. Performance + architecture findings are CARRY-FORWARD from \`03-design-<slug>.md\` (Performance Budget, ADR) — cite, do NOT re-derive. Single-slice findings stay in \`06-tdd.md > Per-Slice Review\`; review may cite their IDs (severity/disposition must match — cross-artifact-duplication linter blocks otherwise).
|
|
1223
1223
|
|
|
1224
1224
|
| ID | Severity | Category | File:line / no-line reason | Description | Status |
|
|
1225
1225
|
|---|---|---|---|---|---|
|
|
@@ -1498,7 +1498,7 @@ delegate to a specialized agent or skill if the harness supports it. The primary
|
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Always-on baseline rule materialized at `.cursor/rules/cclaw-guidelines.mdc`.
|
|
1500
1500
|
* Independent of skill activation — kicks in even when the agent skips
|
|
1501
|
-
* loading skills. Three hard rules cover the most common
|
|
1501
|
+
* loading skills. Three hard rules cover the most common regressions
|
|
1502
1502
|
* (premature draft, premature subagent dispatch, command-line echo to chat).
|
|
1503
1503
|
*/
|
|
1504
1504
|
export const CURSOR_GUIDELINES_RULE_MDC = `---
|
|
@@ -1529,18 +1529,17 @@ draft after 1-2 questions while forcing topic ids remain untagged, STOP
|
|
|
1529
1529
|
and continue the loop.
|
|
1530
1530
|
|
|
1531
1531
|
The \`qa_log_unconverged\` linter rule will block \`stage-complete\` when
|
|
1532
|
-
convergence has not been reached.
|
|
1533
|
-
|
|
1534
|
-
|
|
1532
|
+
convergence has not been reached. \`[topic:<id>]\` tagging is mandatory:
|
|
1533
|
+
English keyword detection is intentionally absent because it mis-reports
|
|
1534
|
+
convergence on RU/UA Q&A logs.
|
|
1535
1535
|
|
|
1536
1536
|
## 2. Mandatory subagents run after Q&A approval
|
|
1537
1537
|
|
|
1538
1538
|
For brainstorm / scope / design, mandatory subagents (
|
|
1539
|
-
\`product-discovery\`, \`critic\`, \`planner\`, \`architect
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
linter will block stage-complete.
|
|
1539
|
+
\`product-discovery\`, \`critic\`, \`planner\`, \`architect\`) run **only
|
|
1540
|
+
AFTER the user approves the elicitation outcome**, never before the Q&A
|
|
1541
|
+
loop converges. Dispatching them early preempts the user dialogue and
|
|
1542
|
+
violates the elicitation contract — the linter will block stage-complete.
|
|
1544
1543
|
|
|
1545
1544
|
See each stage's "Run Phase: post-elicitation" rows in the materialized
|
|
1546
1545
|
Automatic Subagent Dispatch table.
|
|
@@ -1623,9 +1622,9 @@ Track-specific skips are allowed only when \`flow-state.track\` + \`skippedStage
|
|
|
1623
1622
|
them unless the stage or role changes.
|
|
1624
1623
|
`;
|
|
1625
1624
|
/**
|
|
1626
|
-
*
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1625
|
+
* Per-slice prose file written by `slice-builder` (or the controller)
|
|
1626
|
+
* to `<artifacts-dir>/tdd-slices/S-<id>.md`. The main `06-tdd.md` is
|
|
1627
|
+
* auto-indexed via `## Slices Index`.
|
|
1629
1628
|
*/
|
|
1630
1629
|
export function tddSliceFileTemplate(sliceId) {
|
|
1631
1630
|
return `# Slice ${sliceId}
|
|
@@ -23,7 +23,7 @@ export declare const LANGUAGE_RULE_PACK_FILES: {
|
|
|
23
23
|
export declare const LANGUAGE_RULE_PACK_DIR: readonly ["rules", "lang"];
|
|
24
24
|
export declare const LANGUAGE_RULE_PACK_GENERATORS: Record<string, () => string>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Older per-language folders under `.cclaw/skills/`. Listed
|
|
27
27
|
* here so `cclaw sync` and `sync` can surface drift and the installer can
|
|
28
28
|
* clean them up after the move to `.cclaw/rules/lang/`.
|
|
29
29
|
*/
|
|
@@ -149,7 +149,7 @@ export const LANGUAGE_RULE_PACK_GENERATORS = {
|
|
|
149
149
|
go: languageGoSkill
|
|
150
150
|
};
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* Older per-language folders under `.cclaw/skills/`. Listed
|
|
153
153
|
* here so `cclaw sync` and `sync` can surface drift and the installer can
|
|
154
154
|
* clean them up after the move to `.cclaw/rules/lang/`.
|
|
155
155
|
*/
|