cclaw-cli 0.28.0 → 0.30.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 +326 -94
- package/dist/cli.js +3 -28
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +34 -1
- package/dist/content/start-command.d.ts +3 -2
- package/dist/content/start-command.js +5 -4
- package/dist/install.d.ts +10 -0
- package/dist/install.js +19 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,131 +1,363 @@
|
|
|
1
1
|
# cclaw
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
D --> E[Spec]
|
|
19
|
-
E --> F[Plan]
|
|
20
|
-
F --> G[TDD]
|
|
21
|
-
G --> H[Review]
|
|
22
|
-
H --> I[Ship]
|
|
23
|
-
```
|
|
3
|
+
**Install once, ship every time.** cclaw is an installer-first workflow
|
|
4
|
+
runtime that gives your AI coding agent one inspectable path from idea to
|
|
5
|
+
shipped PR:
|
|
6
|
+
|
|
7
|
+
> **brainstorm → scope → design → spec → plan → tdd → review → ship**
|
|
8
|
+
|
|
9
|
+
Every stage has real gates the agent cannot skip, every decision leaves a
|
|
10
|
+
file-backed audit trail, and the same six slash commands work across
|
|
11
|
+
Claude Code, Cursor, OpenCode, and OpenAI Codex.
|
|
12
|
+
|
|
13
|
+
You install cclaw **once** from the terminal, then everything happens
|
|
14
|
+
inside your harness — no hidden control plane, no background daemon, no
|
|
15
|
+
operational knobs to memorise.
|
|
16
|
+
|
|
17
|
+
---
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
## Who this is for
|
|
20
|
+
|
|
21
|
+
- Solo builders who want **shipped outcomes** instead of endless chat.
|
|
22
|
+
- Engineering teams that need a **single, repeatable path** for AI-assisted
|
|
23
|
+
changes across multiple harnesses and languages.
|
|
24
|
+
- Staff engineers and tech leads who want **enforceable discipline**:
|
|
25
|
+
locked-in decisions, no placeholders, mandatory TDD, traceable plans.
|
|
26
|
+
- Maintainers of AI agents/skills who want **measurable prompt engineering**
|
|
27
|
+
via the built-in eval harness.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## How it works
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────┐ ┌──────┐ ┌────────┐ ┌──────┐ ┌──────┐
|
|
35
|
+
│ Idea │ → │ /cc │ → │Classify│ → │Track │ → │Stages│
|
|
36
|
+
└─────────┘ └──────┘ └────────┘ └──────┘ └──┬───┘
|
|
37
|
+
│
|
|
38
|
+
┌───────────────────────────────────────────────┘
|
|
39
|
+
▼
|
|
40
|
+
brainstorm → scope → design → spec → plan → tdd → review → ship
|
|
41
|
+
│ │ │ │ │ │ │ │
|
|
42
|
+
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
43
|
+
01.md 02.md 03.md 04.md 05.md 06.md 07.md 08.md
|
|
44
|
+
│
|
|
45
|
+
└──── gates + subagents + knowledge capture happen at every step
|
|
37
46
|
```
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
Every stage reads and writes real files under `.cclaw/`. `flow-state.json`
|
|
49
|
+
holds the single source of truth for "where are we"; `knowledge.jsonl`
|
|
50
|
+
accumulates reusable lessons **throughout** the flow, not only at the end;
|
|
51
|
+
stage artifacts live under `.cclaw/artifacts/` until the feature is
|
|
52
|
+
archived.
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
```
|
|
55
|
+
You ──► /cc <idea>
|
|
56
|
+
│
|
|
57
|
+
▼
|
|
58
|
+
harness loads stage contract + HARD-GATE
|
|
59
|
+
│
|
|
60
|
+
▼
|
|
61
|
+
cclaw reads state + knowledge, guides execution
|
|
62
|
+
│
|
|
63
|
+
▼
|
|
64
|
+
artifacts written, checkpoint saved
|
|
65
|
+
│
|
|
66
|
+
▼
|
|
67
|
+
next stage is explicit in flow-state.json
|
|
68
|
+
```
|
|
47
69
|
|
|
48
|
-
|
|
70
|
+
---
|
|
49
71
|
|
|
50
|
-
|
|
51
|
-
|---|---|---|
|
|
52
|
-
| **Superpowers** | Rich skill ecosystem and mature workflows | Smaller operational surface, tighter stage discipline, faster onboarding for teams that want one default path |
|
|
53
|
-
| **G-Stack** | Deep multi-role orchestration (CEO/design/eng/release style) | Less overhead, fewer moving parts, easier to keep deterministic in day-to-day product delivery |
|
|
54
|
-
| **Everything Claude Code** | Broad command catalog and flexible patterns | Lower command entropy, clearer defaults, less decision fatigue for regular execution |
|
|
72
|
+
## 30-second install
|
|
55
73
|
|
|
56
|
-
|
|
74
|
+
```bash
|
|
75
|
+
npx cclaw-cli
|
|
76
|
+
```
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
Interactive setup will pick which harnesses to install into. For CI or
|
|
79
|
+
scripted installs:
|
|
59
80
|
|
|
60
81
|
```bash
|
|
61
|
-
npx cclaw-cli init
|
|
82
|
+
npx cclaw-cli init --harnesses=claude,cursor --no-interactive
|
|
62
83
|
```
|
|
63
84
|
|
|
64
|
-
|
|
85
|
+
That's the entire CLI interaction. Everything after install happens
|
|
86
|
+
inside your harness (Claude Code, Cursor, OpenCode, or Codex).
|
|
87
|
+
|
|
88
|
+
### What gets generated
|
|
65
89
|
|
|
66
90
|
```text
|
|
67
|
-
/
|
|
68
|
-
/
|
|
91
|
+
.cclaw/
|
|
92
|
+
├── commands/ # stage + utility command contracts (markdown)
|
|
93
|
+
├── skills/ # stage + utility skills loaded by the harness
|
|
94
|
+
├── contexts/ # cross-cutting context modes (research, debugging, …)
|
|
95
|
+
├── templates/ # artifact skeletons for each stage
|
|
96
|
+
├── rules/ # lint-style rules surfaced to the agent
|
|
97
|
+
├── adapters/ # per-harness translation notes
|
|
98
|
+
├── agents/ # subagent definitions (planner, reviewer, …)
|
|
99
|
+
├── hooks/ # harness-agnostic hook scripts
|
|
100
|
+
├── worktrees/ # isolated feature worktrees (power-user, via /cc-ops)
|
|
101
|
+
├── artifacts/ # active feature artifacts (00-idea.md → 09-retro.md)
|
|
102
|
+
├── runs/ # archived feature snapshots: YYYY-MM-DD-slug/
|
|
103
|
+
├── references/ # (optional) pinned copies of reference frameworks
|
|
104
|
+
├── evals/ # eval corpus, rubrics, baselines, reports
|
|
105
|
+
├── custom-skills/ # user-authored skills (never overwritten)
|
|
106
|
+
├── state/ # flow-state.json + delegation-log.json + activity
|
|
107
|
+
└── knowledge.jsonl # append-only, strict-schema lessons + patterns
|
|
69
108
|
```
|
|
70
109
|
|
|
71
|
-
|
|
110
|
+
Plus harness-specific shims:
|
|
72
111
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
112
|
+
- `.claude/commands/cc*.md` + `.claude/hooks/hooks.json`
|
|
113
|
+
- `.cursor/commands/cc*.md` + `.cursor/hooks.json` + `.cursor/rules/cclaw-workflow.mdc`
|
|
114
|
+
- `.opencode/commands/cc*.md` + `.opencode/plugins/cclaw-plugin.mjs`
|
|
115
|
+
- `.codex/commands/cc*.md` + `.codex/hooks.json`
|
|
116
|
+
- `AGENTS.md` with a managed routing block
|
|
117
|
+
|
|
118
|
+
`.cclaw/config.yaml` holds every tunable key (prompt guard strictness,
|
|
119
|
+
TDD enforcement, git-hook guards, language rule packs, track heuristics).
|
|
120
|
+
Edit it directly — `cclaw-cli upgrade` preserves your changes.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## The four commands you actually use
|
|
125
|
+
|
|
126
|
+
All four appear as slash commands in every supported harness. This is the
|
|
127
|
+
top-level user surface — everything else is either automatic or happens
|
|
128
|
+
inside `/cc-ops` subcommands.
|
|
129
|
+
|
|
130
|
+
| Command | What it does |
|
|
131
|
+
|---|---|
|
|
132
|
+
| **`/cc <idea>`** | Classify the task, discover origin docs (`docs/prd/**`, ADRs, root `PRD.md`, …), sniff the stack, recommend a track, then start the first stage of that track. `/cc` without arguments resumes the current flow. |
|
|
133
|
+
| **`/cc-next`** | The one progression primitive. Reads `flow-state.json`, checks gates + mandatory subagent delegations, and either resumes the current stage or advances to the next. `/cc-next` in a new session is how you **resume**. |
|
|
134
|
+
| **`/cc-ideate`** | Repository improvement discovery. Scans for TODOs, flaky tests, oversized modules, docs drift, and recurring knowledge-store lessons; returns a ranked backlog before you commit to a specific feature. |
|
|
135
|
+
| **`/cc-view`** | Read-only flow visibility. `/cc-view status` (default), `/cc-view tree`, `/cc-view diff` (baseline delta map). Never mutates state. |
|
|
136
|
+
|
|
137
|
+
> Power-user surface: `/cc-ops` is an operational router for manual
|
|
138
|
+
> overrides (rewind a stale stage, manage parallel features, re-run a
|
|
139
|
+
> compound pass). `/cc-learn` is the strict-schema knowledge writer —
|
|
140
|
+
> agents call it automatically from completion protocols; you rarely
|
|
141
|
+
> invoke it by hand.
|
|
142
|
+
|
|
143
|
+
### Example first-run
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
> /cc Add rate limiting to the public /api/v1/search endpoint
|
|
147
|
+
|
|
148
|
+
cclaw: Classifying task…
|
|
149
|
+
Class: software-medium
|
|
150
|
+
Discovered context: docs/rfcs/rate-limit-strategy.md (rate-limit policy draft)
|
|
151
|
+
Stack: node 20.10.0 (pnpm), fastify 4.26, redis 7
|
|
152
|
+
Recommended track: medium (matched triggers: "add endpoint")
|
|
153
|
+
Override? (A) keep medium (B) switch track (C) cancel
|
|
154
|
+
> A
|
|
155
|
+
cclaw: Persisting flow-state.json, seeding 00-idea.md, entering brainstorm…
|
|
79
156
|
```
|
|
80
157
|
|
|
81
|
-
|
|
158
|
+
After this `flow-state.json` contains:
|
|
82
159
|
|
|
83
|
-
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"currentStage": "brainstorm",
|
|
163
|
+
"track": "medium",
|
|
164
|
+
"skippedStages": ["scope", "design"],
|
|
165
|
+
"stageGateCatalog": { "brainstorm": { "passed": [], "blocked": [] } },
|
|
166
|
+
"completedStages": []
|
|
167
|
+
}
|
|
168
|
+
```
|
|
84
169
|
|
|
85
|
-
|
|
170
|
+
And `00-idea.md` starts with:
|
|
86
171
|
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
172
|
+
```text
|
|
173
|
+
Class: software-medium
|
|
174
|
+
Track: medium (matched: "add endpoint")
|
|
175
|
+
Stack: node 20.10.0, fastify 4.26, redis 7
|
|
176
|
+
|
|
177
|
+
## Discovered context
|
|
178
|
+
|
|
179
|
+
- docs/rfcs/rate-limit-strategy.md — rate-limit policy draft (Q2 2026)
|
|
180
|
+
|
|
181
|
+
## User prompt
|
|
182
|
+
|
|
183
|
+
Add rate limiting to the public /api/v1/search endpoint
|
|
96
184
|
```
|
|
97
185
|
|
|
98
|
-
|
|
186
|
+
No magic. No ambiguity about where you are.
|
|
99
187
|
|
|
100
|
-
|
|
101
|
-
- `Release Publish` validates the build, publishes to npm (if version is new), publishes an existing release draft or creates a new GitHub Release, and uploads `.tgz` + plugin manifest artifacts.
|
|
102
|
-
- `Release Package` remains available for manual release/event-driven packaging flows.
|
|
103
|
-
- To trigger a new publish, bump `package.json` version in the PR before merge.
|
|
188
|
+
---
|
|
104
189
|
|
|
105
|
-
|
|
190
|
+
## The eight stages, and the three tracks
|
|
106
191
|
|
|
107
|
-
|
|
192
|
+
cclaw has eight stages, but a single prompt rarely needs all of them.
|
|
193
|
+
`/cc` picks a **track** up front so the flow matches the task.
|
|
108
194
|
|
|
109
|
-
|
|
195
|
+
| Track | Path | Typical trigger |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| **quick** | `spec → tdd → review → ship` | `bug`, `hotfix`, `typo`, `rename`, `bump`, `docs only`, one-liners |
|
|
198
|
+
| **medium** | `brainstorm → spec → plan → tdd → review → ship` | `add endpoint`, `add field`, `extend existing`, `wire integration` |
|
|
199
|
+
| **standard** _(default)_ | all 8 stages | `new feature`, `refactor`, `migration`, `platform`, `schema`, `architecture` |
|
|
110
200
|
|
|
111
|
-
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
201
|
+
Each stage produces a dated artifact under `.cclaw/artifacts/`:
|
|
202
|
+
`00-idea.md` (seed) and `01-brainstorm.md` through `08-ship.md`
|
|
203
|
+
(plus `09-retro.md` at automatic closeout — see below).
|
|
204
|
+
|
|
205
|
+
### Track heuristics are configurable
|
|
206
|
+
|
|
207
|
+
Every team has its own vocabulary. Override the built-in trigger lists in
|
|
208
|
+
`.cclaw/config.yaml`:
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
trackHeuristics:
|
|
212
|
+
priority: [standard, medium, quick]
|
|
213
|
+
fallback: standard
|
|
214
|
+
tracks:
|
|
215
|
+
quick:
|
|
216
|
+
triggers: [hotfix, rollback, prod-incident]
|
|
217
|
+
veto: [schema, migration] # never route quick even if one trigger hits
|
|
218
|
+
standard:
|
|
219
|
+
patterns:
|
|
220
|
+
- "^epic:"
|
|
221
|
+
- "platform-team|core-infra"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`priority` + `veto` + regex `patterns` give you deterministic routing
|
|
225
|
+
without touching any code.
|
|
226
|
+
|
|
227
|
+
### Mid-flow reclassification
|
|
228
|
+
|
|
229
|
+
If you seed a task as `quick` and evidence in spec shows it actually needs a
|
|
230
|
+
schema migration, cclaw **stops and asks** before quietly advancing.
|
|
231
|
+
Reclassification is append-only: the old decision stays in history.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Guardrails that ship in the box
|
|
236
|
+
|
|
237
|
+
These are the things that make cclaw "enterprise-strong" without turning
|
|
238
|
+
it into ceremony:
|
|
239
|
+
|
|
240
|
+
- **Locked decisions (D-XX IDs).** Scope decisions are numbered and must
|
|
241
|
+
reappear in plan + TDD artifacts. The artifact linter catches any
|
|
242
|
+
silent drift.
|
|
243
|
+
- **No placeholders.** `TBD`, `TODO`, `similar to task`, and "static for
|
|
244
|
+
now"-style scope reduction are flagged before a stage completes.
|
|
245
|
+
- **Stale-stage detection.** If an upstream artifact changes after a
|
|
246
|
+
downstream stage is already complete, cclaw marks the downstream stage
|
|
247
|
+
stale and refuses to advance until you re-run it (or explicitly
|
|
248
|
+
acknowledge via a manual override).
|
|
249
|
+
- **Mandatory subagent delegation** at TDD, with per-harness waivers.
|
|
250
|
+
- **Turn Announce Discipline.** Every stage entry/exit emits a visible
|
|
251
|
+
line so users can see what the agent is doing, not just what it says.
|
|
252
|
+
- **Extracted protocols.** Decision, Completion, and Ethos protocols live
|
|
253
|
+
in a single place (`.cclaw/contexts/`), so every skill speaks the same
|
|
254
|
+
dialect.
|
|
255
|
+
- **Knowledge capture throughout the flow.** Every stage completion
|
|
256
|
+
protocol can emit entries to `knowledge.jsonl` — not only retro. Strict
|
|
257
|
+
JSONL schema keeps it machine-queryable.
|
|
258
|
+
- **Automatic integrity checks.** Runtime health is verified on every
|
|
259
|
+
stage transition — no command you need to remember to run.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## TDD that actually runs
|
|
264
|
+
|
|
265
|
+
The `tdd` stage is not prose guidance. It requires:
|
|
266
|
+
|
|
267
|
+
- an explicit **RED** test run (logged to `.cclaw/state/stage-activity.jsonl`)
|
|
268
|
+
- a mandatory **`test-author`** subagent dispatch (logged to
|
|
269
|
+
`.cclaw/state/delegation-log.json`)
|
|
270
|
+
- a **GREEN** full-suite run before exit
|
|
271
|
+
- optional **REFACTOR** pass with coverage preservation
|
|
272
|
+
|
|
273
|
+
`/cc-next` will not advance past `tdd` until the delegation log shows the
|
|
274
|
+
subagent as `completed` or explicitly `waived` (for harnesses without
|
|
275
|
+
native subagent dispatch, such as Codex — see
|
|
276
|
+
[Harness support](#harness-support)).
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Ship and closeout
|
|
281
|
+
|
|
282
|
+
Shipping writes `08-ship.md` and then closes out the feature through a
|
|
283
|
+
guided three-step sequence:
|
|
284
|
+
|
|
285
|
+
1. **Retro** drafts `09-retro.md` from flow artifacts and the delegation
|
|
286
|
+
log; you review and accept.
|
|
287
|
+
2. **Compound pass** promotes repeated knowledge entries (frequency ≥ 2,
|
|
288
|
+
maturity = stable) into first-class rules or skills.
|
|
289
|
+
3. **Archive** moves artifacts to `.cclaw/runs/YYYY-MM-DD-<slug>/` and
|
|
290
|
+
resets `flow-state.json`.
|
|
291
|
+
|
|
292
|
+
Retro is not optional — archive is gated on retro completion so you can't
|
|
293
|
+
silently lose the learning pass.
|
|
294
|
+
|
|
295
|
+
> **Coming next:** cclaw will chain these three steps automatically from
|
|
296
|
+
> `ship` (one structured `edit`/`accept`/`skip` ask, resumable if the
|
|
297
|
+
> session ends). Tracked as the v0.32 closeout-automation wave.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Harness support
|
|
302
|
+
|
|
303
|
+
cclaw is honest about which harnesses give you full automation and which
|
|
304
|
+
need small manual bridges. See
|
|
305
|
+
[`docs/harnesses.md`](./docs/harnesses.md) for the full matrix.
|
|
306
|
+
|
|
307
|
+
| Harness | Subagent dispatch | Hook surface | Structured ask | Status |
|
|
308
|
+
|---|---|---|---|---|
|
|
309
|
+
| Claude Code | native | full | `AskUserQuestion` | full parity |
|
|
310
|
+
| Cursor | partial | full | `AskQuestion` | parity gap: subagent dispatch |
|
|
311
|
+
| OpenCode | partial | plugin | plain-text | parity gap: plugin hooks |
|
|
312
|
+
| OpenAI Codex | none (waiver) | full | plain-text | parity gap: no subagent |
|
|
313
|
+
|
|
314
|
+
Capability gaps are captured in `.cclaw/state/harness-gaps.json`. Where
|
|
315
|
+
native dispatch is missing, cclaw emits a **structured waiver** rather
|
|
316
|
+
than pretending the delegation happened. Closing these gaps is an
|
|
317
|
+
ongoing kinetic effort — see the harness tracking doc above.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Eval-driven prompt engineering
|
|
322
|
+
|
|
323
|
+
cclaw ships with `cclaw-cli eval` — a three-tier regression harness for
|
|
324
|
+
the skills and contracts the runtime generates. Use it when you change a
|
|
325
|
+
stage skill, tweak a prompt, or swap a model.
|
|
326
|
+
|
|
327
|
+
Works with any OpenAI-compatible endpoint — Zhipu AI GLM, OpenAI, Together,
|
|
328
|
+
self-hosted vLLM — via three environment variables:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
CCLAW_EVAL_API_KEY=...
|
|
332
|
+
CCLAW_EVAL_BASE_URL=https://api.z.ai/api/coding/paas/v4 # default
|
|
333
|
+
CCLAW_EVAL_MODEL=glm-5.1 # default
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Full details, corpus format, and the eval contract live in
|
|
337
|
+
[`docs/evals.md`](./docs/evals.md).
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## CLI reference
|
|
342
|
+
|
|
343
|
+
The CLI is deliberately small. Everything operational happens inside
|
|
344
|
+
your harness.
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npx cclaw-cli # launches interactive setup (or prints
|
|
348
|
+
# a one-line status hint if already installed)
|
|
349
|
+
npx cclaw-cli upgrade # refresh generated files; preserves .cclaw/config.yaml
|
|
350
|
+
npx cclaw-cli uninstall # remove .cclaw + generated harness shims
|
|
351
|
+
npx cclaw-cli eval … # maintainer surface (see docs/evals.md)
|
|
352
|
+
npx cclaw-cli --version
|
|
122
353
|
```
|
|
123
354
|
|
|
124
|
-
|
|
355
|
+
For CI or scripted installs, `cclaw-cli init --harnesses=<list>
|
|
356
|
+
--no-interactive` is the non-interactive form. All other tunables
|
|
357
|
+
(prompt-guard strictness, TDD enforcement, language rule packs, track
|
|
358
|
+
heuristics) are set by editing `.cclaw/config.yaml` directly.
|
|
125
359
|
|
|
126
|
-
|
|
127
|
-
per-harness tier/capability matrix, install surface, and lifecycle details live in
|
|
128
|
-
[docs/harnesses.md](./docs/harnesses.md).
|
|
360
|
+
---
|
|
129
361
|
|
|
130
362
|
## License
|
|
131
363
|
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createReadStream,
|
|
2
|
+
import { createReadStream, 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";
|
|
@@ -11,7 +11,7 @@ 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
|
-
import { RUNTIME_ROOT } from "./constants.js";
|
|
14
|
+
import { CCLAW_VERSION, RUNTIME_ROOT } from "./constants.js";
|
|
15
15
|
import { createDefaultConfig, createProfileConfig } from "./config.js";
|
|
16
16
|
import { detectHarnesses } from "./init-detect.js";
|
|
17
17
|
import { HARNESS_ADAPTERS } from "./harness-adapters.js";
|
|
@@ -118,31 +118,6 @@ Docs: https://github.com/zuevrs/cclaw
|
|
|
118
118
|
Issues: https://github.com/zuevrs/cclaw/issues
|
|
119
119
|
`;
|
|
120
120
|
}
|
|
121
|
-
function cliPackageVersion() {
|
|
122
|
-
try {
|
|
123
|
-
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
124
|
-
const candidates = [
|
|
125
|
-
path.resolve(here, "../package.json"),
|
|
126
|
-
path.resolve(here, "../../package.json")
|
|
127
|
-
];
|
|
128
|
-
for (const candidate of candidates) {
|
|
129
|
-
try {
|
|
130
|
-
const raw = readFileSync(candidate, "utf8");
|
|
131
|
-
const parsed = JSON.parse(raw);
|
|
132
|
-
if (parsed.name === "cclaw-cli" && typeof parsed.version === "string") {
|
|
133
|
-
return parsed.version;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch {
|
|
142
|
-
// fall through
|
|
143
|
-
}
|
|
144
|
-
return "unknown";
|
|
145
|
-
}
|
|
146
121
|
function parseHarnesses(raw) {
|
|
147
122
|
const requested = raw
|
|
148
123
|
.split(",")
|
|
@@ -800,7 +775,7 @@ async function runCommand(parsed, ctx) {
|
|
|
800
775
|
return 0;
|
|
801
776
|
}
|
|
802
777
|
if (parsed.showVersion) {
|
|
803
|
-
ctx.stdout.write(`cclaw ${
|
|
778
|
+
ctx.stdout.write(`cclaw ${CCLAW_VERSION}\n`);
|
|
804
779
|
return 0;
|
|
805
780
|
}
|
|
806
781
|
const command = parsed.command;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FlowStage, HarnessId } from "./types.js";
|
|
2
2
|
/** Hidden runtime directory at project root (dot-prefixed). */
|
|
3
3
|
export declare const RUNTIME_ROOT = ".cclaw";
|
|
4
|
-
export declare const CCLAW_VERSION
|
|
4
|
+
export declare const CCLAW_VERSION: string;
|
|
5
5
|
export declare const FLOW_VERSION = "1.0.0";
|
|
6
6
|
export declare const DEFAULT_HARNESSES: HarnessId[];
|
|
7
7
|
/**
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
1
4
|
/** Hidden runtime directory at project root (dot-prefixed). */
|
|
2
5
|
export const RUNTIME_ROOT = ".cclaw";
|
|
3
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Resolved once at module load from the cclaw-cli package.json. Walking a
|
|
8
|
+
* short list of candidates keeps the helper working in both the compiled
|
|
9
|
+
* `dist/` layout and the in-repo `src/` layout (tests, ts-node).
|
|
10
|
+
*/
|
|
11
|
+
function readPackageVersion() {
|
|
12
|
+
try {
|
|
13
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const candidates = [
|
|
15
|
+
path.resolve(here, "../package.json"),
|
|
16
|
+
path.resolve(here, "../../package.json")
|
|
17
|
+
];
|
|
18
|
+
for (const candidate of candidates) {
|
|
19
|
+
try {
|
|
20
|
+
const raw = readFileSync(candidate, "utf8");
|
|
21
|
+
const parsed = JSON.parse(raw);
|
|
22
|
+
if (parsed.name === "cclaw-cli" && typeof parsed.version === "string") {
|
|
23
|
+
return parsed.version;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Fall through to dev fallback.
|
|
33
|
+
}
|
|
34
|
+
return "0.0.0-dev";
|
|
35
|
+
}
|
|
36
|
+
export const CCLAW_VERSION = readPackageVersion();
|
|
4
37
|
export const FLOW_VERSION = "1.0.0";
|
|
5
38
|
export const DEFAULT_HARNESSES = [
|
|
6
39
|
"claude",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Command contract for /cc — the unified entry point.
|
|
3
|
-
* No args → behaves like /cc-next (resume or start
|
|
4
|
-
* With prompt →
|
|
3
|
+
* No args → behaves like /cc-next (resume or start the flow at its first stage).
|
|
4
|
+
* With prompt → classifies the idea, selects a track, and starts the first
|
|
5
|
+
* stage of that track (brainstorm for medium/standard, spec for quick).
|
|
5
6
|
*/
|
|
6
7
|
export declare function startCommandContract(): string;
|
|
7
8
|
/**
|
|
@@ -6,8 +6,9 @@ function flowStatePath() {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Command contract for /cc — the unified entry point.
|
|
9
|
-
* No args → behaves like /cc-next (resume or start
|
|
10
|
-
* With prompt →
|
|
9
|
+
* No args → behaves like /cc-next (resume or start the flow at its first stage).
|
|
10
|
+
* With prompt → classifies the idea, selects a track, and starts the first
|
|
11
|
+
* stage of that track (brainstorm for medium/standard, spec for quick).
|
|
11
12
|
*/
|
|
12
13
|
export function startCommandContract() {
|
|
13
14
|
const flowPath = flowStatePath();
|
|
@@ -111,7 +112,7 @@ export function startCommandSkillMarkdown() {
|
|
|
111
112
|
const flowPath = flowStatePath();
|
|
112
113
|
return `---
|
|
113
114
|
name: ${START_SKILL_NAME}
|
|
114
|
-
description: "Unified entry point for the cclaw flow. No args = resume/next. With prompt = start
|
|
115
|
+
description: "Unified entry point for the cclaw flow. No args = resume/next. With prompt = classify, pick track, start its first stage."
|
|
115
116
|
---
|
|
116
117
|
|
|
117
118
|
# /cc — Flow Entry Point
|
|
@@ -121,7 +122,7 @@ description: "Unified entry point for the cclaw flow. No args = resume/next. Wit
|
|
|
121
122
|
\`/cc\` is the **starting command** for cclaw. It intelligently routes:
|
|
122
123
|
|
|
123
124
|
- **No arguments** → acts as \`/cc-next\` (resume current stage or advance to next)
|
|
124
|
-
- **With a prompt** →
|
|
125
|
+
- **With a prompt** → classifies the task, picks a track (quick/medium/standard), and starts the **first stage of that track** (not always brainstorm — e.g. the \`quick\` track starts at \`spec\`)
|
|
125
126
|
|
|
126
127
|
## HARD-GATE
|
|
127
128
|
|
package/dist/install.d.ts
CHANGED
|
@@ -8,5 +8,15 @@ export interface InitOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export declare function initCclaw(options: InitOptions): Promise<void>;
|
|
10
10
|
export declare function syncCclaw(projectRoot: string): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Refresh generated files in `.cclaw/` without touching user-authored
|
|
13
|
+
* artifacts, state, or custom config keys. Only the `version` + `flowVersion`
|
|
14
|
+
* stamps are rewritten so the on-disk config reflects the installed CLI;
|
|
15
|
+
* `promptGuardMode`, `tddEnforcement`, `gitHookGuards`, `languageRulePacks`,
|
|
16
|
+
* and `trackHeuristics` are preserved verbatim from the existing config.
|
|
17
|
+
*
|
|
18
|
+
* For an explicit reset to the default profile the user should reinstall via
|
|
19
|
+
* `cclaw init --profile=<id>` (after optionally archiving the current run).
|
|
20
|
+
*/
|
|
11
21
|
export declare function upgradeCclaw(projectRoot: string): Promise<void>;
|
|
12
22
|
export declare function uninstallCclaw(projectRoot: string): Promise<void>;
|
package/dist/install.js
CHANGED
|
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
|
-
import { COMMAND_FILE_ORDER, REQUIRED_DIRS, RUNTIME_ROOT } from "./constants.js";
|
|
5
|
+
import { CCLAW_VERSION, COMMAND_FILE_ORDER, FLOW_VERSION, REQUIRED_DIRS, RUNTIME_ROOT } from "./constants.js";
|
|
6
6
|
import { writeConfig, createDefaultConfig, createProfileConfig, readConfig, configPath } from "./config.js";
|
|
7
7
|
import { commandContract } from "./content/contracts.js";
|
|
8
8
|
import { contextModeFiles, createInitialContextModeState } from "./content/contexts.js";
|
|
@@ -1104,11 +1104,25 @@ export async function syncCclaw(projectRoot) {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
await materializeRuntime(projectRoot, config, false);
|
|
1106
1106
|
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Refresh generated files in `.cclaw/` without touching user-authored
|
|
1109
|
+
* artifacts, state, or custom config keys. Only the `version` + `flowVersion`
|
|
1110
|
+
* stamps are rewritten so the on-disk config reflects the installed CLI;
|
|
1111
|
+
* `promptGuardMode`, `tddEnforcement`, `gitHookGuards`, `languageRulePacks`,
|
|
1112
|
+
* and `trackHeuristics` are preserved verbatim from the existing config.
|
|
1113
|
+
*
|
|
1114
|
+
* For an explicit reset to the default profile the user should reinstall via
|
|
1115
|
+
* `cclaw init --profile=<id>` (after optionally archiving the current run).
|
|
1116
|
+
*/
|
|
1107
1117
|
export async function upgradeCclaw(projectRoot) {
|
|
1108
|
-
const
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1118
|
+
const existing = await readConfig(projectRoot);
|
|
1119
|
+
const upgraded = {
|
|
1120
|
+
...existing,
|
|
1121
|
+
version: CCLAW_VERSION,
|
|
1122
|
+
flowVersion: FLOW_VERSION
|
|
1123
|
+
};
|
|
1124
|
+
await writeConfig(projectRoot, upgraded);
|
|
1125
|
+
await materializeRuntime(projectRoot, upgraded, false);
|
|
1112
1126
|
}
|
|
1113
1127
|
function stripManagedHookCommands(value) {
|
|
1114
1128
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|