cclaw-cli 0.49.0 → 0.51.1

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 (183) hide show
  1. package/README.md +57 -84
  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 -491
  6. package/dist/constants.d.ts +2 -13
  7. package/dist/constants.js +1 -43
  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 +55 -17
  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 +44 -21
  23. package/dist/content/ideate-command.d.ts +2 -0
  24. package/dist/content/ideate-command.js +34 -25
  25. package/dist/content/iron-laws.d.ts +5 -5
  26. package/dist/content/iron-laws.js +5 -5
  27. package/dist/content/language-policy.d.ts +2 -0
  28. package/dist/content/language-policy.js +13 -0
  29. package/dist/content/learnings.d.ts +3 -4
  30. package/dist/content/learnings.js +26 -50
  31. package/dist/content/meta-skill.js +33 -22
  32. package/dist/content/next-command.js +41 -38
  33. package/dist/content/node-hooks.js +17 -345
  34. package/dist/content/opencode-plugin.js +5 -103
  35. package/dist/content/research-playbooks.js +14 -14
  36. package/dist/content/review-loop.d.ts +2 -0
  37. package/dist/content/review-loop.js +8 -0
  38. package/dist/content/session-hooks.js +15 -47
  39. package/dist/content/skills.d.ts +0 -5
  40. package/dist/content/skills.js +55 -128
  41. package/dist/content/stage-common-guidance.d.ts +0 -1
  42. package/dist/content/stage-common-guidance.js +17 -14
  43. package/dist/content/stage-schema.d.ts +26 -1
  44. package/dist/content/stage-schema.js +121 -40
  45. package/dist/content/stages/_lint-metadata/index.js +9 -15
  46. package/dist/content/stages/brainstorm.js +22 -43
  47. package/dist/content/stages/design.js +37 -57
  48. package/dist/content/stages/plan.js +22 -13
  49. package/dist/content/stages/review.js +24 -27
  50. package/dist/content/stages/scope.js +34 -46
  51. package/dist/content/stages/ship.js +7 -4
  52. package/dist/content/stages/spec.js +20 -9
  53. package/dist/content/stages/tdd.js +64 -44
  54. package/dist/content/start-command.js +13 -12
  55. package/dist/content/status-command.d.ts +2 -7
  56. package/dist/content/status-command.js +19 -146
  57. package/dist/content/subagents.d.ts +0 -5
  58. package/dist/content/subagents.js +51 -28
  59. package/dist/content/templates.d.ts +1 -1
  60. package/dist/content/templates.js +126 -135
  61. package/dist/content/track-render-context.d.ts +17 -0
  62. package/dist/content/track-render-context.js +44 -0
  63. package/dist/content/tree-command.d.ts +1 -2
  64. package/dist/content/tree-command.js +4 -87
  65. package/dist/content/utility-skills.d.ts +2 -29
  66. package/dist/content/utility-skills.js +2 -1534
  67. package/dist/content/view-command.js +31 -11
  68. package/dist/delegation.d.ts +1 -1
  69. package/dist/delegation.js +5 -15
  70. package/dist/doctor-registry.js +20 -21
  71. package/dist/doctor.js +88 -344
  72. package/dist/flow-state.d.ts +3 -0
  73. package/dist/flow-state.js +2 -0
  74. package/dist/harness-adapters.d.ts +1 -1
  75. package/dist/harness-adapters.js +51 -58
  76. package/dist/install.js +128 -358
  77. package/dist/internal/advance-stage.js +3 -9
  78. package/dist/internal/compound-readiness.d.ts +1 -1
  79. package/dist/internal/compound-readiness.js +1 -1
  80. package/dist/internal/tdd-loop-status.d.ts +1 -1
  81. package/dist/internal/tdd-loop-status.js +1 -1
  82. package/dist/knowledge-store.d.ts +16 -10
  83. package/dist/knowledge-store.js +51 -15
  84. package/dist/policy.js +16 -105
  85. package/dist/run-archive.d.ts +4 -6
  86. package/dist/run-archive.js +15 -20
  87. package/dist/run-persistence.d.ts +2 -2
  88. package/dist/run-persistence.js +3 -9
  89. package/package.json +1 -2
  90. package/dist/content/archive-command.d.ts +0 -2
  91. package/dist/content/archive-command.js +0 -124
  92. package/dist/content/compound-command.d.ts +0 -5
  93. package/dist/content/compound-command.js +0 -193
  94. package/dist/content/contexts.d.ts +0 -18
  95. package/dist/content/contexts.js +0 -24
  96. package/dist/content/contracts.d.ts +0 -2
  97. package/dist/content/contracts.js +0 -51
  98. package/dist/content/doctor-references.d.ts +0 -2
  99. package/dist/content/doctor-references.js +0 -150
  100. package/dist/content/eval-scaffold.d.ts +0 -15
  101. package/dist/content/eval-scaffold.js +0 -370
  102. package/dist/content/feature-command.d.ts +0 -2
  103. package/dist/content/feature-command.js +0 -123
  104. package/dist/content/flow-map.d.ts +0 -23
  105. package/dist/content/flow-map.js +0 -134
  106. package/dist/content/harness-doc.d.ts +0 -2
  107. package/dist/content/harness-doc.js +0 -202
  108. package/dist/content/harness-playbooks.d.ts +0 -24
  109. package/dist/content/harness-playbooks.js +0 -393
  110. package/dist/content/harness-tool-refs.d.ts +0 -20
  111. package/dist/content/harness-tool-refs.js +0 -268
  112. package/dist/content/ops-command.d.ts +0 -2
  113. package/dist/content/ops-command.js +0 -71
  114. package/dist/content/protocols.d.ts +0 -7
  115. package/dist/content/protocols.js +0 -215
  116. package/dist/content/retro-command.d.ts +0 -2
  117. package/dist/content/retro-command.js +0 -165
  118. package/dist/content/rewind-command.d.ts +0 -2
  119. package/dist/content/rewind-command.js +0 -106
  120. package/dist/content/tdd-log-command.d.ts +0 -2
  121. package/dist/content/tdd-log-command.js +0 -85
  122. package/dist/eval/agents/single-shot.d.ts +0 -27
  123. package/dist/eval/agents/single-shot.js +0 -79
  124. package/dist/eval/agents/with-tools.d.ts +0 -44
  125. package/dist/eval/agents/with-tools.js +0 -261
  126. package/dist/eval/agents/workflow.d.ts +0 -31
  127. package/dist/eval/agents/workflow.js +0 -155
  128. package/dist/eval/baseline.d.ts +0 -38
  129. package/dist/eval/baseline.js +0 -282
  130. package/dist/eval/config-loader.d.ts +0 -14
  131. package/dist/eval/config-loader.js +0 -395
  132. package/dist/eval/corpus.d.ts +0 -30
  133. package/dist/eval/corpus.js +0 -330
  134. package/dist/eval/cost-guard.d.ts +0 -102
  135. package/dist/eval/cost-guard.js +0 -190
  136. package/dist/eval/diff.d.ts +0 -64
  137. package/dist/eval/diff.js +0 -323
  138. package/dist/eval/llm-client.d.ts +0 -176
  139. package/dist/eval/llm-client.js +0 -267
  140. package/dist/eval/mode.d.ts +0 -28
  141. package/dist/eval/mode.js +0 -61
  142. package/dist/eval/progress.d.ts +0 -83
  143. package/dist/eval/progress.js +0 -59
  144. package/dist/eval/report.d.ts +0 -11
  145. package/dist/eval/report.js +0 -181
  146. package/dist/eval/rubric-loader.d.ts +0 -20
  147. package/dist/eval/rubric-loader.js +0 -143
  148. package/dist/eval/runner.d.ts +0 -81
  149. package/dist/eval/runner.js +0 -746
  150. package/dist/eval/runs.d.ts +0 -41
  151. package/dist/eval/runs.js +0 -114
  152. package/dist/eval/sandbox.d.ts +0 -38
  153. package/dist/eval/sandbox.js +0 -137
  154. package/dist/eval/tools/glob.d.ts +0 -2
  155. package/dist/eval/tools/glob.js +0 -163
  156. package/dist/eval/tools/grep.d.ts +0 -2
  157. package/dist/eval/tools/grep.js +0 -152
  158. package/dist/eval/tools/index.d.ts +0 -7
  159. package/dist/eval/tools/index.js +0 -35
  160. package/dist/eval/tools/read.d.ts +0 -2
  161. package/dist/eval/tools/read.js +0 -122
  162. package/dist/eval/tools/types.d.ts +0 -49
  163. package/dist/eval/tools/types.js +0 -41
  164. package/dist/eval/tools/write.d.ts +0 -2
  165. package/dist/eval/tools/write.js +0 -92
  166. package/dist/eval/types.d.ts +0 -561
  167. package/dist/eval/types.js +0 -47
  168. package/dist/eval/verifiers/judge.d.ts +0 -40
  169. package/dist/eval/verifiers/judge.js +0 -256
  170. package/dist/eval/verifiers/rules.d.ts +0 -24
  171. package/dist/eval/verifiers/rules.js +0 -218
  172. package/dist/eval/verifiers/structural.d.ts +0 -14
  173. package/dist/eval/verifiers/structural.js +0 -171
  174. package/dist/eval/verifiers/traceability.d.ts +0 -23
  175. package/dist/eval/verifiers/traceability.js +0 -84
  176. package/dist/eval/verifiers/workflow-consistency.d.ts +0 -21
  177. package/dist/eval/verifiers/workflow-consistency.js +0 -225
  178. package/dist/eval/workflow-corpus.d.ts +0 -7
  179. package/dist/eval/workflow-corpus.js +0 -207
  180. package/dist/feature-system.d.ts +0 -42
  181. package/dist/feature-system.js +0 -432
  182. package/dist/internal/knowledge-digest.d.ts +0 -7
  183. package/dist/internal/knowledge-digest.js +0 -93
@@ -0,0 +1,44 @@
1
+ function artifactFileName(path) {
2
+ return path.split("/").pop() ?? path;
3
+ }
4
+ export function trackRenderContext(track) {
5
+ if (track === "quick") {
6
+ return {
7
+ track,
8
+ usesPlanTerminology: false,
9
+ traceabilitySourceNoun: "acceptance criterion",
10
+ traceabilityIdNoun: "acceptance criterion ID",
11
+ traceabilitySliceNoun: "acceptance slice",
12
+ upstreamArtifactLabel: "spec artifact",
13
+ upstreamArtifactPath: ".cclaw/artifacts/04-spec.md"
14
+ };
15
+ }
16
+ return {
17
+ track,
18
+ usesPlanTerminology: true,
19
+ traceabilitySourceNoun: "plan task",
20
+ traceabilityIdNoun: "plan task ID",
21
+ traceabilitySliceNoun: "plan slice",
22
+ upstreamArtifactLabel: "plan artifact",
23
+ upstreamArtifactPath: ".cclaw/artifacts/05-plan.md"
24
+ };
25
+ }
26
+ /**
27
+ * Render track-aware terminology for text that defaults to standard-track plan
28
+ * wording. Keep this centralized so quick-track rewrites do not drift across
29
+ * stage content generators.
30
+ */
31
+ export function renderTrackTerminology(value, context) {
32
+ if (context.usesPlanTerminology) {
33
+ return value;
34
+ }
35
+ return value
36
+ .replace(/\btask from the plan\b/giu, `${context.traceabilitySourceNoun} from the spec`)
37
+ .replace(/\bplan task ID\b/giu, context.traceabilityIdNoun)
38
+ .replace(/\bplan task\b/giu, context.traceabilitySourceNoun)
39
+ .replace(/\bplan row\b/giu, "acceptance row")
40
+ .replace(/\btraceable to plan slice\b/giu, `traceable to ${context.traceabilitySliceNoun}`)
41
+ .replace(/\bplan slice\b/giu, context.traceabilitySliceNoun)
42
+ .replace(/\bplan artifact\b/giu, context.upstreamArtifactLabel)
43
+ .replace(/05-plan\.md/gu, artifactFileName(context.upstreamArtifactPath));
44
+ }
@@ -1,2 +1 @@
1
- export declare function treeCommandContract(): string;
2
- export declare function treeCommandSkillMarkdown(): string;
1
+ export declare function treeSubcommandMarkdown(): string;
@@ -1,6 +1,4 @@
1
1
  import { RUNTIME_ROOT } from "../constants.js";
2
- const TREE_SKILL_FOLDER = "flow-tree";
3
- const TREE_SKILL_NAME = "flow-tree";
4
2
  function flowStatePath() {
5
3
  return `${RUNTIME_ROOT}/state/flow-state.json`;
6
4
  }
@@ -13,90 +11,9 @@ function artifactsPath() {
13
11
  function rewindLogPath() {
14
12
  return `${RUNTIME_ROOT}/state/rewind-log.jsonl`;
15
13
  }
16
- function harnessPlaybooksDir() {
17
- return `${RUNTIME_ROOT}/references/harnesses`;
18
- }
19
- export function treeCommandContract() {
14
+ export function treeSubcommandMarkdown() {
20
15
  return `# /cc-view tree
21
16
 
22
- ## Purpose
23
-
24
- Render a visual flow tree for quick orientation across stages, gates, delegations
25
- (with fulfillmentMode), ship closeout substate, stale markers, artifact presence,
26
- and per-harness playbook availability.
27
-
28
- ## HARD-GATE
29
-
30
- - \`/cc-view tree\` is read-only. Do not mutate flow-state or artifacts.
31
- - Use values from \`${flowStatePath()}\` and \`${delegationLogPath()}\`; never infer missing evidence.
32
-
33
- ## Algorithm
34
-
35
- 1. Read \`${flowStatePath()}\`.
36
- 2. Read \`${delegationLogPath()}\` (if missing, treat current-stage delegations as pending).
37
- 3. Detect artifact files in \`${artifactsPath()}\` (\`01-brainstorm.md\` …
38
- \`08-ship.md\` plus \`09-retro.md\`).
39
- 4. Read rewind records from \`${rewindLogPath()}\` when present for stale-stage context.
40
- 5. Inspect \`${harnessPlaybooksDir()}\` to confirm per-harness playbooks exist
41
- for the installed harness set.
42
- 6. Render the tree using stage order from active track:
43
- - stage node marker: passed/current/pending/skipped/stale
44
- - gate summary: \`passed/required\`
45
- - delegation summary for current stage (each agent carries its
46
- \`fulfillmentMode\` label)
47
- - artifact marker per stage (exists / stale copy / missing)
48
- 7. When \`currentStage === "ship"\` or \`closeout.shipSubstate !== "idle"\`,
49
- append a closeout sub-tree under ship with substate and retro/compound flags.
50
- 8. Append a final \`harnesses\` branch summarising tier + fallback +
51
- playbook-present for each installed harness.
52
-
53
- ## Tree Format
54
-
55
- \`\`\`
56
- cclaw flow tree (track=<track>, run=<runId>)
57
- ├─ [✓] brainstorm gates 6/6 artifact 01-brainstorm.md
58
- ├─ [✓] scope gates 5/5 artifact 02-scope.md
59
- ├─ [▶] design gates 2/7 artifact 03-design.md
60
- │ ├─ delegations:
61
- │ │ ├─ planner ✓ completed mode=isolated
62
- │ │ └─ reviewer ○ pending
63
- │ └─ stale: none
64
- ├─ [○] spec gates - artifact missing
65
- └─ [○] plan gates - artifact missing
66
-
67
- closeout (shipSubstate=retro_review):
68
- ├─ retro: drafted 09-retro.md · awaiting accept/edit/skip
69
- ├─ compound: —
70
- └─ archive: pending
71
-
72
- harnesses:
73
- ├─ claude tier=tier1 fallback=native playbook ✓
74
- ├─ cursor tier=tier2 fallback=generic-dispatch playbook ✓
75
- ├─ opencode tier=tier2 fallback=role-switch playbook ✓
76
- └─ codex tier=tier2 fallback=role-switch playbook ✓
77
- \`\`\`
78
-
79
- - Closeout sub-tree is **omitted** when \`currentStage !== "ship"\` and
80
- \`shipSubstate === "idle"\`.
81
- - Delegations sub-branch is omitted when the stage has no mandatory agents.
82
- - Playbook marker is \`✗ missing\` when the file under
83
- \`${harnessPlaybooksDir()}/<harness>-playbook.md\` is absent.
84
-
85
- Use UTF markers by default, ASCII fallback when terminal cannot render UTF.
86
-
87
- ## Primary skill
88
-
89
- **${RUNTIME_ROOT}/skills/${TREE_SKILL_FOLDER}/SKILL.md**
90
- `;
91
- }
92
- export function treeCommandSkillMarkdown() {
93
- return `---
94
- name: ${TREE_SKILL_NAME}
95
- description: "Render a visual flow tree for stages, gates, delegations (fulfillmentMode), ship closeout substate, artifacts, and per-harness playbooks."
96
- ---
97
-
98
- # /cc-view tree
99
-
100
17
  ## HARD-GATE
101
18
 
102
19
  Do not modify state in this command. It is a pure read/render operation.
@@ -108,7 +25,7 @@ Do not modify state in this command. It is a pure read/render operation.
108
25
  \`fulfillmentMode\` / \`evidenceRefs\`.
109
26
  3. Inspect \`${artifactsPath()}\` for per-stage artifact presence and stale copies,
110
27
  and for the retro artifact \`09-retro.md\`.
111
- 4. Inspect \`${harnessPlaybooksDir()}\` for \`<harness>-playbook.md\` files.
28
+ 4. Use \`npx cclaw-cli doctor --explain\` for harness capability status when needed.
112
29
  5. Render one compact tree:
113
30
  - stage marker: passed/current/pending/skipped/stale,
114
31
  - gates summary,
@@ -124,8 +41,8 @@ Do not modify state in this command. It is a pure read/render operation.
124
41
  then \`next\`; the transient \`archived\` substate surfaces only if the
125
42
  archive step failed mid-run.
126
43
  7. Append a \`harnesses:\` branch. For each installed harness derive the tier
127
- from the harness-gaps report and mark \`playbook ✓/✗ missing\` based on
128
- \`${harnessPlaybooksDir()}/<harness>-playbook.md\` existence.
44
+ and fallback from cclaw capability metadata; use \`npx cclaw-cli doctor --explain\`
45
+ for remediation details when needed.
129
46
  8. If rewind records exist in \`${rewindLogPath()}\`, include latest rewind note in footer.
130
47
 
131
48
  ## Validation
@@ -1,26 +1,7 @@
1
1
  /**
2
- * Utility skills that complement the 8 flow stages.
3
- * These are contextual lenses, not flow stages.
4
- * Each skill: ~120-180 lines, under the 500-line progressive disclosure guideline.
2
+ * Opt-in language rule packs for stage hooks and the meta-skill router.
3
+ * These are generated under `.cclaw/rules/lang`, not as default skills.
5
4
  */
6
- export declare function securityReviewSkill(): string;
7
- export declare function debuggingSkill(): string;
8
- export declare function performanceSkill(): string;
9
- export declare function ciCdSkill(): string;
10
- export declare function docsSkill(): string;
11
- export declare function executingPlansSkill(): string;
12
- export declare function contextEngineeringSkill(): string;
13
- export declare function verificationBeforeCompletionSkill(): string;
14
- export declare function finishingDevelopmentBranchSkill(): string;
15
- export declare function sourceDrivenDevelopmentSkill(): string;
16
- export declare function frontendAccessibilitySkill(): string;
17
- export declare function landscapeCheckSkill(): string;
18
- export declare function knowledgeCurationSkill(): string;
19
- export declare function securityAuditSkill(): string;
20
- export declare function adversarialReviewSkill(): string;
21
- export declare function documentReviewSkill(): string;
22
- export declare function receivingCodeReviewSkill(): string;
23
- export declare function retrospectiveSkill(): string;
24
5
  export declare function languageTypescriptSkill(): string;
25
6
  export declare function languagePythonSkill(): string;
26
7
  export declare function languageGoSkill(): string;
@@ -47,11 +28,3 @@ export declare const LANGUAGE_RULE_PACK_GENERATORS: Record<string, () => string>
47
28
  * clean them up after the move to `.cclaw/rules/lang/`.
48
29
  */
49
30
  export declare const LEGACY_LANGUAGE_RULE_PACK_FOLDERS: readonly ["language-typescript", "language-python", "language-go"];
50
- export declare const UTILITY_SKILL_FOLDERS: readonly ["security", "debugging", "performance", "ci-cd", "docs", "executing-plans", "verification-before-completion", "finishing-a-development-branch", "context-engineering", "source-driven-development", "frontend-accessibility", "landscape-check", "adversarial-review", "security-audit", "knowledge-curation", "retrospective", "document-review", "receiving-code-review"];
51
- export type UtilitySkillFolder = (typeof UTILITY_SKILL_FOLDERS)[number];
52
- /**
53
- * One entry per `UTILITY_SKILL_FOLDERS` slot. Typed via the tuple so that
54
- * adding a folder without a generator (or vice versa) is a TypeScript
55
- * error — keeps the two sources of truth in lockstep at compile time.
56
- */
57
- export declare const UTILITY_SKILL_MAP: Record<UtilitySkillFolder, () => string>;