cclaw-cli 0.4.0 → 0.5.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.
package/dist/doctor.js CHANGED
@@ -304,23 +304,12 @@ export async function doctorChecks(projectRoot, options = {}) {
304
304
  });
305
305
  continue;
306
306
  }
307
- for (const stage of COMMAND_FILE_ORDER) {
308
- const shimPath = path.join(projectRoot, adapter.commandDir, `cc-${stage}.md`);
309
- let shimOk = await exists(shimPath);
310
- let details = shimPath;
311
- if (shimOk) {
312
- const content = await fs.readFile(shimPath, "utf8");
313
- const hasSkillReference = content.includes(`.cclaw/skills/${stageSkillFolder(stage)}/SKILL.md`);
314
- const hasCommandReference = content.includes(`.cclaw/commands/${stage}.md`);
315
- shimOk = hasSkillReference && hasCommandReference;
316
- details = hasSkillReference && hasCommandReference
317
- ? `${shimPath} aligned`
318
- : `${shimPath} missing stage references`;
319
- }
307
+ for (const shim of ["cc.md", "cc-next.md", "cc-learn.md"]) {
308
+ const shimPath = path.join(projectRoot, adapter.commandDir, shim);
320
309
  checks.push({
321
- name: `shim:${harness}:${stage}`,
322
- ok: shimOk,
323
- details
310
+ name: `shim:${harness}:${shim.replace(".md", "")}`,
311
+ ok: await exists(shimPath),
312
+ details: shimPath
324
313
  });
325
314
  }
326
315
  }
@@ -329,12 +318,13 @@ export async function doctorChecks(projectRoot, options = {}) {
329
318
  if (await exists(agentsFile)) {
330
319
  const content = await fs.readFile(agentsFile, "utf8");
331
320
  const hasMarkers = content.includes(CCLAW_MARKER_START) && content.includes(CCLAW_MARKER_END);
332
- const hasAllCommands = COMMAND_FILE_ORDER.every((stage) => content.includes(`/cc-${stage}`));
333
- const hasRouting = content.includes("Intent → Stage Routing") || content.includes("Intent → Stage");
321
+ const hasCcCommand = content.includes("/cc");
322
+ const hasCcNext = content.includes("/cc-next");
323
+ const hasCcLearn = content.includes("/cc-learn");
334
324
  const hasVerification = content.includes("Verification Discipline");
335
325
  const hasMinimalMarker = content.includes("intentionally minimal for cross-project use");
336
326
  const hasMetaSkillPointer = content.includes(".cclaw/skills/using-cclaw/SKILL.md");
337
- agentsBlockOk = hasMarkers && hasAllCommands && hasRouting && hasVerification && hasMinimalMarker && hasMetaSkillPointer;
327
+ agentsBlockOk = hasMarkers && hasCcCommand && hasCcNext && hasCcLearn && hasVerification && hasMinimalMarker && hasMetaSkillPointer;
338
328
  }
339
329
  checks.push({
340
330
  name: "agents:cclaw_block",
@@ -342,7 +332,7 @@ export async function doctorChecks(projectRoot, options = {}) {
342
332
  details: `${agentsFile} must contain the managed cclaw marker block with routing, verification, and minimal detail pointer`
343
333
  });
344
334
  // Utility commands
345
- for (const cmd of ["learn", "autoplan"]) {
335
+ for (const cmd of ["learn"]) {
346
336
  const cmdPath = path.join(projectRoot, RUNTIME_ROOT, "commands", `${cmd}.md`);
347
337
  checks.push({
348
338
  name: `utility_command:${cmd}`,
@@ -353,7 +343,6 @@ export async function doctorChecks(projectRoot, options = {}) {
353
343
  // Utility skills
354
344
  for (const [folder, label] of [
355
345
  ["learnings", "learnings"],
356
- ["autoplan", "autoplan"],
357
346
  ["subagent-dev", "sdd"],
358
347
  ["parallel-dispatch", "parallel-agents"],
359
348
  ["session", "session"],
@@ -782,26 +771,6 @@ export async function doctorChecks(projectRoot, options = {}) {
782
771
  ? `stage "${gateEvidence.stage}" gate evidence is consistent (required=${gateEvidence.requiredCount}, passed=${gateEvidence.passedCount}, blocked=${gateEvidence.blockedCount})`
783
772
  : gateEvidence.issues.join(" ")
784
773
  });
785
- // Utility shims in harness dirs
786
- for (const harness of configuredHarnesses) {
787
- const adapter = HARNESS_ADAPTERS[harness];
788
- if (!adapter) {
789
- checks.push({
790
- name: `harness:${harness}:supported`,
791
- ok: false,
792
- details: `Unsupported harness "${harness}" in ${RUNTIME_ROOT}/config.yaml`
793
- });
794
- continue;
795
- }
796
- for (const cmd of ["learn", "autoplan"]) {
797
- const shimPath = path.join(projectRoot, adapter.commandDir, `cc-${cmd}.md`);
798
- checks.push({
799
- name: `shim:${harness}:${cmd}`,
800
- ok: await exists(shimPath),
801
- details: shimPath
802
- });
803
- }
804
- }
805
774
  // Self-improvement block in stage skills
806
775
  for (const stage of COMMAND_FILE_ORDER) {
807
776
  const skillPath = path.join(projectRoot, RUNTIME_ROOT, "skills", stageSkillFolder(stage), "SKILL.md");
@@ -1,8 +1,7 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { COMMAND_FILE_ORDER, RUNTIME_ROOT } from "./constants.js";
3
+ import { RUNTIME_ROOT } from "./constants.js";
4
4
  import { CCLAW_AGENTS, agentMarkdown } from "./content/agents.js";
5
- import { stageSkillFolder } from "./content/skills.js";
6
5
  import { ensureDir, exists, writeFileSafe } from "./fs-utils.js";
7
6
  export const CCLAW_MARKER_START = "<!-- cclaw-start -->";
8
7
  export const CCLAW_MARKER_END = "<!-- cclaw-end -->";
@@ -18,30 +17,7 @@ export const HARNESS_ADAPTERS = {
18
17
  opencode: { id: "opencode", commandDir: ".opencode/commands" },
19
18
  codex: { id: "codex", commandDir: ".codex/commands" }
20
19
  };
21
- function shimFileName(stage) {
22
- return `cc-${stage}.md`;
23
- }
24
- function shimContent(harness, stage) {
25
- const skillFolder = stageSkillFolder(stage);
26
- return `---
27
- name: cc-${stage}
28
- description: Generated shim for ${harness}. Runs one flow stage with command+skill context.
29
- source: generated-by-cclaw
30
- ---
31
-
32
- # cclaw ${stage}
33
-
34
- Load and execute:
35
- 1. \`.cclaw/skills/${skillFolder}/SKILL.md\`
36
- 2. \`.cclaw/commands/${stage}.md\`
37
-
38
- This command is stage-scoped: do only this stage and then hand off to the next one.
39
- Use \`.cclaw/state/flow-state.json\` for transition guards and status tracking.
40
- Do not skip required handoff gates.
41
- `;
42
- }
43
20
  function agentsMdBlock() {
44
- const stageList = COMMAND_FILE_ORDER.map((s) => `| \`/cc-${s}\` | \`.cclaw/skills/${stageSkillFolder(s)}/SKILL.md\` + \`.cclaw/commands/${s}.md\` |`).join("\n");
45
21
  return `${CCLAW_MARKER_START}
46
22
  ## Cclaw — Workflow Adapter
47
23
 
@@ -52,20 +28,19 @@ function agentsMdBlock() {
52
28
 
53
29
  Before responding to a coding request:
54
30
  1. Read \`.cclaw/state/flow-state.json\` for the current stage.
55
- 2. If a stage applies, invoke the matching \`/cc-*\` command.
31
+ 2. Use \`/cc\` to start or \`/cc-next\` to continue the flow.
56
32
  3. If no stage applies, respond normally.
57
33
 
58
- ### Intent Stage Routing
34
+ ### Commands (3 total)
59
35
 
60
- | Command | Loads |
36
+ | Command | Purpose |
61
37
  |---|---|
62
- ${stageList}
63
- | \`/cc-learn\` | \`.cclaw/skills/learnings/SKILL.md\` + \`.cclaw/commands/learn.md\` |
64
- | \`/cc-autoplan\` | \`.cclaw/skills/autoplan/SKILL.md\` + \`.cclaw/commands/autoplan.md\` |
65
- | \`/cc-next\` | \`.cclaw/skills/flow-next-step/SKILL.md\` + \`.cclaw/commands/next.md\` |
38
+ | \`/cc\` | **Entry point.** No args = resume current stage. With prompt = start brainstorm with idea. |
39
+ | \`/cc-next\` | **Progression.** Advances to the next stage when current is complete. |
40
+ | \`/cc-learn\` | **Cross-cutting.** Capture or review project learnings. |
66
41
 
67
- **Stage order:** brainstorm > scope > design > spec > plan > test > build > review > ship.
68
- One stage per invocation. Gates must pass before handoff.
42
+ **Stage order:** brainstorm > scope > design > spec > plan > tdd > review > ship.
43
+ \`/cc-next\` loads the right stage skill automatically. Gates must pass before handoff.
69
44
 
70
45
  ### Verification Discipline
71
46
 
@@ -115,8 +90,9 @@ export async function removeCclawFromAgentsMd(projectRoot) {
115
90
  }
116
91
  }
117
92
  function utilityShimContent(harness, command, skillFolder, commandFile) {
93
+ const shimName = command === "cc" ? "cc" : `cc-${command}`;
118
94
  return `---
119
- name: cc-${command}
95
+ name: ${shimName}
120
96
  description: Generated shim for ${harness}. Utility command — not a flow stage.
121
97
  source: generated-by-cclaw
122
98
  ---
@@ -145,14 +121,9 @@ export async function syncHarnessShims(projectRoot, harnesses) {
145
121
  }
146
122
  const commandDir = path.join(projectRoot, adapter.commandDir);
147
123
  await ensureDir(commandDir);
148
- for (const stage of COMMAND_FILE_ORDER) {
149
- const fullPath = path.join(commandDir, shimFileName(stage));
150
- await writeFileSafe(fullPath, shimContent(harness, stage));
151
- }
152
- // Utility command shims
153
- await writeFileSafe(path.join(commandDir, "cc-learn.md"), utilityShimContent(harness, "learn", "learnings", "learn.md"));
154
- await writeFileSafe(path.join(commandDir, "cc-autoplan.md"), utilityShimContent(harness, "autoplan", "autoplan", "autoplan.md"));
124
+ await writeFileSafe(path.join(commandDir, "cc.md"), utilityShimContent(harness, "cc", "flow-start", "start.md"));
155
125
  await writeFileSafe(path.join(commandDir, "cc-next.md"), utilityShimContent(harness, "next", "flow-next-step", "next.md"));
126
+ await writeFileSafe(path.join(commandDir, "cc-learn.md"), utilityShimContent(harness, "learn", "learnings", "learn.md"));
156
127
  }
157
128
  await syncAgentFiles(projectRoot);
158
129
  await syncAgentsMd(projectRoot);
package/dist/install.js CHANGED
@@ -6,10 +6,10 @@ import { promisify } from "node:util";
6
6
  import { COMMAND_FILE_ORDER, REQUIRED_DIRS, RUNTIME_ROOT, UTILITY_COMMANDS } from "./constants.js";
7
7
  import { writeConfig, createDefaultConfig, readConfig, configPath } from "./config.js";
8
8
  import { commandContract } from "./content/contracts.js";
9
- import { autoplanSkillMarkdown, autoplanCommandContract } from "./content/autoplan.js";
10
9
  import { contextModeFiles, createInitialContextModeState } from "./content/contexts.js";
11
10
  import { learnSkillMarkdown, learnCommandContract } from "./content/learnings.js";
12
11
  import { nextCommandContract, nextCommandSkillMarkdown } from "./content/next-command.js";
12
+ import { startCommandContract, startCommandSkillMarkdown } from "./content/start-command.js";
13
13
  import { subagentDrivenDevSkill, parallelAgentsSkill } from "./content/subagents.js";
14
14
  import { sessionHooksSkillMarkdown } from "./content/session-hooks.js";
15
15
  import { sessionStartScript, stopCheckpointScript, opencodePluginJs, claudeHooksJson, cursorHooksJson, codexHooksJson } from "./content/hooks.js";
@@ -192,8 +192,8 @@ async function writeSkills(projectRoot) {
192
192
  }
193
193
  // Utility skills (not flow stages)
194
194
  await writeFileSafe(runtimePath(projectRoot, "skills", "learnings", "SKILL.md"), learnSkillMarkdown());
195
- await writeFileSafe(runtimePath(projectRoot, "skills", "autoplan", "SKILL.md"), autoplanSkillMarkdown());
196
195
  await writeFileSafe(runtimePath(projectRoot, "skills", "flow-next-step", "SKILL.md"), nextCommandSkillMarkdown());
196
+ await writeFileSafe(runtimePath(projectRoot, "skills", "flow-start", "SKILL.md"), startCommandSkillMarkdown());
197
197
  await writeFileSafe(runtimePath(projectRoot, "skills", "subagent-dev", "SKILL.md"), subagentDrivenDevSkill());
198
198
  await writeFileSafe(runtimePath(projectRoot, "skills", "parallel-dispatch", "SKILL.md"), parallelAgentsSkill());
199
199
  await writeFileSafe(runtimePath(projectRoot, "skills", "session", "SKILL.md"), sessionHooksSkillMarkdown());
@@ -205,8 +205,8 @@ async function writeSkills(projectRoot) {
205
205
  }
206
206
  async function writeUtilityCommands(projectRoot) {
207
207
  await writeFileSafe(runtimePath(projectRoot, "commands", "learn.md"), learnCommandContract());
208
- await writeFileSafe(runtimePath(projectRoot, "commands", "autoplan.md"), autoplanCommandContract());
209
208
  await writeFileSafe(runtimePath(projectRoot, "commands", "next.md"), nextCommandContract());
209
+ await writeFileSafe(runtimePath(projectRoot, "commands", "start.md"), startCommandContract());
210
210
  }
211
211
  function toObject(value) {
212
212
  if (!value || typeof value !== "object" || Array.isArray(value)) {
@@ -688,6 +688,9 @@ async function cleanLegacyArtifacts(projectRoot) {
688
688
  for (const legacyFolder of [
689
689
  "project-learnings",
690
690
  "auto-orchestration",
691
+ "autoplan",
692
+ "red-first-testing",
693
+ "incremental-implementation",
691
694
  "subagent-driven-development",
692
695
  "dispatching-parallel-agents",
693
696
  "session-guidelines",
@@ -730,7 +733,8 @@ async function cleanStaleFiles(projectRoot) {
730
733
  ...COMMAND_FILE_ORDER.map((stage) => `viby-${stage}.md`),
731
734
  ...UTILITY_COMMANDS.map((cmd) => `viby-${cmd}.md`),
732
735
  ...COMMAND_FILE_ORDER.map((stage) => `cc-${stage}.md`),
733
- ...UTILITY_COMMANDS.map((cmd) => `cc-${cmd}.md`)
736
+ ...UTILITY_COMMANDS.map((cmd) => `cc-${cmd}.md`),
737
+ "cc.md"
734
738
  ]);
735
739
  for (const adapter of Object.values(HARNESS_ADAPTERS)) {
736
740
  const commandDir = path.join(projectRoot, adapter.commandDir);
@@ -744,7 +748,7 @@ async function cleanStaleFiles(projectRoot) {
744
748
  entries = [];
745
749
  }
746
750
  for (const entry of entries) {
747
- if (!/^cc-.*\.md$/u.test(entry))
751
+ if (!/^cc(?:-.*)?\.md$/u.test(entry))
748
752
  continue;
749
753
  if (expectedShimFiles.has(entry))
750
754
  continue;
@@ -930,7 +934,7 @@ export async function uninstallCclaw(projectRoot) {
930
934
  try {
931
935
  const entries = await fs.readdir(fullDir);
932
936
  for (const entry of entries) {
933
- if (/^(?:viby|cc)-.*\.md$/u.test(entry)) {
937
+ if (/^(?:viby|cc)(?:-.*)?\.md$/u.test(entry)) {
934
938
  await fs.rm(path.join(fullDir, entry), { force: true });
935
939
  }
936
940
  }
package/dist/policy.js CHANGED
@@ -66,7 +66,7 @@ export async function policyChecks(projectRoot, options = {}) {
66
66
  });
67
67
  }
68
68
  // --- verification section for build/review/ship skills ---
69
- if (["build", "review", "ship"].includes(stage)) {
69
+ if (["tdd", "review", "ship"].includes(stage)) {
70
70
  rules.push({
71
71
  filePath: skillFile,
72
72
  needle: "## Verification Before Completion",
@@ -89,16 +89,7 @@ export async function policyChecks(projectRoot, options = {}) {
89
89
  { file: runtimeFile("skills/learnings/SKILL.md"), needle: "## Subcommands", name: "utility_skill:learnings:subcommands" },
90
90
  { file: runtimeFile("skills/learnings/SKILL.md"), needle: "## Confidence Decay", name: "utility_skill:learnings:decay" },
91
91
  { file: runtimeFile("skills/learnings/SKILL.md"), needle: "## HARD-GATE", name: "utility_skill:learnings:hard_gate" },
92
- { file: runtimeFile("skills/autoplan/SKILL.md"), needle: "## Phase Sequence", name: "utility_skill:autoplan:phases" },
93
- { file: runtimeFile("skills/autoplan/SKILL.md"), needle: "Decision Principles", name: "utility_skill:autoplan:principles" },
94
- { file: runtimeFile("skills/autoplan/SKILL.md"), needle: "## Decision Taxonomy", name: "utility_skill:autoplan:taxonomy" },
95
- { file: runtimeFile("skills/autoplan/SKILL.md"), needle: "## HARD-GATE", name: "utility_skill:autoplan:hard_gate" },
96
- { file: runtimeFile("skills/autoplan/SKILL.md"), needle: "## Restore Points", name: "utility_skill:autoplan:restore_points" },
97
- { file: runtimeFile("skills/autoplan/SKILL.md"), needle: "## Scope Mode Heuristics (Phase 2)", name: "utility_skill:autoplan:scope_heuristics" },
98
92
  { file: runtimeFile("commands/learn.md"), needle: "## Subcommands", name: "utility_command:learn:subcommands" },
99
- { file: runtimeFile("commands/autoplan.md"), needle: "## Phase Sequence", name: "utility_command:autoplan:phases" },
100
- { file: runtimeFile("commands/autoplan.md"), needle: "## Decision Principles", name: "utility_command:autoplan:principles" },
101
- { file: runtimeFile("commands/autoplan.md"), needle: "## Scope Mode Heuristics (Phase 2)", name: "utility_command:autoplan:scope_heuristics" },
102
93
  { file: runtimeFile("skills/subagent-dev/SKILL.md"), needle: "## HARD-GATE", name: "utility_skill:sdd:hard_gate" },
103
94
  { file: runtimeFile("skills/subagent-dev/SKILL.md"), needle: "## Status Contract", name: "utility_skill:sdd:status_contract" },
104
95
  { file: runtimeFile("skills/subagent-dev/SKILL.md"), needle: "Implementer", name: "utility_skill:sdd:implementer_template" },
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const FLOW_STAGES: readonly ["brainstorm", "scope", "design", "spec", "plan", "test", "build", "review", "ship"];
1
+ export declare const FLOW_STAGES: readonly ["brainstorm", "scope", "design", "spec", "plan", "tdd", "review", "ship"];
2
2
  export type FlowStage = (typeof FLOW_STAGES)[number];
3
3
  export declare const HARNESS_IDS: readonly ["claude", "cursor", "opencode", "codex"];
4
4
  export type HarnessId = (typeof HARNESS_IDS)[number];
package/dist/types.js CHANGED
@@ -4,8 +4,7 @@ export const FLOW_STAGES = [
4
4
  "design",
5
5
  "spec",
6
6
  "plan",
7
- "test",
8
- "build",
7
+ "tdd",
9
8
  "review",
10
9
  "ship"
11
10
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +0,0 @@
1
- /**
2
- * Autoplan orchestrator content for cclaw.
3
- * Generates markdown instructions that AI agents follow; cclaw does not execute the pipeline.
4
- */
5
- export declare function autoplanSkillMarkdown(): string;
6
- export declare function autoplanCommandContract(): string;
7
- export declare function autoplanAgentsMdBlock(): string;