cclaw-cli 0.55.2 → 1.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.
Files changed (72) hide show
  1. package/README.md +3 -3
  2. package/dist/artifact-linter/brainstorm.js +45 -1
  3. package/dist/artifact-linter/design.js +32 -1
  4. package/dist/artifact-linter/plan.js +22 -1
  5. package/dist/artifact-linter/review.js +35 -1
  6. package/dist/artifact-linter/scope.js +19 -9
  7. package/dist/artifact-linter/shared.d.ts +11 -10
  8. package/dist/artifact-linter/shared.js +70 -41
  9. package/dist/artifact-linter/ship.js +36 -0
  10. package/dist/artifact-linter/spec.js +23 -1
  11. package/dist/artifact-linter/tdd.js +74 -0
  12. package/dist/artifact-linter.d.ts +1 -1
  13. package/dist/constants.d.ts +1 -1
  14. package/dist/constants.js +1 -0
  15. package/dist/content/closeout-guidance.d.ts +1 -1
  16. package/dist/content/closeout-guidance.js +10 -11
  17. package/dist/content/core-agents.d.ts +35 -36
  18. package/dist/content/core-agents.js +189 -99
  19. package/dist/content/diff-command.js +1 -1
  20. package/dist/content/examples.d.ts +0 -3
  21. package/dist/content/examples.js +197 -752
  22. package/dist/content/idea.d.ts +60 -0
  23. package/dist/content/idea.js +404 -0
  24. package/dist/content/learnings.d.ts +2 -4
  25. package/dist/content/learnings.js +10 -26
  26. package/dist/content/node-hooks.js +131 -97
  27. package/dist/content/opencode-plugin.js +12 -26
  28. package/dist/content/reference-patterns.js +2 -2
  29. package/dist/content/runtime-shared-snippets.d.ts +8 -0
  30. package/dist/content/runtime-shared-snippets.js +80 -0
  31. package/dist/content/session-hooks.js +1 -1
  32. package/dist/content/skills.d.ts +1 -0
  33. package/dist/content/skills.js +50 -0
  34. package/dist/content/stage-schema.js +107 -63
  35. package/dist/content/stages/review.js +8 -8
  36. package/dist/content/stages/schema-types.d.ts +2 -2
  37. package/dist/content/stages/scope.js +1 -1
  38. package/dist/content/stages/ship.js +1 -1
  39. package/dist/content/status-command.js +3 -3
  40. package/dist/content/subagent-context-skills.js +156 -1
  41. package/dist/content/subagents.d.ts +0 -5
  42. package/dist/content/subagents.js +12 -82
  43. package/dist/content/templates.js +87 -6
  44. package/dist/content/utility-skills.js +26 -97
  45. package/dist/flow-state.d.ts +5 -6
  46. package/dist/flow-state.js +4 -6
  47. package/dist/gate-evidence.d.ts +0 -31
  48. package/dist/gate-evidence.js +3 -181
  49. package/dist/harness-adapters.js +1 -1
  50. package/dist/install.js +38 -4
  51. package/dist/internal/advance-stage/advance.js +0 -1
  52. package/dist/internal/advance-stage/review-loop.js +1 -10
  53. package/dist/knowledge-store.d.ts +2 -20
  54. package/dist/knowledge-store.js +43 -57
  55. package/dist/policy.js +3 -3
  56. package/dist/retro-gate.js +8 -90
  57. package/dist/run-archive.js +1 -4
  58. package/dist/run-persistence.js +14 -109
  59. package/dist/runtime/run-hook.entry.d.ts +3 -0
  60. package/dist/runtime/run-hook.entry.js +5 -0
  61. package/dist/runtime/run-hook.mjs +9477 -0
  62. package/package.json +4 -2
  63. package/dist/content/hook-inline-snippets.d.ts +0 -96
  64. package/dist/content/hook-inline-snippets.js +0 -515
  65. package/dist/content/idea-command.d.ts +0 -8
  66. package/dist/content/idea-command.js +0 -322
  67. package/dist/content/idea-frames.d.ts +0 -31
  68. package/dist/content/idea-frames.js +0 -140
  69. package/dist/content/idea-ranking.d.ts +0 -25
  70. package/dist/content/idea-ranking.js +0 -65
  71. package/dist/trace-matrix.d.ts +0 -27
  72. package/dist/trace-matrix.js +0 -226
@@ -1,5 +1,5 @@
1
1
  import type { FlowStage, FlowTrack } from "./types.js";
2
2
  import { type LintResult } from "./artifact-linter/shared.js";
3
3
  export { validateReviewArmy, checkReviewVerdictConsistency, checkReviewSecurityNoChangeAttestation, type ReviewVerdictConsistencyResult, type ReviewSecurityNoChangeAttestationResult } from "./artifact-linter/review-army.js";
4
- export { type LintFinding, type LintResult, type LearningEntryType, type LearningConfidence, type LearningSeverity, type LearningUniversality, type LearningMaturity, type LearningSource, type LearningSeedEntry, type LearningsParseResult, extractMarkdownSectionBody, parseLearningsSection } from "./artifact-linter/shared.js";
4
+ export { type LintFinding, type LintResult, type LearningEntryType, type LearningConfidence, type LearningSeverity, type LearningSource, type LearningSeedEntry, type LearningsParseResult, extractMarkdownSectionBody, parseLearningsSection } from "./artifact-linter/shared.js";
5
5
  export declare function lintArtifact(projectRoot: string, stage: FlowStage, track?: FlowTrack): Promise<LintResult>;
@@ -10,7 +10,7 @@ export declare const FLOW_VERSION = "1.0.0";
10
10
  export declare const SHIP_FINALIZATION_MODES: readonly ["FINALIZE_MERGE_LOCAL", "FINALIZE_OPEN_PR", "FINALIZE_KEEP_BRANCH", "FINALIZE_DISCARD_BRANCH", "FINALIZE_NO_VCS"];
11
11
  export type ShipFinalizationMode = (typeof SHIP_FINALIZATION_MODES)[number];
12
12
  export declare const DEFAULT_HARNESSES: HarnessId[];
13
- export declare const REQUIRED_DIRS: readonly [".cclaw", ".cclaw/commands", ".cclaw/skills", ".cclaw/templates", ".cclaw/templates/state-contracts", ".cclaw/artifacts", ".cclaw/archive", ".cclaw/state", ".cclaw/rules", ".cclaw/agents", ".cclaw/hooks", ".cclaw/skills/review-prompts"];
13
+ export declare const REQUIRED_DIRS: readonly [".cclaw", ".cclaw/commands", ".cclaw/skills", ".cclaw/templates", ".cclaw/templates/state-contracts", ".cclaw/artifacts", ".cclaw/wave-plans", ".cclaw/archive", ".cclaw/state", ".cclaw/rules", ".cclaw/agents", ".cclaw/hooks", ".cclaw/skills/review-prompts"];
14
14
  export declare const REQUIRED_GITIGNORE_PATTERNS: readonly ["# cclaw generated artifacts", ".cclaw/", ".claude/commands/cc-*.md", ".claude/commands/cc.md", ".cursor/commands/cc-*.md", ".cursor/commands/cc.md", ".opencode/commands/cc-*.md", ".opencode/commands/cc.md", ".agents/skills/cc/SKILL.md", ".agents/skills/cc-*/SKILL.md", ".claude/hooks/hooks.json", ".cursor/hooks.json", ".codex/hooks.json", ".opencode/plugins/cclaw-plugin.mjs", ".cursor/rules/cclaw-workflow.mdc"];
15
15
  /**
16
16
  * Canonical stage -> skill folder mapping.
package/dist/constants.js CHANGED
@@ -59,6 +59,7 @@ export const REQUIRED_DIRS = [
59
59
  `${RUNTIME_ROOT}/templates`,
60
60
  `${RUNTIME_ROOT}/templates/state-contracts`,
61
61
  `${RUNTIME_ROOT}/artifacts`,
62
+ `${RUNTIME_ROOT}/wave-plans`,
62
63
  `${RUNTIME_ROOT}/archive`,
63
64
  `${RUNTIME_ROOT}/state`,
64
65
  `${RUNTIME_ROOT}/rules`,
@@ -4,7 +4,7 @@
4
4
  * Keep closeout chain and ship substate language in one place across command
5
5
  * contracts, skills, and stage/docs surfaces.
6
6
  */
7
- export declare const CLOSEOUT_CHAIN = "retro -> compound -> archive";
7
+ export declare const CLOSEOUT_CHAIN = "post_ship_review -> archive";
8
8
  export declare const CLOSEOUT_SUBSTATE_KEY = "closeout.shipSubstate";
9
9
  export declare function closeoutChainInline(): string;
10
10
  export declare function closeoutSubstateInline(): string;
@@ -4,7 +4,7 @@
4
4
  * Keep closeout chain and ship substate language in one place across command
5
5
  * contracts, skills, and stage/docs surfaces.
6
6
  */
7
- export const CLOSEOUT_CHAIN = "retro -> compound -> archive";
7
+ export const CLOSEOUT_CHAIN = "post_ship_review -> archive";
8
8
  export const CLOSEOUT_SUBSTATE_KEY = "closeout.shipSubstate";
9
9
  export function closeoutChainInline() {
10
10
  return `\`${CLOSEOUT_CHAIN}\``;
@@ -18,18 +18,17 @@ export function closeoutNextCommandGuidance() {
18
18
  export function closeoutSubstateProtocolBullets() {
19
19
  return `When \`currentStage === "ship"\`, route by **${closeoutSubstateInline()}**:
20
20
  - \`"idle"\` or missing -> outcome: initialize closeout by setting
21
- ${closeoutSubstateInline()} = \`"retro_review"\`, then continue \`/cc\`
21
+ ${closeoutSubstateInline()} = \`"post_ship_review"\`, then continue \`/cc\`
22
22
  into the in-stage retro protocol (draft + one structured accept/edit/skip ask).
23
- - \`"retro_review"\` -> outcome: finish retro acceptance/edit/skip and advance
24
- closeout; the draft already exists, so continue it and do not regenerate it.
25
- - \`"compound_review"\` -> outcome: execute the in-stage compound closeout scan
26
- (not \`ce:compound\`) and advance toward archive readiness:
23
+ - \`"post_ship_review"\` -> outcome: execute the unified post-ship closeout leg
24
+ (retro acceptance/edit/skip + in-stage compound scan, not \`ce:compound\`)
25
+ and advance toward archive readiness:
27
26
  read \`.cclaw/state/compound-readiness.json\` plus the relevant tail of
28
27
  \`.cclaw/knowledge.jsonl\`, assess overlap before adding duplicate knowledge,
29
28
  separate bug-track learnings (turn into rules/tests/remediation) from
30
- knowledge-track learnings (durable project/process guidance), and use
31
- lightweight \`supersedes\` / \`superseded_by\` fields when refreshing stale or
32
- partially replaced entries. Optionally ask whether to scan Cursor/Claude/Codex
29
+ knowledge-track learnings (durable project/process guidance), and refresh stale
30
+ guidance in place instead of introducing extra lineage metadata. Optionally ask
31
+ whether to scan Cursor/Claude/Codex
33
32
  session transcripts for matching historical learnings; only do it after opt-in.
34
33
  Ask **one** structured question (apply / skip) per candidate cluster or a
35
34
  single accept-all / skip choice, then advance substate.
@@ -38,8 +37,8 @@ export function closeoutSubstateProtocolBullets() {
38
37
  - \`"archived"\` (transient) -> outcome: report "run archived" and stop (flow complete).`;
39
38
  }
40
39
  export function closeoutFlowMapSentence() {
41
- return `The first stage names are the critical path. \`retro\`, \`compound\`, and \`archive\` are post-ship closeout substates under ${closeoutSubstateInline()}, not separate stage schemas or commands. Continue them with \`/cc\`; do not route compound closeout through \`ce:compound\`.`;
40
+ return `The first stage names are the critical path. \`post_ship_review\` and \`archive\` are post-ship closeout substates under ${closeoutSubstateInline()}, not separate stage schemas or commands. Continue them with \`/cc\`; do not route compound closeout through \`ce:compound\`.`;
42
41
  }
43
42
  export function closeoutProtocolBehaviorSentence() {
44
- return `Keep decision, completion, and preamble discipline inline: ask only decision-changing questions, verify gates before advancing, and keep context compact. After \`ship\`, keep using \`/cc\` through ${closeoutChainInline()}; do not route normal closeout through \`ce:compound\` or a separate operations command. In compound closeout, assess overlap before appending knowledge: refresh recurring bug-track learnings as actionable rules/tests, keep knowledge-track learnings as durable process/project guidance, and mark outdated entries with lightweight \`supersedes\` / \`superseded_by\` fields instead of building a new doc system.`;
43
+ return `Keep decision, completion, and preamble discipline inline: ask only decision-changing questions, verify gates before advancing, and keep context compact. After \`ship\`, keep using \`/cc\` through ${closeoutChainInline()}; do not route normal closeout through \`ce:compound\` or a separate operations command. Inside \`post_ship_review\`, assess overlap before appending knowledge: refresh recurring bug-track learnings as actionable rules/tests and keep knowledge-track learnings as durable process/project guidance without extra lineage metadata.`;
45
44
  }
@@ -15,6 +15,8 @@ export interface AgentReturnSchema {
15
15
  requiredFields: string[];
16
16
  /** Fields that must cite artifact anchors, commands, or code locations when applicable. */
17
17
  evidenceFields: string[];
18
+ /** Additional optional fields allowed for specific agent contracts. */
19
+ optionalFields?: string[];
18
20
  }
19
21
  export interface AgentDefinition {
20
22
  /** Kebab-case identifier, e.g. `"reviewer"`. */
@@ -62,21 +64,21 @@ export declare const CCLAW_AGENTS: readonly [{
62
64
  readonly returnSchema: AgentReturnSchema;
63
65
  readonly body: string;
64
66
  }, {
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 name: "product-discovery";
68
+ readonly description: "MANDATORY during brainstorm and PROACTIVE during scope when value framing or expansion strategy needs product-level discovery pressure.";
67
69
  readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
68
- readonly model: "balanced";
69
- readonly activation: "proactive";
70
+ readonly model: "deep";
71
+ readonly activation: "mandatory";
70
72
  readonly relatedStages: ["brainstorm", "scope"];
71
73
  readonly returnSchema: AgentReturnSchema;
72
74
  readonly body: string;
73
75
  }, {
74
- readonly name: "product-strategist";
75
- readonly description: "PROACTIVE during scope. MUST BE USED when selected scope mode is SCOPE EXPANSION or SELECTIVE EXPANSION to pressure-test 10x vision, strategic upside, and long-term trajectory before lock.";
76
+ readonly name: "divergent-thinker";
77
+ readonly description: "PROACTIVE before planner/critic convergence when brainstorm or scope needs option-space expansion and alternative framings.";
76
78
  readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
77
- readonly model: "deep";
79
+ readonly model: "balanced";
78
80
  readonly activation: "proactive";
79
- readonly relatedStages: ["scope"];
81
+ readonly relatedStages: ["brainstorm", "scope"];
80
82
  readonly returnSchema: AgentReturnSchema;
81
83
  readonly body: string;
82
84
  }, {
@@ -90,11 +92,11 @@ export declare const CCLAW_AGENTS: readonly [{
90
92
  readonly body: string;
91
93
  }, {
92
94
  readonly name: "architect";
93
- readonly description: "MANDATORY during design. MUST BE USED to validate architecture boundaries, alternatives, failure modes, rollout, and spec handoff before implementation.";
95
+ readonly description: "MANDATORY during design and final ship verification. MUST BE USED to validate architecture boundaries, alternatives, failure modes, rollout, and cross-stage cohesion before release.";
94
96
  readonly tools: ["Read", "Grep", "Glob", "WebSearch"];
95
97
  readonly model: "deep";
96
98
  readonly activation: "mandatory";
97
- readonly relatedStages: ["design"];
99
+ readonly relatedStages: ["design", "ship"];
98
100
  readonly returnSchema: AgentReturnSchema;
99
101
  readonly body: string;
100
102
  }, {
@@ -116,39 +118,39 @@ export declare const CCLAW_AGENTS: readonly [{
116
118
  readonly returnSchema: AgentReturnSchema;
117
119
  readonly body: string;
118
120
  }, {
119
- readonly name: "reviewer";
120
- readonly description: "MANDATORY during review. MUST BE USED to run a two-pass audit: spec compliance first, then correctness/maintainability/performance/architecture.";
121
+ readonly name: "coherence-reviewer";
122
+ readonly description: "PROACTIVE during spec/plan/design when internal consistency must be validated across sections, terminology, references, and dependency narratives.";
121
123
  readonly tools: ["Read", "Grep", "Glob"];
122
124
  readonly model: "balanced";
123
- readonly activation: "mandatory";
124
- readonly relatedStages: ["spec", "review", "ship"];
125
+ readonly activation: "proactive";
126
+ readonly relatedStages: ["spec", "plan", "design"];
125
127
  readonly returnSchema: AgentReturnSchema;
126
128
  readonly body: string;
127
129
  }, {
128
- readonly name: "performance-reviewer";
129
- readonly description: "PROACTIVE during review for hot paths, IO, data volume, caching, rendering, or algorithmic cost changes. Produces no-impact rationale when clean.";
130
+ readonly name: "scope-guardian-reviewer";
131
+ readonly description: "PROACTIVE during scope/plan/design when complexity growth, scope drift, or unnecessary abstraction risk needs a dedicated challenge pass.";
130
132
  readonly tools: ["Read", "Grep", "Glob"];
131
133
  readonly model: "balanced";
132
134
  readonly activation: "proactive";
133
- readonly relatedStages: ["review"];
135
+ readonly relatedStages: ["scope", "plan", "design"];
134
136
  readonly returnSchema: AgentReturnSchema;
135
137
  readonly body: string;
136
138
  }, {
137
- readonly name: "compatibility-reviewer";
138
- readonly description: "PROACTIVE during design/review when public APIs, config, persisted data, CLI behavior, generated clients, or dependency versions may change.";
139
+ readonly name: "feasibility-reviewer";
140
+ readonly description: "PROACTIVE during plan/design when resource, runtime, environment, dependency, or rollout assumptions can make the solution non-viable.";
139
141
  readonly tools: ["Read", "Grep", "Glob"];
140
142
  readonly model: "balanced";
141
143
  readonly activation: "proactive";
142
- readonly relatedStages: ["design", "review"];
144
+ readonly relatedStages: ["plan", "design"];
143
145
  readonly returnSchema: AgentReturnSchema;
144
146
  readonly body: string;
145
147
  }, {
146
- readonly name: "observability-reviewer";
147
- readonly description: "PROACTIVE during design/review when diagnosis, telemetry, rollout visibility, or supportability could affect safe operation.";
148
+ readonly name: "reviewer";
149
+ readonly description: "MANDATORY during review. MUST BE USED to run a two-pass audit with explicit inline lens coverage for performance, compatibility, and observability.";
148
150
  readonly tools: ["Read", "Grep", "Glob"];
149
151
  readonly model: "balanced";
150
- readonly activation: "proactive";
151
- readonly relatedStages: ["design", "review"];
152
+ readonly activation: "mandatory";
153
+ readonly relatedStages: ["spec", "review", "ship"];
152
154
  readonly returnSchema: AgentReturnSchema;
153
155
  readonly body: string;
154
156
  }, {
@@ -160,6 +162,15 @@ export declare const CCLAW_AGENTS: readonly [{
160
162
  readonly relatedStages: ["design", "review", "ship"];
161
163
  readonly returnSchema: AgentReturnSchema;
162
164
  readonly body: string;
165
+ }, {
166
+ readonly name: "integration-overseer";
167
+ readonly description: "ON-DEMAND after TDD fan-out to verify cross-slice cohesion contract integrity, integration surfaces, and shared invariants before review handoff.";
168
+ readonly tools: ["Read", "Grep", "Glob"];
169
+ readonly model: "balanced";
170
+ readonly activation: "on-demand";
171
+ readonly relatedStages: ["tdd", "review"];
172
+ readonly returnSchema: AgentReturnSchema;
173
+ readonly body: string;
163
174
  }, {
164
175
  readonly name: "test-author";
165
176
  readonly description: "MANDATORY in TDD stage. MUST BE USED for RED -> GREEN -> REFACTOR with evidence-first discipline.";
@@ -196,15 +207,6 @@ export declare const CCLAW_AGENTS: readonly [{
196
207
  readonly relatedStages: ["tdd"];
197
208
  readonly returnSchema: AgentReturnSchema;
198
209
  readonly body: string;
199
- }, {
200
- readonly name: "implementer";
201
- readonly description: "ON-DEMAND worker for one scoped implementation slice. Use only with self-contained task text, explicit file boundaries, and verification expectations.";
202
- readonly tools: ["Read", "Write", "Edit", "Grep", "Glob", "Bash"];
203
- readonly model: "balanced";
204
- readonly activation: "on-demand";
205
- readonly relatedStages: ["tdd"];
206
- readonly returnSchema: AgentReturnSchema;
207
- readonly body: string;
208
210
  }, {
209
211
  readonly name: "fixer";
210
212
  readonly description: "ON-DEMAND fresh worker after review FAIL/PARTIAL evidence. Must fix only the cited criterion within explicit allowed files.";
@@ -221,9 +223,6 @@ export declare const CCLAW_AGENTS: readonly [{
221
223
  * and typos instead of letting them slip into generated artifacts.
222
224
  */
223
225
  export type AgentName = (typeof CCLAW_AGENTS)[number]["name"];
224
- /**
225
- * Render a complete cclaw agent markdown file (YAML frontmatter + body).
226
- */
227
226
  export declare function agentMarkdown(agent: AgentDefinition): string;
228
227
  /**
229
228
  * Markdown table mapping cclaw stage entry points to specialist agents.