@zenera/cli 1.1.43 → 1.1.45

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 (48) hide show
  1. package/dist/commands/completion.d.ts +1 -1
  2. package/dist/commands/completion.js +4 -4
  3. package/dist/commands/meta.js +10 -10
  4. package/dist/completion.js +1 -1
  5. package/dist/meta/editor.js +43 -3
  6. package/dist/meta/finetune/command.js +2 -2
  7. package/dist/meta/finetune/improvements.js +1 -1
  8. package/dist/meta/prompts.d.ts +8 -3
  9. package/dist/meta/prompts.js +42 -19
  10. package/dist/usage.d.ts +1 -1
  11. package/dist/usage.js +1 -1
  12. package/package.json +4 -4
  13. package/templates/editor/.github/copilot-instructions.md +35 -22
  14. package/templates/editor/.github/{prompts/analyze.prompt.md → skills/analyze/SKILL.md} +6 -3
  15. package/templates/editor/.github/{prompts/dataset.prompt.md → skills/dataset/SKILL.md} +6 -3
  16. package/templates/editor/.github/{prompts/finetune.prompt.md → skills/finetune/SKILL.md} +7 -4
  17. package/templates/editor/.github/{prompts/new-agent.prompt.md → skills/new-agent/SKILL.md} +3 -1
  18. package/templates/editor/.github/{prompts/new-skill.prompt.md → skills/new-skill/SKILL.md} +3 -1
  19. package/templates/editor/.github/{prompts/project-review.prompt.md → skills/project-review/SKILL.md} +6 -0
  20. package/templates/editor/.github/{prompts/spec-apply-feedback.prompt.md → skills/spec-apply-feedback/SKILL.md} +2 -0
  21. package/templates/editor/.github/skills/spec-edit/SKILL.md +324 -0
  22. package/templates/editor/.github/{prompts/spec-sync-project.prompt.md → skills/spec-sync-project/SKILL.md} +41 -15
  23. package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +1 -0
  24. package/templates/editor/.github/skills/zen-cli/SKILL.md +21 -20
  25. package/templates/editor/.github/skills/zen-cli/references/finetune.md +1 -1
  26. package/templates/editor/.github/skills/zen-cli/references/meta.md +2 -2
  27. package/templates/editor/.github/skills/zen-code-python/SKILL.md +1 -0
  28. package/templates/editor/.github/skills/zen-dataset/SKILL.md +1 -0
  29. package/templates/editor/.github/skills/zen-finetune/SKILL.md +2 -1
  30. package/templates/editor/.github/{prompts/finetune-apply.prompt.md → skills/zen-finetune-apply/SKILL.md} +7 -4
  31. package/templates/editor/.github/skills/zen-inspect/SKILL.md +1 -0
  32. package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +1 -0
  33. package/templates/editor/.github/skills/zen-instructions/SKILL.md +1 -0
  34. package/templates/editor/.github/skills/zen-memory/SKILL.md +1 -0
  35. package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +1 -0
  36. package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +1 -0
  37. package/templates/editor/.github/skills/zen-rag-schema/SKILL.md +1 -0
  38. package/templates/editor/.github/skills/zen-review/SKILL.md +34 -0
  39. package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +1 -1
  40. package/templates/editor/.github/skills/zen-review/scripts/check-receipt.mjs +95 -0
  41. package/templates/editor/.github/skills/zen-review/scripts/review.sh +27 -2
  42. package/templates/editor/.github/skills/zen-sandbox/SKILL.md +2 -1
  43. package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +2 -1
  44. package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +115 -20
  45. package/templates/editor/.github/skills/zen-spec-sync/scripts/snapshot.sh +83 -2
  46. package/templates/editor/.github/skills/zen-topology/SKILL.md +1 -0
  47. package/templates/project/agents/prompts/default.md.tmpl +3 -3
  48. package/templates/editor/.github/prompts/spec-edit.prompt.md +0 -250
@@ -1,5 +1,7 @@
1
1
  ---
2
+ name: project-review
2
3
  description: Review the project against the checklist before committing.
4
+ disable-model-invocation: true
3
5
  ---
4
6
 
5
7
  Review this project the way a maintainer would, then report. Read
@@ -18,6 +20,10 @@ spec-sync record, in the order they matter. Load the `zen-review` skill for what
18
20
  each one owns and how to read its output. Do not re-verify by hand anything it
19
21
  already decided, and do not go further while `zen check` fails - nothing below
20
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.
21
27
 
22
28
  **Then list the capabilities this project turns on** — a `memory:` block, a
23
29
  `zen rag` index, a sandbox, an agent that writes code (`zen-code-python`), a
@@ -1,5 +1,7 @@
1
1
  ---
2
+ name: spec-apply-feedback
2
3
  description: Fold the answers left in SPECIFICATION-FEEDBACK.md back into SPECIFICATION.md, and mark each answered question as answered.
4
+ disable-model-invocation: true
3
5
  ---
4
6
 
5
7
  `SPECIFICATION-FEEDBACK.md` is a questionnaire. Each question carries two to
@@ -0,0 +1,324 @@
1
+ ---
2
+ name: spec-edit
3
+ description: Change SPECIFICATION.md as the request given with the command asks - written in the specification's own structure and voice, checked against what the runtime can actually do - and nothing else. Never explores the project or the environment; discovering how things work is /spec-sync-project's job.
4
+ argument-hint: 'what to add, change or remove in the specification'
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ Edit `SPECIFICATION.md` the way the request given with this command asks. The
9
+ specification is the intent of the project; you are changing the intent, not
10
+ the implementation. Making the project match it is `/spec-sync-project`, which
11
+ runs after this.
12
+
13
+ You change one file: `SPECIFICATION.md`. Not `agents.yaml`, not a prompt, not a
14
+ skill, not `SPECIFICATION-FEEDBACK.md`.
15
+
16
+ ## 0. Size the edit, then read only what it needs
17
+
18
+ If no request was given with the command, ask what to change and stop.
19
+
20
+ ### Decide the kind of edit first
21
+
22
+ From the request and `SPECIFICATION.md` alone, before reading anything else:
23
+
24
+ - **Greenfield** - `SPECIFICATION.md` is still the `zen init` scaffold (generic
25
+ placeholders such as "Carry out work inside a workspace on request…",
26
+ "Currently: no steps", "the only agent; nobody to hand work to"), or the
27
+ request asks to define or make a specification for a project or domain.
28
+ - **Incremental** - anything else: the specification already describes a real
29
+ project and the request asks for a specific change.
30
+
31
+ Then decide which sections the request touches (§1), because that decides
32
+ which skills you read.
33
+
34
+ ### Read in one batch
35
+
36
+ Always:
37
+
38
+ - [SPECIFICATION.md](../../../SPECIFICATION.md) - the file you are editing.
39
+ - [SPECIFICATION-FEEDBACK.md](../../../SPECIFICATION-FEEDBACK.md) - the questions
40
+ still open against it, and the ones already answered. It may not exist; that
41
+ only means nothing is open.
42
+
43
+ What the runtime can do, so that what you write is something it can build. On
44
+ a **greenfield** edit read all of them. On an **incremental** edit read only the
45
+ ones for the sections the request touches; when unsure whether a section is
46
+ touched, read its skill:
47
+
48
+ | Section touched | Skill |
49
+ | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
50
+ | **Agents** (split, hand-off, fork) | [zen-topology](../zen-topology/SKILL.md) - one agent or several, hand-off or fork, and what each costs |
51
+ | **Tools and boundaries** (scripts, writing or running code) | [zen-code-python](../zen-code-python/SKILL.md) - reusable scripts as tools, where they live, and which agents own them |
52
+ | **Knowledge** / **Setup** (index over OpenAPI) | [zen-rag-schema](../zen-rag-schema/SKILL.md) - an index over an OpenAPI description |
53
+ | **Knowledge** / **Setup** (index over documents) | [zen-rag-docs](../zen-rag-docs/SKILL.md) - an index over a folder of markdown documents |
54
+ | **Memory** | [zen-memory](../zen-memory/SKILL.md) - what memory is, who may read and write it, and what a strategy for it has to say |
55
+ | **Environment** (image, packages, network, persistence) | [zen-sandbox](../zen-sandbox/SKILL.md) - the container: what it mounts, what it can reach, what persists |
56
+ | Rules every agent is told | [zen-instructions](../zen-instructions/SKILL.md) - house rules, and what belongs there rather than in a prompt |
57
+ | **Models** | [zen-cli](../zen-cli/SKILL.md) and [its models reference](../zen-cli/references/models.md) - how to find which models this machine can actually use |
58
+
59
+ Any of these already in your context - attached, or loaded as a skill - you
60
+ need not read again. Read the rest in **one** batch of parallel reads, never
61
+ one at a time.
62
+
63
+ ### Models
64
+
65
+ Run this once from the project root, in the same batch, only when the edit is
66
+ greenfield, the request names or changes a model, or the specification will use
67
+ `memory/`, `assets/docs-db` or `assets/schema-db` and **Models** has no
68
+ embedding model yet:
69
+
70
+ ```sh
71
+ zen models && zen models ls --chat && zen models ls --embeddings
72
+ ```
73
+
74
+ That is the list of models with a credential on this machine - the only ones a
75
+ new **Models** line may name. A model the request names that is not in it: run
76
+ `zen models search <name>` once; if it is still absent, say so in the chat and
77
+ do not write it. A model already in `SPECIFICATION.md` that the request does not
78
+ mention is kept as it is and not checked.
79
+
80
+ ### What you never read
81
+
82
+ This command changes intent, not implementation, so it needs nothing from the
83
+ project beyond the files above. Do not open, list or search anything else in
84
+ the project: not `agents/`, `scripts/`, `sandbox/`, `resources/`, `assets/`,
85
+ `gym/`, examples, code or data, and not the skills' own `references/` beyond
86
+ the models reference. Do not run any command other than the `zen models` ones
87
+ above, and do not inspect environment variables, the network, running
88
+ processes or installed tools. A path the request names is written into the
89
+ specification as named; you do not read it to find out what is in it.
90
+
91
+ What you would have looked up - an endpoint, an auth scheme, a base URL, a
92
+ file layout, how an existing script works - is either stated by role in the
93
+ specification (§3, "Unknowns are named, not researched") or settled later by
94
+ `/spec-sync-project`, which reads the project.
95
+
96
+ ### Then edit
97
+
98
+ Once that one batch is read, your next action is the edit to
99
+ `SPECIFICATION.md`. If you feel the need to read something more, do not: put it
100
+ in the report as an open question instead.
101
+
102
+ ## 1. Understand the request against what is there
103
+
104
+ Before writing a line, work out - from the request, `SPECIFICATION.md`, the
105
+ feedback file and the skills you read, nothing else:
106
+
107
+ - **How far the edit reaches.** A **greenfield** edit (§0) reaches **every**
108
+ section: replace all generic template sentences and meta-explanations with a
109
+ complete, concrete specification for that domain. An **incremental** edit
110
+ stays narrow: touch only the sections the change implicates.
111
+ - **Which sections the request touches.** Usually more than the one it names: a
112
+ new agent changes **Agents**, **Tools and boundaries** and **Done means**; an
113
+ index changes **Setup**, **Knowledge** and **Environment**.
114
+ - **What it contradicts.** A sentence already in the specification that the
115
+ request makes false is part of the edit - change it too, and report it.
116
+ - **What it settles in the feedback file.** An open question the request
117
+ answers, or an answered one it reverses. Do not edit the feedback file; say
118
+ which questions in the chat.
119
+ - **Whether the runtime can do it.** Check the request against the skills you
120
+ read. Something no tool, agent setting or script can provide is not written
121
+ into the specification as if it could be: say so in the chat, offer the
122
+ nearest thing the runtime does do, and write that only if the request leaves
123
+ no doubt it is wanted.
124
+
125
+ ### Example: a narrow incremental request
126
+
127
+ Request: _"let the agent write code against our appliance's REST API, index the
128
+ API specs in `resources/apis/*.yaml`, and add a skill on how to write code for
129
+ that API"_, on a specification that already describes the project.
130
+
131
+ - Kind: incremental.
132
+ - Sections: **Agents** (which agent writes and runs the code), **Tools and
133
+ boundaries** (scripts in `/workspace/scripts/`, the API it may call, what
134
+ stays read-only), **Setup** and **Knowledge** (a `zen rag schema` index over
135
+ `resources/apis/*.yaml` in `assets/schema-db`, and the new skill under
136
+ `agents/skills/` with what it holds), **Environment** (the libraries and the
137
+ network access the code needs, credentials by env-var name), **Models** only
138
+ if no embedding model is listed yet, **Done means** (one checkable line per
139
+ new behaviour).
140
+ - Skills read: zen-topology, zen-code-python, zen-rag-schema, zen-sandbox -
141
+ plus zen-cli only if an embedding model has to be added.
142
+ - Not read: the API spec files, existing scripts, agents, examples, the
143
+ environment.
144
+ - In the report: the base URL, auth scheme and any other value only the reader
145
+ has, written into the specification by role and env-var name.
146
+
147
+ Once these are worked out, your next action is the edit.
148
+
149
+ ## 2. The structure of a specification
150
+
151
+ Keep the sections the file already has, in its order. Add a section only when
152
+ the request needs one, at its place in this order, and leave out any section
153
+ that would be empty:
154
+
155
+ ```markdown
156
+ # Specification
157
+
158
+ ## Purpose
159
+
160
+ ## Scope
161
+
162
+ ## Models
163
+
164
+ ## Setup
165
+
166
+ ## Agents
167
+
168
+ ## Tools and boundaries
169
+
170
+ ## Knowledge
171
+
172
+ ## Memory
173
+
174
+ ## Environment
175
+
176
+ ## Testing
177
+
178
+ ## Done means
179
+
180
+ ## Out of scope
181
+ ```
182
+
183
+ What each one answers:
184
+
185
+ - **Purpose** - what the system produces, and for whom, in one paragraph.
186
+ - **Scope** - what one request covers, what is in and what is not, hard numeric
187
+ bounds (when a request is refused with a count rather than truncated), and
188
+ what has to happen before the system acts.
189
+ - **Models** - every chat and embedding model by its full id from `zen models`,
190
+ and which agent or job uses which. Keep the chat model already in
191
+ `SPECIFICATION.md` unless the request asks to change it; add an embedding
192
+ model from `zen models ls --embeddings` whenever the specification uses
193
+ `memory/`, `assets/docs-db`, or `assets/schema-db`.
194
+ - **Setup** - what has to exist before a run: OpenAPI specs or reference
195
+ documents fetched, a `zen rag schema` index built in `assets/schema-db`, a
196
+ `zen rag docs` index built in `assets/docs-db`, or reference files generated.
197
+ Each is a named step `scripts/_setup.sh` runs in order; say what it produces,
198
+ from what inputs, and where it lands.
199
+ - **Agents** - one entry per agent: its name, its one job, who it hands to or
200
+ forks, and the behaviours that are specific to it. Use **zen-topology** to
201
+ choose the right shape: split into focused agents (for example, a lead
202
+ coordinator/analyst, a dedicated quantitative/code agent, and a read-only
203
+ research agent) when tasks have distinct tool boundaries or heavy code
204
+ execution (**zen-code-python**), and specify `fork` (`context: none`) when a
205
+ request compares multiple independent items or runs independent research
206
+ tracks in parallel.
207
+ - **Tools and boundaries** - what each agent may reach for (files, shell,
208
+ reusable scripts in `/workspace/scripts/`, web search/read, memory, indexes,
209
+ external APIs), what is read-only, how transient network/API errors are
210
+ retried and fallen back from, and what nothing may reach. Every capability
211
+ named here has an agent that holds it.
212
+ - **Knowledge** - each index (`assets/schema-db`, `assets/docs-db`), each skill
213
+ under `agents/skills/` (naming the skill and the concrete procedure, formulas,
214
+ API conventions, or `rag_search` rules it holds), and the concrete external
215
+ APIs or data sources the project queries (naming specific zero-key primary
216
+ APIs and endpoints, required headers and rate limits, optional free-tier
217
+ keyed APIs, and fallback order).
218
+ - **Memory** - what is worth remembering (reusable scripts as `file` nodes,
219
+ verified identifiers/mappings, API schemas, workflows) and what is not (or
220
+ how time-sensitive facts are bounded), who may read and write, and when an
221
+ agent recalls before working and commits after it - see **zen-memory**.
222
+ - **Environment** - the sandbox (`sandbox/Dockerfile`, persistence, network),
223
+ the exact languages, CLI tools, and libraries pre-installed in the image so
224
+ agents never install packages at run time, where scripts and data outputs
225
+ live under `/workspace`, and the environment variables or credentials the
226
+ project itself needs (an external API, a service) by name - see
227
+ **zen-sandbox**. Never the credentials of chat or embedding models (§3).
228
+ - **Testing** - how a change to the project is checked: `zen check`,
229
+ `scripts/_setup.sh --check`, `scripts/_setup.sh` run twice in a row reporting
230
+ `skipped` the second time, and a concrete verification request the project
231
+ must handle end-to-end.
232
+ - **Done means** - how a finished job is told from an unfinished one, written as
233
+ concrete acceptance tests in prose that a reviewer could check against a run
234
+ (exact attribution fields, script-computed numbers, verified page reads,
235
+ reusable script paths, and required sections).
236
+ - **Out of scope** - what the runtime could do that this project deliberately
237
+ does not, so nobody adds it because it seemed useful.
238
+
239
+ ## 3. How to write it
240
+
241
+ - **Replace scaffold boilerplate on a greenfield request; change the smallest
242
+ thing on an incremental edit.** When `SPECIFICATION.md` is still the initial
243
+ `zen init` scaffold or the request asks to make a specification for a new
244
+ project, rewrite every section for that domain and remove the scaffold's
245
+ generic meta-commentary ("What the work always needs belongs in the image…",
246
+ "Currently: no steps…", "The reply names what changed, file by file…"). When
247
+ editing an already-written domain specification, leave every sentence the
248
+ request does not reach as it is.
249
+ - **Write in a direct, declarative voice.** Match the clean heading and list
250
+ structure of the specification, stating concrete project rules rather than
251
+ abstract explanations of how Zenera works.
252
+ - **Say what and why, never raw config syntax.** The specification is not
253
+ `agents.yaml` in prose. Name the agents, skills, setup steps, indexes, APIs,
254
+ packages, paths, and behavioural rules clearly, without pasting raw YAML
255
+ snippets or shell implementation internals that `/spec-sync-project` derives.
256
+ - **On a greenfield request, turn high-level domain requests into concrete
257
+ architectural choices.** When a request asks to design a project in broad
258
+ terms (for example, "make a specification for financial analytics using open
259
+ APIs"), do not repeat vague phrases like "open APIs" or "packages for data
260
+ analysis". Make the concrete domain choices upfront, from what you know of
261
+ public APIs and libraries and from the skills you read, so
262
+ `/spec-sync-project` can build a working system without guessing:
263
+ - Name specific, working zero-key public APIs and endpoints as primary
264
+ sources (with required headers such as `User-Agent` and rate limits),
265
+ optional keyed free-tier APIs as secondary sources with clean zero-key
266
+ fallback when keys are absent, and `web_search` / `web_read` rules.
267
+ - Name the concrete setup steps (`scripts/<name>.sh`), indexes
268
+ (`assets/schema-db`, `assets/docs-db`), and domain skills under
269
+ `agents/skills/`.
270
+ - Name the exact Python/system libraries to pre-install in
271
+ `sandbox/Dockerfile` and the `/workspace/scripts/` and `/workspace/data/`
272
+ conventions from **zen-code-python**.
273
+ - State explicit numeric limits (such as the maximum entities/tickers per
274
+ request before refusing with a count), retry/fallback rules, and required
275
+ citation fields.
276
+ - **On an incremental request, write what the request states.** Add what it
277
+ asks for, plus the changes it forces in other sections (§1), in the same
278
+ level of detail the specification already uses. Do not design beyond it.
279
+ - **Unknowns are named, not researched.** A value the request and the
280
+ specification do not give - an endpoint, a base URL, an auth scheme, a
281
+ credential, a file layout - is written by role and env-var name (for example
282
+ "the appliance base URL from `APPLIANCE_URL`, credentials from
283
+ `APPLIANCE_USER` and `APPLIANCE_PASSWORD`") and listed in the report as a
284
+ value only the reader has. Never look for it in the project or the
285
+ environment, and do not stop to ask for it.
286
+ - **Be specific where a reader could decide either way.** A limit is a number,
287
+ a model is an id, a failure has a stated outcome. "Handles large inputs" is
288
+ not implementable; "a request over 25 tickers is refused with a count, never
289
+ truncated" is.
290
+ - **Never invent a model id or a user-owned secret.** Keep the model already in
291
+ `SPECIFICATION.md` unless the request asks to change it, and take any new
292
+ chat or embedding model strictly from the `zen models` output on this machine,
293
+ never from memory.
294
+ - **Never name a model provider's credential.** `OPENAI_API_KEY`,
295
+ `ANTHROPIC_API_KEY`, `GOOGLE_APPLICATION_CREDENTIALS` and the like live in
296
+ the zen keyring and reach every run, setup step and sandbox without the
297
+ specification saying so. A **Models** line names the model id, not the key
298
+ behind it; **Environment** and the report list only the credentials of
299
+ external services the project calls. If `SPECIFICATION.md` already names a
300
+ model key, remove it as part of any edit to that section.
301
+ - **Make it checkable.** Every behaviour the request adds gets a line under
302
+ **Done means** that a reviewer could verify against a recorded run.
303
+ - **Name what is now excluded.** When the request narrows the system, the thing
304
+ it rules out goes under **Out of scope**.
305
+ - **Say it once.** If the rule already lives in another section, change it
306
+ there rather than stating it a second time somewhere new.
307
+
308
+ ## 4. Report
309
+
310
+ In the chat:
311
+
312
+ - every section you changed, with each new or changed line quoted
313
+ - every edit the request did not name but made necessary, and why
314
+ - every open question in `SPECIFICATION-FEEDBACK.md` the change settles or
315
+ reopens, by number
316
+ - anything you did not write because the runtime cannot do it
317
+ - every value written by role or env-var name that only the reader has, and
318
+ anything you would have wanted to look up but did not (§0)
319
+ - then, in one line: send `/spec-sync-project` to make the project match.
320
+
321
+ ## 5. The request
322
+
323
+ The words given with the command are the request the specification should
324
+ address. Without them, ask what to change and stop (§0).
@@ -1,5 +1,8 @@
1
1
  ---
2
+ name: spec-sync-project
2
3
  description: Bring the project into compliance with SPECIFICATION.md, and record every open question in SPECIFICATION-FEEDBACK.md.
4
+ argument-hint: '[file or area to focus on]'
5
+ disable-model-invocation: true
3
6
  ---
4
7
 
5
8
  Make this project match `SPECIFICATION.md`. The specification is the intent;
@@ -29,11 +32,15 @@ file under `agents/` say what has been **built or hand-edited** since then. The
29
32
  first narrows the pass to the work nobody has done; the second only widens it,
30
33
  because a prompt or skill someone changed outside a pass still has to be
31
34
  accounted for against the specification.
35
+ Generated house-rule copies print as `maintenance:` and do not alone widen
36
+ the pass; their diffs remain visible and `zen check --fix` owns their repair.
32
37
 
33
38
  The scope decides what you **read and edit**. It never decides what you
34
- **verify**: §6, §7 and the five checks in the skill run at full size on every
35
- pass, however small the diff. The one exception is the skill's **spec-only
36
- pass**, and only under the conditions the skill sets.
39
+ **verify** outside the skill's explicit tiers: **spec-only** and
40
+ **model-reference-only** narrow verification under the conditions the skill
41
+ sets. Choose the tier before loading capability skills. In a normal incremental
42
+ pass, load only skills for capabilities the diff or unresolved work reaches;
43
+ in a full pass, load every enabled capability's skill.
37
44
 
38
45
  When inputs disagree - a ticked answer against a later specification edit, the
39
46
  specification against `zen --version` - use the order of precedence in the
@@ -55,15 +62,17 @@ Read, in this order, and do not edit until all of it is read:
55
62
  6. `SPECIFICATION-FEEDBACK.md`, if it exists - do not re-raise something already
56
63
  open there.
57
64
 
58
- Never read `.tmp/logs/meta.*` - those are other runs of this prompt, not
65
+ Never read `.tmp/logs/meta.*` - those are other runs of this command, not
59
66
  evidence - nor anything of `zen`'s own (copilot instructions §0.2).
60
67
 
61
68
  On an incremental pass this list narrows to the artefacts the scope implicates,
62
69
  and to the changed hunks of the specification rather than all of it. The
63
70
  narrowing is a claim: name what you skipped and why the diff does not reach it.
64
71
 
65
- Run `zen check` first and record what it said. A project that does not load is
66
- the first thing to fix.
72
+ If an initial diagnostic is needed, run
73
+ `zen check --no-models --no-sandbox` and record what it said. A project that
74
+ does not load is the first thing to fix. Do not run expensive model or sandbox
75
+ probes both before and after a narrow edit; the final check covers them.
67
76
 
68
77
  ## 2. Build the difference
69
78
 
@@ -102,10 +111,13 @@ forward pass can see:
102
111
  These are bugs whatever the specification says: fix them in place and report each
103
112
  one. An extra that is merely unspecified is reported under `➕`, not removed.
104
113
 
105
- On an incremental pass this reverse reading covers every file this pass touched
114
+ On an incremental pass this reverse reading covers every project-owned file this pass touched
106
115
  plus every file the implementation diff in §0 named - an edit made in this
107
116
  session, or made by hand since the last pass, is exactly where a fresh
108
117
  contradiction comes from. On a full pass it is the whole tree, as above.
118
+ Generated house-rule copies and the editor tree are maintained by `zen check`,
119
+ not audited line by line against the specification. Preserve any project policy
120
+ discovered in their maintenance diffs in a project-owned topic file.
109
121
 
110
122
  ## 3. Change the smallest thing that closes the gap
111
123
 
@@ -215,7 +227,9 @@ not a paragraph of instructions for a human.
215
227
  Deleting `.tmp/` must leave the project runnable and `scripts/_setup.sh`
216
228
  re-runnable.
217
229
  - Steps that need credentials run on the host, not in the sandbox. Read keys
218
- from the environment or `.env`; never inline one into a script.
230
+ from the environment or `.env`; never inline one into a script. Model
231
+ provider keys are not among them: `zen` supplies those from its keyring, so
232
+ no step checks for, requires or documents one.
219
233
  - Anything the sandbox always needs belongs in `sandbox/Dockerfile`, not in a
220
234
  setup script that installs it again on every run.
221
235
 
@@ -395,10 +409,12 @@ that replaced it, and leave the newer text alone.
395
409
  ## 6. Run `scripts/_setup.sh` and watch it finish
396
410
 
397
411
  After `zen check` passes, run `scripts/_setup.sh` yourself. A pass is not done
398
- until it has run to completion in this session. The exception is a spec-only
399
- pass, as the `zen-spec-sync` skill defines it: there `scripts/_setup.sh --check`
412
+ until it has run to completion in this session. The exceptions are a spec-only
413
+ or model-reference-only pass, as the `zen-spec-sync` skill defines them:
414
+ there `scripts/_setup.sh --check`
400
415
  reporting every step `skipped` is enough, and anything else sends you back to
401
- the full run below.
416
+ the full run below. For any tier, when `STEPS` is empty, one successful
417
+ `scripts/_setup.sh --check` is sufficient; do not run it twice to prove nothing.
402
418
 
403
419
  It is slow - embedding a large corpus is hours, and the progress line says how
404
420
  many - so start it in the background and follow the logs instead of waiting
@@ -436,10 +452,18 @@ blind:
436
452
 
437
453
  ## 7. Verify and report
438
454
 
439
- Run `zen check` again and fix whatever it names rather than working around it.
455
+ After the final edit and setup, run
456
+ `.github/skills/zen-review/scripts/review.sh check full --fix` and fix whatever
457
+ it names rather than working around it. The model-reference-only tier may use
458
+ `check no-sandbox` under the skill's unchanged-sandbox conditions. A pin repair
459
+ requires the full sandbox check. This is the final expensive check, not an
460
+ instruction to repeat an already valid one. Use
461
+ `.github/skills/zen-review/scripts/review.sh --skip-check` (with `no-sandbox`
462
+ only for that eligible tier) for the mechanical review, which verifies the
463
+ receipt instead of probing again. Edits after a check invalidate reuse.
440
464
  It validates structure and says nothing about the prose, so work §9 of the
441
465
  copilot instructions as a checklist afterwards and report each group pass or
442
- fail. Then report in the chat:
466
+ fail, narrowed only by the skill's tier rules. Then report in the chat:
443
467
 
444
468
  - what changed, file by file, and which specification item each change closes
445
469
  - every prompt or skill line that served no specification item, and what became
@@ -450,7 +474,9 @@ fail. Then report in the chat:
450
474
 
451
475
  ## 8. Record the pass
452
476
 
453
- Last, and only once §6 and §7 have actually passed. Write
477
+ Last, and only once §6 and §7 have actually passed. Use `snapshot.sh record`
478
+ with explicit scope, changes, feedback, unresolved items and check outcomes
479
+ (see the `zen-spec-sync` skill), or write
454
480
  `.spec-sync/history/<stamp>.md` in the format the `zen-spec-sync` skill gives -
455
481
  including `Still open`, which is the only place the next pass learns that an
456
482
  unchanged specification line is not yet implemented - and then:
@@ -468,4 +494,4 @@ A pass that changed nothing still writes a history file and still commits. Say
468
494
  in the chat which history file you wrote and that the baseline moved.
469
495
 
470
496
  Do not report a specification item as done unless the file that implements it
471
- exists, `zen check` passes, and `scripts/_setup.sh` completed every step it owns.
497
+ exists, `zen check` passes, and setup satisfies the selected tier's proof.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: zen-analyze-run
3
3
  description: 'Use when asked to analyze, audit or review one recorded Zenera run as a whole - how healthy it was, whether memory was used and saved correctly, whether delegation and forking were right, where tools were misused and time or tokens wasted - and which sentence in the prompts, skills, house rules or tool descriptions to change so the next run does better. Needs a run directory or run id.'
4
+ user-invocable: false
4
5
  ---
5
6
 
6
7
  # Analyze a run
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: zen-cli
3
3
  description: How to drive this project from the terminal with `zen` - running it, validating it, credentials, the sandbox, run reports, and the `gym` and `rag` modules.
4
+ user-invocable: false
4
5
  ---
5
6
 
6
7
  # The `zen` command line
@@ -44,25 +45,25 @@ The full reference lives next to this file, one document per part of the command
44
45
  line. **Read the one that covers the question before answering it** - do not
45
46
  guess a flag, and do not read them all.
46
47
 
47
- | The question is about | Read |
48
- | ------------------------------------------------------------------- | --------------------------------------------------------------- |
49
- | Global flags, `--json`, exit codes, environment, where files live | [frame.md](./references/frame.md) |
50
- | Creating, finding or opening a project | [projects.md](./references/projects.md) |
51
- | Running: the TUI, one-shot answers, sessions, workspaces, overrides | [run.md](./references/run.md) |
52
- | Many questions at once: `zen run batch`, its file, where answers go | [run.md](./references/run.md) |
53
- | Validating: `zen check`, what it can and cannot see | [check.md](./references/check.md) |
54
- | API keys, providers, the keyring, "no credential" errors | [keys.md](./references/keys.md) |
55
- | Which models exist, whether one works, recovering from a refusal | [models.md](./references/models.md) |
56
- | The container shell commands run in, images, `persist` | [sandbox.md](./references/sandbox.md) (and `zen-sandbox` skill) |
57
- | Run reports, trajectories, what a session directory holds | [inspect.md](./references/inspect.md) |
58
- | Reading a run yourself: the node graph, opening a node by id | [inspect.md](./references/inspect.md) (and `zen-inspect` skill) |
59
- | What the agents remember, why something was recalled, forgetting | [memory.md](./references/memory.md) |
60
- | The meta agent: `zen meta run`, stored prompts, its `--json` object | [meta.md](./references/meta.md) |
61
- | The evaluation dataset: cases, drift, notes, drawing a sample | [dataset.md](./references/dataset.md) (and `zen-dataset` skill) |
62
- | Tuning the prose on the dataset: workers, applies, STATUS.md | [finetune.md](./references/finetune.md) |
63
- | Sharing a project: archives, what travels, importing one safely | [export.md](./references/export.md) |
64
- | `zen gym` - a mock API from an OpenAPI/Swagger document | [gym.md](./references/gym.md) |
65
- | `zen rag` - searching an API description, or a pile of markdown | [rag.md](./references/rag.md) |
48
+ | The question is about | Read |
49
+ | -------------------------------------------------------------------- | --------------------------------------------------------------- |
50
+ | Global flags, `--json`, exit codes, environment, where files live | [frame.md](./references/frame.md) |
51
+ | Creating, finding or opening a project | [projects.md](./references/projects.md) |
52
+ | Running: the TUI, one-shot answers, sessions, workspaces, overrides | [run.md](./references/run.md) |
53
+ | Many questions at once: `zen run batch`, its file, where answers go | [run.md](./references/run.md) |
54
+ | Validating: `zen check`, what it can and cannot see | [check.md](./references/check.md) |
55
+ | API keys, providers, the keyring, "no credential" errors | [keys.md](./references/keys.md) |
56
+ | Which models exist, whether one works, recovering from a refusal | [models.md](./references/models.md) |
57
+ | The container shell commands run in, images, `persist` | [sandbox.md](./references/sandbox.md) (and `zen-sandbox` skill) |
58
+ | Run reports, trajectories, what a session directory holds | [inspect.md](./references/inspect.md) |
59
+ | Reading a run yourself: the node graph, opening a node by id | [inspect.md](./references/inspect.md) (and `zen-inspect` skill) |
60
+ | What the agents remember, why something was recalled, forgetting | [memory.md](./references/memory.md) |
61
+ | The meta agent: `zen meta run`, its `/commands`, its `--json` object | [meta.md](./references/meta.md) |
62
+ | The evaluation dataset: cases, drift, notes, drawing a sample | [dataset.md](./references/dataset.md) (and `zen-dataset` skill) |
63
+ | Tuning the prose on the dataset: workers, applies, STATUS.md | [finetune.md](./references/finetune.md) |
64
+ | Sharing a project: archives, what travels, importing one safely | [export.md](./references/export.md) |
65
+ | `zen gym` - a mock API from an OpenAPI/Swagger document | [gym.md](./references/gym.md) |
66
+ | `zen rag` - searching an API description, or a pile of markdown | [rag.md](./references/rag.md) |
66
67
 
67
68
  ## The short version
68
69
 
@@ -82,7 +83,7 @@ zen import a.zip unpack one somebody sent, run nothing in i
82
83
  zen key ls --check which credentials still work
83
84
  zen models test <ref> whether one model actually answers
84
85
  zen models ls --embeddings the embedders this machine can reach
85
- zen meta run acme /analyze --json > analyze.json a stored prompt, the result as JSON
86
+ zen meta run acme /analyze --json > analyze.json a command, the result as JSON
86
87
  ```
87
88
 
88
89
  ## Searching documents without help
@@ -30,7 +30,7 @@ tries used up -> difficult
30
30
  - **A parked case gives its worker back**, so another case runs while it waits
31
31
  for an apply; once woken, it takes a worker before any new case does.
32
32
  - **Applies are batched.** Parked cases' improvement requests are applied
33
- together by `/finetune-apply` once **M** cases are parked, or once nothing is
33
+ together by `/zen-finetune-apply` once **M** cases are parked, or once nothing is
34
34
  running and no case is left to start. `-M` is at least 2 (`-M 1` needs
35
35
  `--force`): one case is an anecdote. No run starts during an apply; runs in
36
36
  flight finish first. Each apply gets its own `applies/<NNN>/APPLY.md`: every
@@ -2,8 +2,8 @@
2
2
 
3
3
  ```
4
4
  zen meta run [project] "<question>" ask it something
5
- zen meta run [project] /<name> [words] run .github/prompts/<name>.prompt.md
6
- zen meta prompts [project] list the stored prompts
5
+ zen meta run [project] /<name> [words] run the command .github/skills/<name>/SKILL.md
6
+ zen meta prompts [project] list the commands (skills without zen-)
7
7
  zen meta resume [project] [session] carry on a run that stopped
8
8
  zen meta model [ref] show or set the model it uses
9
9
  zen meta dataset <verb> see dataset.md
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: zen-code-python
3
3
  description: Code an agent writes must be a reusable tool that can be remembered and re-run, never a one-off. Holds the coding rules (`references/code_python.md`) and decides where they go in the target project - a section of a dedicated code agent's system prompt, or a coding skill for generic agents that sometimes run code - how to adapt them, and what a prompt or skill for a code-writing agent must never say. Load before writing, editing or reviewing any agent prompt, skill or house rule for an agent that writes or runs code - any agent holding `sandbox:*` or `run_command` - and before shipping a script inside a skill.
4
+ user-invocable: false
4
5
  ---
5
6
 
6
7
  # Code an agent writes is a tool
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: zen-dataset
3
3
  description: Keep a project's evaluation dataset in `dataset/` with `zen meta dataset` - every case read from its sources with a class, a complexity, tags, a verbatim rubric and an anchor to the section it came from. Covers extracting a training set of any shape into a proposal, applying it as a revision, finding which cases their sources moved under (drift) and re-reading only those sections, settling gone and uncovered sections, overriding a field by hand, leaving notes and verdicts on a case, reading a case's history and the sessions that touched it, and drawing samples by criteria (class, complexity, tag, rubric, revision, verdict, note kind, source, text) stratified, weighted and seeded. Load before building or refreshing a dataset, before running /dataset, before choosing which cases to run, and before writing a note or verdict on a case.
4
+ user-invocable: false
4
5
  ---
5
6
 
6
7
  # The dataset
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: zen-finetune
3
- description: Fine-tune an agent project against a training set, a batch at a time, and every batch twice over — first with NO memory, then WITH the memory it just built. Read the whole training set, in any format, into a classified, complexity-rated dataset with rubrics; choose up to a limit of cases from it evenly by class, rubric and complex cases first. Batch 1 is a smoke test of 3 cases; each batch that goes smoothly doubles the next, up to a maximum, and each is built when it is needed from new cases plus rechecks of earlier ones — difficult ones first, then complex ones. Each batch runs with an empty memory via `zen run batch`; every trajectory is graded with `zen inspect graph`, `node` and `ask` for rubric compliance, llm-call count, fork use, assumptions, what it committed to memory and delegation; the proposals of every case are merged into edits of prompts, skills, house rules and `agents/<topic>-policy-instructions.md` files, and the same cases run again until they pass. Then what the passing run's cases committed is merged with the last good memory into a candidate, every case runs again from its own copy of it, recall and re-commits are graded the same way, the memory policy is tuned until recall makes the work dramatically cheaper without changing a verdict or re-committing what memory already held — and only then does the candidate become the last good memory and the next batch start. Cases that cause the most trouble go on a difficult list and keep coming back until they are fixed or declared stuck. The agent writes `finetune/README.md` — the plan, a mermaid map of every step, and the progress — before the first run and patches it after every step; `scripts/next.mjs` reads the state off disk so an interrupted session can resume. Load before evaluating an agent project against example queries, before acting on "it gets this wrong", when asked to improve prompts or instructions from evidence rather than taste, when building an eval or regression set out of a specification, when optimising memory use or run cost, or whenever a batch of runs has to be graded rather than merely executed.
3
+ description: Fine-tune an agent project's prose - prompts, skills, house rules, policy files - against a training set, a batch at a time, each batch first with NO memory and then WITH the memory it built. Batch 1 is a 3-case smoke test, each smooth batch doubles the next, and earlier difficult and complex cases come back as rechecks. Trajectories are graded with `zen inspect`, proposals merged into edits, and runs repeated until they pass; then the committed memory becomes a candidate and the memory policy is tuned until recall makes the work cheaper. `finetune/README.md` and `scripts/next.mjs` keep the state on disk so an interrupted session resumes. Load before evaluating a project against example queries, acting on "it gets this wrong", improving instructions from evidence, building a regression set from a specification, optimising memory use or run cost, or grading a batch of runs.
4
+ user-invocable: false
4
5
  ---
5
6
 
6
7
  # Fine-tuning an agent project
@@ -1,10 +1,13 @@
1
1
  ---
2
- description: Apply a batch of improvement requests from the tuning loop to the project's prose - merge them into patterns, edit prompts, skills and policy files, tidy up every file touched, and record what was done with each. Run by `zen meta finetune`; the line after the prompt names the apply directory, and a brief follows it.
2
+ name: zen-finetune-apply
3
+ description: Apply a batch of improvement requests from the tuning loop to the project's prose - merge them into patterns, edit prompts, skills and policy files, tidy up every file touched, and record what was done with each. Run only by `zen meta finetune`, never by hand; the words given with it name the apply directory, and a brief follows them.
4
+ user-invocable: false
5
+ disable-model-invocation: true
3
6
  ---
4
7
 
5
8
  The tuning loop has collected improvement requests from several cases and
6
- wants them applied **together**. The line after this prompt names the apply
7
- directory.
9
+ wants them applied **together**. The words given with this skill name the
10
+ apply directory.
8
11
 
9
12
  Every sentence you add is read by every later call of every agent that loads
10
13
  it, so prose has a price even when it fixes the case in front of you. The loop
@@ -14,7 +17,7 @@ your edit; one it broke comes back to the next apply as a request.
14
17
 
15
18
  ## What you are given
16
19
 
17
- A `## The brief` section after that line is what the loop already read and
20
+ A `## The brief` section after them is what the loop already read and
18
21
  worked out for you, from the files below. Work from it:
19
22
 
20
23
  - Do not read a file the brief shows, and do not run a command it shows -