@zenera/cli 1.1.42 → 1.1.44

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 (56) hide show
  1. package/README.md +6 -4
  2. package/dist/commands/check.js +7 -5
  3. package/dist/commands/completion.d.ts +1 -1
  4. package/dist/commands/completion.js +4 -4
  5. package/dist/commands/meta.js +10 -10
  6. package/dist/commands/run.js +18 -6
  7. package/dist/completion.js +1 -1
  8. package/dist/meta/editor.js +43 -3
  9. package/dist/meta/finetune/command.js +2 -2
  10. package/dist/meta/finetune/improvements.js +1 -1
  11. package/dist/meta/prompts.d.ts +8 -3
  12. package/dist/meta/prompts.js +42 -19
  13. package/dist/resolve.d.ts +2 -0
  14. package/dist/resolve.js +1 -1
  15. package/dist/usage.d.ts +1 -1
  16. package/dist/usage.js +1 -1
  17. package/dist/validate.d.ts +11 -0
  18. package/dist/validate.js +46 -3
  19. package/package.json +4 -4
  20. package/templates/editor/.github/copilot-instructions.md +35 -22
  21. package/templates/editor/.github/{prompts/analyze.prompt.md → skills/analyze/SKILL.md} +6 -3
  22. package/templates/editor/.github/{prompts/dataset.prompt.md → skills/dataset/SKILL.md} +6 -3
  23. package/templates/editor/.github/{prompts/finetune.prompt.md → skills/finetune/SKILL.md} +7 -4
  24. package/templates/editor/.github/{prompts/new-agent.prompt.md → skills/new-agent/SKILL.md} +3 -1
  25. package/templates/editor/.github/{prompts/new-skill.prompt.md → skills/new-skill/SKILL.md} +3 -1
  26. package/templates/editor/.github/{prompts/project-review.prompt.md → skills/project-review/SKILL.md} +6 -0
  27. package/templates/editor/.github/{prompts/spec-apply-feedback.prompt.md → skills/spec-apply-feedback/SKILL.md} +2 -0
  28. package/templates/editor/.github/{prompts/spec-edit.prompt.md → skills/spec-edit/SKILL.md} +26 -23
  29. package/templates/editor/.github/{prompts/spec-sync-project.prompt.md → skills/spec-sync-project/SKILL.md} +40 -16
  30. package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +1 -0
  31. package/templates/editor/.github/skills/zen-cli/SKILL.md +23 -21
  32. package/templates/editor/.github/skills/zen-cli/references/check.md +2 -1
  33. package/templates/editor/.github/skills/zen-cli/references/finetune.md +1 -1
  34. package/templates/editor/.github/skills/zen-cli/references/meta.md +2 -2
  35. package/templates/editor/.github/skills/zen-cli/references/run.md +12 -4
  36. package/templates/editor/.github/skills/zen-code-python/SKILL.md +1 -0
  37. package/templates/editor/.github/skills/zen-dataset/SKILL.md +1 -0
  38. package/templates/editor/.github/skills/zen-finetune/SKILL.md +2 -1
  39. package/templates/editor/.github/{prompts/finetune-apply.prompt.md → skills/zen-finetune-apply/SKILL.md} +7 -4
  40. package/templates/editor/.github/skills/zen-inspect/SKILL.md +1 -0
  41. package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +1 -0
  42. package/templates/editor/.github/skills/zen-instructions/SKILL.md +1 -0
  43. package/templates/editor/.github/skills/zen-memory/SKILL.md +1 -0
  44. package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +1 -0
  45. package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +1 -0
  46. package/templates/editor/.github/skills/zen-rag-schema/SKILL.md +1 -0
  47. package/templates/editor/.github/skills/zen-review/SKILL.md +34 -0
  48. package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +1 -1
  49. package/templates/editor/.github/skills/zen-review/scripts/check-receipt.mjs +95 -0
  50. package/templates/editor/.github/skills/zen-review/scripts/review.sh +27 -2
  51. package/templates/editor/.github/skills/zen-sandbox/SKILL.md +2 -1
  52. package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +2 -1
  53. package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +115 -20
  54. package/templates/editor/.github/skills/zen-spec-sync/scripts/snapshot.sh +83 -2
  55. package/templates/editor/.github/skills/zen-topology/SKILL.md +1 -0
  56. package/templates/project/agents/prompts/default.md.tmpl +3 -3
@@ -1,7 +1,7 @@
1
1
  # Copilot instructions - agent projects
2
2
 
3
3
  > Written by `zen init` into `.github/copilot-instructions.md`, alongside the
4
- > prompt files and skills in the same tree (§2.4). VS Code loads it
4
+ > skills and commands in the same tree (§2.4). VS Code loads it
5
5
  > automatically for every request in this folder, so it is the standing brief
6
6
  > for anyone - human or agent - editing this project.
7
7
  >
@@ -35,12 +35,15 @@ programmed: what an agent knows, which model answers, and which of the tools
35
35
  6. Every change must still load: `agents.yaml` is validated strictly at load,
36
36
  and `zen check` says so before a model is ever called.
37
37
 
38
- ### 0.1 Copilot is the meta-agent: load the skill for every capability in use
38
+ ### 0.1 Copilot is the meta-agent: load skills for the capabilities in scope
39
39
 
40
40
  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.
44
47
 
45
48
  **Every runtime capability a project turns on carries obligations that are not
46
49
  visible in `agents.yaml` and that `zen check` does not report.** Before
@@ -54,20 +57,23 @@ code, `zen-topology` for `handoffs:` or `fork:` on any agent,
54
57
  `zen-cli` always. A capability that is already
55
58
  configured and already passing `zen check` is exactly the case that looks
56
59
  finished and is not: the obligation lives in the skill, so a review that never
57
- opens the skill cannot find what is missing. This applies whatever prompted the
58
- change - a task scoped to `SPECIFICATION.md` does not narrow it. There is one
59
- exception: a `/spec-sync-project` pass that the `zen-spec-sync` skill classes as
60
- **spec-only**. It touches no agent, prompt, skill or wiring, so there is no
61
- obligation for it to meet.
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 only
62
+ skills for capabilities its changed requirements, files, keys or unresolved
63
+ work touch. A full pass still loads every enabled capability's skill. The
64
+ **spec-only** and **model-reference-only** tiers load no capability skill unless
65
+ the work expands beyond their eligibility rules.
62
66
 
63
67
  **Load `zen-instructions` before writing, editing, reviewing or deleting any
64
68
  `agents/*instructions.md`.** They are the house rules, prepended to every
65
- agent's prompt, and three of them are `zen`'s own copies rather than the
69
+ agent's prompt, and four of them are `zen`'s own copies rather than the
66
70
  project's: an edit made inside one is lost at the next `zen check --fix`, `zen
67
71
  init` or `zen open`, with no diff to show for it. The skill is what says which
68
- three those are, where a project's own rules on the same subjects go instead,
72
+ four those are, where a project's own rules on the same subjects go instead,
69
73
  how `requires:` conditions a document, and what filename order decides. None of
70
74
  that is visible in the file being edited.
75
+ Replacing generated copies with `zen check --fix` is maintenance, not manual
76
+ house-rule editing, and does not by itself require loading `zen-instructions`.
71
77
 
72
78
  **Load `zen-code-python` before writing, editing or reviewing any prompt, skill
73
79
  or house rule for an agent that writes or runs code** - any agent holding
@@ -251,8 +257,7 @@ Two consequences that drive nearly every design rule in this document:
251
257
  my-project/
252
258
  ├── .github/ the editor's brief - §2.4
253
259
  │ ├── copilot-instructions.md this file
254
- │ ├── prompts/*.prompt.md tasks you invoke by name
255
- │ └── skills/*/SKILL.md reference the editor loads on demand
260
+ │ └── skills/*/SKILL.md zen-* reference loaded on demand; the rest /commands
256
261
  ├── .env this project's environment - NEVER committed
257
262
  ├── .spec-sync/ what the last /spec-sync-project applied - §0.1
258
263
  ├── agents.yaml who exists, what they may reach for
@@ -349,15 +354,18 @@ agents do, for the same reason - it is a prefix somebody pays for:
349
354
 
350
355
  - **`copilot-instructions.md`** is always on. Everything in it is loaded for
351
356
  every request in this folder, so it holds only what is true of every task.
352
- - **`.github/skills/<name>/SKILL.md`** is reference the editor loads when its
353
- `description` matches what you asked. Put long, occasional material here -
354
- a command surface, a vendor's quirks, a format spec - not in the file above.
355
- The `description` is the routing key; §3.4 applies to these as much as to the
356
- project's own skills.
357
- - **`.github/prompts/<name>.prompt.md`** is a task you invoke by name (`/name`),
358
- with `mode: agent` and a `description` in its frontmatter. Write one when a
359
- job is done repeatedly and has a right order - adding an agent, adding a
360
- skill, reviewing before a commit.
357
+ - **`.github/skills/zen-<name>/SKILL.md`** is reference the editor loads when
358
+ its `description` matches what you asked. Put long, occasional material here
359
+ - a command surface, a vendor's quirks, a format spec - not in the file above.
360
+ The `description` is the routing key; §3.4 applies to these as much as to the
361
+ project's own skills. `user-invocable: false` keeps them out of the `/` menu.
362
+ - **`.github/skills/<name>/SKILL.md`** without the `zen-` prefix is a command
363
+ you invoke by name (`/name`, or `zen meta run /name`), with
364
+ `disable-model-invocation: true` so the model never starts one on a hunch,
365
+ and an `argument-hint` when it takes words. Write one when a job is done
366
+ repeatedly and has a right order - adding an agent, adding a skill, reviewing
367
+ before a commit. It holds the order of the work and loads the `zen-*` skills
368
+ that hold the rules.
361
369
 
362
370
  `zen init` and `zen open` rewrite this whole tree from the version of `zen` in
363
371
  hand, so **edits inside `.github/` do not survive**. Project-specific conventions
@@ -1885,6 +1893,11 @@ the spec-sync record, in that order:
1885
1893
 
1886
1894
  Run it first and read what it says. Everything else below is judgement, which is
1887
1895
  why it is still a list. The `zen-review` skill has the detail.
1896
+ Within a specification-sync pass, reuse its final check with
1897
+ `review.sh --skip-check` instead of probing again, and apply the sync skill's
1898
+ explicit tier scope to this checklist. Use `--skip-check no-sandbox` only for an
1899
+ eligible model-reference-only pass. Independent reviews still cover the whole
1900
+ checklist.
1888
1901
 
1889
1902
  Before finishing any change here:
1890
1903
 
@@ -2086,8 +2099,8 @@ install` is an `image:` that was never set - §3.7.
2086
2099
 
2087
2100
  This file is loaded on every request in this repository, so it is subject to its
2088
2101
  own rules: stable, factual, no hedging. Before adding a section, ask whether it
2089
- is true of every task - if it is not, it is a skill under `.github/skills/`, or
2090
- a prompt file under `.github/prompts/` if it is a procedure (§2.4).
2102
+ is true of every task - if it is not, it is a `zen-*` skill under
2103
+ `.github/skills/`, or a command skill there if it is a procedure (§2.4).
2091
2104
 
2092
2105
  Update it when:
2093
2106
 
@@ -1,5 +1,8 @@
1
1
  ---
2
+ name: analyze
2
3
  description: Analyze one recorded run of this project - its health, what it wasted, and what to change in the instructions. Name the run (directory or id) after the command, or get the most recent one.
4
+ argument-hint: '[run directory or run id]'
5
+ disable-model-invocation: true
3
6
  ---
4
7
 
5
8
  Load the **zen-analyze-run** skill and follow it to analyze one run of this
@@ -10,10 +13,10 @@ audit cannot be graded without it.
10
13
 
11
14
  ## Which run
12
15
 
13
- The line after this prompt may name the run - a run directory or a run id.
14
- If it does, use it. Words after it like `case=<id> ... feedback=<file>` mean
16
+ The words given with the command may name the run - a run directory or a run
17
+ id. If they do, use it. Words after it like `case=<id> ... feedback=<file>` mean
15
18
  the tuning loop sent you: follow section 7 of the skill and write that file.
16
- A `## The brief` section below that line is what the loop already ran for
19
+ A `## The brief` section below them is what the loop already ran for
17
20
  you: section 1 of the skill says how to use it.
18
21
 
19
22
  If it does not, list this project's most recent runs, newest first:
@@ -1,17 +1,20 @@
1
1
  ---
2
+ name: dataset
2
3
  description: Build or refresh this project's dataset - every case read from its sources with a class, complexity, tags, a verbatim rubric and an anchor - re-reading only the sections that changed since the last revision. Name a source after the command to add it, `rebuild` to read everything again, or a case and what to fix.
4
+ argument-hint: '[source file | rebuild | <case id> <what to fix>]'
5
+ disable-model-invocation: true
3
6
  ---
4
7
 
5
8
  Keep `dataset/` in step with its sources. **Load the `zen-dataset` skill before
6
9
  anything else**, and `zen-cli` for the command reference. The skill holds the
7
- extraction rules and every verb; this prompt is the order of the work. If
10
+ extraction rules and every verb; this command is the order of the work. If
8
11
  loading a skill fails, read `.github/skills/<name>/SKILL.md` with your file tool
9
12
  before going on.
10
13
 
11
14
  You never run cases, never edit `agents/`, and never edit a source. Only
12
15
  `zen meta dataset` writes `dataset/` - never a file tool, never a script.
13
16
 
14
- This prompt is **reentrant**: the state on disk says what to do, so running it
17
+ This command is **reentrant**: the state on disk says what to do, so running it
15
18
  twice in a row does nothing the second time.
16
19
 
17
20
  ## 1. Where things stand
@@ -27,7 +30,7 @@ sections are `changed`, `gone` or `uncovered`.
27
30
 
28
31
  ## 2. What to do
29
32
 
30
- The last line of this prompt may hold words. Then read the table top down and
33
+ Words may be given with the command. Then read the table top down and
31
34
  take the first row that fits:
32
35
 
33
36
  | State | Do |
@@ -1,5 +1,8 @@
1
1
  ---
2
+ name: finetune
2
3
  description: Fine-tune this project against a training set, a batch at a time - every batch first with no memory, fixing the instructions, then with the memory it just built, making the same work cheaper - starting from a 3-case smoke test and doubling each smooth batch, until every case is used and no difficult case is open.
4
+ argument-hint: '[training set] [limit]'
5
+ disable-model-invocation: true
3
6
  ---
4
7
 
5
8
  Tune this project against real queries. Nothing here touches model weights: what
@@ -9,7 +12,7 @@ queries produce.
9
12
 
10
13
  **Load the `zen-finetune` skill before anything else**, and load `zen-inspect`,
11
14
  `zen-analyze-run`, `zen-topology` and `zen-inspect-ask` before you grade, and
12
- `zen-instructions` before you write a policy file. This prompt is the order of the work; the skill
15
+ `zen-instructions` before you write a policy file. This command is the order of the work; the skill
13
16
  is how each step is done, and it holds the rules that are easy to get wrong. If
14
17
  loading a skill fails, read `.github/skills/<name>/SKILL.md` with your file tool
15
18
  before going on - never carry on without it.
@@ -28,7 +31,7 @@ command:
28
31
  | one memory node in full | `zen memory show <node-id> --dir "$RUN/batch/<id>/memory"` |
29
32
  | a whole memory, or what one added to another | `zen memory ls --dir <dir>`, `zen memory diff <base> --dir <dir>` |
30
33
 
31
- This prompt is **reentrant**. Tuning is long and gets interrupted - a run dies, a
34
+ This command is **reentrant**. Tuning is long and gets interrupted - a run dies, a
32
35
  session ends, I stop you mid-batch. Every step leaves its result on disk under
33
36
  `finetune/`, so a second invocation does not start over: it reads that state,
34
37
  works out where the work stopped, says so, and carries on from there unless I
@@ -199,7 +202,7 @@ in your reports instead of re-typing it.
199
202
 
200
203
  ## Where you are - work this out before anything else
201
204
 
202
- Do this every time this prompt runs, including the first:
205
+ Do this every time this command runs, including the first:
203
206
 
204
207
  ```sh
205
208
  .github/skills/zen-finetune/scripts/next.mjs
@@ -208,7 +211,7 @@ Do this every time this prompt runs, including the first:
208
211
  ```
209
212
 
210
213
  `next.mjs` reads the whole `finetune/` tree and prints the next step. Do not
211
- re-derive the state from an `ls`. Map what it says onto this prompt:
214
+ re-derive the state from an `ls`. Map what it says onto this command:
212
215
 
213
216
  | What `next.mjs` says | Go to |
214
217
  | ---------------------------------------------------------------- | --------------------------------------------------------------------------------- |
@@ -1,6 +1,8 @@
1
1
  ---
2
- mode: agent
2
+ name: new-agent
3
3
  description: Add an agent to agents.yaml, with its prompt, tools and handoffs.
4
+ argument-hint: "[the agent's job in one sentence]"
5
+ disable-model-invocation: true
4
6
  ---
5
7
 
6
8
  Add an agent to this project. Ask for the one sentence that states its job
@@ -1,6 +1,8 @@
1
1
  ---
2
- mode: agent
2
+ name: new-skill
3
3
  description: Add a skill under agents/skills, with a description that routes.
4
+ argument-hint: '[what the skill says and when it applies]'
5
+ disable-model-invocation: true
4
6
  ---
5
7
 
6
8
  Add a skill to this project. A skill is curated instruction content - and
@@ -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
@@ -1,9 +1,11 @@
1
1
  ---
2
- description: Change SPECIFICATION.md as the request after the command asks - written in the specification's own structure and voice, checked against what the runtime can actually do - and nothing else.
3
- argument-hint: what to add, change or remove in the specification
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.
4
+ argument-hint: 'what to add, change or remove in the specification'
5
+ disable-model-invocation: true
4
6
  ---
5
7
 
6
- Edit `SPECIFICATION.md` the way the request after this command asks. The
8
+ Edit `SPECIFICATION.md` the way the request given with this command asks. The
7
9
  specification is the intent of the project; you are changing the intent, not
8
10
  the implementation. Making the project match it is `/spec-sync-project`, which
9
11
  runs after this.
@@ -11,41 +13,41 @@ runs after this.
11
13
  You change one file: `SPECIFICATION.md`. Not `agents.yaml`, not a prompt, not a
12
14
  skill, not `SPECIFICATION-FEEDBACK.md`.
13
15
 
14
- ## 0. Everything you need is already attached
16
+ ## 0. Read everything you need first
15
17
 
16
- These files are attached to this prompt so the work starts without a round of
17
- reads. Use them as they are; do not read them again with a tool.
18
+ These are the files the work depends on. Read them before anything else, so
19
+ the work starts from all of them rather than from a round of reads later.
18
20
 
19
21
  The project:
20
22
 
21
- - [SPECIFICATION.md](../../SPECIFICATION.md) - the file you are editing.
22
- - [SPECIFICATION-FEEDBACK.md](../../SPECIFICATION-FEEDBACK.md) - the questions
23
+ - [SPECIFICATION.md](../../../SPECIFICATION.md) - the file you are editing.
24
+ - [SPECIFICATION-FEEDBACK.md](../../../SPECIFICATION-FEEDBACK.md) - the questions
23
25
  still open against it, and the ones already answered. It may not exist; that
24
26
  only means nothing is open.
25
27
 
26
28
  What the runtime can do, so that what you write is something it can build:
27
29
 
28
- - [zen-cli](../skills/zen-cli/SKILL.md) - every `zen` command, and
29
- [its models reference](../skills/zen-cli/references/models.md) - how to find
30
+ - [zen-cli](../zen-cli/SKILL.md) - every `zen` command, and
31
+ [its models reference](../zen-cli/references/models.md) - how to find
30
32
  which models this machine can actually use.
31
- - [zen-instructions](../skills/zen-instructions/SKILL.md) - house rules: what
33
+ - [zen-instructions](../zen-instructions/SKILL.md) - house rules: what
32
34
  every agent is told, and what belongs there rather than in a prompt.
33
- - [zen-topology](../skills/zen-topology/SKILL.md) - one agent or several,
35
+ - [zen-topology](../zen-topology/SKILL.md) - one agent or several,
34
36
  hand-off or fork, and what each costs.
35
- - [zen-memory](../skills/zen-memory/SKILL.md) - what memory is, who may read and
37
+ - [zen-memory](../zen-memory/SKILL.md) - what memory is, who may read and
36
38
  write it, and what a strategy for it has to say.
37
- - [zen-rag-docs](../skills/zen-rag-docs/SKILL.md) - an index over a folder of
39
+ - [zen-rag-docs](../zen-rag-docs/SKILL.md) - an index over a folder of
38
40
  markdown documents.
39
- - [zen-rag-schema](../skills/zen-rag-schema/SKILL.md) - an index over an OpenAPI
41
+ - [zen-rag-schema](../zen-rag-schema/SKILL.md) - an index over an OpenAPI
40
42
  description.
41
- - [zen-sandbox](../skills/zen-sandbox/SKILL.md) - the container: what it mounts,
43
+ - [zen-sandbox](../zen-sandbox/SKILL.md) - the container: what it mounts,
42
44
  what it can reach, what persists.
43
- - [zen-code-python](../skills/zen-code-python/SKILL.md) - reusable scripts as
45
+ - [zen-code-python](../zen-code-python/SKILL.md) - reusable scripts as
44
46
  tools, where they live, and which agents own them.
45
47
 
46
- If any of these did not arrive attached - your editor does not resolve links in
47
- prompt files - read all of them in **one** batch of parallel reads before doing
48
- anything else, `SPECIFICATION-FEEDBACK.md` included if it exists. Never one at a
48
+ Any of these already in your context - attached, or loaded as a skill - you
49
+ need not read again. Read the rest in **one** batch of parallel reads before
50
+ doing anything else, `SPECIFICATION-FEEDBACK.md` included if it exists. Never one at a
49
51
  time, and never skip one because the request seems not to need it: a request
50
52
  about an agent's job can still decide what that agent may remember.
51
53
 
@@ -60,7 +62,7 @@ That is the list of models with a credential on this machine - the only ones a
60
62
  `zen models search <name>` once; if it is still absent, say so in the chat and
61
63
  do not write it.
62
64
 
63
- If there is no request after the command, ask what to change and stop.
65
+ If no request was given with the command, ask what to change and stop.
64
66
 
65
67
  ## 1. Understand the request against what is there
66
68
 
@@ -245,6 +247,7 @@ In the chat:
245
247
  needs a value only the reader has
246
248
  - then, in one line: send `/spec-sync-project` to make the project match.
247
249
 
248
- ## 5. User Request:
250
+ ## 5. The request
249
251
 
250
- Following is the user request that the specification should address (if any):
252
+ The words given with the command are the request the specification should
253
+ 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
 
@@ -127,8 +139,8 @@ the model to compute or remember. Specifically:
127
139
  the container is the same one that built it. An unpinned name drifts away from
128
140
  the host on the next image build; a stale pin leaves the container holding an
129
141
  older `zen` than the session outside it. `zen check` reports both, as
130
- `sandbox.pin.absent` and `sandbox.pin.stale`, but will not repair either - the
131
- Dockerfile is the project's file, so this edit is yours to make. The pin
142
+ `sandbox.pin.absent` and `sandbox.pin.stale`, and `zen check --fix` repairs
143
+ both by rewriting only the version after each `@zenera/*` name. The pin
132
144
  follows `zen --version` even when `SPECIFICATION.md` names another number.
133
145
  The `zen-spec-sync` skill gives the one question to raise in that case.
134
146
 
@@ -395,10 +407,12 @@ that replaced it, and leave the newer text alone.
395
407
  ## 6. Run `scripts/_setup.sh` and watch it finish
396
408
 
397
409
  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`
410
+ until it has run to completion in this session. The exceptions are a spec-only
411
+ or model-reference-only pass, as the `zen-spec-sync` skill defines them:
412
+ there `scripts/_setup.sh --check`
400
413
  reporting every step `skipped` is enough, and anything else sends you back to
401
- the full run below.
414
+ the full run below. For any tier, when `STEPS` is empty, one successful
415
+ `scripts/_setup.sh --check` is sufficient; do not run it twice to prove nothing.
402
416
 
403
417
  It is slow - embedding a large corpus is hours, and the progress line says how
404
418
  many - so start it in the background and follow the logs instead of waiting
@@ -436,10 +450,18 @@ blind:
436
450
 
437
451
  ## 7. Verify and report
438
452
 
439
- Run `zen check` again and fix whatever it names rather than working around it.
453
+ After the final edit and setup, run
454
+ `.github/skills/zen-review/scripts/review.sh check full --fix` and fix whatever
455
+ it names rather than working around it. The model-reference-only tier may use
456
+ `check no-sandbox` under the skill's unchanged-sandbox conditions. A pin repair
457
+ requires the full sandbox check. This is the final expensive check, not an
458
+ instruction to repeat an already valid one. Use
459
+ `.github/skills/zen-review/scripts/review.sh --skip-check` (with `no-sandbox`
460
+ only for that eligible tier) for the mechanical review, which verifies the
461
+ receipt instead of probing again. Edits after a check invalidate reuse.
440
462
  It validates structure and says nothing about the prose, so work §9 of the
441
463
  copilot instructions as a checklist afterwards and report each group pass or
442
- fail. Then report in the chat:
464
+ fail, narrowed only by the skill's tier rules. Then report in the chat:
443
465
 
444
466
  - what changed, file by file, and which specification item each change closes
445
467
  - every prompt or skill line that served no specification item, and what became
@@ -450,7 +472,9 @@ fail. Then report in the chat:
450
472
 
451
473
  ## 8. Record the pass
452
474
 
453
- Last, and only once §6 and §7 have actually passed. Write
475
+ Last, and only once §6 and §7 have actually passed. Use `snapshot.sh record`
476
+ with explicit scope, changes, feedback, unresolved items and check outcomes
477
+ (see the `zen-spec-sync` skill), or write
454
478
  `.spec-sync/history/<stamp>.md` in the format the `zen-spec-sync` skill gives -
455
479
  including `Still open`, which is the only place the next pass learns that an
456
480
  unchanged specification line is not yet implemented - and then:
@@ -468,4 +492,4 @@ A pass that changed nothing still writes a history file and still commits. Say
468
492
  in the chat which history file you wrote and that the baseline moved.
469
493
 
470
494
  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.
495
+ 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
 
@@ -70,7 +71,8 @@ guess a flag, and do not read them all.
70
71
  zen init scaffold a project here, pick a model
71
72
  zen check validate everything before spending a turn
72
73
  zen run the TUI
73
- zen run "what changed?" one answer, this directory as the workspace
74
+ zen run "what changed?" one answer, in a fresh session directory
75
+ zen run --here "what changed?" ... about the files in this directory
74
76
  zen run batch --input cases.json many questions at once, each isolated
75
77
  zen inspect --open what the model was actually given
76
78
  zen inspect graph --dir <run dir> the same run as a graph you can read
@@ -81,7 +83,7 @@ zen import a.zip unpack one somebody sent, run nothing in i
81
83
  zen key ls --check which credentials still work
82
84
  zen models test <ref> whether one model actually answers
83
85
  zen models ls --embeddings the embedders this machine can reach
84
- 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
85
87
  ```
86
88
 
87
89
  ## Searching documents without help
@@ -55,7 +55,8 @@ checked too. A word that is neither is a usage error (exit 2), not a report.
55
55
  is written once, by `zen init`, and nothing rewrites it afterwards, so it falls
56
56
  behind the host on the next upgrade and the container ends up holding a
57
57
  different `zen` than the session outside it. Read rather than run, so this one
58
- is reported with `--no-sandbox` too.
58
+ is reported with `--no-sandbox` too. `--fix` rewrites the pins to this `zen`'s
59
+ version and touches nothing else in the Dockerfile.
59
60
 
60
61
  ### Findings
61
62
 
@@ -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