cclaw-cli 0.51.23 → 0.51.25

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 (42) hide show
  1. package/README.md +135 -414
  2. package/dist/artifact-linter.js +10 -6
  3. package/dist/config.d.ts +1 -1
  4. package/dist/config.js +28 -3
  5. package/dist/content/core-agents.d.ts +128 -2
  6. package/dist/content/core-agents.js +291 -13
  7. package/dist/content/examples.js +21 -10
  8. package/dist/content/next-command.js +10 -6
  9. package/dist/content/reference-patterns.d.ts +18 -0
  10. package/dist/content/reference-patterns.js +391 -0
  11. package/dist/content/seed-shelf.js +73 -8
  12. package/dist/content/skills.js +39 -34
  13. package/dist/content/stage-common-guidance.js +19 -3
  14. package/dist/content/stage-schema.d.ts +12 -0
  15. package/dist/content/stage-schema.js +224 -24
  16. package/dist/content/stages/_lint-metadata/index.js +3 -2
  17. package/dist/content/stages/brainstorm.js +27 -18
  18. package/dist/content/stages/design.js +27 -18
  19. package/dist/content/stages/review.js +20 -9
  20. package/dist/content/stages/schema-types.d.ts +9 -2
  21. package/dist/content/stages/scope.js +21 -10
  22. package/dist/content/stages/ship.js +3 -2
  23. package/dist/content/stages/tdd.js +18 -13
  24. package/dist/content/start-command.js +3 -2
  25. package/dist/content/status-command.js +9 -4
  26. package/dist/content/subagents.js +336 -38
  27. package/dist/content/templates.js +182 -25
  28. package/dist/delegation.d.ts +2 -0
  29. package/dist/delegation.js +27 -6
  30. package/dist/doctor.js +167 -25
  31. package/dist/flow-state.d.ts +1 -0
  32. package/dist/flow-state.js +1 -0
  33. package/dist/gate-evidence.js +25 -2
  34. package/dist/install.js +72 -8
  35. package/dist/internal/advance-stage.js +179 -26
  36. package/dist/knowledge-store.js +30 -6
  37. package/dist/run-archive.js +11 -0
  38. package/dist/run-persistence.js +35 -10
  39. package/dist/tdd-verification-evidence.d.ts +17 -0
  40. package/dist/tdd-verification-evidence.js +43 -0
  41. package/dist/types.d.ts +10 -0
  42. package/package.json +1 -1
package/dist/config.d.ts CHANGED
@@ -49,7 +49,7 @@ export declare function readConfig(projectRoot: string, options?: ReadConfigOpti
49
49
  * the user set them explicitly. Keeps the default template small and honest:
50
50
  * only knobs a new user would meaningfully flip show up.
51
51
  */
52
- type AdvancedConfigKey = "tddTestGlobs" | "tdd" | "compound" | "defaultTrack" | "languageRulePacks" | "trackHeuristics" | "sliceReview" | "ironLaws" | "optInAudits" | "reviewLoop";
52
+ type AdvancedConfigKey = "vcs" | "tddTestGlobs" | "tdd" | "compound" | "defaultTrack" | "languageRulePacks" | "trackHeuristics" | "sliceReview" | "ironLaws" | "optInAudits" | "reviewLoop";
53
53
  /**
54
54
  * Options controlling the serialisation shape of `config.yaml`.
55
55
  *
package/dist/config.js CHANGED
@@ -16,6 +16,7 @@ const ALLOWED_CONFIG_KEYS = new Set([
16
16
  "version",
17
17
  "flowVersion",
18
18
  "harnesses",
19
+ "vcs",
19
20
  "strictness",
20
21
  "tddTestGlobs",
21
22
  "tdd",
@@ -51,6 +52,7 @@ const MINIMAL_CONFIG_KEYS = [
51
52
  "version",
52
53
  "flowVersion",
53
54
  "harnesses",
55
+ "vcs",
54
56
  "strictness",
55
57
  "gitHookGuards"
56
58
  ];
@@ -142,11 +144,13 @@ export function createDefaultConfig(harnesses = DEFAULT_HARNESSES, defaultTrack
142
144
  version: CCLAW_VERSION,
143
145
  flowVersion: FLOW_VERSION,
144
146
  harnesses,
147
+ vcs: "git-local-only",
145
148
  strictness: "advisory",
146
149
  tddTestGlobs: [...tddTestPathPatterns],
147
150
  tdd: {
148
151
  testPathPatterns: tddTestPathPatterns,
149
- productionPathPatterns: tddProductionPathPatterns
152
+ productionPathPatterns: tddProductionPathPatterns,
153
+ verificationRef: "auto"
150
154
  },
151
155
  compound: {
152
156
  recurrenceThreshold: DEFAULT_COMPOUND_RECURRENCE_THRESHOLD
@@ -244,6 +248,16 @@ export async function readConfig(projectRoot, options = {}) {
244
248
  const harnesses = hasHarnessesField
245
249
  ? [...new Set(validatedHarnesses)]
246
250
  : DEFAULT_HARNESSES;
251
+ const vcsRaw = parsed.vcs;
252
+ if (Object.prototype.hasOwnProperty.call(parsed, "vcs") &&
253
+ vcsRaw !== "git-with-remote" &&
254
+ vcsRaw !== "git-local-only" &&
255
+ vcsRaw !== "none") {
256
+ throw configValidationError(fullPath, `"vcs" must be one of: git-with-remote, git-local-only, none`);
257
+ }
258
+ const vcs = vcsRaw === "git-with-remote" || vcsRaw === "git-local-only" || vcsRaw === "none"
259
+ ? vcsRaw
260
+ : "git-local-only";
247
261
  const strictnessRaw = parsed.strictness;
248
262
  if (Object.prototype.hasOwnProperty.call(parsed, "strictness") &&
249
263
  strictnessRaw !== "advisory" &&
@@ -258,16 +272,24 @@ export async function readConfig(projectRoot, options = {}) {
258
272
  const tddRaw = parsed.tdd;
259
273
  let explicitTddTestPathPatterns;
260
274
  let explicitTddProductionPathPatterns;
275
+ let explicitTddVerificationRef;
261
276
  if (hasTddField) {
262
277
  if (!isRecord(tddRaw)) {
263
278
  throw configValidationError(fullPath, `"tdd" must be an object`);
264
279
  }
265
- const unknownTddKeys = Object.keys(tddRaw).filter((key) => key !== "testPathPatterns" && key !== "productionPathPatterns");
280
+ const unknownTddKeys = Object.keys(tddRaw).filter((key) => key !== "testPathPatterns" && key !== "productionPathPatterns" && key !== "verificationRef");
266
281
  if (unknownTddKeys.length > 0) {
267
282
  throw configValidationError(fullPath, `"tdd" has unknown key(s): ${unknownTddKeys.join(", ")}`);
268
283
  }
269
284
  explicitTddTestPathPatterns = validateStringArray(tddRaw.testPathPatterns, "tdd.testPathPatterns", fullPath);
270
285
  explicitTddProductionPathPatterns = validateStringArray(tddRaw.productionPathPatterns, "tdd.productionPathPatterns", fullPath);
286
+ if (tddRaw.verificationRef !== undefined &&
287
+ tddRaw.verificationRef !== "auto" &&
288
+ tddRaw.verificationRef !== "required" &&
289
+ tddRaw.verificationRef !== "disabled") {
290
+ throw configValidationError(fullPath, '"tdd.verificationRef" must be one of: auto, required, disabled');
291
+ }
292
+ explicitTddVerificationRef = tddRaw.verificationRef;
271
293
  }
272
294
  if (tddTestGlobsRaw !== undefined &&
273
295
  explicitTddTestPathPatterns !== undefined &&
@@ -508,11 +530,13 @@ export async function readConfig(projectRoot, options = {}) {
508
530
  version: parsed.version ?? CCLAW_VERSION,
509
531
  flowVersion: parsed.flowVersion ?? FLOW_VERSION,
510
532
  harnesses,
533
+ vcs,
511
534
  strictness,
512
535
  tddTestGlobs,
513
536
  tdd: {
514
537
  testPathPatterns: resolvedTddTestPathPatterns,
515
- productionPathPatterns: resolvedTddProductionPathPatterns
538
+ productionPathPatterns: resolvedTddProductionPathPatterns,
539
+ verificationRef: explicitTddVerificationRef ?? "auto"
516
540
  },
517
541
  compound: {
518
542
  recurrenceThreshold: compoundRecurrenceThreshold
@@ -538,6 +562,7 @@ function buildSerializableConfig(config, options = {}) {
538
562
  "version",
539
563
  "flowVersion",
540
564
  "harnesses",
565
+ "vcs",
541
566
  "strictness",
542
567
  "tddTestGlobs",
543
568
  "tdd",
@@ -6,6 +6,16 @@
6
6
  * need isolated subagent context lives in `.cclaw/skills/research/*.md`
7
7
  * playbooks and is executed in-thread by the primary agent.
8
8
  */
9
+ export interface AgentReturnSchema {
10
+ /** Field carrying the terminal verdict/status token. */
11
+ statusField: string;
12
+ /** Exact allowed terminal values for this agent's first structured return. */
13
+ allowedStatuses: string[];
14
+ /** Fields the controller should expect in every completed response. */
15
+ requiredFields: string[];
16
+ /** Fields that must cite artifact anchors, commands, or code locations when applicable. */
17
+ evidenceFields: string[];
18
+ }
9
19
  export interface AgentDefinition {
10
20
  /** Kebab-case identifier, e.g. `"reviewer"`. */
11
21
  name: string;
@@ -19,11 +29,13 @@ export interface AgentDefinition {
19
29
  activation: "proactive" | "on-demand" | "mandatory";
20
30
  /** cclaw flow stages this agent is designed to support. */
21
31
  relatedStages: string[];
32
+ /** Strict terminal return contract rendered into materialized agent files. */
33
+ returnSchema: AgentReturnSchema;
22
34
  /** Markdown body rendered below the YAML frontmatter. */
23
35
  body: string;
24
36
  }
25
37
  /**
26
- * Canonical specialist roster (core-5) materialized under `.cclaw/agents/`.
38
+ * Canonical specialist roster materialized under `.cclaw/agents/`.
27
39
  *
28
40
  * Declared with `satisfies` so the array retains literal `name` types for
29
41
  * downstream type-level consumers (e.g. `AgentName`), while still being
@@ -32,12 +44,58 @@ export interface AgentDefinition {
32
44
  * to `string` and break the compile-time drift guard.
33
45
  */
34
46
  export declare const CCLAW_AGENTS: readonly [{
47
+ readonly name: "researcher";
48
+ readonly description: "PROACTIVE when context readiness, repo search, reference patterns, or external docs could change a stage decision. MUST summarize search-before-read evidence before large reads.";
49
+ readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
50
+ readonly model: "fast";
51
+ readonly activation: "proactive";
52
+ readonly relatedStages: ["brainstorm", "scope", "design", "plan"];
53
+ readonly returnSchema: AgentReturnSchema;
54
+ readonly body: string;
55
+ }, {
35
56
  readonly name: "planner";
36
57
  readonly description: "MANDATORY for scope/design/plan and PROACTIVE for high-ambiguity work. MUST BE USED when sequencing, dependency mapping, or risk trade-offs are required before coding.";
37
58
  readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
38
59
  readonly model: "deep";
39
60
  readonly activation: "mandatory";
40
61
  readonly relatedStages: ["brainstorm", "scope", "design", "spec", "plan"];
62
+ readonly returnSchema: AgentReturnSchema;
63
+ readonly body: string;
64
+ }, {
65
+ readonly name: "product-manager";
66
+ readonly description: "PROACTIVE during brainstorm/scope when product value, persona/JTBD, success metric, or why-now framing is unclear. Use for product discovery, not implementation.";
67
+ readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
68
+ readonly model: "balanced";
69
+ readonly activation: "proactive";
70
+ readonly relatedStages: ["brainstorm", "scope"];
71
+ readonly returnSchema: AgentReturnSchema;
72
+ readonly body: string;
73
+ }, {
74
+ readonly name: "critic";
75
+ readonly description: "PROACTIVE during brainstorm/scope/design when premises, alternatives, cost, rollback, or hidden assumptions need adversarial pressure.";
76
+ readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
77
+ readonly model: "balanced";
78
+ readonly activation: "proactive";
79
+ readonly relatedStages: ["brainstorm", "scope", "design"];
80
+ readonly returnSchema: AgentReturnSchema;
81
+ readonly body: string;
82
+ }, {
83
+ readonly name: "architect";
84
+ readonly description: "MANDATORY during design. MUST BE USED to validate architecture boundaries, alternatives, failure modes, rollout, and spec handoff before implementation.";
85
+ readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
86
+ readonly model: "deep";
87
+ readonly activation: "mandatory";
88
+ readonly relatedStages: ["design"];
89
+ readonly returnSchema: AgentReturnSchema;
90
+ readonly body: string;
91
+ }, {
92
+ readonly name: "spec-validator";
93
+ readonly description: "MANDATORY during standard/deep spec. MUST BE USED to validate measurable acceptance criteria, assumptions, edge cases, and testability mapping.";
94
+ readonly tools: ["Read", "Grep", "Glob"];
95
+ readonly model: "balanced";
96
+ readonly activation: "mandatory";
97
+ readonly relatedStages: ["spec"];
98
+ readonly returnSchema: AgentReturnSchema;
41
99
  readonly body: string;
42
100
  }, {
43
101
  readonly name: "reviewer";
@@ -46,6 +104,34 @@ export declare const CCLAW_AGENTS: readonly [{
46
104
  readonly model: "balanced";
47
105
  readonly activation: "mandatory";
48
106
  readonly relatedStages: ["spec", "review", "ship"];
107
+ readonly returnSchema: AgentReturnSchema;
108
+ readonly body: string;
109
+ }, {
110
+ readonly name: "performance-reviewer";
111
+ readonly description: "PROACTIVE during review for hot paths, IO, data volume, caching, rendering, or algorithmic cost changes. Produces no-impact rationale when clean.";
112
+ readonly tools: ["Read", "Grep", "Glob"];
113
+ readonly model: "balanced";
114
+ readonly activation: "proactive";
115
+ readonly relatedStages: ["review"];
116
+ readonly returnSchema: AgentReturnSchema;
117
+ readonly body: string;
118
+ }, {
119
+ readonly name: "compatibility-reviewer";
120
+ readonly description: "PROACTIVE during design/review when public APIs, config, persisted data, CLI behavior, generated clients, or dependency versions may change.";
121
+ readonly tools: ["Read", "Grep", "Glob"];
122
+ readonly model: "balanced";
123
+ readonly activation: "proactive";
124
+ readonly relatedStages: ["design", "review"];
125
+ readonly returnSchema: AgentReturnSchema;
126
+ readonly body: string;
127
+ }, {
128
+ readonly name: "observability-reviewer";
129
+ readonly description: "PROACTIVE during design/review when diagnosis, telemetry, rollout visibility, or supportability could affect safe operation.";
130
+ readonly tools: ["Read", "Grep", "Glob"];
131
+ readonly model: "balanced";
132
+ readonly activation: "proactive";
133
+ readonly relatedStages: ["design", "review"];
134
+ readonly returnSchema: AgentReturnSchema;
49
135
  readonly body: string;
50
136
  }, {
51
137
  readonly name: "security-reviewer";
@@ -54,6 +140,7 @@ export declare const CCLAW_AGENTS: readonly [{
54
140
  readonly model: "balanced";
55
141
  readonly activation: "mandatory";
56
142
  readonly relatedStages: ["design", "review", "ship"];
143
+ readonly returnSchema: AgentReturnSchema;
57
144
  readonly body: string;
58
145
  }, {
59
146
  readonly name: "test-author";
@@ -62,6 +149,16 @@ export declare const CCLAW_AGENTS: readonly [{
62
149
  readonly model: "balanced";
63
150
  readonly activation: "mandatory";
64
151
  readonly relatedStages: ["tdd"];
152
+ readonly returnSchema: AgentReturnSchema;
153
+ readonly body: string;
154
+ }, {
155
+ readonly name: "release-reviewer";
156
+ readonly description: "MANDATORY during ship. MUST BE USED for release readiness, rollback, finalization mode, evidence freshness, and victory detector checks.";
157
+ readonly tools: ["Read", "Grep", "Glob", "Bash"];
158
+ readonly model: "balanced";
159
+ readonly activation: "mandatory";
160
+ readonly relatedStages: ["ship"];
161
+ readonly returnSchema: AgentReturnSchema;
65
162
  readonly body: string;
66
163
  }, {
67
164
  readonly name: "doc-updater";
@@ -70,6 +167,34 @@ export declare const CCLAW_AGENTS: readonly [{
70
167
  readonly model: "fast";
71
168
  readonly activation: "mandatory";
72
169
  readonly relatedStages: ["tdd", "ship"];
170
+ readonly returnSchema: AgentReturnSchema;
171
+ readonly body: string;
172
+ }, {
173
+ readonly name: "slice-implementer";
174
+ readonly description: "ON-DEMAND or PROACTIVE during TDD GREEN/REFACTOR for one bounded vertical slice after RED evidence exists and file ownership is non-overlapping.";
175
+ readonly tools: ["Read", "Write", "Edit", "Grep", "Glob", "Bash"];
176
+ readonly model: "balanced";
177
+ readonly activation: "on-demand";
178
+ readonly relatedStages: ["tdd"];
179
+ readonly returnSchema: AgentReturnSchema;
180
+ readonly body: string;
181
+ }, {
182
+ readonly name: "implementer";
183
+ readonly description: "ON-DEMAND worker for one scoped implementation slice. Use only with self-contained task text, explicit file boundaries, and verification expectations.";
184
+ readonly tools: ["Read", "Write", "Edit", "Grep", "Glob", "Bash"];
185
+ readonly model: "balanced";
186
+ readonly activation: "on-demand";
187
+ readonly relatedStages: ["tdd"];
188
+ readonly returnSchema: AgentReturnSchema;
189
+ readonly body: string;
190
+ }, {
191
+ readonly name: "fixer";
192
+ readonly description: "ON-DEMAND fresh worker after review FAIL/PARTIAL evidence. Must fix only the cited criterion within explicit allowed files.";
193
+ readonly tools: ["Read", "Write", "Edit", "Grep", "Glob", "Bash"];
194
+ readonly model: "balanced";
195
+ readonly activation: "on-demand";
196
+ readonly relatedStages: ["review", "tdd"];
197
+ readonly returnSchema: AgentReturnSchema;
73
198
  readonly body: string;
74
199
  }];
75
200
  /**
@@ -87,9 +212,10 @@ export declare function agentMarkdown(agent: AgentDefinition): string;
87
212
  */
88
213
  export declare function agentRoutingTable(): string;
89
214
  /**
90
- * Cost tier routing for the core-5 agent roster.
215
+ * Cost tier routing for the specialist agent roster.
91
216
  */
92
217
  export declare function agentCostTierTable(): string;
218
+ export declare function agentRegistryMatrix(): string;
93
219
  /**
94
220
  * AGENTS.md-ready section describing cclaw’s specialist delegation model.
95
221
  */