cherry-works 0.7.4 → 0.9.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 +63 -384
- package/dist/cw.js +2 -1
- package/dist/main.js +2735 -622
- package/dist/portal/main.js +9 -9
- package/dist/portal/styles.css +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,431 +1,110 @@
|
|
|
1
1
|
# Cherry Works
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
markdown files, and `cw` checks them, tests them and compiles them into the
|
|
5
|
-
files your coding agent actually reads.
|
|
3
|
+
Current version: **0.9.0**
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
.cw/charter/guide/no-any/index.md ──cw build──▶ CLAUDE.md
|
|
9
|
-
.cw/charter/sensor/lint/index.md .claude/rules/…
|
|
10
|
-
.cw/charter/posture/secrets/index.md .claude/settings.json (hooks, permissions)
|
|
11
|
-
… .claude/skills/…, .claude/agents/…
|
|
12
|
-
.mcp.json (cw mcp serve)
|
|
13
|
-
```
|
|
5
|
+
**Your team's way of working, written once for coding agents.**
|
|
14
6
|
|
|
15
|
-
|
|
7
|
+
Keep coding standards, workflows, tools and permissions in a **charter**:
|
|
8
|
+
small Markdown files you can review, test and share. Cherry Works compiles
|
|
9
|
+
them into the files **Claude Code** and **Codex** read.
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
usually end up as one long prompt file that nobody reviews and that falls out of
|
|
19
|
-
date. Cherry Works handles them the way you handle code:
|
|
11
|
+

|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
a guide, a sensor or a posture. Each kind says which fields it requires and
|
|
23
|
-
when it comes up.
|
|
24
|
-
- **One build.** `cw build` regenerates every file the agent reads from the
|
|
25
|
-
charter in one pass. Nothing is edited by hand, and a rule you delete
|
|
26
|
-
disappears from the output.
|
|
27
|
-
- **Checked and tested.** `cw doctor` names each broken file and says how to fix
|
|
28
|
-
it. `cw test` runs cases that pin down which rule must come up for which file
|
|
29
|
-
or event. It runs no command and needs no agent, so the result is the same on
|
|
30
|
-
every machine.
|
|
31
|
-
- **Shared without copying.** You can install another team's charter as a vendor
|
|
32
|
-
source. It is pinned to a version and committed with your code, and it never
|
|
33
|
-
silently overrides your own rules.
|
|
13
|
+
## Why use it?
|
|
34
14
|
|
|
35
|
-
|
|
15
|
+
- **Keep instructions maintainable.** One rule or workflow per file, with an
|
|
16
|
+
explicit purpose and scope.
|
|
17
|
+
- **Build for your agent.** Generate instructions, skills and supported host
|
|
18
|
+
settings from the same source.
|
|
19
|
+
- **Check what you ship.** Validate the charter, test which rules apply, and
|
|
20
|
+
evaluate whether a real agent follows them.
|
|
21
|
+
- **Share your team's practices.** Publish a vendor charter and install a
|
|
22
|
+
versioned copy in other repositories.
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
- git
|
|
39
|
-
- A supported agent. Today that is [Claude Code](https://claude.com/claude-code).
|
|
40
|
-
`cw` always writes a neutral output under `.cw/out/` as well.
|
|
24
|
+
## Get started
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
You need **Node.js 22+**, **Git**, and Claude Code or Codex.
|
|
43
27
|
|
|
44
28
|
```bash
|
|
45
29
|
npm install -g cherry-works
|
|
46
|
-
cw --help
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
To run it once without installing anything, use `npx cherry-works <command>`.
|
|
50
|
-
To pin one version to a repository, so that its scripts and its CI run that
|
|
51
|
-
version whatever is installed globally, add it as a development dependency:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npm install -D cherry-works
|
|
55
|
-
npx cw --version
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
`cw --version` prints the version you are running. Upgrade with
|
|
59
|
-
`npm install -g cherry-works@latest`.
|
|
60
|
-
|
|
61
|
-
## Install from source
|
|
62
|
-
|
|
63
|
-
To run `cw` from a checkout of this repository, you also need pnpm 10 or later.
|
|
64
|
-
Build it and link it globally:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
git clone https://github.com/tamnguyenvt/cherry-works.git
|
|
68
|
-
cd cherry-works
|
|
69
|
-
pnpm install
|
|
70
|
-
pnpm build
|
|
71
|
-
pnpm link --global
|
|
72
|
-
cw --help
|
|
73
30
|
```
|
|
74
31
|
|
|
75
|
-
|
|
76
|
-
`pnpm build` again. To remove the link, run `pnpm uninstall --global cherry-works`.
|
|
77
|
-
|
|
78
|
-
## Quick start
|
|
32
|
+
Using a local checkout? [Build and link it globally with pnpm](docs/reference.md#install-from-a-local-checkout).
|
|
79
33
|
|
|
80
|
-
Inside the
|
|
34
|
+
Inside the repository you want to govern:
|
|
81
35
|
|
|
82
36
|
```bash
|
|
83
|
-
cw init
|
|
84
|
-
cw kinds guide # what a guide requires
|
|
37
|
+
cw init # choose your agent and initialize the charter
|
|
85
38
|
cw add guide no-any --header description="No any in TypeScript." --header globs="src/**/*.ts"
|
|
86
|
-
cw edit
|
|
87
|
-
cw build
|
|
88
|
-
cw doctor
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Commit `.cw/` together with what `cw build` wrote. Your agent now reads the rule
|
|
92
|
-
in every session in this repository.
|
|
93
|
-
|
|
94
|
-
## The charter
|
|
95
|
-
|
|
96
|
-
A primitive is a markdown file with YAML front matter. The folder it sits in
|
|
97
|
-
names its kind:
|
|
98
|
-
|
|
99
|
-
```markdown
|
|
100
|
-
---
|
|
101
|
-
kind: guide
|
|
102
|
-
id: no-single-word-naming
|
|
103
|
-
description: How to name a function or a variable.
|
|
104
|
-
globs: ["src/**/*.ts"]
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
Never name a function or variable with a single vague word such as `it`, `data`
|
|
108
|
-
or `merged`. Name it after what it holds or does.
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Each kind comes up at a different time:
|
|
112
|
-
|
|
113
|
-
| Kind | Comes up when |
|
|
114
|
-
|---|---|
|
|
115
|
-
| `guide` | a touched file matches one of its `globs`, or on every turn when it has no globs |
|
|
116
|
-
| `sensor` | the `signal` it names is raised, and the harness runs its `run` command |
|
|
117
|
-
| `skill` | one of its `triggers` matches the request, or it is called by name as `/<id>` |
|
|
118
|
-
| `playbook` | one of its `triggers` matches, or it is called as `/<id>`; its body is a sequence of skills |
|
|
119
|
-
| `agent` | it is spawned by its id, with only the `tools` it lists |
|
|
120
|
-
| `posture` | always, wherever the host can be told what to `allow` and `deny` |
|
|
121
|
-
| `corpus` | a primitive's `rationale` cites it, to give the reasoning behind a rule |
|
|
122
|
-
| `mixin` | never on its own; its body is lent to the primitives that pull it in |
|
|
123
|
-
| `mcp` | a primitive's body names it as `[[<id>]]`: an mcp origin outside the repository, reached through `cw mcp serve` |
|
|
124
|
-
|
|
125
|
-
A skill or a playbook that is only a step of another can say
|
|
126
|
-
`disable-user-invocation: true`: it is then not offered as a `/` command, and
|
|
127
|
-
the agent still opens it when its triggers match or a playbook sends it there.
|
|
128
|
-
|
|
129
|
-
`cw kinds <kind>` gives the exact fields each kind takes. An id names exactly
|
|
130
|
-
one primitive across the whole charter, whatever its kind. If two files claim
|
|
131
|
-
the same id, the build is refused and both files are named. A primitive is
|
|
132
|
-
named by its id alone: bare in a header (`rationale: type-safety`), a test or a
|
|
133
|
-
command, and as `[[<id>]]` in a body, which the build turns into a link.
|
|
134
|
-
Every primitive is a folder holding its `index.md`, and any other file in that
|
|
135
|
-
folder is one of its assets, reached from the body as `./<file>`. An id is at
|
|
136
|
-
most 40 characters, and may be grouped with `/`: the mcp `mfbs/billing` is kept at
|
|
137
|
-
`.cw/charter/mcp/mfbs/billing/index.md`.
|
|
138
|
-
|
|
139
|
-
`cw build` compiles every primitive to `.cw/out/<kind>/<id>/index.md`, with its
|
|
140
|
-
assets copied beside it: its headers,
|
|
141
|
-
then the bodies of the mixins it pulls in, then its own. What your agent's host
|
|
142
|
-
is given points to that document, so you can open any primitive exactly as the
|
|
143
|
-
agent reads it.
|
|
144
|
-
|
|
145
|
-
## Commands
|
|
146
|
-
|
|
147
|
-
| Command | What it does |
|
|
148
|
-
|---|---|
|
|
149
|
-
| `cw init [--agent]` | Set the repository up under a charter, and build it |
|
|
150
|
-
| `cw build [--preview]` | Compile the charter, or show what a build would write |
|
|
151
|
-
| `cw list [--kind] [--min]` | List what the charter holds |
|
|
152
|
-
| `cw kinds [kind]` | List the kinds, or the fields one of them requires |
|
|
153
|
-
| `cw add <kind> <id> [--header k=v …]` | Write a new primitive |
|
|
154
|
-
| `cw edit <id>` | Open a primitive's file in your editor |
|
|
155
|
-
| `cw remove <id> [--yes]` | Delete a primitive this repository authored |
|
|
156
|
-
| `cw explain <id>` | Show which file declares an id, what it pulls in and which tests name it |
|
|
157
|
-
| `cw doctor` | Check the agents, the charter, the vendor sources and the compiled output |
|
|
158
|
-
| `cw context [--exact]` | Say how many tokens the charter puts into the agent's context when a session opens |
|
|
159
|
-
| `cw sessions [--since] [--until] [--json]` | Sum up the tokens of the sessions kept on this machine, by day and by session |
|
|
160
|
-
| `cw test` | Run every case in `.cw/test/` against the charter |
|
|
161
|
-
| `cw eval` | Put every case in `.cw/eval/` to the real agent under promptfoo |
|
|
162
|
-
| `cw suite add \| edit \| remove` | Manage test files |
|
|
163
|
-
| `cw vendor add <source> [--ref] \| remove \| list` | Install, update, remove or list vendor sources |
|
|
164
|
-
| `cw portal [--port]` | Open the charter in a browser on this machine |
|
|
165
|
-
| `cw mcp auth [id] [--status]` | Sign in, as yourself, to every mcp origin the charter reaches, or to one again |
|
|
166
|
-
| `cw mcp serve` | Serve every mcp origin the charter reaches to your agent, over stdio |
|
|
167
|
-
|
|
168
|
-
`cw doctor` exits with a failure status when the charter has an error, when a
|
|
169
|
-
vendored file was edited in this repository, or when the compiled output no
|
|
170
|
-
longer matches the charter. That makes it a gate you can run in CI.
|
|
171
|
-
|
|
172
|
-
## The portal
|
|
173
|
-
|
|
174
|
-
If you would rather not remember commands and field names, run the portal from
|
|
175
|
-
inside a governed repository:
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
cw portal # serves on port 9927, or the next free port
|
|
179
|
-
cw portal --port 8080
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
It prints an address such as `http://127.0.0.1:9927/?t=…`. Open that address in
|
|
183
|
-
your browser. The page has three tabs:
|
|
184
|
-
|
|
185
|
-

|
|
186
|
-
|
|
187
|
-
- **Repo Charter** lists every primitive of this repository by kind, with the
|
|
188
|
-
engine's own line on when that kind comes up. From here you can create a
|
|
189
|
-
primitive, then open it to edit its fields and its markdown body, or delete
|
|
190
|
-
it. The form is built from what the kind requires, so it asks only for the
|
|
191
|
-
fields that kind takes. The **?** on a row explains the primitive: when it
|
|
192
|
-
comes up, what it pulls in, what cites it and which tests name it.
|
|
193
|
-
|
|
194
|
-
| Editing a primitive | Explaining it |
|
|
195
|
-
|---|---|
|
|
196
|
-
|  |  |
|
|
197
|
-
- **Vendor** lists the vendor sources you installed and their primitives, which
|
|
198
|
-
are read-only. You can add a source by its git address and a version, or
|
|
199
|
-
remove one.
|
|
200
|
-
- **Test** lists the test files in `.cw/test/`. You can create, edit and delete
|
|
201
|
-
them, and run every case to see which pass and why a failing one failed.
|
|
202
|
-
|
|
203
|
-

|
|
204
|
-
|
|
205
|
-
The header has a search that finds any primitive in any layer, and two buttons:
|
|
206
|
-
**Build**, which shows what a build would write before it writes anything, and
|
|
207
|
-
**Doctor**, which runs the health check and offers a build when the output is
|
|
208
|
-
behind.
|
|
209
|
-
|
|
210
|
-
The portal drives the same engine as the command line and adds no behaviour of
|
|
211
|
-
its own. What it shows is what the engine answered, and everything it does has
|
|
212
|
-
a command-line equivalent. When the engine refuses a change, the portal shows
|
|
213
|
-
the refusal in the engine's words and writes nothing. It listens only on
|
|
214
|
-
`127.0.0.1`, and every request needs the token in the printed address. Stop it
|
|
215
|
-
with Ctrl+C.
|
|
216
|
-
|
|
217
|
-
## Testing a charter
|
|
218
|
-
|
|
219
|
-
A test file in `.cw/test/` describes situations and what must come up in each
|
|
220
|
-
one:
|
|
221
|
-
|
|
222
|
-
```json
|
|
223
|
-
{
|
|
224
|
-
"description": "The TypeScript guide comes up on source files.",
|
|
225
|
-
"cases": [
|
|
226
|
-
{ "do": { "touchFile": "src/one.ts" }, "expect": { "activate": "no-any" } },
|
|
227
|
-
{ "when": "Stop", "expect": { "run": "lint" } },
|
|
228
|
-
{ "do": { "touchFile": ".env" }, "expect": { "allow": false } }
|
|
229
|
-
]
|
|
230
|
-
}
|
|
39
|
+
cw edit no-any # write the rule in your editor
|
|
40
|
+
cw build # generate the agent's files
|
|
41
|
+
cw doctor # check the result
|
|
231
42
|
```
|
|
232
43
|
|
|
233
|
-
|
|
234
|
-
|
|
44
|
+
Your rule lives at `.cw/charter/guide/no-any/index.md`. Edit that source and
|
|
45
|
+
rebuild when it changes. Review and commit `.cw/` together with the generated
|
|
46
|
+
agent files.
|
|
235
47
|
|
|
236
|
-
|
|
48
|
+
→ [Write your first charter](docs/writing-a-charter.md)
|
|
237
49
|
|
|
238
|
-
|
|
239
|
-
with it. A file in `.cw/eval/` holds prompts and what is expected of each:
|
|
50
|
+
## What's in a charter?
|
|
240
51
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
"description": "Planning goes through the planning skill.",
|
|
244
|
-
"cases": [
|
|
245
|
-
{ "prompt": "plan this feature: export a report as PDF", "expect": { "invoke": "sdd-plan", "maxTokens": 200000 } },
|
|
246
|
-
{ "prompt": "add a function that totals an invoice", "expect": { "follow": "no-single-word-naming" } }
|
|
247
|
-
]
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
Each case expects at least one of:
|
|
52
|
+
Each building block is a **primitive**: an `index.md` with YAML headers and
|
|
53
|
+
instructions, plus any supporting files.
|
|
252
54
|
|
|
253
|
-
|
|
|
55
|
+
| Purpose | Primitives |
|
|
254
56
|
|---|---|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
|
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
cw eval
|
|
261
|
-
```
|
|
57
|
+
| Set standards and permissions | `guide`, `posture` |
|
|
58
|
+
| Describe tasks, workflows and delegated roles | `skill`, `playbook`, `agent` |
|
|
59
|
+
| Run checks and connect tools | `sensor`, `script`, `mcp` |
|
|
60
|
+
| Reuse instructions, documents and reasoning | `mixin`, `template`, `corpus` |
|
|
262
61
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
charter built, so your working tree is never touched. You never write a
|
|
266
|
-
promptfoo configuration. The first run installs promptfoo and the Claude Agent
|
|
267
|
-
SDK under `~/.cherry-works/promptfoo/`, and later runs reuse them.
|
|
62
|
+
Run `cw kinds` to explore them, or `cw kinds guide` for one kind's fields.
|
|
63
|
+
Each id is unique across your charter, installed vendors and built-ins.
|
|
268
64
|
|
|
269
|
-
|
|
270
|
-
that misses what it expects fails the run, with what the agent did instead.
|
|
271
|
-
It runs on whatever Claude Code is signed in with, or on `ANTHROPIC_API_KEY`
|
|
272
|
-
when set, and spends real tokens: commit before you run it, and keep the cases
|
|
273
|
-
few.
|
|
65
|
+
## Reuse a team's charter
|
|
274
66
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
Everything the charter loads when a session opens — always-on guides, every
|
|
278
|
-
skill's description, every subagent's — is paid for on every turn.
|
|
279
|
-
|
|
280
|
-
```bash
|
|
281
|
-
cw context # each primitive's tokens, the largest first, estimated
|
|
282
|
-
cw context --exact # counted through the agent's own command line
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
A guide with `globs` is listed apart: it is loaded only when a file it names is
|
|
286
|
-
touched. `cw build` prints the total in one line, the portal shows the same
|
|
287
|
-
list, and `cw doctor` warns once the total passes `mainContextCeiling` in
|
|
288
|
-
`.cw/settings.json` (20,000 tokens unless you set it).
|
|
289
|
-
|
|
290
|
-
Once a session runs, the engine's own Stop hook counts what it has used, its
|
|
291
|
-
subagents included, each time the agent stops. It keeps one line per stop
|
|
292
|
-
under `~/.cherry-works/` (or the folder `sessionAnalysisFolder` names), never in
|
|
293
|
-
the repository, and tells you in one line each time a session crosses another
|
|
294
|
-
`sessionContextMark` tokens (100,000 unless you set it). The model is never
|
|
295
|
-
sent that line.
|
|
67
|
+
Install a published charter, then build it for your agent:
|
|
296
68
|
|
|
297
69
|
```bash
|
|
298
|
-
cw
|
|
299
|
-
cw
|
|
300
|
-
cw sessions --since 2026-10-01 --until 2026-10-05 --json
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
To put a price on it, ask your agent what last week cost: the built-in
|
|
304
|
-
`cw-session-cost` skill reads the same summary, asks whether to use prices you
|
|
305
|
-
type or the provider's published ones, and answers per session and per day,
|
|
306
|
-
naming the prices it used.
|
|
307
|
-
|
|
308
|
-
Both limits are set in `.cw/settings.json`; leave one out to keep its default:
|
|
309
|
-
|
|
310
|
-
```json
|
|
311
|
-
{
|
|
312
|
-
"agents": ["claude"],
|
|
313
|
-
"mainContextCeiling": 20000,
|
|
314
|
-
"sessionContextMark": 100000
|
|
315
|
-
}
|
|
70
|
+
cw vendor add your-org/charter-baseline --ref v1.0.0
|
|
71
|
+
cw build
|
|
316
72
|
```
|
|
317
73
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
- `sessionContextMark` — every how many tokens a running session tells you what
|
|
321
|
-
it has used so far.
|
|
74
|
+
A vendor copy is read-only and updated from its source. To copy the content
|
|
75
|
+
into your own editable charter instead, use `cw vendor inject`.
|
|
322
76
|
|
|
323
|
-
|
|
324
|
-
`cw doctor` to check.
|
|
325
|
-
|
|
326
|
-
## Vendor sources
|
|
327
|
-
|
|
328
|
-
```bash
|
|
329
|
-
cw vendor add git@github.com:your-org/charter-baseline.git --ref v1.2.0
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
A vendor source is a git repository set up with `cw init`: author its charter
|
|
333
|
-
there, test it, and push. Only its `.cw/charter/` folder is installed, under
|
|
334
|
-
`.cw/vendor/<name>/`, pinned to the ref you chose, with the source's
|
|
335
|
-
`README.md` beside it, and left unstaged for you to read and commit, whatever
|
|
336
|
-
else you have in hand. A repository
|
|
337
|
-
without that folder is refused, and so is one that has vendors of its own:
|
|
338
|
-
vendoring is one level deep. Vendored primitives are read-only. To differ from
|
|
339
|
-
one, write your own primitive under a new id.
|
|
340
|
-
|
|
341
|
-
Run `cw vendor add` again with a new `--ref` to update a source, and
|
|
342
|
-
`cw vendor remove <name>` to take it away. Run `cw build` after either.
|
|
77
|
+
→ [Create and publish a vendor source](docs/creating-a-vendor.md)
|
|
343
78
|
|
|
344
79
|
### Recommended charter vendors
|
|
345
80
|
|
|
346
81
|
| Charter | What it gives your agent | Install |
|
|
347
82
|
| --- | --- | --- |
|
|
348
83
|
| [sdd-charter](https://github.com/tamnguyenvt/sdd-charter) | Spec-driven development: a spec set with a status per story and a roadmap of their dependencies, and six commands (`/sdd-init`, `/sdd-plan`, `/sdd-implement`, `/sdd-bug-fix`, `/sdd-status`, `/sdd-report`) that take each story from request to merge, stopping for your yes at each step. | `cw vendor add git@github.com:tamnguyenvt/sdd-charter.git --ref v0.1.7` |
|
|
349
|
-
| [hexagonal-architecture-charter](https://github.com/tamnguyenvt/hexagonal-architecture-charter) | Sets up a hexagonal (ports and adapters) architecture in a folder you choose, then keeps the agent following it. | `cw vendor add git@github.com:tamnguyenvt/hexagonal-architecture-charter.git --ref v0.1.0` |
|
|
350
|
-
|
|
351
|
-
## MCP origins outside the repository
|
|
352
|
-
|
|
353
|
-
Much of what an agent needs to know is kept elsewhere: another service's code,
|
|
354
|
-
an issue tracker, a wiki. An `mcp` primitive declares one such mcp origin, an MCP
|
|
355
|
-
server, and the tools of it your agent may use:
|
|
356
84
|
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
kind: mcp
|
|
360
|
-
id: mfbs/billing
|
|
361
|
-
description: Billing service code and pull requests.
|
|
362
|
-
endpoint: https://api.githubcopilot.com/mcp/
|
|
363
|
-
path: moneyforward/billing-service
|
|
364
|
-
auth: ["oauth", "token"]
|
|
365
|
-
tools: ["get_file_contents", "search_code", "list_pull_requests"]
|
|
366
|
-
---
|
|
367
|
-
|
|
368
|
-
The billing service. Look here before changing anything that charges a customer.
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
An mcp origin is either an `endpoint` reached over HTTP, or a `command` with its
|
|
372
|
-
`args` that `cw` starts as a local process; a local one takes a token only, in
|
|
373
|
-
the environment variable its `tokenEnv` names. Any primitive points the agent
|
|
374
|
-
at an mcp origin by naming it in its body as `[[mfbs/billing]]`.
|
|
85
|
+
## Work from the terminal or browser
|
|
375
86
|
|
|
376
87
|
```bash
|
|
377
|
-
cw
|
|
378
|
-
cw
|
|
379
|
-
cw
|
|
88
|
+
cw portal # browse and edit the charter locally
|
|
89
|
+
cw test # test activation and permission rules, without an agent
|
|
90
|
+
cw context # estimate the charter's context size
|
|
91
|
+
cw eval --agent codex # evaluate with the real agent; spends tokens
|
|
380
92
|
```
|
|
381
93
|
|
|
382
|
-
|
|
383
|
-
credential, and stops on one you are not signed in to. Every developer signs in
|
|
384
|
-
as themselves, by browser where the mcp origin offers OAuth or with a token
|
|
385
|
-
typed at a hidden prompt. GitHub's MCP server does not let `cw` register for
|
|
386
|
-
OAuth, so sign in there with a personal access token. Credentials are kept in the operating
|
|
387
|
-
system's credential store, never in the repository, and renewed without asking
|
|
388
|
-
where the mcp origin allows it. `cw mcp serve` is the one MCP server your agent is
|
|
389
|
-
given: it serves the tools each mcp origin declares and forwards every call under
|
|
390
|
-
your own credential. An mcp origin that is down or not signed in to loses only its own
|
|
391
|
-
tools.
|
|
392
|
-
|
|
393
|
-
The build asks each mcp origin for its tools once and keeps them beside the
|
|
394
|
-
charter, and turns your agent's own tool search on: a session opens with each
|
|
395
|
-
tool's name and no schema, and the agent looks up the one it needs. `cw mcp
|
|
396
|
-
serve` lists the kept tools without reaching any mcp origin, and reaches one
|
|
397
|
-
only for a call. A tool an `mcp` declares that its mcp origin does not list
|
|
398
|
-
stops the build.
|
|
399
|
-
|
|
400
|
-
A subagent reaches only the mcp origins it lists under `tools`: `[[<id>]]` for every
|
|
401
|
-
tool of an mcp origin, or `[[<id>]]:<tool>` for one of them.
|
|
402
|
-
|
|
403
|
-
## Your agent can write rules too
|
|
404
|
-
|
|
405
|
-
Every governed repository gets a built-in skill, `cw-author`, in the
|
|
406
|
-
agent's hands from the moment `cw init` finishes. It teaches
|
|
407
|
-
the agent to ask `cw kinds` what a kind requires and to write primitives with
|
|
408
|
-
`cw add`, instead of copying fields from memory.
|
|
409
|
-
|
|
410
|
-
## Development
|
|
411
|
-
|
|
412
|
-
```bash
|
|
413
|
-
pnpm install
|
|
414
|
-
pnpm exec playwright install chromium # once per machine, for the portal's browser tests
|
|
415
|
-
pnpm test # dependency rules, build, then every test
|
|
416
|
-
pnpm typecheck
|
|
417
|
-
pnpm cw <command> # run the CLI from source, without building
|
|
418
|
-
```
|
|
94
|
+

|
|
419
95
|
|
|
420
|
-
|
|
421
|
-
`origin/develop`. It runs the tests, installs the exact package it would publish
|
|
422
|
-
into a fresh repository and builds it there, and only then commits, tags
|
|
423
|
-
`v<version>`, publishes and pushes. `pnpm release <version> --dry-run` runs
|
|
424
|
-
every check and changes nothing. A plain `npm publish` is refused.
|
|
96
|
+
## Documentation
|
|
425
97
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
98
|
+
- [Writing a charter](docs/writing-a-charter.md) — rules, workflows, references
|
|
99
|
+
and tests.
|
|
100
|
+
- [Creating a vendor source](docs/creating-a-vendor.md) — publish, install and
|
|
101
|
+
update a shared charter.
|
|
102
|
+
- [Using the portal](docs/use-portal.md) — edit, test and build in your browser.
|
|
103
|
+
- [Reference](docs/reference.md) — commands, host mappings, evaluations,
|
|
104
|
+
context costs, vendor sources and MCP configuration.
|
|
105
|
+
- [Development](docs/reference.md#development) — build from source, run checks
|
|
106
|
+
and release.
|
|
107
|
+
- [Changelog](CHANGELOG.md) — releases and changes.
|
|
430
108
|
|
|
431
|
-
This repository
|
|
109
|
+
This repository uses [its own charter](.cw/charter/) and keeps its product
|
|
110
|
+
specifications in [specs/](specs/spec.md).
|
package/dist/cw.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "cherry-works",
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.9.0",
|
|
7
7
|
description: "The charter engine: resolves a charter and compiles it into what a coding agent reads.",
|
|
8
8
|
keywords: [
|
|
9
9
|
"claude-code",
|
|
@@ -80,6 +80,7 @@ var package_default = {
|
|
|
80
80
|
"radix-ui": "^1.6.7",
|
|
81
81
|
react: "^19.3.0",
|
|
82
82
|
"react-dom": "^19.3.0",
|
|
83
|
+
"smol-toml": "^1.9.1",
|
|
83
84
|
sonner: "^2.0.8",
|
|
84
85
|
"tailwind-merge": "^3.7.0",
|
|
85
86
|
tailwindcss: "^4.3.3",
|