@zenera/cli 1.2.9 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +11 -3
  2. package/dist/command.d.ts +19 -0
  3. package/dist/command.js +5 -9
  4. package/dist/commands/index.d.ts +1 -1
  5. package/dist/commands/index.js +13 -3
  6. package/dist/commands/key.js +15 -1
  7. package/dist/commands/open.js +6 -1
  8. package/dist/commands/version.d.ts +11 -0
  9. package/dist/commands/version.js +129 -19
  10. package/dist/{completion.d.ts → complete.d.ts} +1 -1
  11. package/dist/{completion.js → complete.js} +14 -4
  12. package/dist/{meta/editor.js → editor.js} +7 -1
  13. package/dist/lib.d.ts +19 -1
  14. package/dist/lib.js +35 -0
  15. package/dist/main.js +1 -1
  16. package/dist/scaffold.js +7 -1
  17. package/package.json +6 -7
  18. package/templates/editor/.github/copilot-instructions.md +12 -48
  19. package/templates/editor/.github/skills/project-review/SKILL.md +8 -73
  20. package/templates/editor/.github/skills/zen-cli/references/meta.md +7 -0
  21. package/templates/editor/.github/skills/zen-cli/references/projects.md +7 -2
  22. package/templates/editor/.github/skills/zen-review/SKILL.md +164 -53
  23. package/templates/editor/.github/skills/zen-review/scripts/review.sh +53 -27
  24. package/dist/commands/meta.d.ts +0 -6
  25. package/dist/commands/meta.js +0 -1088
  26. package/dist/meta/finetune/analyze-brief.d.ts +0 -26
  27. package/dist/meta/finetune/analyze-brief.js +0 -131
  28. package/dist/meta/finetune/apply-brief.d.ts +0 -23
  29. package/dist/meta/finetune/apply-brief.js +0 -247
  30. package/dist/meta/finetune/brief.d.ts +0 -45
  31. package/dist/meta/finetune/brief.js +0 -158
  32. package/dist/meta/finetune/children.d.ts +0 -8
  33. package/dist/meta/finetune/children.js +0 -76
  34. package/dist/meta/finetune/command.d.ts +0 -30
  35. package/dist/meta/finetune/command.js +0 -516
  36. package/dist/meta/finetune/cost.d.ts +0 -46
  37. package/dist/meta/finetune/cost.js +0 -105
  38. package/dist/meta/finetune/dataset/anchors.d.ts +0 -41
  39. package/dist/meta/finetune/dataset/anchors.js +0 -239
  40. package/dist/meta/finetune/dataset/changes.d.ts +0 -36
  41. package/dist/meta/finetune/dataset/changes.js +0 -319
  42. package/dist/meta/finetune/dataset/command.d.ts +0 -17
  43. package/dist/meta/finetune/dataset/command.js +0 -1011
  44. package/dist/meta/finetune/dataset/drift.d.ts +0 -33
  45. package/dist/meta/finetune/dataset/drift.js +0 -71
  46. package/dist/meta/finetune/dataset/export.d.ts +0 -26
  47. package/dist/meta/finetune/dataset/export.js +0 -51
  48. package/dist/meta/finetune/dataset/index.d.ts +0 -2
  49. package/dist/meta/finetune/dataset/index.js +0 -2
  50. package/dist/meta/finetune/dataset/sample.d.ts +0 -50
  51. package/dist/meta/finetune/dataset/sample.js +0 -197
  52. package/dist/meta/finetune/dataset/schema.d.ts +0 -33
  53. package/dist/meta/finetune/dataset/schema.js +0 -216
  54. package/dist/meta/finetune/dataset/store.d.ts +0 -35
  55. package/dist/meta/finetune/dataset/store.js +0 -177
  56. package/dist/meta/finetune/dataset/types.d.ts +0 -127
  57. package/dist/meta/finetune/dataset/types.js +0 -39
  58. package/dist/meta/finetune/failure.d.ts +0 -15
  59. package/dist/meta/finetune/failure.js +0 -26
  60. package/dist/meta/finetune/feedback.d.ts +0 -57
  61. package/dist/meta/finetune/feedback.js +0 -104
  62. package/dist/meta/finetune/improvements.d.ts +0 -98
  63. package/dist/meta/finetune/improvements.js +0 -501
  64. package/dist/meta/finetune/index.d.ts +0 -2
  65. package/dist/meta/finetune/index.js +0 -2
  66. package/dist/meta/finetune/journal.d.ts +0 -35
  67. package/dist/meta/finetune/journal.js +0 -135
  68. package/dist/meta/finetune/live.d.ts +0 -84
  69. package/dist/meta/finetune/live.js +0 -272
  70. package/dist/meta/finetune/loop.d.ts +0 -3
  71. package/dist/meta/finetune/loop.js +0 -163
  72. package/dist/meta/finetune/memories.d.ts +0 -47
  73. package/dist/meta/finetune/memories.js +0 -171
  74. package/dist/meta/finetune/recheck.d.ts +0 -58
  75. package/dist/meta/finetune/recheck.js +0 -311
  76. package/dist/meta/finetune/report.d.ts +0 -40
  77. package/dist/meta/finetune/report.js +0 -1397
  78. package/dist/meta/finetune/retry.d.ts +0 -24
  79. package/dist/meta/finetune/retry.js +0 -96
  80. package/dist/meta/finetune/sampler.d.ts +0 -18
  81. package/dist/meta/finetune/sampler.js +0 -47
  82. package/dist/meta/finetune/system.d.ts +0 -27
  83. package/dist/meta/finetune/system.js +0 -132
  84. package/dist/meta/finetune/train.d.ts +0 -43
  85. package/dist/meta/finetune/train.js +0 -425
  86. package/dist/meta/finetune/tui.d.ts +0 -16
  87. package/dist/meta/finetune/tui.js +0 -316
  88. package/dist/meta/finetune/tuning.d.ts +0 -193
  89. package/dist/meta/finetune/tuning.js +0 -308
  90. package/dist/meta/finetune/usage.d.ts +0 -66
  91. package/dist/meta/finetune/usage.js +0 -260
  92. package/dist/meta/finetune/view.d.ts +0 -9
  93. package/dist/meta/finetune/view.js +0 -27
  94. package/dist/meta/host.d.ts +0 -16
  95. package/dist/meta/host.js +0 -22
  96. package/dist/meta/index.d.ts +0 -11
  97. package/dist/meta/index.js +0 -11
  98. package/dist/meta/launch.d.ts +0 -81
  99. package/dist/meta/launch.js +0 -288
  100. package/dist/meta/model.d.ts +0 -61
  101. package/dist/meta/model.js +0 -146
  102. package/dist/meta/prompts.d.ts +0 -23
  103. package/dist/meta/prompts.js +0 -84
  104. package/dist/meta/relay.d.ts +0 -20
  105. package/dist/meta/relay.js +0 -123
  106. package/dist/meta/tokens.d.ts +0 -52
  107. package/dist/meta/tokens.js +0 -226
  108. package/dist/meta/window.d.ts +0 -61
  109. package/dist/meta/window.js +0 -198
  110. package/dist/meta/wire.d.ts +0 -51
  111. package/dist/meta/wire.js +0 -159
  112. /package/dist/{meta/editor.d.ts → editor.d.ts} +0 -0
@@ -41,9 +41,6 @@ Copilot is always the meta-agent that creates and changes target projects. Load
41
41
  the editor's `zen-cli` skill before deciding how a target project should run,
42
42
  be validated, or use command-line capabilities. It is the command contract; do
43
43
  not reconstruct `zen` arguments from memory or call `--help` to discover them.
44
- When the task is to bring a project into compliance with `SPECIFICATION.md`,
45
- load `zen-spec-sync` first; its narrow tiers contain the exact validation
46
- commands and do not require loading `zen-cli` as well.
47
44
 
48
45
  **Every runtime capability a project turns on carries obligations that are not
49
46
  visible in `agents.yaml` and that `zen check` does not report.** Before
@@ -57,11 +54,8 @@ code, `zen-topology` for `handoffs:` or `fork:` on any agent,
57
54
  `zen-cli` always. A capability that is already
58
55
  configured and already passing `zen check` is exactly the case that looks
59
56
  finished and is not: the obligation lives in the skill, so a review that never
60
- opens the skill cannot find what is missing. Outside a specification-sync pass,
61
- this applies whatever prompted the change. During an incremental sync, load the
62
- skills the `zen-spec-sync` pass plan names for the areas its changes reach - an
63
- enabled capability no change reaches owes nothing new. A full pass still loads
64
- every enabled capability's skill.
57
+ opens the skill cannot find what is missing. This applies whatever prompted the
58
+ change.
65
59
 
66
60
  **Load `zen-instructions` before writing, editing, reviewing or deleting any
67
61
  `agents/*instructions.md`.** They are the house rules, prepended to every
@@ -137,16 +131,6 @@ file untouched and put this project's own memory policy in a second topic file,
137
131
  anything. Never paraphrase it into prose of your own.
138
132
  See §5.3.
139
133
 
140
- A project with a `SPECIFICATION.md` carries one more: **`.spec-sync/` records
141
- what the last `/spec-sync-project` pass applied**, and the `zen-spec-sync` skill is
142
- loaded before running that prompt, whether or not a baseline exists yet. The
143
- state is committed, because a record only the last machine has is not a record.
144
- Two things to watch for, neither of which `zen check` reports: a baseline that
145
- moved without a history entry to match it, which is a pass claiming work it did
146
- not do, and a `.spec-sync/baseline/` whose `manifest.txt` no longer matches its
147
- files. Both are reported, not quietly repaired - rewriting the manifest asserts
148
- a pass that never happened.
149
-
150
134
  ### 0.2 `zen` is a black box
151
135
 
152
136
  `zen` is the tool you drive, not the code you are working on. What it does is
@@ -163,8 +147,7 @@ what the `zen-cli` skill and its own output say it does. So:
163
147
  when its log has not grown for 10 minutes. Embedding a large corpus takes
164
148
  hours, and the progress line says how many.
165
149
  - When a `zen` command fails, or does something its skill does not describe,
166
- quote the command and the line it printed in your answer - and in
167
- `SPECIFICATION-FEEDBACK.md` during a `/spec-sync-project` pass - then go on
150
+ quote the command and the line it printed in your answer, then go on
168
151
  with the next step. Do not look for the cause.
169
152
 
170
153
  ---
@@ -258,7 +241,6 @@ my-project/
258
241
  │ ├── copilot-instructions.md this file
259
242
  │ └── skills/*/SKILL.md zen-* reference loaded on demand; the rest /commands
260
243
  ├── .env this project's environment - NEVER committed
261
- ├── .spec-sync/ what the last /spec-sync-project applied - §0.1
262
244
  ├── agents.yaml who exists, what they may reach for
263
245
  ├── agents/
264
246
  │ ├── instructions.md house rules, prepended to every agent
@@ -418,7 +400,7 @@ token in those files is read by a model as an instruction to open something:
418
400
  `memory_copy_file`.
419
401
  - [ ] No project file is named: `agents.yaml`, `agents/instructions.md`,
420
402
  `agents/prompts/…`, `agents/skills/…`, `sandbox/Dockerfile`, `.env`,
421
- `.github/…`, `sessions/…`, `SPECIFICATION.md`, `README.md`, `docs/…`.
403
+ `.github/…`, `sessions/…`, `README.md`, `docs/…`.
422
404
  - [ ] Nothing escapes a mount: no `../`, no `~`, no host path (`/Users/…`,
423
405
  `/home/<someone>`), no `/etc`, `/var` or `/tmp` expected to hold anything
424
406
  the project put there.
@@ -1914,20 +1896,18 @@ ok, `1` failed, `2` usage, `3` invalid project, `4` no usable credential.
1914
1896
 
1915
1897
  ## 9. Review checklist
1916
1898
 
1917
- Three of these are decidable, and are one command - `zen check`, the path sweep,
1918
- the spec-sync record, in that order:
1899
+ Load the `zen-review` skill for any review: it picks the depth from the request,
1900
+ runs the mechanical checks, and suggests the command for each finding. The
1901
+ decidable part splits by cost into a fast half and a slow one:
1919
1902
 
1920
1903
  ```sh
1921
- .github/skills/zen-review/scripts/review.sh
1904
+ .github/skills/zen-review/scripts/review.sh fast # zen check --no-models --no-sandbox, paths, setup - seconds
1905
+ .github/skills/zen-review/scripts/review.sh slow # zen check with sandbox build + model probes - minutes
1922
1906
  ```
1923
1907
 
1924
- Run it first and read what it says. Everything else below is judgement, which is
1925
- why it is still a list. The `zen-review` skill has the detail.
1926
- Within a specification-sync pass, reuse its final check with
1927
- `review.sh --skip-check` instead of probing again, and apply the sync skill's
1928
- pass plan to this checklist. Use `--skip-check no-sandbox` only when that plan
1929
- does not reach the sandbox image. Independent reviews still cover the whole
1930
- checklist.
1908
+ Run `fast` first and read what it says. Warn the user before `slow` - it builds
1909
+ the sandbox image with Docker - and start it separately. Everything else below
1910
+ is judgement, which is why it is still a list.
1931
1911
 
1932
1912
  Before finishing any change here:
1933
1913
 
@@ -2024,22 +2004,6 @@ candidates; these are the judgements to make about each one)**
2024
2004
  - [ ] No key literal in YAML, prompt, skill or log - `${VAR}` only
2025
2005
  - [ ] `.env` is git-ignored
2026
2006
 
2027
- **Specification** (only where the project has a `SPECIFICATION.md`)
2028
-
2029
- - [ ] `.github/skills/zen-spec-sync/scripts/snapshot.sh status` does not say
2030
- `tampered` - the baseline matches its own `manifest.txt`
2031
- - [ ] `.spec-sync/baseline/applied.txt` names the newest file in
2032
- `.spec-sync/history/`; a baseline ahead of the history is a pass that
2033
- claimed work it did not finish
2034
- - [ ] The newest history entry's `Still open` is what the next pass will trust,
2035
- and says so honestly - an unchanged specification line is not evidence
2036
- that anything implements it
2037
- - [ ] No question in `SPECIFICATION-FEEDBACK.md` has a box marked `[x]`, or
2038
- exactly one answer left under it, without a matching `✅ Answered` entry
2039
- or a strike naming the specification line that superseded it - that is
2040
- an answer given and never folded into the specification
2041
- - [ ] `.spec-sync/` is committed and `.tmp/` is not
2042
-
2043
2007
  ---
2044
2008
 
2045
2009
  ## 10. Where to change what
@@ -1,81 +1,16 @@
1
1
  ---
2
2
  name: project-review
3
- description: Review the project against the checklist before committing.
3
+ description: Review the project before committing - loads the `zen-review` skill and follows it (quick by default; say "full" for the sandbox build and model probes too).
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- Review this project the way a maintainer would, then report. Read
8
- `agents.yaml`, every `agents/*instructions.md`, every file under
9
- `agents/prompts/` and the skill descriptions under `agents/skills/` before
10
- saying anything.
7
+ Load the `zen-review` skill now, before anything else, and follow it. It owns
8
+ the whole review: which depth to run, the mechanical checks and how to read
9
+ them, the judgement checklist, the suggestions and the report.
11
10
 
12
- **Run the mechanical checks first, and report what they say:**
11
+ Choose the depth from what I typed after the command, as `zen-review` §1 says:
12
+ nothing, or "quick", is a quick review; "full", "everything" or "before commit"
13
+ is a full one. The entry point is
14
+ `.github/skills/zen-review/scripts/review.sh`.
13
15
 
14
- ```sh
15
- .github/skills/zen-review/scripts/review.sh
16
- ```
17
-
18
- That is `zen check`, the §2.5 path sweep and the
19
- spec-sync record, in the order they matter. Load the `zen-review` skill for what
20
- each one owns and how to read its output. Do not re-verify by hand anything it
21
- already decided, and do not go further while `zen check` fails - nothing below
22
- matters until it passes.
23
- If `review.sh check` already passed in this conversation and nothing has been
24
- edited since, run `review.sh --skip-check` instead: it verifies that receipt
25
- rather than probing again, and fails if the project changed. Reusing the check
26
- does not narrow the review - everything below still covers the whole project.
27
-
28
- **Then list the capabilities this project turns on** — a `memory:` block, a
29
- `zen rag` index, a sandbox, an agent that writes code (`zen-code-python`), a
30
- `SPECIFICATION.md` — and load the editor skill for each before judging it. The obligations live in the skill, not in
31
- `agents.yaml`, and `zen check` reports none of them. A capability that is
32
- already configured and already passing is exactly the case that looks finished
33
- and is not.
34
-
35
- Everything that follows is what no tool can see:
36
-
37
- - **One job each.** Can you state every agent's job in one sentence? If not,
38
- say which agent and what the two jobs are.
39
- - **Prompts.** Second person, imperative, failure paths stated, no hedging, no
40
- politeness padding, no meta-talk about the runtime. Nothing in the house rules
41
- that is true of only one agent, and nothing in `agents/instructions.md` that
42
- belongs in a `<topic>-instructions.md` of its own because it only applies when
43
- one capability is on.
44
- - **Facts.** Any number, threshold, fee or date living in a prompt is in the
45
- wrong file. Name it and say which skill it belongs in.
46
- - **Paths.** For each candidate `check-paths.sh` printed: is it a path the
47
- agent cannot open, or noise? Say which, and for a real one say what it should
48
- have been. Judge the rest of the §2.5 checklist yourself — that no instruction
49
- assumes the workspace is this directory, that every `/assets/…` and
50
- `/skills/<name>/…` names a committed file, and that the agent holding the
51
- prompt has the tool the path implies.
52
- - **Memory.** Anything this project decides for itself belongs in
53
- `agents/memory-policy-instructions.md`, not in the copy — and it should say
54
- something. Audiences that exist because an agent would be _misled_ by the
55
- other slice, not merely because it does not need it.
56
- - **Skill descriptions.** Each one a condition, not a title; no two overlapping.
57
- Every skill a folder with a `SKILL.md`, and a skill that ships a script writes
58
- its `/skills/<name>/…` path.
59
- - **Tools.** Every grant justified by the agent's job; nothing mutating held by
60
- an agent that only reads; every granted tool mentioned by the prompt. An agent
61
- with no `skills:` key indexes the whole catalog - check that every agent can
62
- actually follow the skills it is offered.
63
- - **Sandbox.** `persist: true` unless a throwaway rootfs is wanted on purpose.
64
- What the work always needs is in the image, not installed by a prompt on every
65
- run.
66
- - **Control flow.** Whichever this project uses - load the `zen-topology` skill
67
- first when `agents.yaml` has `handoffs:` or `fork:`. A handoff moves the
68
- conversation and must have a path back; a fork returns by itself and condenses
69
- to one result, so whatever the caller needs must be in the branch's answer.
70
- Wanting one lookup and spending the conversation on it is a fork, not a
71
- handoff. No router that answers.
72
- - **Models.** Each agent on the cheapest tier that is right, not the safest.
73
- - **Cache.** Nothing volatile - dates, ids, counts - in the stable prefix.
74
- - **Secrets.** No key inlined anywhere; `.env` ignored, `sessions/` ignored.
75
- - **Specification.** Where a `SPECIFICATION.md` exists, `review.sh` reported the
76
- record's mode. Judge the rest: the newest history entry's "Still open" is
77
- honest, its baseline names that entry, and `.spec-sync/` is committed.
78
-
79
- Report as a list of findings, each naming the file and the line, ordered by how
80
- much it will cost to leave. Say plainly if you find nothing worth changing.
81
16
  Do not edit anything unless I ask.
@@ -3,14 +3,21 @@
3
3
  ```
4
4
  zen meta run [project] "<question>" ask it something
5
5
  zen meta run [project] /<name> [words] run the command .github/skills/<name>/SKILL.md
6
+ zen meta chat [project] [question] a conversation, in a terminal only
6
7
  zen meta prompts [project] list the commands (skills without zen-)
7
8
  zen meta resume [project] [session] carry on a run that stopped
8
9
  zen meta model [ref] show or set the model it uses
9
10
  zen meta dataset <verb> see dataset.md
10
11
  ```
11
12
 
13
+ Provided by `@zenera/meta` - `npm i -g @zenera/meta` if `zen meta` says it is
14
+ not installed. `zen meta dataset` and `zen meta finetune` come with it.
15
+
12
16
  `zen meta --help` has every option.
13
17
 
18
+ `zen meta chat` needs a person at a terminal: it refuses `--json` and a
19
+ stdin that is not a TTY. From a script or another agent, use `zen meta run`.
20
+
14
21
  ## `--json`
15
22
 
16
23
  `zen meta run --json` prints ONE object on stdout when the run ends:
@@ -130,5 +130,10 @@ window immediately rather than after a prompt.
130
130
  zen version
131
131
  ```
132
132
 
133
- The CLI version, the library version and the Node version. `zen --version`
134
- prints the CLI version alone and returns before anything else loads.
133
+ Every `@zenera/*` package this `zen` resolves - what it is built on, then the
134
+ ones it loads by name (`@zenera/meta`, `@zenera/gym`, `@zenera/rag`), each with
135
+ its install line when missing - and the programs they run on: Node, Podman and,
136
+ with `@zenera/meta`, Copilot CLI. A package whose version is not the CLI's is
137
+ marked; they ship in lockstep, so that is the first thing to fix when a command
138
+ misbehaves. `--json` gives `{ packages, subsystems }`. `zen --version` prints
139
+ the CLI version alone and returns before anything else loads.
@@ -1,47 +1,174 @@
1
1
  ---
2
2
  name: zen-review
3
- description: Checking a project before committing - the three mechanical checks `/project-review` makes before any judgement (`zen check`, the §2.5 path sweep, the spec-sync record), what each one owns, what their exit codes mean, which findings hand off to `zen-instructions`, and what deliberately has no check because no tool can make it. Load before running `/project-review`, before saying a project is ready, and whenever a review finding needs verifying rather than restating.
3
+ description: Reviewing, checking or validating an agent project - the whole procedure `/project-review` follows. Picks the depth from the request (a quick check by default, everything at once when a full or pre-commit check is asked for), runs the fast mechanical half (`zen check --no-models --no-sandbox`, the §2.5 path sweep, the setup dry run) and the slow half (`zen check` with the sandbox image build and model probes) separately, walks the judgement checklist no tool can make, and reports findings with the command that fixes each one - rebuild the sandbox, run the setup script, `zen check --fix`. Load whenever the user asks to check, review or validate a project, before saying a project is ready, and whenever a review finding needs verifying rather than restating.
4
4
  user-invocable: false
5
5
  ---
6
6
 
7
7
  # Reviewing a project
8
8
 
9
9
  A review of an agent project is two jobs wearing one name. One half is
10
- decidable - a schema is valid or it is not, a path resolves or it does not, a
11
- copy matches its reference or it does not - and a human doing it by hand gets it
12
- wrong in the same three places every time. The other half is judgement: whether
13
- an agent has one job, whether a description routes, whether a number is in the
14
- wrong file.
10
+ decidable - a schema is valid or it is not, a path resolves or it does not, an
11
+ index is built or it is not - and a human doing it by hand gets it wrong in the
12
+ same places every time. The other half is judgement: whether an agent has one
13
+ job, whether a description routes, whether a number is in the wrong file.
15
14
 
16
- This skill owns the first half, so the prompt can be all of the second.
15
+ The decidable half is scripted and split by cost into a **fast** part and a
16
+ **slow** part. The judgement half is the checklist further down. A review ends
17
+ in one report that says what is wrong and what to run next.
17
18
 
18
- ## The one command
19
+ ## 1. Choose the depth from the request
19
20
 
20
- From the project root, or anywhere at all:
21
+ | The user asked | Do |
22
+ | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
23
+ | "check", "is it ok?", "quick check", anything unqualified | **Quick**: the fast half and the judgement checklist. Then ask whether to run the slow half. |
24
+ | "full check", "check everything", "deep", "before I commit", "release" | **Full**: the fast half, then warn and start the slow half right away; judgement while it runs. |
25
+ | one area ("check the paths", "does the sandbox build?") | Only the part that owns it - `check-paths.sh`, or the slow half - and say what was not covered. |
26
+
27
+ `/project-review` with nothing after it is a quick review. When in doubt, go
28
+ quick and ask: the fast half costs seconds, the slow one can cost minutes. When
29
+ you ask, say what the slow half would add - whether the Dockerfile builds and
30
+ whether every model id is real - so the answer is an informed one. When nobody
31
+ can answer - a scripted `zen meta run /project-review` - do not ask: run the
32
+ quick review and end the report with the command for the slow half.
33
+
34
+ ## 2. The fast half - files, paths, setup
21
35
 
22
36
  ```sh
23
- .github/skills/zen-review/scripts/review.sh
37
+ .github/skills/zen-review/scripts/review.sh fast
24
38
  ```
25
39
 
26
- It runs three checks in the order a reviewer needs them and prints a summary:
40
+ Seconds, offline, no Docker, no tokens. It always runs, first. Each step's
41
+ header is the exact command it ran:
42
+
43
+ | Step | Owns |
44
+ | ------------------------------------ | ---------------------------------------------------------------------- |
45
+ | `zen check --no-models --no-sandbox` | everything decidable about the configuration and the files it names |
46
+ | `paths (check-paths.sh)` | paths a running agent cannot open - §2.5 |
47
+ | `setup (scripts/_setup.sh --check)` | whether what must exist before a run (an index, a generated file) does |
48
+ | `sandbox` | a hint: `sandbox/` changed since the last commit |
49
+
50
+ Every step runs even when an earlier one fails. The exit code is `1` if any
51
+ step wants attention, `0` if none does; the `sandbox` step is a hint and never
52
+ fails the run. Nothing else matters while `zen check` fails - report what it
53
+ said and fix that first. There is no point paying for a container build on a
54
+ project whose `agents.yaml` does not parse.
27
55
 
28
- | Step | Runs | Owns |
29
- | ----------- | ------------------------------------------ | -------------------------------------------- |
30
- | `zen check` | the CLI | everything decidable about the configuration |
31
- | `paths` | `zen-review/scripts/check-paths.sh` | paths a running agent cannot open - §2.5 |
32
- | `spec-sync` | `zen-spec-sync/scripts/snapshot.sh status` | whether the record of the last pass is sound |
56
+ ## 3. The slow half - sandbox build and model probes
33
57
 
34
- Every step runs even when an earlier one fails, because a review that stops at
35
- the first problem is one somebody has to run three times. The exit code is `1` if
36
- any step wants attention and `0` if none does. `review.sh fast` passes
37
- `--no-models --no-sandbox` to `zen check`, which is the right call while
38
- iterating and the wrong one before committing - a key that authenticates says
39
- nothing about the model id it is spent on.
58
+ ```sh
59
+ .github/skills/zen-review/scripts/review.sh slow # add --fix to repair zen's own files first
60
+ ```
40
61
 
41
- Nothing below matters while `zen check` fails. Report what it said and fix that
42
- first.
62
+ This is the full `zen check`, with the sandbox image build and the model probes
63
+ turned on. **Before starting it, tell the user it may take several minutes**:
64
+ it builds the project's image with Docker (a cold build with no layer cache is
65
+ the slow part) and asks every model that has a credential to answer once. Then
66
+ start it on its own - in the background where your tools allow - and do the
67
+ judgement checklist while it runs. Report its result when it finishes.
68
+
69
+ It is the only check that proves a Dockerfile builds and a model id is real: a
70
+ key that authenticates says nothing about the model it is spent on. A project
71
+ with no sandbox only pays for the model probes; a machine with no container
72
+ engine gets a warning rather than an error - say so, do not call that a pass.
73
+
74
+ `slow` does not repeat the path sweep or the setup dry run, and it saves a
75
+ receipt (§7) so the same pass does not pay for it twice. If files change after
76
+ the fast half, run `fast` again; it is cheap. `review.sh` with no argument
77
+ still runs everything in one blocking go - prefer the split.
78
+
79
+ ## 4. The judgement half
80
+
81
+ Read `agents.yaml`, every `agents/*instructions.md`, every file under
82
+ `agents/prompts/` and the skill descriptions under `agents/skills/` before
83
+ saying anything. Do not re-verify by hand anything the scripts already decided.
84
+
85
+ **List the capabilities this project turns on** - a `memory:` block, a `zen
86
+ rag` index, a sandbox, an agent that writes code (`zen-code-python`),
87
+ `handoffs:` or `fork:` (`zen-topology`) - and load the editor skill for each
88
+ before judging it. The obligations live in the skill, not in `agents.yaml`, and
89
+ `zen check` reports none of them. A capability that is already configured and
90
+ already passing is exactly the case that looks finished and is not.
91
+
92
+ Then, what no tool can see:
93
+
94
+ - **One job each.** Can you state every agent's job in one sentence? If not,
95
+ say which agent and what the two jobs are.
96
+ - **Prompts.** Second person, imperative, failure paths stated, no hedging, no
97
+ politeness padding, no meta-talk about the runtime. Nothing in the house rules
98
+ that is true of only one agent, and nothing in `agents/instructions.md` that
99
+ belongs in a `<topic>-instructions.md` of its own because it only applies when
100
+ one capability is on.
101
+ - **Facts.** Any number, threshold, fee or date living in a prompt is in the
102
+ wrong file. Name it and say which skill it belongs in.
103
+ - **Paths.** For each candidate `check-paths.sh` printed: is it a path the agent
104
+ cannot open, or noise? Say which, and for a real one say what it should have
105
+ been. Judge the rest of the §2.5 checklist yourself - that no instruction
106
+ assumes the workspace is this directory, that every `/assets/…` and
107
+ `/skills/<name>/…` names a committed file, and that the agent holding the
108
+ prompt has the tool the path implies.
109
+ - **Memory.** Anything this project decides for itself belongs in
110
+ `agents/memory-policy-instructions.md`, not in the copy - and it should say
111
+ something. Audiences that exist because an agent would be _misled_ by the
112
+ other slice, not merely because it does not need it.
113
+ - **Skill descriptions.** Each one a condition, not a title; no two overlapping.
114
+ Every skill a folder with a `SKILL.md`, and a skill that ships a script writes
115
+ its `/skills/<name>/…` path.
116
+ - **Tools.** Every grant justified by the agent's job; nothing mutating held by
117
+ an agent that only reads; every granted tool mentioned by the prompt. An agent
118
+ with no `skills:` key indexes the whole catalog - check that every agent can
119
+ actually follow the skills it is offered.
120
+ - **Sandbox.** `persist: true` unless a throwaway rootfs is wanted on purpose.
121
+ What the work always needs is in the image, not installed by a prompt on every
122
+ run.
123
+ - **Control flow.** Load `zen-topology` first when `agents.yaml` has
124
+ `handoffs:` or `fork:`. A handoff moves the conversation and must have a path
125
+ back; a fork returns by itself and condenses to one result, so whatever the
126
+ caller needs must be in the branch's answer. Wanting one lookup and spending
127
+ the conversation on it is a fork, not a handoff. No router that answers.
128
+ - **Models.** Each agent on the cheapest tier that is right, not the safest.
129
+ - **Cache.** Nothing volatile - dates, ids, counts - in the stable prefix.
130
+ - **Secrets.** No key inlined anywhere; `.env` ignored, `sessions/` ignored.
131
+
132
+ §9 of the copilot instructions is the long form of this list.
133
+
134
+ ## 5. Suggest the next step
135
+
136
+ A finding without a next step is half a finding. Map what the checks said to
137
+ the command that addresses it, and put it in the report:
138
+
139
+ | What the review saw | Suggest |
140
+ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
141
+ | `rules.stale`, a missing house-rule copy, an outdated editor tree | `zen check --fix` (load `zen-instructions` first - §9) |
142
+ | `setup` says not done; an index is not `ready` | `scripts/_setup.sh` - and `scripts/_setup.sh --force` when the source documents changed |
143
+ | `sandbox` hint: `sandbox/` changed since the last commit | `review.sh slow` to prove it builds, then `zen sandbox pull` to rebuild the image runs use |
144
+ | slow half: no container engine, or the machine is not running | `zen sandbox up` |
145
+ | slow half: the image build failed | fix `sandbox/Dockerfile`, then `review.sh slow` again; load `zen-sandbox` |
146
+ | slow half: a model refused or never answered | `zen models test <ref>`; fix the model id, or the credential with `zen key` |
147
+ | a sandbox pin was repaired by `--fix` | `review.sh slow` - a repair may have changed the image |
148
+ | quick review done, slow half not run | ask whether to run `review.sh slow`, and say it can take several minutes |
149
+ | only judgement findings | the edit, by file and line - and run `review.sh fast` again after making it |
150
+
151
+ Load `zen-cli` before suggesting any other `zen` command, so the arguments come
152
+ from the contract rather than memory.
153
+
154
+ ## 6. The report
155
+
156
+ Open with the mechanical results, one line per command actually run, named as
157
+ the script's step headers name it - never collapse two into one:
43
158
 
44
- ## Reusing a check within the same pass
159
+ ```
160
+ • zen check --no-models --no-sandbox: passed (0 errors, 0 warnings)
161
+ • check-paths.sh: passed - every path is under /workspace, /assets or /skills
162
+ • scripts/_setup.sh --check: 1 step needs setup (docs_index)
163
+ • zen check (sandbox build + model probes): not run - quick review
164
+ ```
165
+
166
+ Then the findings, each naming the file and the line, ordered by how much they
167
+ will cost to leave, each with its next step from §5. Say plainly if you find
168
+ nothing worth changing, and say which checks did not run. Do not edit anything
169
+ unless the user asks.
170
+
171
+ ## 7. Reusing a check within the same pass
45
172
 
46
173
  Instead of calling `zen check` separately and repeating it in the review, run:
47
174
 
@@ -51,32 +178,31 @@ Instead of calling `zen check` separately and repeating it in the review, run:
51
178
  ```
52
179
 
53
180
  `check` runs only the CLI check and saves a receipt in `.tmp/review-check.json`
54
- on success. `--skip-check` verifies that receipt, then still runs the path sweep
55
- and spec-sync checks. It fails explicitly for a missing, failed, stale or
181
+ on success. `--skip-check` verifies that receipt, then still runs the path
182
+ sweep. It fails explicitly for a missing, failed, stale or
56
183
  insufficient check; it never silently treats a skipped check as success.
57
184
 
58
185
  Receipts cover project file contents, permissions, additions and deletions, and the CLI
59
- version. They exclude only root `.git/`, `.tmp/` and `.spec-sync/`, so writing
60
- history does not invalidate a result. Symlinks and special files are unsupported:
61
- run the ordinary review instead. Hashing includes assets and dependencies and
62
- can itself be costly for large projects; the ordinary review remains available.
186
+ version. They exclude only the root `.git/`, `.tmp/` and history directories,
187
+ so writing scratch output or history does not invalidate a result. Symlinks and
188
+ special files are unsupported: run the ordinary review instead. Hashing
189
+ includes assets and dependencies and can itself be costly for large projects;
190
+ the ordinary review remains available.
63
191
 
64
192
  This is same-pass reuse, not a persistent health cache. Do not reuse after
65
193
  changing credentials, environment variables, external files, ignored scratch
66
194
  inputs or remote resources: those are not certified by the receipt. Run a fresh
67
195
  check instead. Only use reuse for a self-contained project's stable inputs.
68
196
 
69
- `check no-sandbox` and `--skip-check no-sandbox` are for a spec-sync pass whose
70
- plan does not reach the sandbox image. They still probe models. `check fast` and
197
+ `check no-sandbox` and `--skip-check no-sandbox` are for a change that does not
198
+ reach the sandbox image. They still probe models. `check fast` and
71
199
  `--skip-check fast` omit both expensive probes and are for iteration only.
72
200
  A full receipt covers either partial mode, but a partial receipt cannot stand
73
201
  in for a full one. If a partial check repairs or otherwise changes files, no
74
202
  reusable receipt is issued: run `check full`, because a repair may have changed
75
203
  the sandbox pin. Finish setup and all edits before saving the final receipt.
76
204
 
77
- ## The script this skill ships
78
-
79
- ### `check-paths.sh` - the §2.5 sweep
205
+ ## 8. `check-paths.sh` - the §2.5 sweep
80
206
 
81
207
  A running agent's whole world is three paths: `/workspace`, `/assets` and
82
208
  `/skills`. Every path-shaped token in `agents/*instructions.md`,
@@ -103,7 +229,7 @@ copy sitting in this project.
103
229
 
104
230
  `raw` is the sweep with nothing filtered, for when you suspect the filter.
105
231
 
106
- ## Findings that are not yours to fix in place
232
+ ## 9. Findings that are not yours to fix in place
107
233
 
108
234
  `zen check` reports `rules.stale`, `files.uninstructed`, `memory.uninstructed`,
109
235
  `fork.uninstructed`, `rules.requires.unknown` or `rules.unreached` against a
@@ -119,22 +245,7 @@ project's own rules on the same subject go instead, what `requires:` does, and
119
245
  what filename order decides. A review that fixes one of ours in place has
120
246
  undone itself by the next `zen open` and left nothing behind to say so.
121
247
 
122
- ## What has no check, on purpose
123
-
124
- Not because it would be hard, but because the answer would be wrong:
125
-
126
- - **Whether an agent has one job.** Read the prompt.
127
- - **Whether a description routes.** Two overlapping descriptions both parse.
128
- - **Whether a fact belongs in a skill.** A threshold in a prompt is valid YAML.
129
- - **Whether a tool grant is justified.** `zen check` confirms the selector
130
- resolves, never that the agent needs it.
131
- - **Whether the newest spec-sync history entry is honest.** A pass can claim
132
- anything; only reading the diff says whether it did it.
133
-
134
- That list is `/project-review`, and §9 of the copilot instructions is the long
135
- form. Run the script first so the prompt is spent on this.
136
-
137
- ## Where these scripts live, and why edits to them vanish
248
+ ## 10. Where these scripts live, and why edits to them vanish
138
249
 
139
250
  `zen init` and `zen open` rewrite the whole `.github/` tree from the version of
140
251
  `zen` in hand. These scripts arrive with it, so a change made to the copy in a