opencode-skills-collection 4.0.45 → 4.0.46
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/bundled-skills/.antigravity-install-manifest.json +25 -1
- package/bundled-skills/agy-delegate/SKILL.md +168 -0
- package/bundled-skills/agy-delegate/references/dispatch-and-poll.md +140 -0
- package/bundled-skills/agy-delegate/references/multi-task-queues.md +59 -0
- package/bundled-skills/agy-delegate/references/review-and-land.md +103 -0
- package/bundled-skills/agy-delegate/references/writing-the-brief.md +124 -0
- package/bundled-skills/aider-delegate/SKILL.md +227 -0
- package/bundled-skills/aider-delegate/references/dispatch-and-poll.md +154 -0
- package/bundled-skills/aider-delegate/references/multi-task-queues.md +68 -0
- package/bundled-skills/aider-delegate/references/review-and-land.md +101 -0
- package/bundled-skills/aider-delegate/references/writing-the-brief.md +142 -0
- package/bundled-skills/babysit-pr/SKILL.md +343 -0
- package/bundled-skills/claude-delegate/SKILL.md +182 -0
- package/bundled-skills/claude-delegate/references/dispatch-and-poll.md +220 -0
- package/bundled-skills/claude-delegate/references/multi-task-queues.md +66 -0
- package/bundled-skills/claude-delegate/references/review-and-land.md +117 -0
- package/bundled-skills/claude-delegate/references/writing-the-brief.md +158 -0
- package/bundled-skills/cline-delegate/SKILL.md +140 -0
- package/bundled-skills/cline-delegate/references/dispatch-and-poll.md +142 -0
- package/bundled-skills/cline-delegate/references/multi-task-queues.md +58 -0
- package/bundled-skills/cline-delegate/references/review-and-land.md +80 -0
- package/bundled-skills/cline-delegate/references/writing-the-brief.md +129 -0
- package/bundled-skills/codex-delegate/SKILL.md +177 -0
- package/bundled-skills/codex-delegate/references/dispatch-and-poll.md +161 -0
- package/bundled-skills/codex-delegate/references/multi-task-queues.md +66 -0
- package/bundled-skills/codex-delegate/references/review-and-land.md +126 -0
- package/bundled-skills/codex-delegate/references/writing-the-brief.md +125 -0
- package/bundled-skills/commandcode-delegate/SKILL.md +188 -0
- package/bundled-skills/commandcode-delegate/references/dispatch-and-poll.md +222 -0
- package/bundled-skills/commandcode-delegate/references/multi-task-queues.md +81 -0
- package/bundled-skills/commandcode-delegate/references/review-and-land.md +144 -0
- package/bundled-skills/commandcode-delegate/references/writing-the-brief.md +147 -0
- package/bundled-skills/copilot-delegate/SKILL.md +159 -0
- package/bundled-skills/copilot-delegate/references/dispatch-and-poll.md +143 -0
- package/bundled-skills/copilot-delegate/references/multi-task-queues.md +58 -0
- package/bundled-skills/copilot-delegate/references/review-and-land.md +80 -0
- package/bundled-skills/copilot-delegate/references/writing-the-brief.md +140 -0
- package/bundled-skills/cursor-delegate/SKILL.md +170 -0
- package/bundled-skills/cursor-delegate/references/dispatch-and-poll.md +162 -0
- package/bundled-skills/cursor-delegate/references/multi-task-queues.md +59 -0
- package/bundled-skills/cursor-delegate/references/review-and-land.md +93 -0
- package/bundled-skills/cursor-delegate/references/writing-the-brief.md +126 -0
- package/bundled-skills/debate-review/SKILL.md +85 -0
- package/bundled-skills/debate-review/assets/prompts/review-debate.md +51 -0
- package/bundled-skills/debate-review/assets/prompts/review-main.md +64 -0
- package/bundled-skills/debate-review/assets/prompts/review-rebuttal.md +42 -0
- package/bundled-skills/debate-review/references/comment-format.md +63 -0
- package/bundled-skills/debate-review/references/schema.md +95 -0
- package/bundled-skills/delegate-setup/SKILL.md +215 -0
- package/bundled-skills/delegate-setup/references/schema.md +100 -0
- package/bundled-skills/delegate-setup/references/setup-dialogue.md +101 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/users/aas-core.md +1 -1
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +3 -3
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/falsify/SKILL.md +263 -0
- package/bundled-skills/falsify/references/bias-catalog.md +42 -0
- package/bundled-skills/falsify/references/mental-models.md +135 -0
- package/bundled-skills/falsify/templates/thinking-ledger.md +104 -0
- package/bundled-skills/graceful-shutdown/SKILL.md +379 -0
- package/bundled-skills/grok-delegate/SKILL.md +179 -0
- package/bundled-skills/grok-delegate/references/dispatch-and-poll.md +171 -0
- package/bundled-skills/grok-delegate/references/multi-task-queues.md +67 -0
- package/bundled-skills/grok-delegate/references/review-and-land.md +130 -0
- package/bundled-skills/grok-delegate/references/writing-the-brief.md +119 -0
- package/bundled-skills/kimi-delegate/SKILL.md +137 -0
- package/bundled-skills/kimi-delegate/references/dispatch-and-poll.md +134 -0
- package/bundled-skills/kimi-delegate/references/multi-task-queues.md +58 -0
- package/bundled-skills/kimi-delegate/references/review-and-land.md +92 -0
- package/bundled-skills/kimi-delegate/references/writing-the-brief.md +132 -0
- package/bundled-skills/omp-delegate/SKILL.md +186 -0
- package/bundled-skills/omp-delegate/references/dispatch-and-poll.md +155 -0
- package/bundled-skills/omp-delegate/references/multi-task-queues.md +59 -0
- package/bundled-skills/omp-delegate/references/review-and-land.md +95 -0
- package/bundled-skills/omp-delegate/references/writing-the-brief.md +149 -0
- package/bundled-skills/opencode-delegate/SKILL.md +189 -0
- package/bundled-skills/opencode-delegate/references/dispatch-and-poll.md +156 -0
- package/bundled-skills/opencode-delegate/references/multi-task-queues.md +68 -0
- package/bundled-skills/opencode-delegate/references/review-and-land.md +125 -0
- package/bundled-skills/opencode-delegate/references/writing-the-brief.md +142 -0
- package/bundled-skills/pi-delegate/SKILL.md +148 -0
- package/bundled-skills/pi-delegate/references/dispatch-and-poll.md +146 -0
- package/bundled-skills/pi-delegate/references/multi-task-queues.md +59 -0
- package/bundled-skills/pi-delegate/references/review-and-land.md +95 -0
- package/bundled-skills/pi-delegate/references/writing-the-brief.md +132 -0
- package/bundled-skills/qoder-delegate/SKILL.md +151 -0
- package/bundled-skills/qoder-delegate/references/dispatch-and-poll.md +119 -0
- package/bundled-skills/qoder-delegate/references/multi-task-queues.md +43 -0
- package/bundled-skills/qoder-delegate/references/review-and-land.md +66 -0
- package/bundled-skills/qoder-delegate/references/writing-the-brief.md +85 -0
- package/bundled-skills/sandbase-mcp/SKILL.md +194 -0
- package/bundled-skills/ui-slop-score/SKILL.md +2 -2
- package/bundled-skills/unsloth-finetuning/SKILL.md +352 -0
- package/bundled-skills/vibe-delegate/SKILL.md +147 -0
- package/bundled-skills/vibe-delegate/references/dispatch-and-poll.md +144 -0
- package/bundled-skills/vibe-delegate/references/multi-task-queues.md +59 -0
- package/bundled-skills/vibe-delegate/references/review-and-land.md +87 -0
- package/bundled-skills/vibe-delegate/references/writing-the-brief.md +131 -0
- package/bundled-skills/warp-delegate/SKILL.md +192 -0
- package/bundled-skills/warp-delegate/references/dispatch-and-poll.md +163 -0
- package/bundled-skills/warp-delegate/references/multi-task-queues.md +80 -0
- package/bundled-skills/warp-delegate/references/review-and-land.md +123 -0
- package/bundled-skills/warp-delegate/references/writing-the-brief.md +105 -0
- package/bundled-skills/zcode-delegate/SKILL.md +202 -0
- package/bundled-skills/zcode-delegate/references/dispatch-and-poll.md +113 -0
- package/bundled-skills/zcode-delegate/references/multi-task-queues.md +87 -0
- package/bundled-skills/zcode-delegate/references/review-and-land.md +81 -0
- package/bundled-skills/zcode-delegate/references/writing-the-brief.md +120 -0
- package/package.json +1 -1
- package/skills_index.json +660 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Multi-task queues
|
|
2
|
+
|
|
3
|
+
A queue is a list of briefs run through Warp one at a time, each reviewed before the next is
|
|
4
|
+
dispatched. It is the shape to reach for when the user hands you a backlog rather than a single
|
|
5
|
+
task.
|
|
6
|
+
|
|
7
|
+
## Run them sequentially
|
|
8
|
+
|
|
9
|
+
Dispatch one brief, review it, land it, then dispatch the next. Parallel runs against the same
|
|
10
|
+
working tree interleave edits into a diff nobody can review — and because `oz agent run` has no
|
|
11
|
+
sandbox, there is nothing to keep two runs out of each other's files.
|
|
12
|
+
|
|
13
|
+
If tasks are genuinely independent and you want them concurrent, give each its own checkout (a git
|
|
14
|
+
worktree) and its own `--cd`. Otherwise, keep the queue serial.
|
|
15
|
+
|
|
16
|
+
## Carry constraints forward
|
|
17
|
+
|
|
18
|
+
Each brief is self-contained, so a constraint discovered in task 2 does not reach task 5 by itself.
|
|
19
|
+
Keep a short running list and paste the relevant lines into every subsequent brief:
|
|
20
|
+
|
|
21
|
+
- Conventions you had to correct in an earlier review ("use the existing `Result` type, not
|
|
22
|
+
exceptions").
|
|
23
|
+
- Files that are off-limits for the whole queue.
|
|
24
|
+
- Gates that turned out to be slow, flaky, or need a flag.
|
|
25
|
+
- Decisions already made, so a later task does not relitigate them.
|
|
26
|
+
|
|
27
|
+
A constraint that had to be corrected twice belongs in the repository's own skill directory
|
|
28
|
+
(`.agents/skills/`, `.warp/skills/`) instead — then pass it with `--skill` and stop re-pasting it.
|
|
29
|
+
|
|
30
|
+
## One out-dir per task
|
|
31
|
+
|
|
32
|
+
Give every dispatch its own `--out-dir` so artifacts do not overwrite each other:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
node "<skill-dir>/scripts/relay.mjs" --brief briefs/03-stream-export.txt \
|
|
36
|
+
--cd /path/to/repo --out-dir /tmp/warp-queue/03 --name "queue-03-stream-export"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`--name` labels the run in Warp's own run list, which makes a queue far easier to follow later.
|
|
40
|
+
Keeping the out-dirs numbered means `result.json`, `events.jsonl`, and `final.txt` for any task stay
|
|
41
|
+
recoverable after the queue has moved on.
|
|
42
|
+
|
|
43
|
+
## Track progress where the user can see it
|
|
44
|
+
|
|
45
|
+
Maintain a visible checklist — the orchestrator's task list, or a scratch file — with one line per
|
|
46
|
+
task and its state: pending, dispatched, under review, landed, or abandoned. Record the commit sha
|
|
47
|
+
as each task lands, and the reason whenever one is abandoned.
|
|
48
|
+
|
|
49
|
+
## When a task fails
|
|
50
|
+
|
|
51
|
+
Do not roll straight into the next brief. Decide first:
|
|
52
|
+
|
|
53
|
+
- **Rework** — the diff is close. Continue the conversation with `--conversation <id>` and a delta
|
|
54
|
+
brief.
|
|
55
|
+
- **Re-scope** — the task was too big or the brief was wrong. Split it and requeue the parts.
|
|
56
|
+
- **Abandon** — it depends on something that is not true yet. Record why and move on.
|
|
57
|
+
|
|
58
|
+
A failed task that leaves a dirty tree must be cleaned up before the next dispatch. `git status`
|
|
59
|
+
should be clean, or clean except for work you have deliberately kept.
|
|
60
|
+
|
|
61
|
+
## Stop the queue when
|
|
62
|
+
|
|
63
|
+
- Two consecutive tasks fail for the same underlying reason — the shared assumption is wrong, and
|
|
64
|
+
the remaining briefs probably inherit it.
|
|
65
|
+
- A task reveals the plan itself is wrong. Re-plan with the user rather than working the list.
|
|
66
|
+
- The gates start failing for reasons unrelated to the current task; something earlier in the queue
|
|
67
|
+
broke and the diff is no longer trustworthy.
|
|
68
|
+
|
|
69
|
+
## Final coherence pass
|
|
70
|
+
|
|
71
|
+
Ten individually correct diffs can still add up to an incoherent whole. When the queue is done,
|
|
72
|
+
review the aggregate — `git diff <first-commit>~1..HEAD`:
|
|
73
|
+
|
|
74
|
+
- Duplicated helpers that separate tasks each introduced.
|
|
75
|
+
- Naming that drifted between early and late tasks.
|
|
76
|
+
- Docs, types, or tests that an earlier task's assumption made stale.
|
|
77
|
+
- Dead code left by a later task superseding an earlier one.
|
|
78
|
+
|
|
79
|
+
Fix these yourself if small. If the cleanup is substantial, it is one more brief — dispatch it with
|
|
80
|
+
the aggregate diff as the current state.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Review and land
|
|
2
|
+
|
|
3
|
+
Warp edits the working tree. **You commit.** That boundary is the point of the skill: the
|
|
4
|
+
implementer produces a diff, and a reviewer who did not write it decides whether it ships.
|
|
5
|
+
|
|
6
|
+
## Why the review is not optional here
|
|
7
|
+
|
|
8
|
+
Every delegate skill asks you to verify the implementer's claims. Warp raises the stakes: `oz agent
|
|
9
|
+
run` has no sandbox, no permission mode, and no read-only run, so nothing constrained what the run
|
|
10
|
+
could touch while it worked. The diff is not a courtesy record — it is the only record.
|
|
11
|
+
|
|
12
|
+
## The checklist
|
|
13
|
+
|
|
14
|
+
Work through these in order. Stop at the first one that fails and decide whether to rework or
|
|
15
|
+
discard.
|
|
16
|
+
|
|
17
|
+
1. **Read `result.json` first.** If there is no `result.json`, stop: a usage error exits 2 before
|
|
18
|
+
Warp is ever dispatched and writes none, so an absent file means the run did not happen — read the
|
|
19
|
+
relay's stderr, not the tree. Otherwise require `status: "completed"` and `exitCode: 0` before
|
|
20
|
+
going further. `failed`, `timeout`, `aborted`, and `warp_unavailable` all mean the run did not
|
|
21
|
+
finish on its own terms, and `timeout` and `aborted` additionally mean the tree may be mid-edit
|
|
22
|
+
and incoherent. Rework or discard from the baseline rather than reviewing a partial run.
|
|
23
|
+
2. **Start from `touchedFiles`.** It is `git status --porcelain` taken after the run: post-run,
|
|
24
|
+
git-visible worktree state, not a log of what the agent did. It cannot show an ignored file, an
|
|
25
|
+
edit the run made and then reverted, or a write outside the repository, and it includes anything
|
|
26
|
+
already dirty before dispatch. Start there, but do not read it as the complete set. `null` means
|
|
27
|
+
git could not report — inspect the tree by hand. `[]` on a run that claimed edits is a
|
|
28
|
+
contradiction worth chasing.
|
|
29
|
+
3. **Re-run the gates yourself.** Do not accept "tests pass" from `finalMessage`. Run the project's
|
|
30
|
+
actual lint, typecheck, build, and test commands and read the output. Take "actual" from
|
|
31
|
+
`CONTRIBUTING.md`, the CI config, or `package.json`: a project's gate set often includes a
|
|
32
|
+
packaging, manifest, or schema validation step that lint and test do not cover, and that is
|
|
33
|
+
exactly the gate a run can break without any test going red.
|
|
34
|
+
4. **Read the whole diff against the brief.** `git diff` and `git diff --staged` — then open every
|
|
35
|
+
`??` path in `touchedFiles` directly, including everything inside an untracked directory. Neither
|
|
36
|
+
diff command shows the contents of an untracked file, so a file Warp created is invisible to both
|
|
37
|
+
and would otherwise reach your commit unread. Ask of each hunk and each new file: did the brief
|
|
38
|
+
ask for this? Changes outside the brief's stated scope are the thing to catch.
|
|
39
|
+
5. **Check what should NOT have changed.** Lockfiles, CI config, formatter config, unrelated
|
|
40
|
+
modules, and anything the brief listed under "leave untouched".
|
|
41
|
+
6. **Grep for dangling references** after any removal or rename — imports, string keys, docs.
|
|
42
|
+
7. **Round-trip migrations.** Apply and roll back before trusting a schema change.
|
|
43
|
+
8. **Run guard skills** if the repository has them installed.
|
|
44
|
+
9. **Confirm nothing was committed.** `git log -1` should still be your last commit. The relay never
|
|
45
|
+
commits; if a commit exists, the agent made it despite the brief — treat that as a finding.
|
|
46
|
+
|
|
47
|
+
## Reading `finalMessage` correctly
|
|
48
|
+
|
|
49
|
+
`finalMessage` is Warp's self-report: a claim, not evidence. Read it for two things only —
|
|
50
|
+
|
|
51
|
+
- **Decisions it made that the brief did not specify.** These are the parts you most need to surface
|
|
52
|
+
to the user.
|
|
53
|
+
- **What it says it could not do.** Usually accurate, and it tells you where to look first.
|
|
54
|
+
|
|
55
|
+
Everything else in it — "all tests pass", "no other files changed" — is a hypothesis your gates and
|
|
56
|
+
your diff read either confirm or refute. If `finalMessage` is empty on a run that exited 0, read
|
|
57
|
+
`events.jsonl` rather than assuming the run did nothing.
|
|
58
|
+
|
|
59
|
+
## Rework through a conversation
|
|
60
|
+
|
|
61
|
+
When the diff is close but wrong, continue the same conversation rather than starting cold:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node "<skill-dir>/scripts/relay.mjs" --brief delta-brief.txt --cd /path/to/repo \
|
|
65
|
+
--conversation "$(jq -r .conversationId /tmp/warp-run-1/result.json)"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Warp still holds the earlier exchange, so send only the delta — what was wrong, what to change, what
|
|
69
|
+
to leave alone. See [writing-the-brief.md](writing-the-brief.md#delta-briefs).
|
|
70
|
+
|
|
71
|
+
If `conversationId` is `null`, the stream did not carry one; dispatch a fresh run with a brief that
|
|
72
|
+
restates the corrected requirements.
|
|
73
|
+
|
|
74
|
+
Discard rather than rework when the diff misunderstood the goal, wanders far outside the brief, or
|
|
75
|
+
would take longer to correct than to redo.
|
|
76
|
+
|
|
77
|
+
Discard against a known baseline, never with a blanket revert. `git checkout -- .` is the wrong
|
|
78
|
+
reach: it leaves staged and untracked files behind, so the tree stays dirty for the next dispatch,
|
|
79
|
+
and it destroys any uncommitted work of your own that predates the run. Dispatch from a clean tree —
|
|
80
|
+
commit your own changes, or `git stash push --include-untracked` them. A bare `git stash` leaves
|
|
81
|
+
untracked files in place, and those resurface as `??` entries in `touchedFiles`, where the cleanup
|
|
82
|
+
below would delete work the run never made. Confirm `git status --porcelain` prints nothing before
|
|
83
|
+
dispatching, so that everything dirty afterward is Warp's, then drop exactly what the run
|
|
84
|
+
introduced, reading the paths off `touchedFiles`:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git restore --staged --worktree -- <tracked paths> # the ' M' / 'M ' entries
|
|
88
|
+
git clean -f -- <untracked paths> # the '??' entries
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A `??` entry can name a whole directory rather than each file under it; passing that path removes
|
|
92
|
+
the directory and its contents, since `-d` only governs the no-pathspec case. The exception is a
|
|
93
|
+
nested git repository — if the run scaffolded one, `git clean -f` skips it and `-ff` is required.
|
|
94
|
+
|
|
95
|
+
If dispatching from a clean tree is not an option, give Warp its own `git worktree` instead: then
|
|
96
|
+
discarding is `git worktree remove --force`, and your work was never in reach. Either way, rewrite
|
|
97
|
+
the brief before dispatching again.
|
|
98
|
+
|
|
99
|
+
## Landing
|
|
100
|
+
|
|
101
|
+
Commit once the gates pass and the diff holds. Write the commit message yourself: it should describe
|
|
102
|
+
the change, not the delegation. Do not credit the tool in the message unless the project's own
|
|
103
|
+
convention asks for it.
|
|
104
|
+
|
|
105
|
+
## Surface, don't absorb
|
|
106
|
+
|
|
107
|
+
Delegation is something the human opted into, and committing verified, gate-passing work is the
|
|
108
|
+
agreed contract. Two limits stay with you:
|
|
109
|
+
|
|
110
|
+
- **Surface, don't absorb.** Report Warp's design decisions, its defensible-but-unasked turns, and
|
|
111
|
+
the non-blocking nitpicks you chose not to fix. Silently smoothing them over hides the
|
|
112
|
+
implementer's judgment from the person who owns the code.
|
|
113
|
+
- **Stop for scope changes.** If finishing correctly requires going beyond the brief — a dependency
|
|
114
|
+
bump, a schema change, an interface the brief did not mention — ask rather than expanding the
|
|
115
|
+
mandate yourself.
|
|
116
|
+
|
|
117
|
+
Snapshot egress is a decision you make **before** dispatch, not something you report after it. `oz
|
|
118
|
+
agent run` uploads an end-of-run workspace snapshot by default, so reading `snapshotDisabled: false`
|
|
119
|
+
off a finished run tells you only that the upload already happened. If the repository is sensitive,
|
|
120
|
+
pass `--no-snapshot` on the dispatch and confirm `snapshotDisabled: true` in `result.json` before
|
|
121
|
+
going further. Keep reporting the field either way — it is the evidence of which way the run went.
|
|
122
|
+
|
|
123
|
+
Also surface the `runUrl` when someone will want to inspect the run in Warp.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Writing the brief
|
|
2
|
+
|
|
3
|
+
The brief is the whole contract. Warp sees only the text you send plus whatever it can inspect in
|
|
4
|
+
the workspace — no chat history, no shared context, none of the reasoning that led you here.
|
|
5
|
+
|
|
6
|
+
## How the brief reaches Warp
|
|
7
|
+
|
|
8
|
+
`oz agent run` requires one of `--prompt`, `--saved-prompt`, `--task-id`, or `--skill`. Its
|
|
9
|
+
`-f/--file` config path does **not** satisfy that requirement, so there is no stdin or file channel
|
|
10
|
+
for the task text: the relay passes the brief as the `--prompt` value on argv.
|
|
11
|
+
|
|
12
|
+
Two consequences that do not apply to the other skills in this package:
|
|
13
|
+
|
|
14
|
+
- **The brief is visible in the host process list** (`ps`, Activity Monitor, Task Manager) for as
|
|
15
|
+
long as the run is live. Keep credentials, tokens, and customer data out of it. Point Warp at a
|
|
16
|
+
file in the repo or an environment variable instead of inlining a secret.
|
|
17
|
+
- **A very large brief can hit the OS argument limit.** Practical briefs are far below it, but a
|
|
18
|
+
brief that inlines whole files can trip it. Reference paths rather than pasting file contents —
|
|
19
|
+
Warp can read the workspace itself.
|
|
20
|
+
|
|
21
|
+
Because the brief rides argv, the relay never launches `oz` through a shell on any platform.
|
|
22
|
+
|
|
23
|
+
## Structure
|
|
24
|
+
|
|
25
|
+
Cover these in order. Skip a heading only when it genuinely does not apply.
|
|
26
|
+
|
|
27
|
+
1. **Goal** — one sentence on the outcome, not the mechanics.
|
|
28
|
+
2. **Current state** — where the code is now, and the paths that matter. **Name the workspace root
|
|
29
|
+
as an absolute path**, and prefer absolute paths for the files you call out. `--cwd` is not
|
|
30
|
+
uniformly honoured: on a verified run against oz 0.2026.05.27, shell commands executed in the
|
|
31
|
+
pinned workspace (`pwd` returned it), but the agent stated its working directory was `/` and its
|
|
32
|
+
file-reading tool resolved bare relative paths against `$HOME` — so `src/strings.js` was first
|
|
33
|
+
read as `/Users/<you>/src/strings.js`. The agent recovered by running `pwd` and retrying, but it
|
|
34
|
+
burned a turn, and in a home directory that happened to hold a matching path it would have read
|
|
35
|
+
the wrong file. There is no sandbox to catch that.
|
|
36
|
+
3. **What to change** — the specific edits, in the order they make sense.
|
|
37
|
+
4. **What to leave untouched** — files, patterns, and public interfaces that must not move. Warp has
|
|
38
|
+
no sandbox, so this is a written boundary, not an enforced one.
|
|
39
|
+
5. **Gates** — the project's *actual* commands. Read them out of `package.json`, `Makefile`, or the
|
|
40
|
+
CI config; do not invent `npm test` because it is conventional.
|
|
41
|
+
6. **Report contract** — what the final message must state (below).
|
|
42
|
+
7. **Do not commit** — say it explicitly. Committing is the orchestrator's job.
|
|
43
|
+
|
|
44
|
+
## The report contract
|
|
45
|
+
|
|
46
|
+
Ask for a final message that states, plainly:
|
|
47
|
+
|
|
48
|
+
- What changed, file by file.
|
|
49
|
+
- Which gate commands were run, and their exact outcome.
|
|
50
|
+
- Anything the run could not do, and why.
|
|
51
|
+
- Any decision it made that the brief did not specify.
|
|
52
|
+
|
|
53
|
+
The relay captures that message as `finalMessage` in `result.json` and as `final.txt`. Treat it as a
|
|
54
|
+
claim to verify, never as verification — see [review-and-land.md](review-and-land.md).
|
|
55
|
+
|
|
56
|
+
## Repository context files
|
|
57
|
+
|
|
58
|
+
Warp reads skills from `.agents/skills/`, `.warp/skills/`, `.claude/skills/`, and `.codex/skills/`.
|
|
59
|
+
If the repository carries conventions in one of those, name it with the relay's `--skill` flag
|
|
60
|
+
(`name`, `repo:name`, or `org/repo:name`) so it becomes the base prompt and your brief stays the
|
|
61
|
+
task. Anything not in one of those locations — a plain `CONTRIBUTING.md`, for instance — must be
|
|
62
|
+
referenced by path in the brief; do not assume it is loaded.
|
|
63
|
+
|
|
64
|
+
## One task per brief
|
|
65
|
+
|
|
66
|
+
A brief that carries two unrelated changes produces a diff you cannot review cleanly and a
|
|
67
|
+
conversation you cannot resume precisely. Split them and queue the parts — see
|
|
68
|
+
[multi-task-queues.md](multi-task-queues.md).
|
|
69
|
+
|
|
70
|
+
## Delta briefs
|
|
71
|
+
|
|
72
|
+
When you continue a conversation with `--conversation <id>`, Warp still holds the earlier exchange.
|
|
73
|
+
Send only what changed:
|
|
74
|
+
|
|
75
|
+
- What you reviewed and what was wrong — be specific about the file and the symptom.
|
|
76
|
+
- What to do about it.
|
|
77
|
+
- What to leave alone from the previous round.
|
|
78
|
+
- The gates to re-run.
|
|
79
|
+
|
|
80
|
+
Do not re-send the original brief. Restating a satisfied requirement invites Warp to redo work that
|
|
81
|
+
was already correct.
|
|
82
|
+
|
|
83
|
+
## Worked example
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Goal: make the CSV export stream instead of buffering the whole result set.
|
|
87
|
+
|
|
88
|
+
Current state: src/export/csv.ts builds one string in memory (see toCsv) and
|
|
89
|
+
returns it from the /export route in src/routes/export.ts.
|
|
90
|
+
|
|
91
|
+
Change:
|
|
92
|
+
- Rewrite toCsv to return a Readable that yields one row at a time.
|
|
93
|
+
- Update the /export route to pipe that stream to the response.
|
|
94
|
+
- Keep the column order and the quoting behaviour exactly as they are now.
|
|
95
|
+
|
|
96
|
+
Leave untouched: the public signature of toCsv's caller in src/routes/export.ts
|
|
97
|
+
beyond the pipe change, and every file under src/import/.
|
|
98
|
+
|
|
99
|
+
Gates: `npm run lint`, `npm run typecheck`, `npm test -- export`.
|
|
100
|
+
|
|
101
|
+
Report: list each file you changed, quote the exact output of each gate command,
|
|
102
|
+
and state anything you could not finish.
|
|
103
|
+
|
|
104
|
+
Do not commit. Leave the changes in the working tree.
|
|
105
|
+
```
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zcode-delegate
|
|
3
|
+
description: Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly
|
|
4
|
+
requests it, while the orchestrator retains review and landing responsibility.
|
|
5
|
+
risk: safe
|
|
6
|
+
category: agent-orchestration
|
|
7
|
+
source: https://github.com/amElnagdy/delegate-skills
|
|
8
|
+
source_repo: amElnagdy/delegate-skills
|
|
9
|
+
source_type: community
|
|
10
|
+
date_added: '2026-08-26'
|
|
11
|
+
license: MIT
|
|
12
|
+
license_source: https://github.com/amElnagdy/delegate-skills/blob/master/LICENSE
|
|
13
|
+
compatibility: Requires the `zcode` CLI (Z.AI ZCode) with a configured model provider,
|
|
14
|
+
Node 18+, and git. ZCode ships its CLI inside the desktop app rather than on PATH
|
|
15
|
+
or npm — see Prerequisites. The orchestrating agent must be able to run shell commands
|
|
16
|
+
and read files. Shell examples assume bash/zsh (macOS/Linux, or Git Bash/WSL on
|
|
17
|
+
Windows).
|
|
18
|
+
metadata:
|
|
19
|
+
version: 0.5.0
|
|
20
|
+
---
|
|
21
|
+
# ZCode Delegate
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
- You want to delegate a bounded coding task to a separate `zcode` implementer (`Z.AI ZCode`) and then review its diff yourself.
|
|
26
|
+
- The user explicitly asked for delegation to this implementer.
|
|
27
|
+
|
|
28
|
+
You are the **orchestrator**. This skill lets you hand a bounded coding task to a separate
|
|
29
|
+
**implementer** — the Z.AI ZCode CLI — then review what it produced and land it yourself. You write
|
|
30
|
+
the brief and own the judgment; ZCode does the typing; you verify and commit.
|
|
31
|
+
|
|
32
|
+
Nothing here is specific to one orchestrating agent. The loop needs only the ability to run a shell
|
|
33
|
+
command and read a file. (It is designed for and run on Claude Code; treat other orchestrators as
|
|
34
|
+
designed-for, not yet proven.)
|
|
35
|
+
|
|
36
|
+
## When NOT to use this
|
|
37
|
+
|
|
38
|
+
- The task is small enough to just do inline — delegation overhead is not worth it.
|
|
39
|
+
- ZCode is not installed, or its CLI has no model provider configured.
|
|
40
|
+
- You want to write the code yourself, or you only need a review.
|
|
41
|
+
|
|
42
|
+
## Prerequisites (check once)
|
|
43
|
+
|
|
44
|
+
1. **ZCode is installed.** The CLI ships **inside the desktop app** — it is not on PATH and not on
|
|
45
|
+
npm. The relay resolves it in this order: `--zcode-path <file>` or `ZCODE_CLI` first, then PATH,
|
|
46
|
+
then the installed app bundle. On Linux the app is an AppImage with no fixed install path, so
|
|
47
|
+
the flag or the environment variable is required there — the relay guesses nothing.
|
|
48
|
+
2. **A model provider is configured for the CLI**, with a key it can actually reach. Being signed
|
|
49
|
+
into the desktop app is *not* enough — see below.
|
|
50
|
+
3. You are in (or will point `--cd` at) the target git repository.
|
|
51
|
+
|
|
52
|
+
The relay records the CLI version and how it was resolved into `result.json`, so a surprising
|
|
53
|
+
install is visible after the fact.
|
|
54
|
+
|
|
55
|
+
## Authenticating the headless CLI
|
|
56
|
+
|
|
57
|
+
**Signing into the ZCode desktop app does not authenticate the CLI this relay drives.** The CLI
|
|
58
|
+
keeps its own config at `~/.zcode/cli/config.json`, separate from the desktop app's, and nothing
|
|
59
|
+
bridges the two. `zcode login` is the intended path, but where it fails with `OAuth response is
|
|
60
|
+
not valid JSON` the way in is a Z.AI API key.
|
|
61
|
+
|
|
62
|
+
Two pieces are needed, and they are separate:
|
|
63
|
+
|
|
64
|
+
1. **The provider block** must exist in `~/.zcode/cli/config.json`. It defines the provider, its
|
|
65
|
+
endpoint and its models — the environment cannot supply this:
|
|
66
|
+
|
|
67
|
+
```jsonc
|
|
68
|
+
{
|
|
69
|
+
"provider": {
|
|
70
|
+
"zai": {
|
|
71
|
+
"kind": "anthropic",
|
|
72
|
+
"options": { "apiKeyRequired": true, "baseURL": "https://api.z.ai/api/anthropic" },
|
|
73
|
+
"models": { "glm-5.1": { "name": "GLM-5.1" } }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"model": { "main": "zai/glm-5.1" }
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
2. **The key** can live either in `provider.zai.options.apiKey` in that file, or in the
|
|
81
|
+
environment as any one of `ZAI_API_KEY`, `ZCODE_API_KEY`, or `ANTHROPIC_API_KEY`. Prefer the
|
|
82
|
+
environment — it keeps the secret off disk.
|
|
83
|
+
|
|
84
|
+
If a run fails with `Model provider is missing an API key: <provider>`, the provider block resolved
|
|
85
|
+
but no key was found: set one of those variables and re-run.
|
|
86
|
+
|
|
87
|
+
## Autonomy — read this before dispatching
|
|
88
|
+
|
|
89
|
+
ZCode's own term is **mode**. It has four values; only two are usable headlessly.
|
|
90
|
+
|
|
91
|
+
| mode | Behaviour |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| `yolo` | **Writes.** ZCode's own default for `--prompt`, and this relay's write-capable default. |
|
|
94
|
+
| `plan` | **Refuses edits.** What `--read-only` selects. |
|
|
95
|
+
| `build` | **Rejected by this relay.** No permission client exists headlessly, so tools are blocked and the run exits 0 having done nothing. |
|
|
96
|
+
| `edit` | Rejected for the same reason. |
|
|
97
|
+
|
|
98
|
+
Two limits stated plainly, because ZCode cannot enforce them:
|
|
99
|
+
|
|
100
|
+
- **`plan` mode refused edits in testing, but the relay does not treat that as a guarantee.** It
|
|
101
|
+
takes a Git fingerprint before the run and reports a tri-state `readOnlyViolation` afterwards.
|
|
102
|
+
Confirm `touchedFiles` came back empty rather than assuming no edits.
|
|
103
|
+
- **ZCode has no `--allowed-tools`.** Only the `--disallowed-tools` denylist exists, and it *is*
|
|
104
|
+
genuinely enforced. An explicit allowlisted tool surface is therefore impossible here — do not
|
|
105
|
+
assume one.
|
|
106
|
+
|
|
107
|
+
## The loop
|
|
108
|
+
|
|
109
|
+
Run these five steps per task. Steps 1, 4, and 5 are your judgment; 2 and 3 are mechanical.
|
|
110
|
+
|
|
111
|
+
### 1. Write the brief
|
|
112
|
+
|
|
113
|
+
ZCode sees **only** what you send — no repo memory, no chat history. Everything the task needs goes
|
|
114
|
+
in the brief: the goal, the current state, what to change, what to leave untouched, the project's
|
|
115
|
+
**actual** gate commands (discover them from the repo's CLAUDE.md/AGENTS.md/Makefile — do not
|
|
116
|
+
assume), and a report contract. Tell ZCode it will **not** commit. One task per brief. The relay
|
|
117
|
+
delivers the brief as an attached file, so the command line no longer bounds its length — the
|
|
118
|
+
model's context window still does. Full guidance and a template:
|
|
119
|
+
[references/writing-the-brief.md](references/writing-the-brief.md).
|
|
120
|
+
|
|
121
|
+
### 2. Dispatch
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
|
|
125
|
+
# read-only (review/diagnosis, no edits): add --read-only
|
|
126
|
+
# continue a specific session: add --session <sess_...> (from result.json; send only the delta brief)
|
|
127
|
+
# continue the latest session for --cd: add --resume-last
|
|
128
|
+
# withhold tools (denylist): add --disallowed-tools "Write,Edit,Bash"
|
|
129
|
+
# point at the CLI explicitly: add --zcode-path /path/to/zcode.cjs
|
|
130
|
+
# hard time limit (watchdog): add --timeout 2h (default: off)
|
|
131
|
+
# see all options: node .../relay.mjs --help
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
(`<skill-dir>` is this skill's installed directory — the folder containing this `SKILL.md`.)
|
|
135
|
+
|
|
136
|
+
The relay writes its artifacts to a temp dir, so the repo under review stays clean. It **never
|
|
137
|
+
commits** — see step 5. Mechanics, flags, and the `result.json` shape:
|
|
138
|
+
[references/dispatch-and-poll.md](references/dispatch-and-poll.md).
|
|
139
|
+
|
|
140
|
+
### 3. Wait for completion
|
|
141
|
+
|
|
142
|
+
The relay blocks until ZCode finishes, so back it with whatever your orchestrator offers:
|
|
143
|
+
|
|
144
|
+
- **Claude Code:** run the Bash call with `run_in_background: true`; you are notified on completion.
|
|
145
|
+
- **Plain shell / other agents:** foreground for short tasks, or background it and poll the result
|
|
146
|
+
file. The run is done when `result.json` exists with a `status`. A pre-run usage error exits 2 and
|
|
147
|
+
writes **no** result file, so check the exit code too; a CLI that cannot be found exits 127 but
|
|
148
|
+
*does* write a `result.json` with status `zcode_unavailable`.
|
|
149
|
+
|
|
150
|
+
Do not trust progress trackers over reality: read the working tree, not a status line.
|
|
151
|
+
|
|
152
|
+
### 4. Review — do not trust the self-report
|
|
153
|
+
|
|
154
|
+
- **Re-run the project's gates yourself.** Never take "gates passed" on faith.
|
|
155
|
+
- **Read the diff** against the brief: did ZCode do what was asked, nothing more and nothing less?
|
|
156
|
+
`touchedFiles` is your starting point.
|
|
157
|
+
- **On a `--read-only` run, check `readOnlyViolation` and confirm `touchedFiles` is empty.**
|
|
158
|
+
- Run the relevant guard skills on the diff if you have them installed.
|
|
159
|
+
|
|
160
|
+
Full checklist: [references/review-and-land.md](references/review-and-land.md).
|
|
161
|
+
|
|
162
|
+
### 5. Land it
|
|
163
|
+
|
|
164
|
+
**The orchestrator commits.** Only after the gates pass and the diff holds:
|
|
165
|
+
|
|
166
|
+
- Commit the verified work yourself, with a clear message.
|
|
167
|
+
- If it needs changes, send a delta brief with `--session <sessionId>` from the prior `result.json`,
|
|
168
|
+
and review again.
|
|
169
|
+
|
|
170
|
+
## Read-only second opinions
|
|
171
|
+
|
|
172
|
+
The relay doubles as a way to get an adversarial second opinion with no write risk: dispatch
|
|
173
|
+
`--read-only` with a brief listing the agreed points, then each contested point with both positions,
|
|
174
|
+
and ask ZCode to defend or concede each. Because plan mode's guarantee is measured rather than
|
|
175
|
+
enforced here, verify `touchedFiles` came back empty instead of assuming no edits.
|
|
176
|
+
|
|
177
|
+
## Authorization model
|
|
178
|
+
|
|
179
|
+
Delegation is something the human opts into. Once they have, committing verified, gate-passing work
|
|
180
|
+
is the agreed contract. Two limits: **surface, don't absorb** (report ZCode's design decisions and
|
|
181
|
+
defensible-but-unasked turns rather than silently keeping them) and **stop for scope changes** (if
|
|
182
|
+
correct completion needs going beyond the brief, ask). The full treatment is in
|
|
183
|
+
[references/review-and-land.md](references/review-and-land.md).
|
|
184
|
+
|
|
185
|
+
## References
|
|
186
|
+
|
|
187
|
+
- [references/writing-the-brief.md](references/writing-the-brief.md) — how to write a brief ZCode can
|
|
188
|
+
execute blind: structure, the report contract, embedding the real gate commands.
|
|
189
|
+
- [references/dispatch-and-poll.md](references/dispatch-and-poll.md) — `relay.mjs` flags, the
|
|
190
|
+
`result.json` contract, how the CLI is resolved, backgrounding, and recovery.
|
|
191
|
+
- [references/review-and-land.md](references/review-and-land.md) — the review checklist, the commit
|
|
192
|
+
boundary, and the exact-session rework cycle.
|
|
193
|
+
- [references/multi-task-queues.md](references/multi-task-queues.md) — running a sequential queue:
|
|
194
|
+
carrying constraints forward, progress tracking, and the end-of-run coherence check.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
## Limitations
|
|
198
|
+
|
|
199
|
+
- Docs-only import — executable `scripts/relay.mjs` not included; see upstream for full runtime. Requires `zcode` CLI, Node 18+, git.
|
|
200
|
+
- Relay never commits — it only returns structured result JSON; you review and land the commit.
|
|
201
|
+
|
|
202
|
+
> Adapted from [amElnagdy/delegate-skills](https://github.com/amElnagdy/delegate-skills) (MIT) — docs-only, runtime not bundled.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Dispatch and poll
|
|
2
|
+
|
|
3
|
+
The relay wraps the ZCode CLI so your job is "run a command, read a file."
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
|
|
7
|
+
cat brief.txt | node "<skill-dir>/scripts/relay.mjs" --cd /path/to/repo
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## How the relay finds ZCode
|
|
11
|
+
|
|
12
|
+
ZCode does not install a `zcode` binary on PATH and does not publish one to npm — the CLI ships
|
|
13
|
+
inside the desktop app. The relay resolves it in this order, first hit wins:
|
|
14
|
+
|
|
15
|
+
1. `zcode` on **PATH** — if you made a shim or alias, this is used.
|
|
16
|
+
2. **`--zcode-path <file>`**, else the **`ZCODE_CLI`** environment variable.
|
|
17
|
+
3. The installed **app bundle**: `%LOCALAPPDATA%\Programs\ZCode\resources\glm\zcode.cjs` on Windows,
|
|
18
|
+
`/Applications/ZCode.app/…` (and `~/Applications/…`) on macOS. Linux ships an AppImage with no
|
|
19
|
+
fixed install path, so there is nothing to auto-discover there — use option 1 or 2.
|
|
20
|
+
|
|
21
|
+
A resolved `.cjs` bundle is launched under `node`. `result.json` records which route was used in
|
|
22
|
+
`zcodeSource` (`path` / `flag` / `env` / `bundle`), so a surprising install is visible after the run.
|
|
23
|
+
|
|
24
|
+
If no CLI is found — including when you name one explicitly that does not exist — the relay exits
|
|
25
|
+
**127** and still writes a `result.json` with `status: "zcode_unavailable"`.
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
|
|
29
|
+
| Flag | Effect |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `--brief <file>` | Path to the brief. Omitted → read from stdin. |
|
|
32
|
+
| `--cd <dir>` | Working root for ZCode (default: current directory). |
|
|
33
|
+
| `--lane <name>` | Fleet lane from `delegate-setup` config. Explicit flags win over lane dials. |
|
|
34
|
+
| `--mode <mode>` | ZCode's `--mode`. **Only `plan` and `yolo` are accepted** (see below). Default `yolo`. |
|
|
35
|
+
| `--read-only` | Shortcut for `--mode plan` (review/diagnosis, no edits). |
|
|
36
|
+
| `--disallowed-tools <list>` | Comma/space-separated denylist, e.g. `"Write,Edit,Bash"`. Enforced by ZCode. |
|
|
37
|
+
| `--session <id>` | Continue a specific session by `sess_…` id from a prior `result.json`. |
|
|
38
|
+
| `--resume-last` | Continue the latest session **for `--cd`**. Mutually exclusive with `--session`. |
|
|
39
|
+
| `--zcode-path <file>` | Point at the CLI explicitly. |
|
|
40
|
+
| `--timeout <dur>` | Relay-side watchdog (default: off). `30m`, `2h`. ZCode has no timeout flag of its own. |
|
|
41
|
+
| `--out-dir <dir>` | Where to write run artifacts (default: a fresh dir under the system temp dir). |
|
|
42
|
+
| `-h, --help` | Show help. |
|
|
43
|
+
|
|
44
|
+
### Why `build` and `edit` are rejected
|
|
45
|
+
|
|
46
|
+
ZCode documents four modes. Headless runs have no permission client, so under `build` or `edit` the
|
|
47
|
+
Write and Bash tools are blocked and the run **exits 0 having changed nothing**, with a report
|
|
48
|
+
explaining that tool permissions were denied. That is a success status for a run that did no work,
|
|
49
|
+
so the relay refuses those modes up front with a usage error (exit 2) rather than letting them look
|
|
50
|
+
like a completed task. Use `--mode yolo` to write, or `--read-only` for plan mode.
|
|
51
|
+
|
|
52
|
+
## The `result.json` contract
|
|
53
|
+
|
|
54
|
+
Speaks `delegate-relay.result.v1`.
|
|
55
|
+
|
|
56
|
+
| Field | Meaning |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `status` | `completed` \| `failed` \| `timeout` \| `aborted` \| `zcode_unavailable` |
|
|
59
|
+
| `exitCode` | ZCode's own exit code, or the relay's mapping for a killed run |
|
|
60
|
+
| `signal` | The signal that killed the child, or `null` |
|
|
61
|
+
| `finalMessage` | ZCode's final report (its `response` field) |
|
|
62
|
+
| `sessionId` | The `sess_…` id — pass to `--session` to continue this exact session |
|
|
63
|
+
| `touchedFiles` | Git porcelain paths. `[]` when the tree is clean, `null` when git cannot report. |
|
|
64
|
+
| `mode` | The ZCode mode the run actually used |
|
|
65
|
+
| `readOnlyViolation` | Tri-state. `false` = the tripwire saw no change on a plan run, `true` = it did, `null` = unknown or not applicable |
|
|
66
|
+
| `usage` | ZCode's token accounting (input, output, total, cache reads) |
|
|
67
|
+
| `contextWindow` | From ZCode's `projection` |
|
|
68
|
+
| `zcodeVersion`, `zcodeSource` | Which CLI ran, and how it was found |
|
|
69
|
+
| `briefPath`, `outputPath`, `finalPath` | Run artifacts on disk |
|
|
70
|
+
|
|
71
|
+
Exit codes: a pre-run usage error (bad args, empty brief, a rejected `--mode`) exits **2** and writes
|
|
72
|
+
**no** result file. A CLI that cannot be found exits **127** and *does* write one. Otherwise the exit
|
|
73
|
+
code mirrors ZCode's, and a run killed by the watchdog reports `timeout`.
|
|
74
|
+
|
|
75
|
+
An orchestrator that polls for the file must therefore also check the exit code — a non-zero exit
|
|
76
|
+
with no file is a usage error, not a crashed run.
|
|
77
|
+
|
|
78
|
+
## Backgrounding
|
|
79
|
+
|
|
80
|
+
- **Claude Code:** run the Bash call with `run_in_background: true`.
|
|
81
|
+
- **bash/zsh (incl. Git Bash/WSL):** `… &`, then poll for `result.json`.
|
|
82
|
+
- **PowerShell:** `Start-Job`. **cmd:** `start /b`.
|
|
83
|
+
|
|
84
|
+
The run is finished when `result.json` exists with a `status` *and* the process has exited.
|
|
85
|
+
|
|
86
|
+
## Reading the output
|
|
87
|
+
|
|
88
|
+
ZCode's `--json` prints a single JSON document at the end rather than a stream of events, and the
|
|
89
|
+
relay parses it tolerantly: the bundled AI SDK sometimes prints a warning banner on stdout ahead of
|
|
90
|
+
the JSON, so leading non-JSON lines are skipped. The raw stdout is preserved at `outputPath` and the
|
|
91
|
+
final report at `finalPath`, so nothing is lost if parsing degrades.
|
|
92
|
+
|
|
93
|
+
If the document cannot be parsed at all:
|
|
94
|
+
|
|
95
|
+
- with exit 0, the run is still `completed`, `finalMessage` falls back to the raw stdout, and a
|
|
96
|
+
`parseWarning` field is set — read `outputPath` yourself.
|
|
97
|
+
- with a non-zero exit, the run is `failed` and `stderrTail` carries the last lines of stderr.
|
|
98
|
+
|
|
99
|
+
## When a run misbehaves
|
|
100
|
+
|
|
101
|
+
- **`status: "timeout"`** — the watchdog fired. The whole ZCode process tree was killed. Inspect the
|
|
102
|
+
working tree before re-dispatching; a killed run can leave partial edits.
|
|
103
|
+
- **`status: "aborted"`** — the relay itself was killed and forwarded the kill. Same advice.
|
|
104
|
+
- **`status: "zcode_unavailable"`** — no CLI found. Check the three resolution routes above.
|
|
105
|
+
- **Exit 1 with `Session not found`** — the `--session` id does not exist. Session ids are
|
|
106
|
+
`sess_`-prefixed; copy them from a prior `result.json`, not from memory.
|
|
107
|
+
- **`completed` but `touchedFiles` is empty on a write run** — read `finalMessage`. ZCode may have
|
|
108
|
+
reported that it could not proceed. That is a real outcome, not a relay bug.
|
|
109
|
+
- **`(no final message captured)` on a resumed plan-mode run** — ZCode has been observed returning
|
|
110
|
+
`"response": ""` while doing substantial work (658 output tokens across 602 events in one measured
|
|
111
|
+
run). The relay reports what ZCode sent, so an empty report here is the CLI's, not a parse failure:
|
|
112
|
+
`parseWarning` will be absent and `usage` non-zero. Read `outputPath` and the working tree rather
|
|
113
|
+
than concluding nothing happened.
|