cclaw-cli 0.30.0 → 0.31.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/README.md +4 -2
- package/dist/cli.d.ts +2 -4
- package/dist/cli.js +48 -133
- package/dist/config.d.ts +1 -11
- package/dist/config.js +0 -40
- package/dist/doctor.js +0 -2
- package/dist/harness-adapters.js +19 -7
- package/dist/install.d.ts +3 -5
- package/dist/install.js +4 -9
- package/dist/types.d.ts +0 -12
- package/dist/types.js +0 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,7 +117,8 @@ Plus harness-specific shims:
|
|
|
117
117
|
|
|
118
118
|
`.cclaw/config.yaml` holds every tunable key (prompt guard strictness,
|
|
119
119
|
TDD enforcement, git-hook guards, language rule packs, track heuristics).
|
|
120
|
-
Edit it directly — `cclaw-cli upgrade` preserves your changes.
|
|
120
|
+
Edit it directly — `cclaw-cli upgrade` preserves your changes. Full key
|
|
121
|
+
reference: [`docs/config.md`](./docs/config.md).
|
|
121
122
|
|
|
122
123
|
---
|
|
123
124
|
|
|
@@ -355,7 +356,8 @@ npx cclaw-cli --version
|
|
|
355
356
|
For CI or scripted installs, `cclaw-cli init --harnesses=<list>
|
|
356
357
|
--no-interactive` is the non-interactive form. All other tunables
|
|
357
358
|
(prompt-guard strictness, TDD enforcement, language rule packs, track
|
|
358
|
-
heuristics) are set by editing `.cclaw/config.yaml` directly
|
|
359
|
+
heuristics) are set by editing `.cclaw/config.yaml` directly — see
|
|
360
|
+
[`docs/config.md`](./docs/config.md) for the full key reference.
|
|
359
361
|
|
|
360
362
|
---
|
|
361
363
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import type { FlowTrack, HarnessId
|
|
2
|
+
import type { FlowTrack, HarnessId } from "./types.js";
|
|
3
3
|
import type { EvalMode } from "./eval/types.js";
|
|
4
4
|
type CommandName = "init" | "sync" | "doctor" | "upgrade" | "uninstall" | "archive" | "eval";
|
|
5
5
|
interface ParsedArgs {
|
|
6
6
|
command?: CommandName;
|
|
7
7
|
harnesses?: HarnessId[];
|
|
8
8
|
track?: FlowTrack;
|
|
9
|
-
profile?: InitProfile;
|
|
10
9
|
dryRun?: boolean;
|
|
11
10
|
interactive?: boolean;
|
|
12
11
|
reconcileGates?: boolean;
|
|
@@ -40,6 +39,5 @@ interface ParsedArgs {
|
|
|
40
39
|
export declare function usage(): string;
|
|
41
40
|
declare function parseHarnesses(raw: string): HarnessId[];
|
|
42
41
|
declare function parseTrack(raw: string): FlowTrack;
|
|
43
|
-
declare function parseProfile(raw: string): InitProfile;
|
|
44
42
|
declare function parseArgs(argv: string[]): ParsedArgs;
|
|
45
|
-
export { parseArgs, parseHarnesses, parseTrack
|
|
43
|
+
export { parseArgs, parseHarnesses, parseTrack };
|
package/dist/cli.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createReadStream, realpathSync } from "node:fs";
|
|
2
|
+
import { createReadStream, existsSync, realpathSync } from "node:fs";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { createInterface } from "node:readline/promises";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
-
import { FLOW_TRACKS, HARNESS_IDS
|
|
9
|
+
import { FLOW_TRACKS, HARNESS_IDS } from "./types.js";
|
|
10
10
|
import { doctorChecks, doctorSucceeded } from "./doctor.js";
|
|
11
11
|
import { initCclaw, syncCclaw, uninstallCclaw, upgradeCclaw } from "./install.js";
|
|
12
12
|
import { error, info } from "./logger.js";
|
|
13
13
|
import { archiveRun } from "./runs.js";
|
|
14
14
|
import { CCLAW_VERSION, RUNTIME_ROOT } from "./constants.js";
|
|
15
|
-
import { createDefaultConfig
|
|
15
|
+
import { createDefaultConfig } from "./config.js";
|
|
16
16
|
import { detectHarnesses } from "./init-detect.js";
|
|
17
17
|
import { HARNESS_ADAPTERS } from "./harness-adapters.js";
|
|
18
18
|
import { runEval } from "./eval/runner.js";
|
|
@@ -21,7 +21,6 @@ import { writeBaselinesFromReport } from "./eval/baseline.js";
|
|
|
21
21
|
import { writeJsonReport, writeMarkdownReport } from "./eval/report.js";
|
|
22
22
|
import { formatDiffMarkdown, runEvalDiff } from "./eval/diff.js";
|
|
23
23
|
import { ensureRunDir, generateRunId, isRunAlive, listRuns, readRunStatus, resolveRunId, runLogPath, writeRunStatus } from "./eval/runs.js";
|
|
24
|
-
import { EVAL_MODES } from "./eval/types.js";
|
|
25
24
|
import { parseModeInput } from "./eval/mode.js";
|
|
26
25
|
import { FLOW_STAGES } from "./types.js";
|
|
27
26
|
const INSTALLER_COMMANDS = [
|
|
@@ -37,82 +36,33 @@ export function usage() {
|
|
|
37
36
|
return `cclaw - installer-first flow toolkit
|
|
38
37
|
|
|
39
38
|
Usage:
|
|
40
|
-
cclaw
|
|
41
|
-
cclaw
|
|
42
|
-
cclaw --
|
|
39
|
+
npx cclaw-cli # launch setup or print "already installed" hint
|
|
40
|
+
npx cclaw-cli <command> [flags]
|
|
41
|
+
npx cclaw-cli --help | -h
|
|
42
|
+
npx cclaw-cli --version | -v
|
|
43
43
|
|
|
44
44
|
Commands:
|
|
45
45
|
init Bootstrap .cclaw runtime, state, and harness shims in this project.
|
|
46
|
-
Flags: --
|
|
47
|
-
--
|
|
48
|
-
|
|
49
|
-
--interactive Force interactive prompts (TTY only).
|
|
50
|
-
--no-interactive Skip interactive prompts even on TTY.
|
|
51
|
-
--dry-run Print resolved config + generated surfaces without writing files.
|
|
52
|
-
sync Regenerate harness shim files from the current .cclaw config (non-destructive).
|
|
53
|
-
doctor Run health checks against the local .cclaw runtime. Exit code 2 when any error-severity check fails.
|
|
54
|
-
Flags: --reconcile-gates Recompute current-stage gate evidence before checks.
|
|
55
|
-
--json Emit machine-readable JSON output.
|
|
56
|
-
--only=<filter> Comma list of severities/check-name filters (error,warning,info,trace:,hook:...).
|
|
57
|
-
--explain Include fix + doc reference per check in text mode.
|
|
58
|
-
--quiet Print only failing checks (and totals).
|
|
59
|
-
archive Move .cclaw/artifacts into .cclaw/runs/<date>-<slug> and reset flow state.
|
|
60
|
-
Flags: --name=<feature> Feature slug (default: inferred from 00-idea.md).
|
|
61
|
-
--skip-retro Bypass mandatory retro gate (requires --retro-reason).
|
|
62
|
-
--retro-reason=<t> Reason for bypassing retro gate.
|
|
63
|
-
eval Run cclaw evals against .cclaw/evals/corpus (Phase 7: structural verifier + baselines).
|
|
64
|
-
Flags: --stage=<id> Limit to one flow stage (${FLOW_STAGES.join("|")}) for fixture/agent modes.
|
|
65
|
-
--mode=<${EVAL_MODES.join("|")}>
|
|
66
|
-
Evaluation mode:
|
|
67
|
-
fixture = verify existing artifacts with structural/rule/judge verifiers.
|
|
68
|
-
agent = LLM drafts one stage's artifact in a sandbox with tools.
|
|
69
|
-
workflow = LLM runs the full multi-stage flow (brainstorm→plan).
|
|
70
|
-
Legacy --tier=A|B|C still works (deprecated).
|
|
71
|
-
--schema-only Run only structural verifiers (default).
|
|
72
|
-
--rules Also run rule-based verifiers (keywords, regex, counts, uniqueness, traceability).
|
|
73
|
-
--judge Run the LLM judge (median-of-N) against each case's rubric. Requires CCLAW_EVAL_API_KEY; fixture mode judges an existing artifact, agent/workflow modes draft first and then judge.
|
|
74
|
-
--dry-run Validate config + corpus, print summary, do not execute.
|
|
75
|
-
--json Emit machine-readable JSON on stdout.
|
|
76
|
-
--no-write Skip writing the report to .cclaw/evals/reports/.
|
|
77
|
-
--update-baseline Overwrite baselines from the current run (requires --confirm).
|
|
78
|
-
--confirm Acknowledge --update-baseline (prevents accidental resets).
|
|
79
|
-
--quiet Silence the stderr progress logger (default: emit one
|
|
80
|
-
line per case / stage to stderr so long runs are visible).
|
|
81
|
-
--max-cost-usd=<n> Abort the run if committed USD spend crosses <n>
|
|
82
|
-
(independent from the daily cap). Also readable from
|
|
83
|
-
CCLAW_EVAL_MAX_COST_USD.
|
|
84
|
-
--compare-model=<id> Run the same corpus twice — once with the configured model
|
|
85
|
-
and once with <id> — then diff the summaries. Exit code 1
|
|
86
|
-
when the override model regressed.
|
|
87
|
-
--background Spawn the run as a detached child process, write the
|
|
88
|
-
combined output to .cclaw/evals/runs/<id>/run.log, and
|
|
89
|
-
return immediately. Attach later with
|
|
90
|
-
\`cclaw eval runs tail <id|latest>\`.
|
|
91
|
-
|
|
92
|
-
Subcommands:
|
|
93
|
-
diff <old> <new> Compare two reports under .cclaw/evals/reports/.
|
|
94
|
-
Each argument is a cclawVersion (e.g. 0.26.0), a filename,
|
|
95
|
-
or the literal "latest". Exit code 1 when the diff shows a
|
|
96
|
-
regression. Accepts --json to emit machine-readable output.
|
|
97
|
-
runs [action] [id] Inspect background runs under .cclaw/evals/runs/.
|
|
98
|
-
Actions: list (default) | status <id|latest> | tail <id|latest>.
|
|
99
|
-
upgrade Refresh generated files in .cclaw without modifying user artifacts.
|
|
46
|
+
Flags: --harnesses=<list> Comma list of harnesses (claude,cursor,opencode,codex).
|
|
47
|
+
--no-interactive Skip interactive prompts even on TTY (for CI/scripts).
|
|
48
|
+
upgrade Refresh generated files in .cclaw. Preserves your config.yaml.
|
|
100
49
|
uninstall Remove .cclaw runtime and the generated harness shim files.
|
|
50
|
+
eval Run cclaw evals. Maintainer surface — see docs/evals.md.
|
|
51
|
+
Full flag reference: \`npx cclaw-cli eval --help\` or docs/evals.md.
|
|
101
52
|
|
|
102
53
|
Global flags:
|
|
103
54
|
-h, --help Show this help message and exit 0.
|
|
104
55
|
-v, --version Print the cclaw CLI version and exit 0.
|
|
105
56
|
|
|
106
57
|
Examples:
|
|
107
|
-
cclaw
|
|
108
|
-
cclaw
|
|
109
|
-
cclaw
|
|
110
|
-
cclaw eval --dry-run
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
cclaw eval diff 0.26.0 latest
|
|
58
|
+
npx cclaw-cli
|
|
59
|
+
npx cclaw-cli init --harnesses=claude,cursor --no-interactive
|
|
60
|
+
npx cclaw-cli upgrade
|
|
61
|
+
npx cclaw-cli eval --dry-run
|
|
62
|
+
|
|
63
|
+
Everything operational (retro, archive, worktrees, doctor, learnings)
|
|
64
|
+
happens inside your harness via slash commands. The CLI is just a
|
|
65
|
+
launcher. See README.md for the four user-facing slash commands.
|
|
116
66
|
|
|
117
67
|
Docs: https://github.com/zuevrs/cclaw
|
|
118
68
|
Issues: https://github.com/zuevrs/cclaw/issues
|
|
@@ -136,13 +86,6 @@ function parseTrack(raw) {
|
|
|
136
86
|
}
|
|
137
87
|
return trimmed;
|
|
138
88
|
}
|
|
139
|
-
function parseProfile(raw) {
|
|
140
|
-
const trimmed = raw.trim();
|
|
141
|
-
if (!INIT_PROFILES.includes(trimmed)) {
|
|
142
|
-
throw new Error(`Unknown profile: ${trimmed}. Supported: ${INIT_PROFILES.join(", ")}`);
|
|
143
|
-
}
|
|
144
|
-
return trimmed;
|
|
145
|
-
}
|
|
146
89
|
function parseLegacyTier(raw) {
|
|
147
90
|
return parseModeInput(raw.toUpperCase(), {
|
|
148
91
|
source: "cli",
|
|
@@ -165,6 +108,26 @@ function parseEvalStage(raw) {
|
|
|
165
108
|
function isInitPromptAllowed(ctx) {
|
|
166
109
|
return Boolean(process.stdin.isTTY && ctx.stdout.isTTY);
|
|
167
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Print a short, friendly hint when the user runs `cclaw-cli` with no
|
|
113
|
+
* arguments. Does not read or mutate flow state — only checks whether
|
|
114
|
+
* `.cclaw/config.yaml` exists to branch between "installed" and
|
|
115
|
+
* "not-installed" messaging. Keeps exit 0 in both cases: users discover
|
|
116
|
+
* the tool through this path, not through an error.
|
|
117
|
+
*/
|
|
118
|
+
function printNoArgsHint(ctx) {
|
|
119
|
+
const installed = existsSync(path.join(ctx.cwd, RUNTIME_ROOT, "config.yaml"));
|
|
120
|
+
if (installed) {
|
|
121
|
+
ctx.stdout.write("cclaw is installed in this project. Open your harness (Claude Code, " +
|
|
122
|
+
"Cursor, OpenCode, or Codex) and type `/cc` to start.\n");
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
ctx.stdout.write("cclaw is not installed in this project yet.\n" +
|
|
126
|
+
"Run `npx cclaw-cli init` to bootstrap .cclaw and the harness shims.\n" +
|
|
127
|
+
"For help: `npx cclaw-cli --help`.\n");
|
|
128
|
+
}
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
168
131
|
function buildInitSurfacePreview(harnesses) {
|
|
169
132
|
const lines = [
|
|
170
133
|
".cclaw/config.yaml",
|
|
@@ -206,39 +169,11 @@ function buildInitSurfacePreview(harnesses) {
|
|
|
206
169
|
}
|
|
207
170
|
return lines;
|
|
208
171
|
}
|
|
209
|
-
function inferTrackDefault(profile, track) {
|
|
210
|
-
if (track)
|
|
211
|
-
return track;
|
|
212
|
-
if (!profile)
|
|
213
|
-
return "standard";
|
|
214
|
-
return createProfileConfig(profile).defaultTrack ?? "standard";
|
|
215
|
-
}
|
|
216
172
|
async function promptInitConfig(defaults, ctx) {
|
|
217
173
|
const rl = createInterface({
|
|
218
174
|
input: process.stdin,
|
|
219
175
|
output: ctx.stdout
|
|
220
176
|
});
|
|
221
|
-
const pickSingle = async (label, options, fallback) => {
|
|
222
|
-
while (true) {
|
|
223
|
-
ctx.stdout.write(`\n${label}\n`);
|
|
224
|
-
options.forEach((option, index) => {
|
|
225
|
-
const marker = option === fallback ? " (default)" : "";
|
|
226
|
-
ctx.stdout.write(` ${index + 1}) ${option}${marker}\n`);
|
|
227
|
-
});
|
|
228
|
-
const answer = (await rl.question("> ")).trim();
|
|
229
|
-
if (answer.length === 0) {
|
|
230
|
-
return fallback;
|
|
231
|
-
}
|
|
232
|
-
const numeric = Number(answer);
|
|
233
|
-
if (Number.isInteger(numeric) && numeric >= 1 && numeric <= options.length) {
|
|
234
|
-
return options[numeric - 1];
|
|
235
|
-
}
|
|
236
|
-
if (options.includes(answer)) {
|
|
237
|
-
return answer;
|
|
238
|
-
}
|
|
239
|
-
ctx.stdout.write("Invalid selection. Use option number or value.\n");
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
177
|
const pickHarnesses = async (fallback) => {
|
|
243
178
|
const fallbackText = fallback.join(",");
|
|
244
179
|
while (true) {
|
|
@@ -260,11 +195,8 @@ async function promptInitConfig(defaults, ctx) {
|
|
|
260
195
|
}
|
|
261
196
|
};
|
|
262
197
|
try {
|
|
263
|
-
const profile = await pickSingle("Select init profile:", INIT_PROFILES, defaults.profile);
|
|
264
|
-
const trackDefault = inferTrackDefault(profile, defaults.track);
|
|
265
|
-
const track = await pickSingle("Select default flow track:", FLOW_TRACKS, trackDefault);
|
|
266
198
|
const harnesses = await pickHarnesses(defaults.harnesses);
|
|
267
|
-
return {
|
|
199
|
+
return { harnesses };
|
|
268
200
|
}
|
|
269
201
|
finally {
|
|
270
202
|
rl.close();
|
|
@@ -279,13 +211,11 @@ async function resolveInitInputs(parsed, ctx) {
|
|
|
279
211
|
const promptForbidden = parsed.interactive === false;
|
|
280
212
|
const implicitPrompt = !promptForbidden &&
|
|
281
213
|
isInitPromptAllowed(ctx) &&
|
|
282
|
-
parsed.profile === undefined &&
|
|
283
214
|
parsed.track === undefined &&
|
|
284
215
|
parsed.harnesses === undefined;
|
|
285
216
|
const shouldPrompt = promptRequested || implicitPrompt;
|
|
286
217
|
if (!shouldPrompt) {
|
|
287
218
|
return {
|
|
288
|
-
profile: parsed.profile,
|
|
289
219
|
track: parsed.track,
|
|
290
220
|
harnesses: autoHarnesses,
|
|
291
221
|
detectedHarnesses
|
|
@@ -295,14 +225,11 @@ async function resolveInitInputs(parsed, ctx) {
|
|
|
295
225
|
throw new Error("Interactive init requires a TTY. Remove --interactive or run in a terminal.");
|
|
296
226
|
}
|
|
297
227
|
const defaults = {
|
|
298
|
-
profile: parsed.profile ?? "standard",
|
|
299
|
-
track: inferTrackDefault(parsed.profile, parsed.track),
|
|
300
228
|
harnesses: autoHarnesses ?? HARNESS_IDS.slice()
|
|
301
229
|
};
|
|
302
230
|
const prompted = await promptInitConfig(defaults, ctx);
|
|
303
231
|
return {
|
|
304
|
-
|
|
305
|
-
track: prompted.track,
|
|
232
|
+
track: parsed.track,
|
|
306
233
|
harnesses: prompted.harnesses,
|
|
307
234
|
detectedHarnesses
|
|
308
235
|
};
|
|
@@ -447,7 +374,6 @@ function parseArgs(argv) {
|
|
|
447
374
|
continue;
|
|
448
375
|
}
|
|
449
376
|
if (flag.startsWith("--profile=")) {
|
|
450
|
-
parsed.profile = parseProfile(flag.replace("--profile=", ""));
|
|
451
377
|
continue;
|
|
452
378
|
}
|
|
453
379
|
if (flag === "--interactive") {
|
|
@@ -780,28 +706,20 @@ async function runCommand(parsed, ctx) {
|
|
|
780
706
|
}
|
|
781
707
|
const command = parsed.command;
|
|
782
708
|
if (!command) {
|
|
783
|
-
ctx
|
|
784
|
-
return 1;
|
|
709
|
+
return printNoArgsHint(ctx);
|
|
785
710
|
}
|
|
786
711
|
if (command === "init") {
|
|
787
712
|
const resolved = await resolveInitInputs(parsed, ctx);
|
|
788
|
-
const effectiveProfile = resolved.profile;
|
|
789
713
|
const effectiveTrack = resolved.track;
|
|
790
714
|
const effectiveHarnesses = resolved.harnesses;
|
|
791
715
|
if (parsed.dryRun === true) {
|
|
792
|
-
const previewConfig =
|
|
793
|
-
? createProfileConfig(effectiveProfile, {
|
|
794
|
-
harnesses: effectiveHarnesses,
|
|
795
|
-
defaultTrack: effectiveTrack
|
|
796
|
-
})
|
|
797
|
-
: createDefaultConfig(effectiveHarnesses, effectiveTrack);
|
|
716
|
+
const previewConfig = createDefaultConfig(effectiveHarnesses, effectiveTrack);
|
|
798
717
|
const previewSurfaces = buildInitSurfacePreview(previewConfig.harnesses);
|
|
799
718
|
info(ctx, "Dry run: no files were written.");
|
|
800
719
|
if (resolved.detectedHarnesses.length > 0 && parsed.harnesses === undefined) {
|
|
801
720
|
info(ctx, `Detected harnesses from repo: ${resolved.detectedHarnesses.join(", ")}`);
|
|
802
721
|
}
|
|
803
722
|
ctx.stdout.write(`${JSON.stringify({
|
|
804
|
-
profile: effectiveProfile ?? "standard(default)",
|
|
805
723
|
track: previewConfig.defaultTrack ?? "standard",
|
|
806
724
|
harnesses: previewConfig.harnesses,
|
|
807
725
|
promptGuardMode: previewConfig.promptGuardMode,
|
|
@@ -814,16 +732,13 @@ async function runCommand(parsed, ctx) {
|
|
|
814
732
|
await initCclaw({
|
|
815
733
|
projectRoot: ctx.cwd,
|
|
816
734
|
harnesses: effectiveHarnesses,
|
|
817
|
-
track: effectiveTrack
|
|
818
|
-
profile: effectiveProfile
|
|
735
|
+
track: effectiveTrack
|
|
819
736
|
});
|
|
820
737
|
if (resolved.detectedHarnesses.length > 0 && parsed.harnesses === undefined) {
|
|
821
738
|
info(ctx, `Detected harnesses from repo: ${resolved.detectedHarnesses.join(", ")}`);
|
|
822
739
|
}
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
const suffix = profileNote || trackNote ? ` (${(profileNote + trackNote).trim()})` : "";
|
|
826
|
-
info(ctx, `Initialized .cclaw runtime and generated harness shims${suffix}`);
|
|
740
|
+
const trackNote = effectiveTrack ? ` (track=${effectiveTrack})` : "";
|
|
741
|
+
info(ctx, `Initialized .cclaw runtime and generated harness shims${trackNote}`);
|
|
827
742
|
return 0;
|
|
828
743
|
}
|
|
829
744
|
if (command === "sync") {
|
|
@@ -1043,4 +958,4 @@ function isDirectExecution() {
|
|
|
1043
958
|
if (isDirectExecution()) {
|
|
1044
959
|
void main();
|
|
1045
960
|
}
|
|
1046
|
-
export { parseArgs, parseHarnesses, parseTrack
|
|
961
|
+
export { parseArgs, parseHarnesses, parseTrack };
|
package/dist/config.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import type { FlowTrack, HarnessId,
|
|
1
|
+
import type { FlowTrack, HarnessId, VibyConfig } from "./types.js";
|
|
2
2
|
export declare function configPath(projectRoot: string): string;
|
|
3
3
|
export declare function createDefaultConfig(harnesses?: HarnessId[], defaultTrack?: FlowTrack): VibyConfig;
|
|
4
|
-
/**
|
|
5
|
-
* Build a VibyConfig for a named init profile. Profile defaults are applied
|
|
6
|
-
* first, then any explicit overrides (CLI flags) win. This keeps the profile
|
|
7
|
-
* contract deterministic and testable.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createProfileConfig(profile: InitProfile, overrides?: {
|
|
10
|
-
harnesses?: HarnessId[];
|
|
11
|
-
defaultTrack?: FlowTrack;
|
|
12
|
-
languageRulePacks?: LanguageRulePack[];
|
|
13
|
-
}): VibyConfig;
|
|
14
4
|
export declare function readConfig(projectRoot: string): Promise<VibyConfig>;
|
|
15
5
|
export declare function writeConfig(projectRoot: string, config: VibyConfig): Promise<void>;
|
package/dist/config.js
CHANGED
|
@@ -67,46 +67,6 @@ export function createDefaultConfig(harnesses = DEFAULT_HARNESSES, defaultTrack
|
|
|
67
67
|
languageRulePacks: []
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Build a VibyConfig for a named init profile. Profile defaults are applied
|
|
72
|
-
* first, then any explicit overrides (CLI flags) win. This keeps the profile
|
|
73
|
-
* contract deterministic and testable.
|
|
74
|
-
*/
|
|
75
|
-
export function createProfileConfig(profile, overrides = {}) {
|
|
76
|
-
const base = createDefaultConfig();
|
|
77
|
-
switch (profile) {
|
|
78
|
-
case "minimal":
|
|
79
|
-
return {
|
|
80
|
-
...base,
|
|
81
|
-
harnesses: overrides.harnesses ?? ["claude"],
|
|
82
|
-
promptGuardMode: "advisory",
|
|
83
|
-
tddEnforcement: "advisory",
|
|
84
|
-
gitHookGuards: false,
|
|
85
|
-
defaultTrack: overrides.defaultTrack ?? "medium",
|
|
86
|
-
languageRulePacks: overrides.languageRulePacks ?? []
|
|
87
|
-
};
|
|
88
|
-
case "standard":
|
|
89
|
-
return {
|
|
90
|
-
...base,
|
|
91
|
-
harnesses: overrides.harnesses ?? DEFAULT_HARNESSES,
|
|
92
|
-
promptGuardMode: "advisory",
|
|
93
|
-
tddEnforcement: "advisory",
|
|
94
|
-
gitHookGuards: false,
|
|
95
|
-
defaultTrack: overrides.defaultTrack ?? "standard",
|
|
96
|
-
languageRulePacks: overrides.languageRulePacks ?? []
|
|
97
|
-
};
|
|
98
|
-
case "full":
|
|
99
|
-
return {
|
|
100
|
-
...base,
|
|
101
|
-
harnesses: overrides.harnesses ?? DEFAULT_HARNESSES,
|
|
102
|
-
promptGuardMode: "strict",
|
|
103
|
-
tddEnforcement: "strict",
|
|
104
|
-
gitHookGuards: true,
|
|
105
|
-
defaultTrack: overrides.defaultTrack ?? "standard",
|
|
106
|
-
languageRulePacks: overrides.languageRulePacks ?? [...LANGUAGE_RULE_PACKS]
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
70
|
export async function readConfig(projectRoot) {
|
|
111
71
|
const fullPath = configPath(projectRoot);
|
|
112
72
|
if (!(await exists(fullPath))) {
|
package/dist/doctor.js
CHANGED
|
@@ -484,7 +484,6 @@ export async function doctorChecks(projectRoot, options = {}) {
|
|
|
484
484
|
const hasCcCommand = content.includes("/cc");
|
|
485
485
|
const hasCcNext = content.includes("/cc-next");
|
|
486
486
|
const hasCcIdeate = content.includes("/cc-ideate");
|
|
487
|
-
const hasCcLearn = content.includes("/cc-learn");
|
|
488
487
|
const hasCcView = content.includes("/cc-view");
|
|
489
488
|
const hasCcOps = content.includes("/cc-ops");
|
|
490
489
|
const hasVerification = content.includes("Verification Discipline");
|
|
@@ -494,7 +493,6 @@ export async function doctorChecks(projectRoot, options = {}) {
|
|
|
494
493
|
&& hasCcCommand
|
|
495
494
|
&& hasCcNext
|
|
496
495
|
&& hasCcIdeate
|
|
497
|
-
&& hasCcLearn
|
|
498
496
|
&& hasCcView
|
|
499
497
|
&& hasCcOps
|
|
500
498
|
&& hasVerification
|
package/dist/harness-adapters.js
CHANGED
|
@@ -30,12 +30,6 @@ const UTILITY_SHIMS = [
|
|
|
30
30
|
skillFolder: "flow-view",
|
|
31
31
|
commandFile: "view.md"
|
|
32
32
|
},
|
|
33
|
-
{
|
|
34
|
-
fileName: "cc-learn.md",
|
|
35
|
-
command: "learn",
|
|
36
|
-
skillFolder: "learnings",
|
|
37
|
-
commandFile: "learn.md"
|
|
38
|
-
},
|
|
39
33
|
{
|
|
40
34
|
fileName: "cc-ops.md",
|
|
41
35
|
command: "ops",
|
|
@@ -43,6 +37,13 @@ const UTILITY_SHIMS = [
|
|
|
43
37
|
commandFile: "ops.md"
|
|
44
38
|
}
|
|
45
39
|
];
|
|
40
|
+
/**
|
|
41
|
+
* Shims that older cclaw versions installed as top-level slash commands but
|
|
42
|
+
* which we now treat as internal (skill-only, invoked by the agent, never
|
|
43
|
+
* typed by users). On sync/upgrade we proactively delete any stale file from
|
|
44
|
+
* harness command directories so `/cc-learn` etc. do not linger.
|
|
45
|
+
*/
|
|
46
|
+
const LEGACY_HARNESS_SHIMS = ["cc-learn.md"];
|
|
46
47
|
export function harnessShimFileNames() {
|
|
47
48
|
return ["cc.md", ...UTILITY_SHIMS.map((shim) => shim.fileName)];
|
|
48
49
|
}
|
|
@@ -150,9 +151,11 @@ When in doubt, prefer **non-trivial** — the quick track is opt-in and only saf
|
|
|
150
151
|
| \`/cc-next\` | **Progression.** Advances to the next stage when current is complete. |
|
|
151
152
|
| \`/cc-ideate\` | **Discovery mode.** Generates a ranked repo-improvement backlog before implementation. |
|
|
152
153
|
| \`/cc-view\` | **Read-only router.** Unified entry for status/tree/diff views. |
|
|
153
|
-
| \`/cc-learn\` | **Cross-cutting.** Capture or review project knowledge (append-only JSONL). |
|
|
154
154
|
| \`/cc-ops\` | **Operations router.** Unified entry for feature/tdd-log/retro/compound/archive/rewind actions. |
|
|
155
155
|
|
|
156
|
+
Knowledge capture and curation run automatically as part of stage completion
|
|
157
|
+
protocols via the internal \`learnings\` skill — no user-facing command.
|
|
158
|
+
|
|
156
159
|
**Stage order:** brainstorm > scope > design > spec > plan > tdd > review > ship.
|
|
157
160
|
\`/cc-next\` loads the right stage skill automatically. Gates must pass before handoff.
|
|
158
161
|
|
|
@@ -263,6 +266,15 @@ export async function syncHarnessShims(projectRoot, harnesses) {
|
|
|
263
266
|
for (const shim of UTILITY_SHIMS) {
|
|
264
267
|
await writeFileSafe(path.join(commandDir, shim.fileName), utilityShimContent(harness, shim.command, shim.skillFolder, shim.commandFile));
|
|
265
268
|
}
|
|
269
|
+
for (const legacy of LEGACY_HARNESS_SHIMS) {
|
|
270
|
+
const legacyPath = path.join(commandDir, legacy);
|
|
271
|
+
try {
|
|
272
|
+
await fs.unlink(legacyPath);
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
// fine — file may not exist (fresh install) or may be on read-only FS
|
|
276
|
+
}
|
|
277
|
+
}
|
|
266
278
|
}
|
|
267
279
|
await syncAgentFiles(projectRoot);
|
|
268
280
|
await syncAgentsMd(projectRoot, harnesses);
|
package/dist/install.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { FlowTrack, HarnessId
|
|
1
|
+
import type { FlowTrack, HarnessId } from "./types.js";
|
|
2
2
|
export interface InitOptions {
|
|
3
3
|
projectRoot: string;
|
|
4
4
|
harnesses?: HarnessId[];
|
|
5
5
|
track?: FlowTrack;
|
|
6
|
-
/** When set, pre-fills config defaults from the named profile before applying flag overrides. */
|
|
7
|
-
profile?: InitProfile;
|
|
8
6
|
}
|
|
9
7
|
export declare function initCclaw(options: InitOptions): Promise<void>;
|
|
10
8
|
export declare function syncCclaw(projectRoot: string): Promise<void>;
|
|
@@ -15,8 +13,8 @@ export declare function syncCclaw(projectRoot: string): Promise<void>;
|
|
|
15
13
|
* `promptGuardMode`, `tddEnforcement`, `gitHookGuards`, `languageRulePacks`,
|
|
16
14
|
* and `trackHeuristics` are preserved verbatim from the existing config.
|
|
17
15
|
*
|
|
18
|
-
* For an explicit reset
|
|
19
|
-
*
|
|
16
|
+
* For an explicit reset, run `cclaw-cli uninstall && cclaw-cli init`
|
|
17
|
+
* (after optionally archiving the current run via `/cc-ops archive`).
|
|
20
18
|
*/
|
|
21
19
|
export declare function upgradeCclaw(projectRoot: string): Promise<void>;
|
|
22
20
|
export declare function uninstallCclaw(projectRoot: string): Promise<void>;
|
package/dist/install.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import { CCLAW_VERSION, COMMAND_FILE_ORDER, FLOW_VERSION, REQUIRED_DIRS, RUNTIME_ROOT } from "./constants.js";
|
|
6
|
-
import { writeConfig, createDefaultConfig,
|
|
6
|
+
import { writeConfig, createDefaultConfig, readConfig, configPath } from "./config.js";
|
|
7
7
|
import { commandContract } from "./content/contracts.js";
|
|
8
8
|
import { contextModeFiles, createInitialContextModeState } from "./content/contexts.js";
|
|
9
9
|
import { learnSkillMarkdown, learnCommandContract } from "./content/learnings.js";
|
|
@@ -1088,12 +1088,7 @@ async function materializeRuntime(projectRoot, config, forceStateReset) {
|
|
|
1088
1088
|
await ensureGitignore(projectRoot);
|
|
1089
1089
|
}
|
|
1090
1090
|
export async function initCclaw(options) {
|
|
1091
|
-
const config = options.
|
|
1092
|
-
? createProfileConfig(options.profile, {
|
|
1093
|
-
harnesses: options.harnesses,
|
|
1094
|
-
defaultTrack: options.track
|
|
1095
|
-
})
|
|
1096
|
-
: createDefaultConfig(options.harnesses, options.track);
|
|
1091
|
+
const config = createDefaultConfig(options.harnesses, options.track);
|
|
1097
1092
|
await writeConfig(options.projectRoot, config);
|
|
1098
1093
|
await materializeRuntime(options.projectRoot, config, true);
|
|
1099
1094
|
}
|
|
@@ -1111,8 +1106,8 @@ export async function syncCclaw(projectRoot) {
|
|
|
1111
1106
|
* `promptGuardMode`, `tddEnforcement`, `gitHookGuards`, `languageRulePacks`,
|
|
1112
1107
|
* and `trackHeuristics` are preserved verbatim from the existing config.
|
|
1113
1108
|
*
|
|
1114
|
-
* For an explicit reset
|
|
1115
|
-
*
|
|
1109
|
+
* For an explicit reset, run `cclaw-cli uninstall && cclaw-cli init`
|
|
1110
|
+
* (after optionally archiving the current run via `/cc-ops archive`).
|
|
1116
1111
|
*/
|
|
1117
1112
|
export async function upgradeCclaw(projectRoot) {
|
|
1118
1113
|
const existing = await readConfig(projectRoot);
|
package/dist/types.d.ts
CHANGED
|
@@ -15,18 +15,6 @@ export type FlowTrack = (typeof FLOW_TRACKS)[number];
|
|
|
15
15
|
export declare const TRACK_STAGES: Record<FlowTrack, readonly FlowStage[]>;
|
|
16
16
|
export declare const HARNESS_IDS: readonly ["claude", "cursor", "opencode", "codex"];
|
|
17
17
|
export type HarnessId = (typeof HARNESS_IDS)[number];
|
|
18
|
-
/**
|
|
19
|
-
* Init profiles pre-fill `cclaw init` flags for common install shapes.
|
|
20
|
-
*
|
|
21
|
-
* - `minimal` — single-harness (claude), medium track default, no git hook guards. For solo
|
|
22
|
-
* contributors who still want brainstorm/spec/plan rigor without full scope+design overhead.
|
|
23
|
-
* - `standard` — default harness set, standard track, no git hook guards, advisory guards.
|
|
24
|
-
* Matches the pre-profile default behavior.
|
|
25
|
-
* - `full` — default harness set, standard track, git hook guards on, strict prompt guards.
|
|
26
|
-
* For teams that want every safety rail on.
|
|
27
|
-
*/
|
|
28
|
-
export declare const INIT_PROFILES: readonly ["minimal", "standard", "full"];
|
|
29
|
-
export type InitProfile = (typeof INIT_PROFILES)[number];
|
|
30
18
|
/**
|
|
31
19
|
* Opt-in language rule packs. When enabled in config, `cclaw sync` installs the
|
|
32
20
|
* corresponding utility skill so the meta-skill router can load language-specific
|
package/dist/types.js
CHANGED
|
@@ -25,17 +25,6 @@ export const TRACK_STAGES = {
|
|
|
25
25
|
quick: ["spec", "tdd", "review", "ship"]
|
|
26
26
|
};
|
|
27
27
|
export const HARNESS_IDS = ["claude", "cursor", "opencode", "codex"];
|
|
28
|
-
/**
|
|
29
|
-
* Init profiles pre-fill `cclaw init` flags for common install shapes.
|
|
30
|
-
*
|
|
31
|
-
* - `minimal` — single-harness (claude), medium track default, no git hook guards. For solo
|
|
32
|
-
* contributors who still want brainstorm/spec/plan rigor without full scope+design overhead.
|
|
33
|
-
* - `standard` — default harness set, standard track, no git hook guards, advisory guards.
|
|
34
|
-
* Matches the pre-profile default behavior.
|
|
35
|
-
* - `full` — default harness set, standard track, git hook guards on, strict prompt guards.
|
|
36
|
-
* For teams that want every safety rail on.
|
|
37
|
-
*/
|
|
38
|
-
export const INIT_PROFILES = ["minimal", "standard", "full"];
|
|
39
28
|
/**
|
|
40
29
|
* Opt-in language rule packs. When enabled in config, `cclaw sync` installs the
|
|
41
30
|
* corresponding utility skill so the meta-skill router can load language-specific
|