@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.
- package/README.md +6 -4
- package/dist/commands/check.js +7 -5
- package/dist/commands/completion.d.ts +1 -1
- package/dist/commands/completion.js +4 -4
- package/dist/commands/meta.js +10 -10
- package/dist/commands/run.js +18 -6
- 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/resolve.d.ts +2 -0
- package/dist/resolve.js +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/usage.js +1 -1
- package/dist/validate.d.ts +11 -0
- package/dist/validate.js +46 -3
- 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} +40 -16
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +1 -0
- package/templates/editor/.github/skills/zen-cli/SKILL.md +23 -21
- package/templates/editor/.github/skills/zen-cli/references/check.md +2 -1
- 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-cli/references/run.md +12 -4
- 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
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# snapshot.sh status full | incremental | tampered, and what differs
|
|
6
6
|
# snapshot.sh diff the difference the next pass has to work
|
|
7
|
+
# snapshot.sh record write a history entry, without moving the baseline
|
|
7
8
|
# snapshot.sh commit move the baseline on, once the pass has finished
|
|
8
9
|
#
|
|
9
10
|
# Run it from anywhere; it finds the project root from its own location, which
|
|
@@ -73,6 +74,13 @@ differs() {
|
|
|
73
74
|
! cmp -s "$(side "$BASE/$1")" "$(side "$1")"
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
owned() {
|
|
78
|
+
case "$1" in
|
|
79
|
+
agents/files-instructions.md|agents/fork-instructions.md|agents/memory-instructions.md|agents/tools-instructions.md) return 0 ;;
|
|
80
|
+
*) return 1 ;;
|
|
81
|
+
esac
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
# Which baseline files no longer hash to what the manifest says they do.
|
|
77
85
|
# `FAILED` covers a changed file; `FAILED open or read` covers a missing one.
|
|
78
86
|
broken() {
|
|
@@ -109,7 +117,11 @@ EOF
|
|
|
109
117
|
fi
|
|
110
118
|
while IFS= read -r file; do
|
|
111
119
|
if [ -n "$file" ] && differs "$file"; then
|
|
112
|
-
|
|
120
|
+
if owned "$file"; then
|
|
121
|
+
echo "maintenance: $file"
|
|
122
|
+
else
|
|
123
|
+
echo "changed: $file"
|
|
124
|
+
fi
|
|
113
125
|
fi
|
|
114
126
|
done <<EOF
|
|
115
127
|
$(scope)
|
|
@@ -127,6 +139,74 @@ $(scope)
|
|
|
127
139
|
EOF
|
|
128
140
|
}
|
|
129
141
|
|
|
142
|
+
record() {
|
|
143
|
+
mode=""
|
|
144
|
+
scope_text=""
|
|
145
|
+
changed_text=""
|
|
146
|
+
feedback_text=""
|
|
147
|
+
open_text=""
|
|
148
|
+
checks_text=""
|
|
149
|
+
while [ "$#" -gt 0 ]; do
|
|
150
|
+
if [ "$#" -lt 2 ] || [ -z "$2" ]; then
|
|
151
|
+
echo "snapshot.sh record: every option needs a non-empty value" >&2
|
|
152
|
+
return 2
|
|
153
|
+
fi
|
|
154
|
+
case "$1" in
|
|
155
|
+
--mode)
|
|
156
|
+
case "$2" in
|
|
157
|
+
full|incremental) mode="$2" ;;
|
|
158
|
+
*) echo "snapshot.sh record: mode must be full or incremental" >&2; return 2 ;;
|
|
159
|
+
esac
|
|
160
|
+
;;
|
|
161
|
+
--scope) scope_text="$scope_text- $2
|
|
162
|
+
" ;;
|
|
163
|
+
--changed) changed_text="$changed_text- $2
|
|
164
|
+
" ;;
|
|
165
|
+
--feedback) feedback_text="$feedback_text- $2
|
|
166
|
+
" ;;
|
|
167
|
+
--still-open) open_text="$open_text- $2
|
|
168
|
+
" ;;
|
|
169
|
+
--checks) checks_text="$checks_text- $2
|
|
170
|
+
" ;;
|
|
171
|
+
*) echo "snapshot.sh record: unknown option $1" >&2; return 2 ;;
|
|
172
|
+
esac
|
|
173
|
+
shift 2
|
|
174
|
+
done
|
|
175
|
+
if [ -z "$mode" ] || [ -z "$scope_text" ] || [ -z "$changed_text" ] ||
|
|
176
|
+
[ -z "$feedback_text" ] || [ -z "$open_text" ] || [ -z "$checks_text" ]; then
|
|
177
|
+
echo "usage: snapshot.sh record --mode full|incremental --scope <text> --changed <text> --feedback <text> --still-open <text> --checks <text> (repeat sections as needed; use 'None' explicitly)" >&2
|
|
178
|
+
return 2
|
|
179
|
+
fi
|
|
180
|
+
if [ ! -f SPECIFICATION.md ]; then
|
|
181
|
+
echo "snapshot.sh record: SPECIFICATION.md is missing" >&2
|
|
182
|
+
return 1
|
|
183
|
+
fi
|
|
184
|
+
spec_sum="$(shasum -a 256 SPECIFICATION.md)"
|
|
185
|
+
spec_sha="${spec_sum%% *}"
|
|
186
|
+
stamp="$(date -u +%Y-%m-%dT%H%M%SZ)"
|
|
187
|
+
entry="$HISTORY/$stamp.md"
|
|
188
|
+
draft="$(mktemp "$HISTORY/.record.XXXXXX")"
|
|
189
|
+
trap 'rm -f "$draft"' EXIT
|
|
190
|
+
{
|
|
191
|
+
printf '# Sync pass %s\n\n' "$stamp"
|
|
192
|
+
printf -- '- **Mode** - %s\n- **Spec sha** - %s\n' "$mode" "$spec_sha"
|
|
193
|
+
printf '\n## Scope\n\n%s' "$scope_text"
|
|
194
|
+
printf '\n## Changed\n\n%s' "$changed_text"
|
|
195
|
+
printf '\n## Feedback\n\n%s' "$feedback_text"
|
|
196
|
+
printf '\n## Still open\n\n%s' "$open_text"
|
|
197
|
+
printf '\n## Checks\n\n%s' "$checks_text"
|
|
198
|
+
} >"$draft"
|
|
199
|
+
# Linking refuses to replace an existing entry, even within the same second.
|
|
200
|
+
if ! ln "$draft" "$entry"; then
|
|
201
|
+
echo "snapshot.sh record: could not create $entry; no entry was overwritten" >&2
|
|
202
|
+
return 1
|
|
203
|
+
fi
|
|
204
|
+
rm -f "$draft"
|
|
205
|
+
trap - EXIT
|
|
206
|
+
echo "history: $entry"
|
|
207
|
+
echo "baseline: unchanged (run snapshot.sh commit only after verification)"
|
|
208
|
+
}
|
|
209
|
+
|
|
130
210
|
commit() {
|
|
131
211
|
entry="$(newest)"
|
|
132
212
|
if [ -z "$entry" ]; then
|
|
@@ -192,9 +272,10 @@ EOF
|
|
|
192
272
|
case "${1:-status}" in
|
|
193
273
|
status) status ;;
|
|
194
274
|
diff) show_diff ;;
|
|
275
|
+
record) shift; record "$@" ;;
|
|
195
276
|
commit) commit ;;
|
|
196
277
|
*)
|
|
197
|
-
echo "usage: snapshot.sh [status|diff|commit]" >&2
|
|
278
|
+
echo "usage: snapshot.sh [status|diff|record|commit]" >&2
|
|
198
279
|
exit 2
|
|
199
280
|
;;
|
|
200
281
|
esac
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zen-topology
|
|
3
3
|
description: 'Use when designing, reviewing or auditing how a Zenera project divides work between agents - whether to hand off, fork one branch to delegate, fan out several branches, or keep the work in one conversation; which fork `context` to pick; what each choice costs in tokens, prompt cache and elapsed time; and how to read a recorded run for topology mistakes (missed fan-out, a forked sequence, an early or looping hand-off, a delegation that cost more than it saved). Load before adding or changing `handoffs:` or `fork:` in agents.yaml, before writing a prompt line that says when to delegate, and before grading Delegation or Forking in a run audit.'
|
|
4
|
+
user-invocable: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Agent topology
|
|
@@ -60,9 +60,9 @@ To find out more, `--help` works on every command and subcommand:
|
|
|
60
60
|
|
|
61
61
|
- `zen meta --help` lists everything the meta agent can do: `run`,
|
|
62
62
|
`prompts`, `resume`, `model`, `dataset` and `finetune`, with examples.
|
|
63
|
-
- `zen meta run --help` lists the options for a run and the
|
|
64
|
-
|
|
65
|
-
`zen meta prompts` lists the
|
|
63
|
+
- `zen meta run --help` lists the options for a run and the `/<name>`
|
|
64
|
+
commands used above.
|
|
65
|
+
`zen meta prompts` lists the commands on their own.
|
|
66
66
|
- `zen meta dataset --help` and `zen meta finetune --help` cover building an
|
|
67
67
|
evaluation dataset and tuning the project against it.
|
|
68
68
|
- `zen meta run "<question>"` asks the meta agent anything about the project,
|