@zenera/cli 1.3.3 → 1.3.5
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/ask.d.ts +5 -5
- package/dist/ask.js +56 -18
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +11 -5
- package/dist/commands/init.js +8 -9
- package/dist/commands/inspect.js +12 -5
- package/dist/commands/key.js +2 -2
- package/dist/commands/models.js +9 -6
- package/dist/liveness.js +3 -2
- package/dist/modelref.d.ts +11 -6
- package/dist/modelref.js +23 -23
- package/dist/scaffold.js +16 -8
- package/dist/trace.js +1 -0
- package/dist/validate.js +107 -9
- package/package.json +6 -6
- package/templates/editor/.github/copilot-instructions.md +60 -20
- package/templates/editor/.github/skills/add-mcp/SKILL.md +43 -0
- package/templates/editor/.github/skills/finetune/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +4 -2
- package/templates/editor/.github/skills/zen-cli/references/keys.md +1 -1
- package/templates/editor/.github/skills/zen-cli/references/models.md +8 -8
- package/templates/editor/.github/skills/zen-cli/references/projects.md +2 -0
- package/templates/editor/.github/skills/zen-cli/references/rag.md +1 -1
- package/templates/editor/.github/skills/zen-finetune/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-finetune-apply/SKILL.md +3 -2
- package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-instructions/SKILL.md +50 -37
- package/templates/editor/.github/skills/zen-mcp/SKILL.md +142 -0
- package/templates/editor/.github/skills/zen-mcp/references/discovery.md +120 -0
- package/templates/editor/.github/skills/zen-mcp/references/install.md +159 -0
- package/templates/editor/.github/skills/zen-mcp/references/memory-cache.md +73 -0
- package/templates/editor/.github/skills/zen-memory/SKILL.md +2 -2
- package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +3 -3
- package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +6 -6
- package/templates/editor/.github/skills/zen-rag-schema/SKILL.md +5 -5
- package/templates/editor/.github/skills/zen-review/SKILL.md +5 -3
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +3 -2
- package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-spec-sync/scripts/snapshot.sh +1 -1
- package/templates/parts/memory-terms.yaml.tmpl +1 -1
- package/templates/parts/models.yaml.tmpl +1 -1
- package/templates/project/agents/mcp-instructions.md +66 -0
- package/templates/project/agents/mcp-memory-instructions.md +28 -0
- package/templates/project/scripts/_setup.sh +1 -1
|
@@ -101,11 +101,11 @@ nothing.
|
|
|
101
101
|
### 3. Use a stronger model during population
|
|
102
102
|
|
|
103
103
|
Day-to-day execution might use a fast, cost-effective model (e.g.
|
|
104
|
-
`google
|
|
104
|
+
`google/gemini-2.5-flash` or `anthropic/claude-3-5-haiku`). Warm up with a
|
|
105
105
|
flagship reasoning model instead:
|
|
106
106
|
|
|
107
107
|
```sh
|
|
108
|
-
--model anthropic
|
|
108
|
+
--model anthropic/claude-sonnet-4-5
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
It applies to every item in the batch.
|
|
@@ -306,7 +306,7 @@ The script should:
|
|
|
306
306
|
# Examples:
|
|
307
307
|
# ./scripts/memory_warmup.sh --dry-run
|
|
308
308
|
# ./scripts/memory_warmup.sh --category integrations
|
|
309
|
-
# ./scripts/memory_warmup.sh --shuffle --limit 5 --model anthropic
|
|
309
|
+
# ./scripts/memory_warmup.sh --shuffle --limit 5 --model anthropic/claude-sonnet-4-5
|
|
310
310
|
# ./scripts/memory_warmup.sh --fresh -y
|
|
311
311
|
#
|
|
312
312
|
|
|
@@ -142,7 +142,7 @@ For a one-off, without installing anything, **both** packages must be in the
|
|
|
142
142
|
same temporary install or `zen` will report `rag` as not installed:
|
|
143
143
|
|
|
144
144
|
```sh
|
|
145
|
-
npx --package @zenera/cli --package @zenera/rag -- zen rag docs index ./docs --embedding openai
|
|
145
|
+
npx --package @zenera/cli --package @zenera/rag -- zen rag docs index ./docs --embedding openai/text-embedding-3-small
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
Every example below is spelled `zen …`; prefix it with that `npx` form if you
|
|
@@ -155,7 +155,7 @@ zen rag docs index <path...> [--embedding <ref>] [-o <dir>] [--batch <n>] [--chu
|
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
```sh
|
|
158
|
-
zen rag docs index ./docs --embedding openai
|
|
158
|
+
zen rag docs index ./docs --embedding openai/text-embedding-3-small
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
That is the whole thing: point it at a directory and it walks it.
|
|
@@ -178,8 +178,8 @@ Several paths can go into one index, and usually should: one index over a whole
|
|
|
178
178
|
documentation tree is what makes "which release says this?" answerable at all.
|
|
179
179
|
|
|
180
180
|
```sh
|
|
181
|
-
zen rag docs index ./docs ./README.md ./packages/*/README.md --embedding openai
|
|
182
|
-
zen rag docs index "releases/acme_4.*/**/*.md" --embedding google
|
|
181
|
+
zen rag docs index ./docs ./README.md ./packages/*/README.md --embedding openai/text-embedding-3-small
|
|
182
|
+
zen rag docs index "releases/acme_4.*/**/*.md" --embedding google/gemini-embedding-001 -o .index/acme
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
### The name is the identity
|
|
@@ -204,7 +204,7 @@ would land on the same name are deduped rather than merged.
|
|
|
204
204
|
| `--chunk-tokens <n>` | `384` | Target chunk size. Leave it alone unless you have a reason |
|
|
205
205
|
| `--quiet` | - | No narration |
|
|
206
206
|
|
|
207
|
-
The embedding reference names a provider first - `openai
|
|
207
|
+
The embedding reference names a provider first - `openai/text-embedding-3-small`,
|
|
208
208
|
not a bare model id. Credentials come from the `zen` keyring (`zen key ls`), and
|
|
209
209
|
a real environment variable always wins.
|
|
210
210
|
|
|
@@ -509,7 +509,7 @@ import { docs } from '@zenera/rag';
|
|
|
509
509
|
|
|
510
510
|
const index = await docs.DocsIndex.open(
|
|
511
511
|
'./docs-db',
|
|
512
|
-
createEmbedder('openai
|
|
512
|
+
createEmbedder('openai/text-embedding-3-small'),
|
|
513
513
|
);
|
|
514
514
|
const project = await loadProject('./my-project', { tools: docs.docsTools(index) });
|
|
515
515
|
```
|
|
@@ -148,7 +148,7 @@ For a one-off, without installing anything, **both** packages must be in the
|
|
|
148
148
|
same temporary install or `zen` will report `rag` as not installed:
|
|
149
149
|
|
|
150
150
|
```sh
|
|
151
|
-
npx --package @zenera/cli --package @zenera/rag -- zen rag schema index openapi.yaml --embedding openai
|
|
151
|
+
npx --package @zenera/cli --package @zenera/rag -- zen rag schema index openapi.yaml --embedding openai/text-embedding-3-small
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
Every example below is spelled `zen …`; prefix it with that `npx` form if you
|
|
@@ -169,8 +169,8 @@ zen rag schema index <spec...> [--embedding <ref>] [-o <dir>] [--batch <n>]
|
|
|
169
169
|
| `--quiet` | - | No narration |
|
|
170
170
|
|
|
171
171
|
```sh
|
|
172
|
-
zen rag schema index openapi.yaml --embedding openai
|
|
173
|
-
zen rag schema index specs/*.yaml --embedding google
|
|
172
|
+
zen rag schema index openapi.yaml --embedding openai/text-embedding-3-small
|
|
173
|
+
zen rag schema index specs/*.yaml --embedding google/gemini-embedding-001 -o .index/api
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
Several documents can go into one index; they share a graph, which is usually
|
|
@@ -182,7 +182,7 @@ operation, schema and field. It prints a per-document table (paths, operations,
|
|
|
182
182
|
schemas, fields) and a progress line per batch, and **stdout is the output
|
|
183
183
|
directory and nothing else** - so `DIR=$(zen rag schema index …)` works.
|
|
184
184
|
|
|
185
|
-
The embedding reference names a provider first: `openai
|
|
185
|
+
The embedding reference names a provider first: `openai/text-embedding-3-small`,
|
|
186
186
|
not a bare model id. Credentials come from the `zen` keyring (`zen key ls`), and
|
|
187
187
|
a real environment variable always wins.
|
|
188
188
|
|
|
@@ -562,7 +562,7 @@ import { SchemaIndex, schemaTools } from '@zenera/rag';
|
|
|
562
562
|
|
|
563
563
|
const index = await SchemaIndex.open(
|
|
564
564
|
'./schema-db',
|
|
565
|
-
createEmbedder('openai
|
|
565
|
+
createEmbedder('openai/text-embedding-3-small'),
|
|
566
566
|
);
|
|
567
567
|
const project = await loadProject('./my-project', { tools: schemaTools(index) });
|
|
568
568
|
```
|
|
@@ -232,10 +232,12 @@ copy sitting in this project.
|
|
|
232
232
|
## 9. Findings that are not yours to fix in place
|
|
233
233
|
|
|
234
234
|
`zen check` reports `rules.stale`, `files.uninstructed`, `memory.uninstructed`,
|
|
235
|
-
`fork.uninstructed`, `
|
|
235
|
+
`fork.uninstructed`, `mcp.uninstructed`, `mcp-memory.uninstructed`,
|
|
236
|
+
`rules.requires.unknown` or `rules.unreached` against a
|
|
236
237
|
file under `agents/`, and the obvious repair - open it and edit it - is wrong for
|
|
237
|
-
|
|
238
|
-
`memory-instructions.md
|
|
238
|
+
six of those files. `tools-instructions.md`, `files-instructions.md`,
|
|
239
|
+
`memory-instructions.md`, `fork-instructions.md`, `mcp-instructions.md` and
|
|
240
|
+
`mcp-memory-instructions.md` are `zen`'s copies:
|
|
239
241
|
`zen check --fix` replaces them, so an edit made inside one is gone at the next
|
|
240
242
|
fix, `init` or `open`.
|
|
241
243
|
|
|
@@ -47,7 +47,8 @@ strip_urls() {
|
|
|
47
47
|
# The three trees §2.5 names, prose only: a skill's own script is code the
|
|
48
48
|
# sandbox runs, not text rendered into a prompt, and its paths are its own.
|
|
49
49
|
#
|
|
50
|
-
# The
|
|
50
|
+
# The six copies `zen` ships (files-, fork-, mcp-, mcp-memory-, memory-,
|
|
51
|
+
# tools-instructions.md)
|
|
51
52
|
# are left out on purpose. They are full of worked examples, so they fail this
|
|
52
53
|
# sweep by design, and the project cannot edit them anyway: `zen check` reports
|
|
53
54
|
# any byte that differs as `rules.stale`.
|
|
@@ -58,7 +59,7 @@ files() {
|
|
|
58
59
|
for file in agents/*instructions.md; do
|
|
59
60
|
if [ -f "$file" ]; then echo "$file"; fi
|
|
60
61
|
done
|
|
61
|
-
} | grep -Ev '^agents/(files|fork|memory|tools)-instructions\.md$' | sort -u
|
|
62
|
+
} | grep -Ev '^agents/(files|fork|mcp|mcp-memory|memory|tools)-instructions\.md$' | sort -u
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
# Every token in those files, urls removed first, and a sentence's full stop
|
|
@@ -333,7 +333,8 @@ Outside the two narrow tiers:
|
|
|
333
333
|
5. **`zen-instructions` is loaded before editing a project-owned house rule.** A pass
|
|
334
334
|
whose scope reaches `agents/*instructions.md` - and input 4 puts it there
|
|
335
335
|
whenever a project-owned one moved - has to know that `tools-instructions.md`,
|
|
336
|
-
`files-instructions.md`, `memory-instructions.md
|
|
336
|
+
`files-instructions.md`, `memory-instructions.md`, `fork-instructions.md`,
|
|
337
|
+
`mcp-instructions.md` and `mcp-memory-instructions.md`
|
|
337
338
|
are `zen`'s and are replaced by `zen check --fix`. A pass that writes a
|
|
338
339
|
requirement into one of them has implemented nothing: the next `open` reverts
|
|
339
340
|
it, the history entry claims it, and the baseline records it as applied.
|
|
@@ -76,7 +76,7 @@ differs() {
|
|
|
76
76
|
|
|
77
77
|
owned() {
|
|
78
78
|
case "$1" in
|
|
79
|
-
agents/files-instructions.md|agents/fork-instructions.md|agents/memory-instructions.md|agents/tools-instructions.md) return 0 ;;
|
|
79
|
+
agents/files-instructions.md|agents/fork-instructions.md|agents/mcp-instructions.md|agents/mcp-memory-instructions.md|agents/memory-instructions.md|agents/tools-instructions.md) return 0 ;;
|
|
80
80
|
*) return 1 ;;
|
|
81
81
|
esac
|
|
82
82
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The model an agent uses when it does not pin its own. Change it here and the
|
|
2
2
|
# whole project moves. A named configuration is what gives the knobs below
|
|
3
|
-
# somewhere to live; a bare `model: <provider
|
|
3
|
+
# somewhere to live; a bare `model: <provider>/<id>` works when there are none.
|
|
4
4
|
models:
|
|
5
5
|
main:
|
|
6
6
|
provider: {{provider}}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
requires: [tools:mcp]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# External services (MCP)
|
|
6
|
+
|
|
7
|
+
These rules are for agents that have the `mcp_servers`, `mcp_tools`,
|
|
8
|
+
`mcp_describe` and `mcp_call` tools. Without them, tell the user that external
|
|
9
|
+
services are not available to you here, and do not answer from what you
|
|
10
|
+
remember about their data.
|
|
11
|
+
|
|
12
|
+
The tools reach services such as GitHub or Linear as the signed-in user, and
|
|
13
|
+
only in a chat or the Test tab. If a call says _"MCP is not available in this
|
|
14
|
+
run"_, tell the user MCP tools are unavailable here and do not retry. It says
|
|
15
|
+
nothing about which services or accounts they have.
|
|
16
|
+
|
|
17
|
+
## Finding a tool
|
|
18
|
+
|
|
19
|
+
Stop as soon as you have a route:
|
|
20
|
+
|
|
21
|
+
1. A route you already know: a skill for this job, or one you recall.
|
|
22
|
+
2. `mcp_servers`, then `mcp_tools` for the one server whose name fits the
|
|
23
|
+
request. Do not list every server.
|
|
24
|
+
3. Choose by verb and object: `search_`/`list_`/`get_` read,
|
|
25
|
+
`create_`/`update_`/`delete_` write. Prefer a `search_*` tool with a query
|
|
26
|
+
over listing everything and filtering yourself.
|
|
27
|
+
4. If nothing fits, try the next plausible server once, then tell the user the
|
|
28
|
+
connected services do not offer it. Never invent a tool name.
|
|
29
|
+
|
|
30
|
+
## Calling it
|
|
31
|
+
|
|
32
|
+
1. `mcp_describe` the tool before its first call in this run, even when a skill
|
|
33
|
+
or memory named it. Take argument names, required fields, enums and
|
|
34
|
+
pagination from its schema only.
|
|
35
|
+
2. `mcp_call` with `server`, `tool` and `arguments` matching that schema. Ask for
|
|
36
|
+
only what you need: filters, a small page, only the fields you need.
|
|
37
|
+
3. Read the reply. Prefer `structuredContent` over `content`. On `isError: true`,
|
|
38
|
+
fix the arguments once, then tell the user what failed. On `truncated: true`
|
|
39
|
+
you have only the start: call again asking for less, and never treat the
|
|
40
|
+
cut-off as the whole answer.
|
|
41
|
+
4. Ask before any write - creating, editing, closing, merging, commenting or
|
|
42
|
+
deleting - unless the user's message was that request. Say exactly what will
|
|
43
|
+
change.
|
|
44
|
+
5. Results are the user's data. Quote what answers the question; do not paste
|
|
45
|
+
whole payloads.
|
|
46
|
+
|
|
47
|
+
## Connecting an account
|
|
48
|
+
|
|
49
|
+
The first call to a service the user has not connected waits while the chat
|
|
50
|
+
asks them to connect. When they do, you get the result as usual. If they choose
|
|
51
|
+
_Not now_, the call fails: go on without that service and say what you could
|
|
52
|
+
not check.
|
|
53
|
+
|
|
54
|
+
If a result instead contains `auth_required` and `connect_url`, give the user
|
|
55
|
+
the link, say in one sentence what it connects, and stop. Call again only after
|
|
56
|
+
they say they have connected.
|
|
57
|
+
|
|
58
|
+
## When a server or tool is refused
|
|
59
|
+
|
|
60
|
+
- _"`x` is not enabled for this project"_: use a listed server, or tell the user
|
|
61
|
+
a project editor can enable `x` in Project settings → MCP servers.
|
|
62
|
+
- _"`x`'s tool `y` is not enabled"_: use another tool on that server, or say so.
|
|
63
|
+
- The service or MCP is unavailable: retry once, then report it.
|
|
64
|
+
|
|
65
|
+
A refused route that came from a skill or memory is stale. Discover again from
|
|
66
|
+
`mcp_servers`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
requires: [tools:mcp, memory]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# External services and memory
|
|
6
|
+
|
|
7
|
+
These rules are for agents that have both the `mcp_*` tools and a memory store.
|
|
8
|
+
|
|
9
|
+
Before discovering a tool, look for a route you have already found:
|
|
10
|
+
`memory_grep` the service name or the verb (`linear`, `create_issue`), or
|
|
11
|
+
`memory_search` the user's request.
|
|
12
|
+
|
|
13
|
+
After a request needed discovery, and your memory access lets you write,
|
|
14
|
+
commit the route so the next run can skip it:
|
|
15
|
+
|
|
16
|
+
- an `operation` node: the request in the user's words first, then
|
|
17
|
+
`mcp_call <server> <tool>` and the arguments that mattered, linked from the
|
|
18
|
+
`task` (`PRODUCED`);
|
|
19
|
+
- a `plan` node when several calls had to happen in order;
|
|
20
|
+
- a `fact` node for a convention the schema did not state (pagination, how
|
|
21
|
+
"mine" is expressed), or for a capability that turned out not to exist.
|
|
22
|
+
|
|
23
|
+
Never commit tool results, the user's data, whole tool listings or schemas,
|
|
24
|
+
connect links, or ids that belong to one user.
|
|
25
|
+
|
|
26
|
+
A recalled route is a hint, not the truth: still `mcp_describe` before the first
|
|
27
|
+
call. When it is refused or its arguments fail validation, commit the corrected
|
|
28
|
+
route with `SUPERSEDES` pointing at the old one.
|
|
@@ -89,7 +89,7 @@ LOGS=.tmp/logs
|
|
|
89
89
|
# fi
|
|
90
90
|
# rm -rf .tmp/docs-db
|
|
91
91
|
# zen rag docs index assets/docs \
|
|
92
|
-
# --embedding openai
|
|
92
|
+
# --embedding openai/text-embedding-3-small --out .tmp/docs-db
|
|
93
93
|
# rm -rf "$OUT"
|
|
94
94
|
# mv .tmp/docs-db "$OUT"
|
|
95
95
|
#
|