@zenera/cli 1.1.43 → 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.
- package/dist/commands/completion.d.ts +1 -1
- package/dist/commands/completion.js +4 -4
- package/dist/commands/meta.js +10 -10
- package/dist/completion.js +1 -1
- package/dist/meta/editor.js +43 -3
- package/dist/meta/finetune/command.js +2 -2
- package/dist/meta/finetune/improvements.js +1 -1
- package/dist/meta/prompts.d.ts +8 -3
- package/dist/meta/prompts.js +42 -19
- package/dist/usage.d.ts +1 -1
- package/dist/usage.js +1 -1
- package/package.json +4 -4
- package/templates/editor/.github/copilot-instructions.md +35 -22
- package/templates/editor/.github/{prompts/analyze.prompt.md → skills/analyze/SKILL.md} +6 -3
- package/templates/editor/.github/{prompts/dataset.prompt.md → skills/dataset/SKILL.md} +6 -3
- package/templates/editor/.github/{prompts/finetune.prompt.md → skills/finetune/SKILL.md} +7 -4
- package/templates/editor/.github/{prompts/new-agent.prompt.md → skills/new-agent/SKILL.md} +3 -1
- package/templates/editor/.github/{prompts/new-skill.prompt.md → skills/new-skill/SKILL.md} +3 -1
- package/templates/editor/.github/{prompts/project-review.prompt.md → skills/project-review/SKILL.md} +6 -0
- package/templates/editor/.github/{prompts/spec-apply-feedback.prompt.md → skills/spec-apply-feedback/SKILL.md} +2 -0
- package/templates/editor/.github/{prompts/spec-edit.prompt.md → skills/spec-edit/SKILL.md} +26 -23
- package/templates/editor/.github/{prompts/spec-sync-project.prompt.md → skills/spec-sync-project/SKILL.md} +38 -14
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-cli/SKILL.md +21 -20
- package/templates/editor/.github/skills/zen-cli/references/finetune.md +1 -1
- package/templates/editor/.github/skills/zen-cli/references/meta.md +2 -2
- package/templates/editor/.github/skills/zen-code-python/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-dataset/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-finetune/SKILL.md +2 -1
- package/templates/editor/.github/{prompts/finetune-apply.prompt.md → skills/zen-finetune-apply/SKILL.md} +7 -4
- package/templates/editor/.github/skills/zen-inspect/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-instructions/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-memory/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-rag-schema/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-review/SKILL.md +34 -0
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +1 -1
- package/templates/editor/.github/skills/zen-review/scripts/check-receipt.mjs +95 -0
- package/templates/editor/.github/skills/zen-review/scripts/review.sh +27 -2
- package/templates/editor/.github/skills/zen-sandbox/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +115 -20
- package/templates/editor/.github/skills/zen-spec-sync/scripts/snapshot.sh +83 -2
- package/templates/editor/.github/skills/zen-topology/SKILL.md +1 -0
- package/templates/project/agents/prompts/default.md.tmpl +3 -3
package/templates/editor/.github/{prompts/project-review.prompt.md → skills/project-review/SKILL.md}
RENAMED
|
@@ -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
|
-
|
|
3
|
-
|
|
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
|
|
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.
|
|
16
|
+
## 0. Read everything you need first
|
|
15
17
|
|
|
16
|
-
These
|
|
17
|
-
|
|
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](
|
|
22
|
-
- [SPECIFICATION-FEEDBACK.md](
|
|
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](../
|
|
29
|
-
[its models reference](../
|
|
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](../
|
|
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](../
|
|
35
|
+
- [zen-topology](../zen-topology/SKILL.md) - one agent or several,
|
|
34
36
|
hand-off or fork, and what each costs.
|
|
35
|
-
- [zen-memory](../
|
|
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](../
|
|
39
|
+
- [zen-rag-docs](../zen-rag-docs/SKILL.md) - an index over a folder of
|
|
38
40
|
markdown documents.
|
|
39
|
-
- [zen-rag-schema](../
|
|
41
|
+
- [zen-rag-schema](../zen-rag-schema/SKILL.md) - an index over an OpenAPI
|
|
40
42
|
description.
|
|
41
|
-
- [zen-sandbox](../
|
|
43
|
+
- [zen-sandbox](../zen-sandbox/SKILL.md) - the container: what it mounts,
|
|
42
44
|
what it can reach, what persists.
|
|
43
|
-
- [zen-code-python](../
|
|
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
|
-
|
|
47
|
-
|
|
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
|
|
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.
|
|
250
|
+
## 5. The request
|
|
249
251
|
|
|
250
|
-
|
|
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
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
-
|
|
66
|
-
|
|
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
|
|
|
@@ -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
|
|
399
|
-
pass, as the `zen-spec-sync` skill defines
|
|
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
|
-
|
|
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.
|
|
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
|
|
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
|
|
48
|
-
|
|
|
49
|
-
| Global flags, `--json`, exit codes, environment, where files live
|
|
50
|
-
| Creating, finding or opening a project
|
|
51
|
-
| Running: the TUI, one-shot answers, sessions, workspaces, overrides
|
|
52
|
-
| Many questions at once: `zen run batch`, its file, where answers go
|
|
53
|
-
| Validating: `zen check`, what it can and cannot see
|
|
54
|
-
| API keys, providers, the keyring, "no credential" errors
|
|
55
|
-
| Which models exist, whether one works, recovering from a refusal
|
|
56
|
-
| The container shell commands run in, images, `persist`
|
|
57
|
-
| Run reports, trajectories, what a session directory holds
|
|
58
|
-
| Reading a run yourself: the node graph, opening a node by id
|
|
59
|
-
| What the agents remember, why something was recalled, forgetting
|
|
60
|
-
| The meta agent: `zen meta run`,
|
|
61
|
-
| The evaluation dataset: cases, drift, notes, drawing a sample
|
|
62
|
-
| Tuning the prose on the dataset: workers, applies, STATUS.md
|
|
63
|
-
| Sharing a project: archives, what travels, importing one safely
|
|
64
|
-
| `zen gym` - a mock API from an OpenAPI/Swagger document
|
|
65
|
-
| `zen rag` - searching an API description, or a pile of markdown
|
|
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
|
|
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/
|
|
6
|
-
zen meta prompts [project] list the
|
|
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,
|
|
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
|
-
|
|
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
|
|
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
|
|
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 -
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-inspect
|
|
3
3
|
description: 'Use when an LLM agent must diagnose a recorded Zenera run non-interactively: read `zen inspect graph`, open selected nodes, replay an `llm_call` with `zen inspect ask`, identify loops, failed tools, wrong prompts, missed skills, early hand-offs, failed branches, compaction, latency, or token waste. Requires explicit run, node, and question arguments so commands remain deterministic and never prompt.'
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Diagnose a run non-interactively
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-inspect-ask
|
|
3
3
|
description: 'Use when formulating a question for `zen inspect ask` about an `llm_call` node of a recorded Zenera run - especially a "why did you NOT do X" question (why no `memory_search` first, why no `fork` for independent research branches, why no skill, why no test run). Covers choosing the node, ruling out missing tools before asking, wording the counterfactual so the answer quotes the instruction that blocked the better behaviour, and verifying that quote against the recorded request.'
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Asking a run why it did not do the better thing
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-instructions
|
|
3
3
|
description: The house rules - `agents/instructions.md` and every `agents/<topic>-instructions.md` prepended to every agent's system prompt. How the set is discovered and ordered, the `requires:` frontmatter and its closed vocabulary (`files`, `files-write`, `fork`, `memory`, `memory-write`, `memory-forget`), which four documents are `zen`'s own and are replaced by `zen check --fix`, how a project writes its own customisable topic prompts beside them (`files-policy-instructions.md`, `memory-policy-instructions.md`, `fork-<topic>-instructions.md`, `tools-<topic>-instructions.md`) without losing the copy, what belongs in a house rule as against an agent prompt or a skill, and every `zen check` finding these files can produce. Load before creating, editing, reviewing or deleting any `agents/*instructions.md`, before adding a capability whose rules arrive as one, and whenever `rules.stale`, `rules.unreached`, `files.uninstructed`, `memory.uninstructed` or `fork.uninstructed` is reported.
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# House rules
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-memory
|
|
3
3
|
description: Agent memory in Zenera projects - the `memory:` block and per-agent `access`/`sees`/`writes`/`autoRecall`, the five `memory_*` tools (when to use `memory_grep` instead of `memory_search`), kinds, relations and how recall ranks, inspecting a graph with `zen memory`, designing a memory strategy, `agents/memory-instructions.md` vs `agents/memory-policy-instructions.md`, remembering files under `/memory`, and putting memory in front of a `zen rag` index.
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Memory
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-memory-warmup
|
|
3
3
|
description: Pre-populating an agent project's memory graph before production by running a curated file of seed queries through `zen run batch` — one parallel batch instead of a hand-rolled fan-out, with per-item workspaces and per-item memories the command makes for you, choosing the source graph with --memory, bounding the parallelism with --concurrency, warming with a stronger --model, reading what each query learned from batch.json and per-item output.json, folding it all back with zen memory merge, validating with zen memory stats, atomic promotion into the project, and generating the population script in scripts/memory_warmup.sh.
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Memory Warmup
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-rag-docs
|
|
3
3
|
description: What a document index is, how to build one from a folder of `.md` files with `zen rag docs index` (or `npx @zenera/cli`), and how to ask it something - searching by meaning and narrowing to a release, a heading or a table, listing and grepping it exactly instead of reaching for shell `grep`/`rg`, reading a section back verbatim, giving it to an agent as tools, and writing the project skill that a wired-in index requires. For an OpenAPI description instead of prose, see `zen-rag-schema`.
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# The document index
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-rag-schema
|
|
3
3
|
description: What a schema index is, how it finds the right call inside a large OpenAPI/Swagger document, and how to build and query one with `zen rag schema` (or `npx @zenera/cli`) - searching it by meaning, listing and grepping it exactly instead of reaching for shell `grep`/`rg`, tracing a field up to the operations that carry it, giving it to an agent as tools, and writing the project skill that a wired-in index requires. For a pile of markdown instead of an API description, see `zen-rag-docs`.
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# The schema index
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-review
|
|
3
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.
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Reviewing a project
|
|
@@ -40,6 +41,39 @@ nothing about the model id it is spent on.
|
|
|
40
41
|
Nothing below matters while `zen check` fails. Report what it said and fix that
|
|
41
42
|
first.
|
|
42
43
|
|
|
44
|
+
## Reusing a check within the same pass
|
|
45
|
+
|
|
46
|
+
Instead of calling `zen check` separately and repeating it in the review, run:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
.github/skills/zen-review/scripts/review.sh check full --fix
|
|
50
|
+
.github/skills/zen-review/scripts/review.sh --skip-check
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`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
|
|
56
|
+
insufficient check; it never silently treats a skipped check as success.
|
|
57
|
+
|
|
58
|
+
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.
|
|
63
|
+
|
|
64
|
+
This is same-pass reuse, not a persistent health cache. Do not reuse after
|
|
65
|
+
changing credentials, environment variables, external files, ignored scratch
|
|
66
|
+
inputs or remote resources: those are not certified by the receipt. Run a fresh
|
|
67
|
+
check instead. Only use reuse for a self-contained project's stable inputs.
|
|
68
|
+
|
|
69
|
+
`check no-sandbox` and `--skip-check no-sandbox` are for the spec-sync skill's
|
|
70
|
+
eligible model-reference-only pass. They still probe models. `check fast` and
|
|
71
|
+
`--skip-check fast` omit both expensive probes and are for iteration only.
|
|
72
|
+
A full receipt covers either partial mode, but a partial receipt cannot stand
|
|
73
|
+
in for a full one. If a partial check repairs or otherwise changes files, no
|
|
74
|
+
reusable receipt is issued: run `check full`, because a repair may have changed
|
|
75
|
+
the sandbox pin. Finish setup and all edits before saving the final receipt.
|
|
76
|
+
|
|
43
77
|
## The script this skill ships
|
|
44
78
|
|
|
45
79
|
### `check-paths.sh` - the §2.5 sweep
|
|
@@ -38,7 +38,7 @@ NOISE='^(and/or|he/she|his/her|input/output|read/write|w/o|n/a|N/A|24/7|km/h)$|^
|
|
|
38
38
|
# second half is indistinguishable from a real absolute path once it is alone.
|
|
39
39
|
#
|
|
40
40
|
# A meta agent command, `zen meta run /spec-edit`, goes the same way: its
|
|
41
|
-
# `/<name>` is a
|
|
41
|
+
# `/<name>` is a command (a skill), not a file the running agent is told to open.
|
|
42
42
|
strip_urls() {
|
|
43
43
|
sed -E -e 's#[a-zA-Z][a-zA-Z0-9+.-]*://[^][ )"'"'"'`>]*##g' \
|
|
44
44
|
-e 's#(zen meta run( [A-Za-z0-9_.-]+)?) /[A-Za-z0-9_-]+#\1#g' "$1"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { lstatSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
|
|
6
|
+
const [action, mode = 'full', fix] = process.argv.slice(2);
|
|
7
|
+
const modes = {
|
|
8
|
+
full: [],
|
|
9
|
+
'no-sandbox': ['--no-sandbox'],
|
|
10
|
+
fast: ['--no-models', '--no-sandbox'],
|
|
11
|
+
};
|
|
12
|
+
const receipt = '.tmp/review-check.json';
|
|
13
|
+
|
|
14
|
+
function fingerprint() {
|
|
15
|
+
const hash = createHash('sha256');
|
|
16
|
+
function walk(dir) {
|
|
17
|
+
for (const entry of readdirSync(dir, { withFileTypes: true }).sort((a, b) =>
|
|
18
|
+
a.name < b.name ? -1 : a.name > b.name ? 1 : 0,
|
|
19
|
+
)) {
|
|
20
|
+
if (dir === '.' && ['.git', '.tmp', '.spec-sync'].includes(entry.name)) continue;
|
|
21
|
+
const path = `${dir}/${entry.name}`;
|
|
22
|
+
hash.update(JSON.stringify([path, entry.isDirectory(), lstatSync(path).mode]));
|
|
23
|
+
if (entry.isDirectory()) walk(path);
|
|
24
|
+
else if (entry.isFile())
|
|
25
|
+
hash.update(createHash('sha256').update(readFileSync(path)).digest('hex'));
|
|
26
|
+
else throw new Error(`cannot reuse validation with a symlink or special file: ${path}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
walk('.');
|
|
30
|
+
return hash.digest('hex');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function version() {
|
|
34
|
+
const result = spawnSync('zen', ['--version'], { encoding: 'utf8' });
|
|
35
|
+
if (result.error) throw result.error;
|
|
36
|
+
if (result.status !== 0) throw new Error('zen --version failed');
|
|
37
|
+
return result.stdout.trim();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
if (
|
|
42
|
+
!Object.hasOwn(modes, mode) ||
|
|
43
|
+
!['run', 'verify'].includes(action) ||
|
|
44
|
+
(fix !== undefined && (action !== 'run' || fix !== '--fix')) ||
|
|
45
|
+
process.argv.length > 5
|
|
46
|
+
) {
|
|
47
|
+
throw new Error('usage: check-receipt.mjs run|verify full|no-sandbox|fast [--fix]');
|
|
48
|
+
}
|
|
49
|
+
if (action === 'run') {
|
|
50
|
+
mkdirSync('.tmp', { recursive: true });
|
|
51
|
+
// Invalidate the previous result before trying a new check.
|
|
52
|
+
writeFileSync(receipt, 'null\n');
|
|
53
|
+
const before = fingerprint();
|
|
54
|
+
const result = spawnSync('zen', ['check', ...modes[mode], ...(fix ? [fix] : [])], {
|
|
55
|
+
stdio: 'inherit',
|
|
56
|
+
});
|
|
57
|
+
if (result.error) throw result.error;
|
|
58
|
+
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
59
|
+
const after = fingerprint();
|
|
60
|
+
if (mode !== 'full' && before !== after) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
'files changed during a partial check (possibly a sandbox pin repair); run check full before reusing validation',
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
writeFileSync(
|
|
66
|
+
receipt,
|
|
67
|
+
JSON.stringify({
|
|
68
|
+
root: resolve('.'),
|
|
69
|
+
mode,
|
|
70
|
+
version: version(),
|
|
71
|
+
fingerprint: after,
|
|
72
|
+
}) + '\n',
|
|
73
|
+
);
|
|
74
|
+
console.log(`check receipt: ${receipt}`);
|
|
75
|
+
} else {
|
|
76
|
+
const saved = JSON.parse(readFileSync(receipt, 'utf8'));
|
|
77
|
+
const covers =
|
|
78
|
+
saved &&
|
|
79
|
+
(saved.mode === 'full' ||
|
|
80
|
+
saved.mode === mode ||
|
|
81
|
+
(saved.mode === 'no-sandbox' && mode === 'fast'));
|
|
82
|
+
if (
|
|
83
|
+
!covers ||
|
|
84
|
+
saved.root !== resolve('.') ||
|
|
85
|
+
saved.version !== version() ||
|
|
86
|
+
saved.fingerprint !== fingerprint()
|
|
87
|
+
) {
|
|
88
|
+
throw new Error('check receipt is stale or lacks required probes; run a fresh check');
|
|
89
|
+
}
|
|
90
|
+
console.log(`zen check: reusing successful ${saved.mode} check`);
|
|
91
|
+
}
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error(`check receipt: ${error.message}`);
|
|
94
|
+
process.exitCode = 1;
|
|
95
|
+
}
|