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,5 +1,6 @@
1
1
  import type { FlowStage, FlowTrack, TransitionRule } from "./types.js";
2
2
  export declare const TRANSITION_RULES: TransitionRule[];
3
+ export declare const FLOW_STATE_SCHEMA_VERSION = 1;
3
4
  export interface StageGateState {
4
5
  required: string[];
5
6
  recommended: string[];
@@ -66,6 +67,8 @@ export interface CloseoutState {
66
67
  }
67
68
  export declare function createInitialCloseoutState(): CloseoutState;
68
69
  export interface FlowState {
70
+ /** Backward-compatible schema marker for future migrations. */
71
+ schemaVersion: typeof FLOW_STATE_SCHEMA_VERSION;
69
72
  activeRunId: string;
70
73
  currentStage: FlowStage;
71
74
  completedStages: FlowStage[];
@@ -1,6 +1,7 @@
1
1
  import { buildTransitionRules, orderedStageSchemas, stageGateIds, stageRecommendedGateIds } from "./content/stage-schema.js";
2
2
  import { FLOW_STAGES, FLOW_TRACKS, TRACK_STAGES } from "./types.js";
3
3
  export const TRANSITION_RULES = buildTransitionRules();
4
+ export const FLOW_STATE_SCHEMA_VERSION = 1;
4
5
  /**
5
6
  * Ship closeout substate machine.
6
7
  *
@@ -80,6 +81,7 @@ export function createInitialFlowState(activeRunIdOrOptions = {}, maybeTrack) {
80
81
  };
81
82
  }
82
83
  return {
84
+ schemaVersion: FLOW_STATE_SCHEMA_VERSION,
83
85
  activeRunId,
84
86
  currentStage: firstStageForTrack(track),
85
87
  completedStages: [],
@@ -78,7 +78,7 @@ export interface HarnessAdapter {
78
78
  /**
79
79
  * Declared fallback pattern used when the harness cannot satisfy a
80
80
  * mandatory delegation natively. Drives `checkMandatoryDelegations`
81
- * and the generated playbook per harness.
81
+ * and generated harness guidance.
82
82
  */
83
83
  subagentFallback: SubagentFallback;
84
84
  };
@@ -33,35 +33,11 @@ const UTILITY_SHIMS = [
33
33
  command: "view",
34
34
  skillFolder: "flow-view",
35
35
  commandFile: "view.md"
36
- },
37
- {
38
- fileName: "cc-ops.md",
39
- skillName: "cc-ops",
40
- command: "ops",
41
- skillFolder: "flow-ops",
42
- commandFile: "ops.md"
43
36
  }
44
37
  ];
45
38
  /** Skill-kind shim name for the root `/cc` entry point. */
46
39
  const ENTRY_SHIM_SKILL_NAME = "cc";
47
- /**
48
- * Skill directory names that v0.39.0 / v0.39.1 installed under
49
- * `.agents/skills/` before the rename. We delete these on every sync so
50
- * upgrades from those versions do not leave orphaned `cclaw-cc*`
51
- * folders that would double-register in Codex's skill listing.
52
- */
53
- const LEGACY_CODEX_SKILL_NAMES = [
54
- "cclaw-cc",
55
- "cclaw-cc-next",
56
- "cclaw-cc-view",
57
- "cclaw-cc-ops",
58
- "cclaw-cc-ideate",
59
- // Pre-v0.40 installed `/cc-learn` as a top-level skill before it was
60
- // folded into `/cc-ops`. Without this entry the orphan stays behind
61
- // after upgrade and Codex lists both the new in-thread workflow and
62
- // the legacy slash command.
63
- "cclaw-cc-learn"
64
- ];
40
+ const LEGACY_CODEX_SKILL_PREFIX = "cclaw-cc";
65
41
  /**
66
42
  * Shims that older cclaw versions installed as top-level slash commands but
67
43
  * which we now treat as internal (skill-only, invoked by the agent, never
@@ -96,7 +72,7 @@ export const HARNESS_ADAPTERS = {
96
72
  // Cursor has a real Task tool with subagent_type (generalPurpose,
97
73
  // explore, shell, browser-use, …) but no user-defined named
98
74
  // subagents. cclaw maps each named agent (planner/reviewer/…) onto
99
- // generic dispatch with a role prompt — see the cursor playbook.
75
+ // generic dispatch with a role prompt.
100
76
  nativeSubagentDispatch: "generic",
101
77
  hookSurface: "full",
102
78
  structuredAsk: "AskQuestion",
@@ -115,9 +91,8 @@ export const HARNESS_ADAPTERS = {
115
91
  // permission-gated — `opencode.json` must set
116
92
  // `permission.question: "allow"` and ACP clients must export
117
93
  // `OPENCODE_ENABLE_QUESTION_TOOL=1`. cclaw surfaces the tool name
118
- // in the Decision Protocol and in the OpenCode playbook; skills
119
- // fall back to the shared plain-text lettered list when the tool
120
- // is denied or unavailable.
94
+ // in generated harness guidance; skills fall back to the shared
95
+ // plain-text lettered list when the tool is denied or unavailable.
121
96
  structuredAsk: "question",
122
97
  subagentFallback: "role-switch"
123
98
  }
@@ -144,9 +119,8 @@ export const HARNESS_ADAPTERS = {
144
119
  // It is the primitive the built-in Plan / Collaboration mode
145
120
  // templates use (see `codex-rs/collaboration-mode-templates`).
146
121
  // Agents running inside Codex can call it directly; cclaw wires
147
- // it into the Decision Protocol and the Codex playbook. The
148
- // shared plain-text lettered list is the documented fallback
149
- // when the tool is unavailable.
122
+ // it into generated harness guidance. The shared plain-text
123
+ // lettered list is the documented fallback when the tool is unavailable.
150
124
  structuredAsk: "request_user_input",
151
125
  subagentFallback: "role-switch"
152
126
  }
@@ -218,11 +192,10 @@ When in doubt, prefer **non-trivial** — the quick track is opt-in and only saf
218
192
  ### Instruction Priority (top wins)
219
193
 
220
194
  1. User message in the current turn.
221
- 2. Active stage skill HARD-GATE (\`.cclaw/skills/<stage>/SKILL.md\`).
222
- 3. Command contract gates (\`.cclaw/commands/<stage>.md\`).
223
- 4. The \`using-cclaw\` meta-skill.
224
- 5. Contextual utility skills.
225
- 6. Training priors.
195
+ 2. Active stage skill and command contract.
196
+ 3. The \`using-cclaw\` meta-skill.
197
+ 4. Contextual utility skills.
198
+ 5. Training priors.
226
199
 
227
200
  ### Commands
228
201
 
@@ -232,13 +205,12 @@ When in doubt, prefer **non-trivial** — the quick track is opt-in and only saf
232
205
  | \`/cc-next\` | **Progression.** Advances to the next stage when current is complete. |
233
206
  | \`/cc-ideate\` | **Ideate mode.** Generates a ranked repo-improvement backlog before implementation. |
234
207
  | \`/cc-view\` | **Read-only router.** Unified entry for status/tree/diff views. |
235
- | \`/cc-ops\` | **Operations router.** Unified entry for feature/tdd-log/retro/compound/archive/rewind actions. |
236
208
 
237
209
  Knowledge capture and curation run automatically as part of stage completion
238
210
  protocols via the internal \`learnings\` skill — no user-facing command.
239
211
 
240
- **Stage order:** brainstorm > scope > design > spec > plan > tdd > review > ship.
241
- \`/cc-next\` loads the right stage skill automatically. Gates must pass before handoff.
212
+ **Stage order:** brainstorm > scope > design > spec > plan > tdd > review > ship, then closeout: retro > compound > archive.
213
+ \`/cc-next\` loads the right stage skill automatically and also drives post-ship closeout. Gates must pass before handoff.
242
214
 
243
215
  ### Verification Discipline
244
216
 
@@ -253,14 +225,14 @@ If the same approach fails three times in a row (same command, same finding, sam
253
225
  - This managed AGENTS block is intentionally minimal for cross-project use.
254
226
  - Harness coverage is tiered: Tier1 (claude), Tier2 (cursor/opencode/codex — codex has Bash-only tool hooks), Tier3 (fallback/manual-only).
255
227
  - Detailed operating procedures live in \`.cclaw/skills/using-cclaw/SKILL.md\`.
256
- - Preamble budget and cooldown rules live in \`.cclaw/references/protocols/ethos.md\`.
228
+ - Keep preambles brief; re-announce role/stage only when either changes.
257
229
  - Subagent orchestration patterns: \`.cclaw/skills/subagent-dev/SKILL.md\` and \`.cclaw/skills/parallel-dispatch/SKILL.md\`.
258
230
 
259
231
  ### Codex users
260
232
 
261
233
  OpenAI Codex CLI has **no native \`/cc\` slash command** (custom prompts
262
234
  were deprecated in v0.89, Jan 2026). The \`/cc\`, \`/cc-next\`,
263
- \`/cc-ideate\`, \`/cc-view\`, \`/cc-ops\` tokens above describe intent — in
235
+ \`/cc-ideate\`, \`/cc-view\` tokens above describe intent — in
264
236
  Codex they map onto skills cclaw installs at
265
237
  \`.agents/skills/cc*/SKILL.md\`. Activate one of two ways:
266
238
 
@@ -275,9 +247,8 @@ in \`~/.codex/config.toml\`. cclaw generates \`.codex/hooks.json\` on
275
247
  sync; if the feature flag is off, hooks are inert and cclaw's
276
248
  session-start rehydration simply does not fire. Run \`cclaw doctor\` to
277
249
  see if the flag is missing. \`.codex/commands/*\` is still unused by
278
- Codex CLI and is removed on every sync. See
279
- \`.cclaw/references/harnesses/codex-playbook.md\` for the hook coverage
280
- matrix (Bash-only \`PreToolUse\`/\`PostToolUse\`; other events are full).
250
+ Codex CLI and is removed on every sync. Run \`cclaw doctor --explain\` for
251
+ hook coverage details (Bash-only \`PreToolUse\`/\`PostToolUse\`; other events are full).
281
252
  ${CCLAW_MARKER_END}`;
282
253
  }
283
254
  /** Removes the cclaw AGENTS.md block. */
@@ -334,6 +305,20 @@ export async function removeCclawFromAgentsMd(projectRoot) {
334
305
  await removeCclawFromRoutingFile(path.join(projectRoot, "AGENTS.md"));
335
306
  await removeCclawFromRoutingFile(path.join(projectRoot, "CLAUDE.md"));
336
307
  }
308
+ function utilityShimBehavior(command) {
309
+ switch (command) {
310
+ case "cc":
311
+ return "This is the entry command, not a flow stage. It may initialize or resume flow state after confirmation.";
312
+ case "next":
313
+ return "This is the progression command, not a flow stage. It may advance stages and post-ship closeout through managed helpers.";
314
+ case "ideate":
315
+ return "This is an ideation command, not a flow stage. It may write ideation artifacts/seeds but does not advance flow state.";
316
+ case "view":
317
+ return "This is a read-only view command, not a flow stage. It never mutates flow state.";
318
+ default:
319
+ return "This is a utility command, not a flow stage.";
320
+ }
321
+ }
337
322
  function utilityShimContent(harness, command, skillFolder, commandFile) {
338
323
  const shimName = command === "cc" ? "cc" : `cc-${command}`;
339
324
  return `---
@@ -348,7 +333,7 @@ Load and execute:
348
333
  1. \`.cclaw/skills/${skillFolder}/SKILL.md\`
349
334
  2. \`.cclaw/commands/${commandFile}\`
350
335
 
351
- This is a utility command (not a flow stage). It does not advance flow state.
336
+ ${utilityShimBehavior(command)}
352
337
  `;
353
338
  }
354
339
  /**
@@ -360,15 +345,13 @@ This is a utility command (not a flow stage). It does not advance flow state.
360
345
  function codexSkillDescription(command) {
361
346
  switch (command) {
362
347
  case "cc":
363
- return `Entry point for the cclaw 8-stage workflow (brainstorm scope design spec plantdd → review → ship). Use whenever the user types \`/cc\`, \`/cclaw\`, or asks to "start the flow", "begin cclaw", "kick off the workflow", "classify this task", or wants to start/resume a non-trivial software change. No args = resume the active stage from \`.cclaw/state/flow-state.json\`. With a prompt = classify and pick a track (quick/medium/standard).`;
348
+ return `Entry point for the cclaw track-aware workflow ending in ship plus auto-closeout (retrocompoundarchive). Use whenever the user types \`/cc\`, \`/cclaw\`, or asks to "start the flow", "begin cclaw", "kick off the workflow", "classify this task", or wants to start/resume a non-trivial software change. No args = resume the active stage from \`.cclaw/state/flow-state.json\`. With a prompt = classify and pick a track (quick/medium/standard).`;
364
349
  case "next":
365
- return `Advance the cclaw flow to the next stage. Use when the user types \`/cc-next\` or asks to "move to the next stage", "continue the flow", "advance cclaw", "progress the workflow", or when the current stage skill reports completion and gates have passed.`;
350
+ return `Advance the cclaw flow to the next stage or post-ship closeout substate. Use when the user types \`/cc-next\` or asks to "move to the next stage", "continue the flow", "advance cclaw", "progress the workflow", or when the current stage skill reports completion and gates have passed.`;
366
351
  case "ideate":
367
352
  return `Read-only repo-improvement ideate mode for cclaw. Use when the user types \`/cc-ideate\` or asks to "ideate", "scan the repo for TODOs/tech debt", "generate a backlog", or wants a ranked list of candidate ideas before committing to a single flow. Does not mutate \`.cclaw/state/flow-state.json\`.`;
368
353
  case "view":
369
354
  return `Read-only router for cclaw flow views. Use when the user types \`/cc-view\`, \`/cc-view status\`, \`/cc-view tree\`, \`/cc-view diff\`, or asks to "show cclaw status", "show the flow tree", "diff flow state", or wants a snapshot without mutation.`;
370
- case "ops":
371
- return `Operations router for cclaw post-flow actions. Use when the user types \`/cc-ops\`, \`/cc-ops feature\`, \`/cc-ops tdd-log\`, \`/cc-ops retro\`, \`/cc-ops compound\`, \`/cc-ops archive\`, \`/cc-ops rewind\`, or asks to "archive the run", "run the retro", "compound knowledge", "rewind to an earlier stage", or manage feature worktrees.`;
372
355
  default:
373
356
  return `Generated cclaw skill for ${command}.`;
374
357
  }
@@ -399,8 +382,8 @@ under \`.agents/skills/${skillSlug}/\` so the user can either:
399
382
 
400
383
  Lifecycle hooks **are** available in Codex CLI v0.114+ (behind the
401
384
  \`[features] codex_hooks = true\` flag in \`~/.codex/config.toml\`) and
402
- cclaw installs a matching \`.codex/hooks.json\` see the playbook for
403
- what the hook surface does and does not cover.
385
+ cclaw installs a matching \`.codex/hooks.json\`; run \`cclaw doctor --explain\`
386
+ for the current hook surface and limitations.
404
387
 
405
388
  ## Protocol
406
389
 
@@ -422,8 +405,7 @@ what the hook surface does and does not cover.
422
405
  (v0.33+).
423
406
  - Codex's \`PreToolUse\` / \`PostToolUse\` hooks currently only intercept
424
407
  the \`Bash\` tool. \`Write\`, \`Edit\`, \`WebSearch\`, and MCP tool calls
425
- are **not** gated by hooks — read
426
- \`.cclaw/references/harnesses/codex-playbook.md\` for what cclaw
408
+ are **not** gated by hooks — use \`cclaw doctor --explain\` for what cclaw
427
409
  substitutes with in-turn agent steps for those call classes.
428
410
  - Codex's \`SessionStart\` matcher only supports \`startup|resume\`. Claude
429
411
  and Cursor also fire on \`clear\` and \`compact\`, so mid-session
@@ -488,10 +470,19 @@ async function cleanupLegacyCodexSurfaces(projectRoot) {
488
470
  catch {
489
471
  // best-effort cleanup
490
472
  }
491
- // Remove the old `cclaw-cc*` skill folders if they exist from a
492
- // previous cclaw install. Idempotent; best-effort.
473
+ // Remove old `cclaw-cc*` skill folders if they exist from a previous
474
+ // cclaw install. Idempotent; best-effort.
493
475
  const legacySkillsRoot = path.join(projectRoot, ".agents/skills");
494
- for (const name of LEGACY_CODEX_SKILL_NAMES) {
476
+ let legacySkillNames = [];
477
+ try {
478
+ legacySkillNames = (await fs.readdir(legacySkillsRoot, { withFileTypes: true }))
479
+ .filter((entry) => entry.isDirectory() && entry.name.startsWith(LEGACY_CODEX_SKILL_PREFIX))
480
+ .map((entry) => entry.name);
481
+ }
482
+ catch {
483
+ legacySkillNames = [];
484
+ }
485
+ for (const name of legacySkillNames) {
495
486
  const folder = path.join(legacySkillsRoot, name);
496
487
  try {
497
488
  await fs.rm(folder, { recursive: true, force: true });