cclaw-cli 0.48.35 → 0.51.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.
Files changed (181) hide show
  1. package/README.md +54 -82
  2. package/dist/artifact-linter.d.ts +4 -0
  3. package/dist/artifact-linter.js +24 -3
  4. package/dist/cli.d.ts +1 -19
  5. package/dist/cli.js +49 -495
  6. package/dist/constants.d.ts +2 -13
  7. package/dist/constants.js +1 -46
  8. package/dist/content/closeout-guidance.d.ts +14 -0
  9. package/dist/content/closeout-guidance.js +42 -0
  10. package/dist/content/core-agents.js +51 -9
  11. package/dist/content/decision-protocol.d.ts +12 -0
  12. package/dist/content/decision-protocol.js +20 -0
  13. package/dist/content/diff-command.d.ts +1 -2
  14. package/dist/content/diff-command.js +8 -94
  15. package/dist/content/examples.d.ts +4 -10
  16. package/dist/content/examples.js +10 -20
  17. package/dist/content/hook-events.js +2 -2
  18. package/dist/content/hook-inline-snippets.d.ts +5 -2
  19. package/dist/content/hook-inline-snippets.js +33 -1
  20. package/dist/content/hook-manifest.d.ts +3 -4
  21. package/dist/content/hook-manifest.js +11 -12
  22. package/dist/content/hooks.js +2 -0
  23. package/dist/content/ideate-command.d.ts +2 -0
  24. package/dist/content/ideate-command.js +31 -25
  25. package/dist/content/iron-laws.d.ts +5 -5
  26. package/dist/content/iron-laws.js +5 -5
  27. package/dist/content/learnings.d.ts +3 -4
  28. package/dist/content/learnings.js +24 -50
  29. package/dist/content/meta-skill.js +31 -24
  30. package/dist/content/next-command.js +38 -38
  31. package/dist/content/node-hooks.js +17 -343
  32. package/dist/content/opencode-plugin.js +2 -100
  33. package/dist/content/research-playbooks.js +14 -14
  34. package/dist/content/review-loop.d.ts +2 -0
  35. package/dist/content/review-loop.js +8 -0
  36. package/dist/content/session-hooks.js +14 -46
  37. package/dist/content/skills.d.ts +0 -5
  38. package/dist/content/skills.js +53 -128
  39. package/dist/content/stage-common-guidance.d.ts +0 -1
  40. package/dist/content/stage-common-guidance.js +15 -14
  41. package/dist/content/stage-schema.d.ts +26 -1
  42. package/dist/content/stage-schema.js +121 -40
  43. package/dist/content/stages/_lint-metadata/index.js +9 -15
  44. package/dist/content/stages/brainstorm.js +22 -43
  45. package/dist/content/stages/design.js +37 -57
  46. package/dist/content/stages/plan.js +22 -13
  47. package/dist/content/stages/review.js +24 -27
  48. package/dist/content/stages/scope.js +34 -46
  49. package/dist/content/stages/ship.js +7 -4
  50. package/dist/content/stages/spec.js +20 -9
  51. package/dist/content/stages/tdd.js +64 -44
  52. package/dist/content/start-command.js +10 -12
  53. package/dist/content/status-command.d.ts +2 -7
  54. package/dist/content/status-command.js +19 -146
  55. package/dist/content/subagents.d.ts +0 -5
  56. package/dist/content/subagents.js +47 -28
  57. package/dist/content/templates.d.ts +1 -1
  58. package/dist/content/templates.js +126 -135
  59. package/dist/content/track-render-context.d.ts +17 -0
  60. package/dist/content/track-render-context.js +44 -0
  61. package/dist/content/tree-command.d.ts +1 -2
  62. package/dist/content/tree-command.js +4 -87
  63. package/dist/content/utility-skills.d.ts +2 -29
  64. package/dist/content/utility-skills.js +2 -1533
  65. package/dist/content/view-command.js +29 -11
  66. package/dist/delegation.d.ts +1 -1
  67. package/dist/delegation.js +5 -15
  68. package/dist/doctor-registry.js +20 -21
  69. package/dist/doctor.js +88 -408
  70. package/dist/flow-state.d.ts +3 -0
  71. package/dist/flow-state.js +2 -0
  72. package/dist/harness-adapters.d.ts +1 -1
  73. package/dist/harness-adapters.js +48 -57
  74. package/dist/install.js +128 -520
  75. package/dist/internal/advance-stage.js +3 -9
  76. package/dist/internal/compound-readiness.d.ts +1 -1
  77. package/dist/internal/compound-readiness.js +1 -1
  78. package/dist/internal/tdd-loop-status.d.ts +1 -1
  79. package/dist/internal/tdd-loop-status.js +1 -1
  80. package/dist/knowledge-store.d.ts +16 -10
  81. package/dist/knowledge-store.js +51 -15
  82. package/dist/policy.js +16 -109
  83. package/dist/run-archive.d.ts +4 -6
  84. package/dist/run-archive.js +15 -20
  85. package/dist/run-persistence.d.ts +2 -2
  86. package/dist/run-persistence.js +3 -9
  87. package/package.json +1 -2
  88. package/dist/content/archive-command.d.ts +0 -2
  89. package/dist/content/archive-command.js +0 -124
  90. package/dist/content/compound-command.d.ts +0 -5
  91. package/dist/content/compound-command.js +0 -193
  92. package/dist/content/contexts.d.ts +0 -9
  93. package/dist/content/contexts.js +0 -65
  94. package/dist/content/contracts.d.ts +0 -2
  95. package/dist/content/contracts.js +0 -51
  96. package/dist/content/doctor-references.d.ts +0 -2
  97. package/dist/content/doctor-references.js +0 -150
  98. package/dist/content/eval-scaffold.d.ts +0 -15
  99. package/dist/content/eval-scaffold.js +0 -370
  100. package/dist/content/feature-command.d.ts +0 -2
  101. package/dist/content/feature-command.js +0 -123
  102. package/dist/content/flow-map.d.ts +0 -23
  103. package/dist/content/flow-map.js +0 -134
  104. package/dist/content/harness-doc.d.ts +0 -2
  105. package/dist/content/harness-doc.js +0 -202
  106. package/dist/content/harness-playbooks.d.ts +0 -24
  107. package/dist/content/harness-playbooks.js +0 -393
  108. package/dist/content/harness-tool-refs.d.ts +0 -20
  109. package/dist/content/harness-tool-refs.js +0 -268
  110. package/dist/content/ops-command.d.ts +0 -2
  111. package/dist/content/ops-command.js +0 -71
  112. package/dist/content/protocols.d.ts +0 -7
  113. package/dist/content/protocols.js +0 -215
  114. package/dist/content/retro-command.d.ts +0 -2
  115. package/dist/content/retro-command.js +0 -165
  116. package/dist/content/rewind-command.d.ts +0 -2
  117. package/dist/content/rewind-command.js +0 -106
  118. package/dist/content/tdd-log-command.d.ts +0 -2
  119. package/dist/content/tdd-log-command.js +0 -85
  120. package/dist/eval/agents/single-shot.d.ts +0 -27
  121. package/dist/eval/agents/single-shot.js +0 -79
  122. package/dist/eval/agents/with-tools.d.ts +0 -44
  123. package/dist/eval/agents/with-tools.js +0 -261
  124. package/dist/eval/agents/workflow.d.ts +0 -31
  125. package/dist/eval/agents/workflow.js +0 -155
  126. package/dist/eval/baseline.d.ts +0 -38
  127. package/dist/eval/baseline.js +0 -282
  128. package/dist/eval/config-loader.d.ts +0 -14
  129. package/dist/eval/config-loader.js +0 -395
  130. package/dist/eval/corpus.d.ts +0 -30
  131. package/dist/eval/corpus.js +0 -330
  132. package/dist/eval/cost-guard.d.ts +0 -102
  133. package/dist/eval/cost-guard.js +0 -190
  134. package/dist/eval/diff.d.ts +0 -64
  135. package/dist/eval/diff.js +0 -323
  136. package/dist/eval/llm-client.d.ts +0 -176
  137. package/dist/eval/llm-client.js +0 -267
  138. package/dist/eval/mode.d.ts +0 -28
  139. package/dist/eval/mode.js +0 -61
  140. package/dist/eval/progress.d.ts +0 -83
  141. package/dist/eval/progress.js +0 -59
  142. package/dist/eval/report.d.ts +0 -11
  143. package/dist/eval/report.js +0 -181
  144. package/dist/eval/rubric-loader.d.ts +0 -20
  145. package/dist/eval/rubric-loader.js +0 -143
  146. package/dist/eval/runner.d.ts +0 -81
  147. package/dist/eval/runner.js +0 -746
  148. package/dist/eval/runs.d.ts +0 -41
  149. package/dist/eval/runs.js +0 -114
  150. package/dist/eval/sandbox.d.ts +0 -38
  151. package/dist/eval/sandbox.js +0 -137
  152. package/dist/eval/tools/glob.d.ts +0 -2
  153. package/dist/eval/tools/glob.js +0 -163
  154. package/dist/eval/tools/grep.d.ts +0 -2
  155. package/dist/eval/tools/grep.js +0 -152
  156. package/dist/eval/tools/index.d.ts +0 -7
  157. package/dist/eval/tools/index.js +0 -35
  158. package/dist/eval/tools/read.d.ts +0 -2
  159. package/dist/eval/tools/read.js +0 -122
  160. package/dist/eval/tools/types.d.ts +0 -49
  161. package/dist/eval/tools/types.js +0 -41
  162. package/dist/eval/tools/write.d.ts +0 -2
  163. package/dist/eval/tools/write.js +0 -92
  164. package/dist/eval/types.d.ts +0 -561
  165. package/dist/eval/types.js +0 -47
  166. package/dist/eval/verifiers/judge.d.ts +0 -40
  167. package/dist/eval/verifiers/judge.js +0 -256
  168. package/dist/eval/verifiers/rules.d.ts +0 -24
  169. package/dist/eval/verifiers/rules.js +0 -218
  170. package/dist/eval/verifiers/structural.d.ts +0 -14
  171. package/dist/eval/verifiers/structural.js +0 -171
  172. package/dist/eval/verifiers/traceability.d.ts +0 -23
  173. package/dist/eval/verifiers/traceability.js +0 -84
  174. package/dist/eval/verifiers/workflow-consistency.d.ts +0 -21
  175. package/dist/eval/verifiers/workflow-consistency.js +0 -225
  176. package/dist/eval/workflow-corpus.d.ts +0 -7
  177. package/dist/eval/workflow-corpus.js +0 -207
  178. package/dist/feature-system.d.ts +0 -42
  179. package/dist/feature-system.js +0 -432
  180. package/dist/internal/knowledge-digest.d.ts +0 -7
  181. package/dist/internal/knowledge-digest.js +0 -93
@@ -1,23 +0,0 @@
1
- /**
2
- * Relative path used by skills/commands to cite the consolidated flow map.
3
- * Stable contract — changing this value is a breaking change for doctor
4
- * policies and meta-skill links.
5
- */
6
- export declare const FLOW_MAP_REL_PATH = ".cclaw/references/flow-map.md";
7
- /**
8
- * Canonical one-page overview of cclaw's user-facing surface.
9
- *
10
- * Purpose: give the model (and any curious human) a single file that
11
- * answers "what does cclaw expose, where does my current stage fit, and
12
- * which files drive progress?" without forcing a walk of the 8 stage
13
- * skills plus the 4 router skills plus the meta-skill.
14
- *
15
- * Design rules:
16
- * - Keep it under ~150 lines; it is a map, not a manual.
17
- * - Only cite files that already exist under `.cclaw/`.
18
- * - Do not duplicate protocol text (decision/completion/ethos live in
19
- * `.cclaw/references/protocols/`). Link, don't inline.
20
- * - Do not introduce new gates or hard rules here — flow-map is
21
- * descriptive, not prescriptive.
22
- */
23
- export declare function flowMapMarkdown(): string;
@@ -1,134 +0,0 @@
1
- import { RUNTIME_ROOT } from "../constants.js";
2
- /**
3
- * Relative path used by skills/commands to cite the consolidated flow map.
4
- * Stable contract — changing this value is a breaking change for doctor
5
- * policies and meta-skill links.
6
- */
7
- export const FLOW_MAP_REL_PATH = `${RUNTIME_ROOT}/references/flow-map.md`;
8
- /**
9
- * Canonical one-page overview of cclaw's user-facing surface.
10
- *
11
- * Purpose: give the model (and any curious human) a single file that
12
- * answers "what does cclaw expose, where does my current stage fit, and
13
- * which files drive progress?" without forcing a walk of the 8 stage
14
- * skills plus the 4 router skills plus the meta-skill.
15
- *
16
- * Design rules:
17
- * - Keep it under ~150 lines; it is a map, not a manual.
18
- * - Only cite files that already exist under `.cclaw/`.
19
- * - Do not duplicate protocol text (decision/completion/ethos live in
20
- * `.cclaw/references/protocols/`). Link, don't inline.
21
- * - Do not introduce new gates or hard rules here — flow-map is
22
- * descriptive, not prescriptive.
23
- */
24
- export function flowMapMarkdown() {
25
- return `# cclaw Flow Map
26
-
27
- One-page surface reference. Use this when you need the shape of cclaw
28
- without reading every skill — the stage quick-map, the user-facing
29
- slash commands, the Ralph Loop signal, and the key state files.
30
-
31
- For enforcement details, load the matching stage skill or command
32
- contract. For protocols (decision/completion/ethos) see
33
- \`${RUNTIME_ROOT}/references/protocols/\`.
34
-
35
- ## Stages (8)
36
-
37
- | # | Stage | Goal | Primary artifact |
38
- |---|---|---|---|
39
- | 1 | brainstorm | Explore options and constraints | \`.cclaw/artifacts/00-idea.md\` (+ \`01-brainstorm.md\`) |
40
- | 2 | scope | Freeze scope (in/out, assumptions) | \`.cclaw/artifacts/02-scope.md\` |
41
- | 3 | design | Pick the shape of the change | \`.cclaw/artifacts/03-design.md\` |
42
- | 4 | spec | Turn design into testable acceptance criteria | \`.cclaw/artifacts/04-spec.md\` |
43
- | 5 | plan | Decompose spec into executable slices | \`.cclaw/artifacts/05-plan.md\` |
44
- | 6 | tdd | Drive each slice through RED → GREEN → REFACTOR (Ralph Loop) | \`.cclaw/artifacts/06-tdd.md\` + \`.cclaw/state/tdd-cycle-log.jsonl\` |
45
- | 7 | review | Cross-check correctness, spec coverage, and ethos | \`.cclaw/artifacts/07-review.md\` |
46
- | 8 | ship | Close out: retro, compound, archive | \`.cclaw/artifacts/08-ship.md\` (+ \`09-retro.md\`) |
47
-
48
- Track shortcuts (set in \`.cclaw/state/flow-state.json\`):
49
-
50
- - \`quick\` — spec → tdd → review → ship
51
- - \`medium\` — brainstorm → spec → plan → tdd → review → ship
52
- - \`standard\` — all 8 stages (default)
53
-
54
- ## User-facing slash commands
55
-
56
- | Command | Role | Notes |
57
- |---|---|---|
58
- | \`/cc\` | Entry point. No args = resume. With prompt = classify + start. | Writes \`00-idea.md\` and picks the track. |
59
- | \`/cc-next\` | Advance or resume the current stage based on gates. | Soft nudge from Ralph Loop during \`tdd\`. |
60
- | \`/cc-ideate\` | Repo-improvement discovery, separate from product flow. | Produces ideas, not stage artifacts. |
61
- | \`/cc-view [status\\|tree\\|diff]\` | Read-only router. Never mutates flow state. | \`diff\` refreshes the snapshot baseline by design. |
62
- | \`/cc-ops [feature\\|tdd-log\\|retro\\|compound\\|archive\\|rewind]\` | Operations router for post-flow and side-channel actions. | Mutations are scoped to each subcommand. |
63
-
64
- Subcommand dispatch lives in \`${RUNTIME_ROOT}/commands/\` and the
65
- matching \`${RUNTIME_ROOT}/skills/flow-*/SKILL.md\`. The meta-skill
66
- (\`${RUNTIME_ROOT}/skills/using-cclaw/SKILL.md\`) decides which router to
67
- use before any substantive work.
68
-
69
- ## Ralph Loop (TDD progress signal)
70
-
71
- When \`currentStage === "tdd"\`, SessionStart writes
72
- \`${RUNTIME_ROOT}/state/ralph-loop.json\` from the TDD cycle log. Fields
73
- worth acting on:
74
-
75
- - \`loopIteration\` — how many RED → GREEN cycles already landed.
76
- - \`redOpenSlices\` — slices with an unsatisfied RED. Non-empty means do
77
- **not** advance to review.
78
- - \`acClosed\` — distinct acceptance-criterion IDs closed by a GREEN row
79
- (requires \`acIds\` on the green log entry via \`/cc-ops tdd-log\`).
80
- - \`sliceCount\` — total distinct plan slices ever touched.
81
-
82
- Ralph Loop is a signal, not a gate. Stage advancement still runs
83
- through the normal \`flow-state.json\` gate catalog.
84
-
85
- ## Compound readiness (auto-promotion signal)
86
-
87
- SessionStart also refreshes
88
- \`${RUNTIME_ROOT}/state/compound-readiness.json\` from \`knowledge.jsonl\`.
89
- The file lists clusters whose summed \`frequency\` reaches
90
- \`compound.recurrenceThreshold\` (default 3) or whose severity is
91
- \`critical\` (override). It surfaces a one-line nudge in the session
92
- digest only during \`review\` and \`ship\`, where lift-to-rule is in
93
- scope; earlier stages refresh the file silently. Promotion itself stays
94
- manual via \`/cc-ops compound\` so the signal never blocks flow.
95
-
96
- ## Key state files
97
-
98
- | Path | What it holds |
99
- |---|---|
100
- | \`${RUNTIME_ROOT}/state/flow-state.json\` | Track, currentStage, completedStages, gate catalog, closeout substate. |
101
- | \`${RUNTIME_ROOT}/state/delegation-log.json\` | Per-stage mandatory agent status + fulfillmentMode + evidenceRefs. |
102
- | \`${RUNTIME_ROOT}/state/tdd-cycle-log.jsonl\` | Append-only RED/GREEN/REFACTOR entries (source of Ralph Loop). |
103
- | \`${RUNTIME_ROOT}/state/ralph-loop.json\` | Derived Ralph Loop status (TDD-only). |
104
- | \`${RUNTIME_ROOT}/state/compound-readiness.json\` | Derived compound-promotion readiness (refreshed each SessionStart). |
105
- | \`${RUNTIME_ROOT}/state/stage-activity.jsonl\` | Append-only stage-enter/exit and gate-pass signals. |
106
- | \`${RUNTIME_ROOT}/state/checkpoint.json\` | Latest session checkpoint (stage + timestamp). |
107
- | \`${RUNTIME_ROOT}/state/context-mode.json\` | Active context mode (\`default\`, \`headless\`, ...). |
108
- | \`${RUNTIME_ROOT}/state/harness-gaps.json\` | Per-harness tier, subagent fallback, playbook path (schemaVersion 2). |
109
- | \`${RUNTIME_ROOT}/knowledge.jsonl\` | Append-only learnings; surfaced to sessions via digest. |
110
-
111
- ## Strictness and hooks
112
-
113
- Hook-driven guards respect the \`strictness\` field in
114
- \`${RUNTIME_ROOT}/config.yaml\`:
115
-
116
- - \`advisory\` (default) — hooks warn but never block tool calls.
117
- - \`strict\` — hooks block tool calls that violate their scope.
118
-
119
- Override per-session with \`CCLAW_STRICTNESS=advisory|strict\`.
120
-
121
- Hook wiring itself comes from a **single manifest** (\`src/content/hook-manifest.ts\`):
122
- the per-harness documents at \`.claude/hooks/hooks.json\`, \`.cursor/hooks.json\`,
123
- \`.codex/hooks.json\` are all derived from it. Inspect the live bindings with
124
- \`cclaw internal hook-manifest\` (add \`--json\` for machine-readable output).
125
-
126
- ## When in doubt
127
-
128
- 1. Read \`${RUNTIME_ROOT}/state/flow-state.json\` to know where you are.
129
- 2. Load the matching stage skill only if you are about to do
130
- substantive work (see \`using-cclaw\` meta-skill).
131
- 3. Prefer \`/cc-next\` for progression. \`/cc-view\` for visibility.
132
- \`/cc-ops\` for side-channel operations.
133
- `;
134
- }
@@ -1,2 +0,0 @@
1
- export declare function harnessIntegrationDocMarkdown(): string;
2
- export declare function harnessDocsOverviewMarkdown(): string;
@@ -1,202 +0,0 @@
1
- import { HARNESS_ADAPTERS, harnessTier } from "../harness-adapters.js";
2
- import { STAGE_TO_SKILL_FOLDER } from "../constants.js";
3
- import { HOOK_EVENTS_BY_HARNESS, HOOK_SEMANTIC_EVENTS } from "./hook-events.js";
4
- import { HARNESS_PLAYBOOKS_DIR, harnessPlaybookFileName } from "./harness-playbooks.js";
5
- import { HARNESS_TOOL_REFS_DIR } from "./harness-tool-refs.js";
6
- function harnessTitle(harness) {
7
- switch (harness) {
8
- case "claude":
9
- return "Claude Code";
10
- case "cursor":
11
- return "Cursor";
12
- case "opencode":
13
- return "OpenCode";
14
- case "codex":
15
- return "OpenAI Codex";
16
- }
17
- }
18
- function tierDescription(tier) {
19
- if (tier === "tier1")
20
- return "full native automation";
21
- if (tier === "tier2")
22
- return "partial automation with waivers";
23
- return "compatibility shim";
24
- }
25
- export function harnessIntegrationDocMarkdown() {
26
- const harnesses = Object.keys(HARNESS_ADAPTERS);
27
- const stageSkillRows = Object.entries(STAGE_TO_SKILL_FOLDER)
28
- .map(([stage, skillFolder]) => `| \`${stage}\` | \`${skillFolder}\` |`)
29
- .join("\n");
30
- const hookCasingRows = [
31
- "| Claude Code | `claude` | PascalCase (`SessionStart`, `PreToolUse`) |",
32
- "| Cursor | `cursor` | camelCase (`sessionStart`, `preToolUse`) |",
33
- "| OpenCode | `opencode` | camelCase (`sessionStart`, `preToolUse`) |",
34
- "| OpenAI Codex | `codex` | PascalCase (`SessionStart`, `PreToolUse`) |"
35
- ].join("\n");
36
- const capabilityRows = harnesses
37
- .map((harness) => {
38
- const adapter = HARNESS_ADAPTERS[harness];
39
- const tier = harnessTier(harness);
40
- const caps = adapter.capabilities;
41
- const playbook = `\`${HARNESS_PLAYBOOKS_DIR}/${harnessPlaybookFileName(harness)}\``;
42
- return `| ${harnessTitle(harness)} | \`${harness}\` | \`${tier}\` (${tierDescription(tier)}) | ${caps.nativeSubagentDispatch} | ${caps.subagentFallback} | ${caps.hookSurface} | ${caps.structuredAsk} | ${playbook} |`;
43
- })
44
- .join("\n");
45
- const hookRows = HOOK_SEMANTIC_EVENTS.map((eventName) => {
46
- const columns = harnesses
47
- .map((harness) => {
48
- const mapping = HOOK_EVENTS_BY_HARNESS[harness][eventName];
49
- return mapping ?? "missing";
50
- })
51
- .join(" | ");
52
- return `| \`${eventName}\` | ${columns} |`;
53
- }).join("\n");
54
- return `# Harness Integration Matrix
55
-
56
- Generated from \`src/harness-adapters.ts\` capabilities and hook event mappings.
57
-
58
- ## Capability tiers
59
-
60
- | Harness | ID | Tier | Native dispatch | Fallback | Hook surface | Structured ask | Playbook |
61
- |---|---|---|---|---|---|---|---|
62
- ${capabilityRows}
63
-
64
- Fallback legend:
65
-
66
- - \`native\` — first-class named subagent dispatch (Claude).
67
- - \`generic-dispatch\` — generic Task dispatcher mapped to cclaw roles (Cursor).
68
- - \`role-switch\` — in-session role announce + delegation-log entry with evidenceRefs (OpenCode, Codex).
69
- - \`waiver\` — no parity path; reserved for harnesses that cannot role-switch (none shipped).
70
-
71
- ## Parallel research dispatch semantics
72
-
73
- Design-stage research fleet uses the same parity model:
74
-
75
- - **Claude / Cursor**: dispatch all four research lenses in one turn
76
- (stack, features, architecture, pitfalls) and synthesize into
77
- \`.cclaw/artifacts/02a-research.md\`.
78
- - **OpenCode / Codex**: execute the same four lenses via sequential
79
- role-switch, each with explicit announce -> execute -> evidence trail.
80
- This preserves auditability when native parallel dispatch is unavailable.
81
-
82
- ## Semantic hook event coverage
83
-
84
- | Event | Claude | Cursor | OpenCode | Codex |
85
- |---|---|---|---|---|
86
- ${hookRows}
87
-
88
- ## Hook event casing
89
-
90
- Hook keys are intentionally harness-native and must not be normalized:
91
-
92
- | Harness | ID | Event key casing |
93
- |---|---|---|
94
- ${hookCasingRows}
95
-
96
- Use the exact event names from each harness schema. Treating all hooks as one
97
- shared casing silently breaks generated wiring.
98
-
99
- ## Interpretation
100
-
101
- - \`tier1\`: full native delegation + structured asks + full hook surface.
102
- - \`tier2\`: usable flow with capability gaps; mandatory delegation can require waivers.
103
- - Codex-specific ceiling: \`PreToolUse\` can only intercept \`Bash\`. Direct
104
- \`Write\`/\`Edit\` to \`.cclaw/state/flow-state.json\` cannot be hard-blocked
105
- at hook level, so the canonical path is
106
- \`node .cclaw/hooks/stage-complete.mjs <stage>\` plus the non-blocking
107
- \`UserPromptSubmit\` state nudge.
108
-
109
- ## Shared command contract
110
-
111
- All harnesses receive the same utility commands:
112
-
113
- - \`/cc\` - flow entry and resume
114
- - \`/cc-next\` - stage progression
115
- - \`/cc-ideate\` - ideate mode for ranked repo-improvement backlog
116
- - \`/cc-view\` - read-only router for status/tree/diff
117
- - \`/cc-ops\` - operations router for feature/tdd-log/retro/compound/archive/rewind
118
-
119
- Read-only subcommands:
120
- - \`/cc-view status\` - visual flow snapshot
121
- - \`/cc-view tree\` - deep flow tree (stages, artifacts, stale markers)
122
- - \`/cc-view diff\` - before/after flow-state diff map
123
-
124
- Operations subcommands:
125
- - \`/cc-ops feature ...\` - git-worktree feature isolation and routing
126
- - \`/cc-ops tdd-log ...\` - explicit RED/GREEN/REFACTOR evidence log
127
- - \`/cc-ops retro\` - mandatory retrospective gate before archive
128
- - \`/cc-ops compound\` - lift repeated learnings into durable rules/skills
129
- - \`/cc-ops archive\` - archive active run from harness flow
130
- - \`/cc-ops rewind ...\` - rewind flow and invalidate downstream stages
131
- - \`/cc-ops rewind --ack ...\` - clear stale stage markers after redo
132
-
133
- Stage order remains canonical:
134
- \`brainstorm -> scope -> design -> spec -> plan -> tdd -> review -> ship\`
135
-
136
- ## Stage -> skill folder mapping
137
-
138
- | Stage | Skill folder |
139
- |---|---|
140
- ${stageSkillRows}
141
-
142
- This map is generated from \`src/constants.ts::STAGE_TO_SKILL_FOLDER\` so
143
- skill-path naming stays explicit and stable even when stage ids differ from
144
- folder names.
145
-
146
- ## Install surfaces
147
-
148
- Always generated:
149
-
150
- - \`.cclaw/commands/*.md\`
151
- - \`.cclaw/skills/*/SKILL.md\`
152
- - \`.cclaw/references/**\`
153
- - \`.cclaw/state/*.json|*.jsonl\`
154
- - \`AGENTS.md\` managed block
155
-
156
- Harness-specific additions:
157
-
158
- - \`claude\`: \`.claude/commands/cc*.md\`, \`.claude/hooks/hooks.json\`
159
- - \`cursor\`: \`.cursor/commands/cc*.md\`, \`.cursor/hooks.json\`, \`.cursor/rules/cclaw-workflow.mdc\`
160
- - \`opencode\`: \`.opencode/commands/cc*.md\`, \`.opencode/plugins/cclaw-plugin.mjs\`, opencode plugin registration
161
- - \`codex\`: \`.agents/skills/cc/SKILL.md\`, \`.agents/skills/cc-next/SKILL.md\`, \`.agents/skills/cc-ideate/SKILL.md\`, \`.agents/skills/cc-view/SKILL.md\`, \`.agents/skills/cc-ops/SKILL.md\`, \`.codex/hooks.json\` (Codex CLI reads \`.agents/skills/\` for custom skills and consumes \`.codex/hooks.json\` on v0.114+ when \`[features] codex_hooks = true\` is set in \`~/.codex/config.toml\`. \`.codex/commands/\` and the legacy \`.agents/skills/cclaw-cc*/\` layout from v0.39.x are auto-cleaned on sync.)
162
-
163
- ## Runtime observability
164
-
165
- - \`.cclaw/state/harness-gaps.json\` captures per-harness capability gaps for the active config.
166
- - \`cclaw doctor\` validates shim, hook, and lifecycle surfaces against this capability model.
167
- `;
168
- }
169
- export function harnessDocsOverviewMarkdown() {
170
- const harnesses = Object.keys(HARNESS_ADAPTERS);
171
- const rows = harnesses
172
- .map((harness) => {
173
- const tier = harnessTier(harness);
174
- const toolMap = `\`.cclaw/${HARNESS_TOOL_REFS_DIR}/${harness}.md\``;
175
- const playbook = `\`.cclaw/${HARNESS_PLAYBOOKS_DIR}/${harnessPlaybookFileName(harness)}\``;
176
- return `| ${harnessTitle(harness)} | \`${harness}\` | \`${tier}\` | ${toolMap} | ${playbook} |`;
177
- })
178
- .join("\n");
179
- return `# Harness Docs Overview
180
-
181
- Single entrypoint for harness-specific references generated by cclaw sync.
182
-
183
- ## Core references
184
-
185
- - Integration matrix: \`.cclaw/references/harnesses.md\`
186
- - Tool-map index: \`.cclaw/references/${HARNESS_TOOL_REFS_DIR}/README.md\`
187
- - Playbook index: \`.cclaw/references/${HARNESS_PLAYBOOKS_DIR}/README.md\`
188
-
189
- ## Per-harness quick links
190
-
191
- | Harness | ID | Tier | Tool map | Playbook |
192
- |---|---|---|---|---|
193
- ${rows}
194
-
195
- ## How to use this pack
196
-
197
- 1. Start with \`harnesses.md\` to understand capability/tier differences.
198
- 2. Open the harness-specific tool map before writing stage logic that depends on tool names.
199
- 3. Open the harness-specific playbook before asserting delegation parity behavior.
200
- 4. If docs disagree, treat \`harnesses.md\` + harness adapter capabilities as source of truth and regenerate.
201
- `;
202
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Per-harness parity playbooks.
3
- *
4
- * cclaw's subagent contracts (planner / reviewer / security-reviewer /
5
- * test-author / doc-updater) assume Claude-style isolated workers. On
6
- * harnesses without that primitive, the agent has to fulfil the role via a
7
- * documented fallback (generic Task dispatch, role-switch in-session, …).
8
- *
9
- * Each playbook is:
10
- * 1. short (≤ ~150 lines markdown),
11
- * 2. executable — reproducible by an agent without reading the whole repo,
12
- * 3. evidence-first — always records a delegation-log entry with
13
- * `fulfillmentMode` and `evidenceRefs` so `cclaw doctor` can tell the
14
- * role was actually performed.
15
- *
16
- * Playbooks are materialised at
17
- * `.cclaw/references/harnesses/<harness>-playbook.md` by install/sync/upgrade.
18
- */
19
- import type { HarnessId } from "../types.js";
20
- export declare const HARNESS_PLAYBOOKS_DIR = "references/harnesses";
21
- export declare function harnessPlaybookRelativePath(harness: HarnessId): string;
22
- export declare function harnessPlaybookFileName(harness: HarnessId): string;
23
- export declare function harnessPlaybookMarkdown(harness: HarnessId): string;
24
- export declare function harnessPlaybooksIndexMarkdown(): string;