opencode-skills-collection 4.0.44 → 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.
Files changed (117) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +25 -1
  2. package/bundled-skills/agy-delegate/SKILL.md +168 -0
  3. package/bundled-skills/agy-delegate/references/dispatch-and-poll.md +140 -0
  4. package/bundled-skills/agy-delegate/references/multi-task-queues.md +59 -0
  5. package/bundled-skills/agy-delegate/references/review-and-land.md +103 -0
  6. package/bundled-skills/agy-delegate/references/writing-the-brief.md +124 -0
  7. package/bundled-skills/aider-delegate/SKILL.md +227 -0
  8. package/bundled-skills/aider-delegate/references/dispatch-and-poll.md +154 -0
  9. package/bundled-skills/aider-delegate/references/multi-task-queues.md +68 -0
  10. package/bundled-skills/aider-delegate/references/review-and-land.md +101 -0
  11. package/bundled-skills/aider-delegate/references/writing-the-brief.md +142 -0
  12. package/bundled-skills/babysit-pr/SKILL.md +343 -0
  13. package/bundled-skills/claude-delegate/SKILL.md +182 -0
  14. package/bundled-skills/claude-delegate/references/dispatch-and-poll.md +220 -0
  15. package/bundled-skills/claude-delegate/references/multi-task-queues.md +66 -0
  16. package/bundled-skills/claude-delegate/references/review-and-land.md +117 -0
  17. package/bundled-skills/claude-delegate/references/writing-the-brief.md +158 -0
  18. package/bundled-skills/cline-delegate/SKILL.md +140 -0
  19. package/bundled-skills/cline-delegate/references/dispatch-and-poll.md +142 -0
  20. package/bundled-skills/cline-delegate/references/multi-task-queues.md +58 -0
  21. package/bundled-skills/cline-delegate/references/review-and-land.md +80 -0
  22. package/bundled-skills/cline-delegate/references/writing-the-brief.md +129 -0
  23. package/bundled-skills/codex-delegate/SKILL.md +177 -0
  24. package/bundled-skills/codex-delegate/references/dispatch-and-poll.md +161 -0
  25. package/bundled-skills/codex-delegate/references/multi-task-queues.md +66 -0
  26. package/bundled-skills/codex-delegate/references/review-and-land.md +126 -0
  27. package/bundled-skills/codex-delegate/references/writing-the-brief.md +125 -0
  28. package/bundled-skills/commandcode-delegate/SKILL.md +188 -0
  29. package/bundled-skills/commandcode-delegate/references/dispatch-and-poll.md +222 -0
  30. package/bundled-skills/commandcode-delegate/references/multi-task-queues.md +81 -0
  31. package/bundled-skills/commandcode-delegate/references/review-and-land.md +144 -0
  32. package/bundled-skills/commandcode-delegate/references/writing-the-brief.md +147 -0
  33. package/bundled-skills/copilot-delegate/SKILL.md +159 -0
  34. package/bundled-skills/copilot-delegate/references/dispatch-and-poll.md +143 -0
  35. package/bundled-skills/copilot-delegate/references/multi-task-queues.md +58 -0
  36. package/bundled-skills/copilot-delegate/references/review-and-land.md +80 -0
  37. package/bundled-skills/copilot-delegate/references/writing-the-brief.md +140 -0
  38. package/bundled-skills/cursor-delegate/SKILL.md +170 -0
  39. package/bundled-skills/cursor-delegate/references/dispatch-and-poll.md +162 -0
  40. package/bundled-skills/cursor-delegate/references/multi-task-queues.md +59 -0
  41. package/bundled-skills/cursor-delegate/references/review-and-land.md +93 -0
  42. package/bundled-skills/cursor-delegate/references/writing-the-brief.md +126 -0
  43. package/bundled-skills/debate-review/SKILL.md +85 -0
  44. package/bundled-skills/debate-review/assets/prompts/review-debate.md +51 -0
  45. package/bundled-skills/debate-review/assets/prompts/review-main.md +64 -0
  46. package/bundled-skills/debate-review/assets/prompts/review-rebuttal.md +42 -0
  47. package/bundled-skills/debate-review/references/comment-format.md +63 -0
  48. package/bundled-skills/debate-review/references/schema.md +95 -0
  49. package/bundled-skills/delegate-setup/SKILL.md +215 -0
  50. package/bundled-skills/delegate-setup/references/schema.md +100 -0
  51. package/bundled-skills/delegate-setup/references/setup-dialogue.md +101 -0
  52. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  53. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  54. package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
  55. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  56. package/bundled-skills/docs/users/aas-core.md +1 -1
  57. package/bundled-skills/docs/users/bundles.md +1 -1
  58. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  59. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  60. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  61. package/bundled-skills/docs/users/usage.md +3 -3
  62. package/bundled-skills/docs/users/visual-guide.md +4 -4
  63. package/bundled-skills/falsify/SKILL.md +263 -0
  64. package/bundled-skills/falsify/references/bias-catalog.md +42 -0
  65. package/bundled-skills/falsify/references/mental-models.md +135 -0
  66. package/bundled-skills/falsify/templates/thinking-ledger.md +104 -0
  67. package/bundled-skills/graceful-shutdown/SKILL.md +379 -0
  68. package/bundled-skills/grok-delegate/SKILL.md +179 -0
  69. package/bundled-skills/grok-delegate/references/dispatch-and-poll.md +171 -0
  70. package/bundled-skills/grok-delegate/references/multi-task-queues.md +67 -0
  71. package/bundled-skills/grok-delegate/references/review-and-land.md +130 -0
  72. package/bundled-skills/grok-delegate/references/writing-the-brief.md +119 -0
  73. package/bundled-skills/kimi-delegate/SKILL.md +137 -0
  74. package/bundled-skills/kimi-delegate/references/dispatch-and-poll.md +134 -0
  75. package/bundled-skills/kimi-delegate/references/multi-task-queues.md +58 -0
  76. package/bundled-skills/kimi-delegate/references/review-and-land.md +92 -0
  77. package/bundled-skills/kimi-delegate/references/writing-the-brief.md +132 -0
  78. package/bundled-skills/omp-delegate/SKILL.md +186 -0
  79. package/bundled-skills/omp-delegate/references/dispatch-and-poll.md +155 -0
  80. package/bundled-skills/omp-delegate/references/multi-task-queues.md +59 -0
  81. package/bundled-skills/omp-delegate/references/review-and-land.md +95 -0
  82. package/bundled-skills/omp-delegate/references/writing-the-brief.md +149 -0
  83. package/bundled-skills/opencode-delegate/SKILL.md +189 -0
  84. package/bundled-skills/opencode-delegate/references/dispatch-and-poll.md +156 -0
  85. package/bundled-skills/opencode-delegate/references/multi-task-queues.md +68 -0
  86. package/bundled-skills/opencode-delegate/references/review-and-land.md +125 -0
  87. package/bundled-skills/opencode-delegate/references/writing-the-brief.md +142 -0
  88. package/bundled-skills/pi-delegate/SKILL.md +148 -0
  89. package/bundled-skills/pi-delegate/references/dispatch-and-poll.md +146 -0
  90. package/bundled-skills/pi-delegate/references/multi-task-queues.md +59 -0
  91. package/bundled-skills/pi-delegate/references/review-and-land.md +95 -0
  92. package/bundled-skills/pi-delegate/references/writing-the-brief.md +132 -0
  93. package/bundled-skills/qoder-delegate/SKILL.md +151 -0
  94. package/bundled-skills/qoder-delegate/references/dispatch-and-poll.md +119 -0
  95. package/bundled-skills/qoder-delegate/references/multi-task-queues.md +43 -0
  96. package/bundled-skills/qoder-delegate/references/review-and-land.md +66 -0
  97. package/bundled-skills/qoder-delegate/references/writing-the-brief.md +85 -0
  98. package/bundled-skills/sandbase-mcp/SKILL.md +194 -0
  99. package/bundled-skills/ui-slop-score/SKILL.md +2 -2
  100. package/bundled-skills/unsloth-finetuning/SKILL.md +352 -0
  101. package/bundled-skills/vibe-delegate/SKILL.md +147 -0
  102. package/bundled-skills/vibe-delegate/references/dispatch-and-poll.md +144 -0
  103. package/bundled-skills/vibe-delegate/references/multi-task-queues.md +59 -0
  104. package/bundled-skills/vibe-delegate/references/review-and-land.md +87 -0
  105. package/bundled-skills/vibe-delegate/references/writing-the-brief.md +131 -0
  106. package/bundled-skills/warp-delegate/SKILL.md +192 -0
  107. package/bundled-skills/warp-delegate/references/dispatch-and-poll.md +163 -0
  108. package/bundled-skills/warp-delegate/references/multi-task-queues.md +80 -0
  109. package/bundled-skills/warp-delegate/references/review-and-land.md +123 -0
  110. package/bundled-skills/warp-delegate/references/writing-the-brief.md +105 -0
  111. package/bundled-skills/zcode-delegate/SKILL.md +202 -0
  112. package/bundled-skills/zcode-delegate/references/dispatch-and-poll.md +113 -0
  113. package/bundled-skills/zcode-delegate/references/multi-task-queues.md +87 -0
  114. package/bundled-skills/zcode-delegate/references/review-and-land.md +81 -0
  115. package/bundled-skills/zcode-delegate/references/writing-the-brief.md +120 -0
  116. package/package.json +1 -1
  117. package/skills_index.json +660 -0
@@ -0,0 +1,222 @@
1
+ # Dispatch and poll
2
+
3
+ `scripts/relay.mjs` is the dispatch layer. It wraps `cmd -p`, feeds it the brief on stdin, captures the
4
+ NDJSON event stream, and writes a structured `result.json`. Your job collapses to: run one command,
5
+ then read one file. Everything Command Code-specific lives in the helper, which is what keeps the loop
6
+ portable across orchestrators.
7
+
8
+ ## Before the first run: check the binary
9
+
10
+ Three gotchas, all worth 30 seconds:
11
+
12
+ ```bash
13
+ command -v cmd # `cmd` is a generic name — an alias or another tool can shadow it
14
+ cmd --version # the relay records this in result.json; confirm it is Command Code's
15
+ cmd status # must report authenticated (else `cmd login`)
16
+ ```
17
+
18
+ On native Windows, use `cmdc`; `cmd` is the system shell. The relay launches the installed `cmdc.cmd`
19
+ shim through `cmd.exe`, while the brief stays on stdin and variable argument values stay restricted to
20
+ shell-safe tokens. Native Windows launch is contract-tested, but a live Command Code run is still
21
+ unverified. `COMMANDCODE_BIN` remains an absolute-path override, including for `.cmd`/`.bat` shims,
22
+ and must never point to `COMSPEC`.
23
+
24
+ ## Dispatching
25
+
26
+ ```bash
27
+ node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
28
+ ```
29
+
30
+ (`<skill-dir>` is wherever this skill is installed — the folder containing its `SKILL.md`. On Claude
31
+ Code it's the printed "Base directory for this skill"; on other orchestrators substitute that install
32
+ path. See [`SKILL.md`](../SKILL.md) if you need to locate it.)
33
+
34
+ Options:
35
+
36
+ | Flag | Effect |
37
+ | --- | --- |
38
+ | `--brief <file>` | The brief. Omit it to read the brief from stdin (`node relay.mjs … < brief.txt`). |
39
+ | `--cd <dir>` | Working root for Command Code (default: current directory). It is the child's working directory — Command Code has no `--cd` of its own, and under `--yolo` it is a starting point, not a boundary. |
40
+ | `--lane <name>` | Fleet lane from `delegate-setup` config. Applies that lane's dials; fails if the lane's `implementer` is not this relay. Explicit dial flags win. |
41
+ | `--model <name>` | Model for this run, e.g. `vendor/model` (default: Command Code's own). `cmd --list-models` lists what your account can use. |
42
+ | `--effort <level>` | Reasoning effort — `low` \| `medium` \| `high`, model-dependent. The relay accepts a bare token; Command Code and the model own the supported levels. |
43
+ | `--read-only` | Withhold the write, edit, and shell tools: no `--yolo`, plus `--permission-mode plan`. For review and diagnosis, followed by a Git-visible `readOnlyViolation` tripwire. |
44
+ | `--tools-all` | Also pass `--tools-all`, so no tool stays withheld. Ignored under `--read-only` — it does not lift the write gate. |
45
+ | `--max-turns <n>` | Cap conversation turns (default: Command Code's own, 100). Command Code may exit 0 at the cap; when its complete result reports `max_turns`, the relay reports failure and exits 1. |
46
+ | `--session <id>` | Continue one specific session by id (the `sessionId` from a prior `result.json`); send only the delta brief. Mutually exclusive with `--continue-last`. |
47
+ | `--continue-last` | Continue the most recent session. "Most recent" is global, not per-repo, so an unrelated run can steal it — prefer `--session`. |
48
+ | `--clean-env` | Pass only runtime basics (`PATH`, home, locale, temp, and Windows equivalents) to Command Code and its version preflight. This changes inherited variables only; it does not protect files or other same-user secrets. |
49
+ | `--keep-env <name>` | Keep one additional variable under `--clean-env`; repeat for each required environment-backed credential, proxy, certificate, or MCP variable. The name must be set and use portable environment-variable syntax. |
50
+ | `--timeout <dur>` | Relay-side watchdog (e.g. `30m`, `2h`); on expiry the child is killed and `result.json` gets `status: "timeout"`. Off by default. |
51
+ | `--out-dir <dir>` | Where artifacts go (default: a fresh private dir under the system temp dir). |
52
+
53
+ Artifacts default to the system temp dir so relay-created files stay out of the target repository.
54
+ On POSIX, that directory is mode `0700` and its files are created as `0600`. The touched-files report
55
+ then shows Command Code's Git-visible edits without the helper's artifacts.
56
+
57
+ `--clean-env` is not a security boundary: Command Code still reaches files and other same-user secrets
58
+ through `HOME` (its own state lives in `~/.commandcode`) and OS facilities, and under `--yolo` there is
59
+ no sandbox at all. Its login credentials are file-backed, so a `--clean-env` run stays authenticated;
60
+ provider, proxy, certificate, or MCP settings that reference a stripped variable need it named with
61
+ `--keep-env`. The same filtered environment is used for preflight and dispatch.
62
+
63
+ ## What the helper is doing
64
+
65
+ ```bash
66
+ cmd -p --output-format json --skip-onboarding --no-auto-update -t --yolo [--tools-all] \
67
+ [-m <model>] [--effort <level>] [--max-turns <n>] < brief.txt # fresh implementation run
68
+ cmd -p --output-format json --skip-onboarding --no-auto-update -t --permission-mode plan … # --read-only
69
+ cmd -p … --resume <sessionId> < delta-brief.txt # exact-session rework
70
+ cmd -p … --continue < delta-brief.txt # most-recent fallback
71
+ ```
72
+
73
+ The four constant flags earn their place: `--output-format json` is what makes the run machine-readable
74
+ at all, `--skip-onboarding` stops the taste-onboarding prompt from blocking an automated run, `-t`
75
+ auto-trusts the project so the trust prompt doesn't, and `--no-auto-update` keeps a background update
76
+ from swapping the binary mid-run. The brief goes in on stdin, never in argv — Command Code's `-p` takes
77
+ an optional query argument, so an unrecognized flag would be read as that query and the run would die
78
+ with "too many arguments". Command Code waits at most 30 seconds for piped stdin; the relay writes the
79
+ brief immediately.
80
+
81
+ ## The result
82
+
83
+ `<out-dir>/result.json` is the contract. Fields:
84
+
85
+ - `schema` — the result-format version (currently `delegate-relay.result.v1`)
86
+ - `status` — `completed` | `failed` | `timeout` | `aborted` | `commandcode_unavailable`
87
+ - `exitCode` — preserves Command Code's non-zero exit code; changes a zero exit with a complete non-success result to 1; uses `128` plus the signal number if the child was killed;
88
+ `127` if the binary isn't on PATH; on a `timeout` the relay forces a non-zero code even when the child
89
+ exited `0` after the watchdog's SIGTERM
90
+ - `signal` — the signal that killed the child, otherwise `null`
91
+ - `commandCodeVersion` — the binary that actually ran
92
+ - `sessionId` — feed this to a later `--session <id>` (exact session; preferred) or `--continue-last`
93
+ (global "most recent", which another run can steal)
94
+ - `finalMessage` — Command Code's own final report (the `<structured_output_contract>` you asked for),
95
+ lifted from `finalText` on a complete result line or recovered from the last `message_end` or
96
+ `text_delta`; recovered text may be partial or empty, and is written to `finalPath` only when non-empty
97
+ - `resultLine` — how much of the tail survived: `complete`, `truncated`, or `absent`. See the
98
+ truncation section below; the four fields under it are null unless this says `complete`
99
+ - `resultSubtype` / `stopReason` / `usage` / `durationMs` — straight from that result line: `success`,
100
+ `error`, or `max_turns`; why the turn ended; token counts; wall-clock
101
+ - `touchedFiles` — `git status --porcelain` lines in the working root: your review starting point.
102
+ `null` (not `[]`) when git can't report — `git` missing, or a non-repo working root; `[]` means git
103
+ ran and the tree is clean
104
+ - `readOnlyViolation` — only meaningful under `--read-only`: `false` when the Git-visible detector
105
+ saw no change beyond the relay's own artifacts; it does not cover ignored or outside-repository
106
+ paths. `true` when the detector saw a change, `null` when git couldn't snapshot either side.
107
+ `null` on write-capable runs, where the question doesn't apply
108
+ - `autonomy` — the state the run actually got, in Command Code's terms (`--yolo …` or `plan …`)
109
+ - `briefPath` / `eventsPath` / `finalPath` — the exact brief relay sent, the raw NDJSON event stream,
110
+ and the final-message file; `finalPath` is `null` when `finalMessage` is empty
111
+ - `workdir`, `readOnly`, `toolsAll`, `model`, `effort`, `maxTurns`, `session`, `continueLast`,
112
+ `cleanEnv`, `keepEnv`, `startedAt`, `finishedAt` — `session` is the explicit session id, or `null`
113
+ for fresh and `--continue-last` runs; `keepEnv` records names only, never values
114
+ - `stderrTail` — last ~20 stderr lines; present on every run that did not complete (`failed`,
115
+ `timeout`, `aborted`), absent on `completed`, `commandcode_unavailable`, and launch failures
116
+ - `error` — present on a launch failure, on `timeout` and `aborted` runs, and when Command Code
117
+ reported a non-success result of its own
118
+
119
+ The helper also prints a summary to stdout and exits with Command Code's exit code, so a wrapping
120
+ script can branch on success/failure directly.
121
+
122
+ ## The tail is not reliable — read `resultLine`
123
+
124
+ `cmd` ends a run with a `run_end` event that embeds the **entire conversation** — every tool call,
125
+ its arguments, and its result — and then exits with `process.exit`, which discards whatever is still
126
+ queued in its stdout pipe. On any run big enough to matter, the tail therefore arrives cut mid-write
127
+ and the `result` line after it never lands. Successful live write runs have lost the result line,
128
+ either truncating `run_end` or dropping the rest of the stream. A synthetic writer that exits the
129
+ same way loses the stream down to whatever fits the OS
130
+ pipe buffer, no matter how fast the reader is — so this is the CLI's flush behavior, not the relay's
131
+ read speed (the relay batches its event-log writes precisely so it drains as fast as it can).
132
+
133
+ What the relay does about it, and what it means for you:
134
+
135
+ - Nothing load-bearing is read from the tail. `sessionId` comes from `run_start`, the **first** line of
136
+ the stream, so resume always works. The report is taken from the last `message_end`, falling back to
137
+ the streamed `text_delta`s of a message whose `message_end` was lost.
138
+ - `resultLine` tells you which case you got. Under `truncated` or `absent`, `resultSubtype`,
139
+ `stopReason`, `usage`, and `durationMs` are `null` because the CLI never delivered them — not because
140
+ the run lacked them. The summary prints a note saying so.
141
+ - `finalMessage` can still come back short or empty when the report itself was in the discarded
142
+ region. **The diff is the deliverable, not the report** — review `touchedFiles` and `git diff`, and
143
+ treat a thin report as missing information rather than as a failed run.
144
+ - Read-only runs are small and usually keep a `complete` result line, so the second-opinion use is
145
+ unaffected.
146
+
147
+ When a complete result line arrives, `status: "completed"` requires exit 0 and
148
+ `resultSubtype: "success"`; any other subtype is reported as failed with exit 1. When the result line
149
+ is truncated or absent, the relay falls back to the process exit code: exit 0 is completed and a
150
+ non-zero exit is failed. In that fallback case, read `resultLine` and review the diff because the
151
+ missing subtype cannot prove the task finished.
152
+
153
+ ## Waiting for completion
154
+
155
+ The helper blocks until Command Code finishes. Back it with whatever your orchestrator offers:
156
+
157
+ - **Claude Code:** run the `Bash` call with `run_in_background: true`; you're notified on completion,
158
+ then read `result.json`.
159
+ - **Plain shell / other agents:** foreground for short tasks, or background and poll — `node relay.mjs
160
+ … &` in bash/zsh, or your shell's equivalent (`Start-Job` in PowerShell). A run is done when
161
+ `result.json` exists with a `status`. **But** a pre-run usage error (bad args, empty brief) exits with
162
+ code 2 *before* writing any file — so check the exit code too, don't only watch for the file. (A
163
+ missing binary exits 127 but *does* write a `result.json` with status `commandcode_unavailable`.)
164
+
165
+ Trust the working tree and the process state over any progress display. A run is finished when the
166
+ process has exited and `result.json` is written — not when a status line says so.
167
+
168
+ ## When a run misbehaves
169
+
170
+ - **`status: commandcode_unavailable` (exit 127):** the binary isn't on PATH. Install Command Code, run
171
+ `cmd login` (`cmdc login` on Windows), or set `COMMANDCODE_BIN`, then re-dispatch.
172
+ - **an `error` mentioning `version preflight` (`failed`, or `timeout` at exit 124):** the bounded
173
+ `cmd --version` probe exited non-zero or hung past its cap (10s, or `--timeout` when shorter), so
174
+ Command Code was never dispatched; only the relay's own artifacts may already exist under
175
+ `--out-dir`. Check the install by running `cmd --version` yourself.
176
+ - **`status: failed` at exit 3:** not authenticated. `cmd login`, then re-dispatch.
177
+ - **`status: failed` at exit 5 or 10:** rate limited, or out of credits. Wait, lower the model tier, or
178
+ top up — the relay's summary names which.
179
+ - **`status: failed` with `stopReason: max_turns`:** the run hit the turn cap mid-task. If Command Code exited 0, the relay exits 1; otherwise it preserves the non-zero child exit. The
180
+ tree may hold a half-applied change. Inspect it, then either raise `--max-turns` and re-dispatch, or
181
+ split the brief.
182
+ - **`status: failed` at exit 0→1 with an `error` about subtype:** Command Code ended the run cleanly
183
+ without succeeding. The usual cause is a write-capable task dispatched `--read-only`, where the report
184
+ says the tools were refused. Re-dispatch without `--read-only`.
185
+ - **`status: failed` otherwise:** read `result.json`'s `stderrTail` and the tail of `eventsPath`. Common
186
+ causes: an invalid `--model`, an unsupported `--effort` for the selected model, or a network lapse.
187
+ Fix the cause and re-dispatch; don't paper over it by doing the work yourself unless that's what the
188
+ user wants.
189
+ - **`status: timeout`:** the `--timeout` watchdog killed the run. The working tree may hold a
190
+ half-applied change — inspect it before deciding between a longer `--timeout`, a smaller brief,
191
+ or a resume.
192
+ - **`status: aborted`:** the relay itself was killed (its parent's timeout, a stopped task, a closed
193
+ terminal) and forwarded the kill to `cmd`. The result is written before the relay exits; inspect the
194
+ working tree before re-dispatching. On native Windows a hard kill of the relay is uncatchable (Node
195
+ supports no `SIGTERM` handler there), so this status may never get written — a relay process that is
196
+ gone without a `result.json` is an aborted run; inspect the working tree and `events.jsonl` directly.
197
+ - **`status: failed` with `signal: "SIGKILL"`:** the host ended the child — commonly the OOM killer or
198
+ a supervisor timeout, not an implementer error. Free up host memory or split the task into smaller
199
+ briefs, then re-dispatch.
200
+ - **`readOnlyViolation: true`:** the tripwire detected a Git-visible change during a `--read-only`
201
+ run. It cannot attribute a concurrent change to Command Code, but its read-only state is a permission
202
+ layer rather than an OS sandbox. Review the diff and report the warning before doing anything else.
203
+ - **Empty `finalMessage`:** this is missing information, not a separate failure state. Read `status`
204
+ and `resultLine`; when the result line is truncated or absent, inspect the event log and diff before
205
+ landing.
206
+
207
+ ## Recovering lost work
208
+
209
+ `events.jsonl` records every NDJSON line Command Code streamed, and its `run_end` event embeds the
210
+ whole conversation — every tool call, its arguments, and its result. That makes the log both the map of
211
+ what a lost run did and, for file writes, often a literal copy of the content it wrote. If finished work
212
+ is lost — the run killed late, or the tree damaged afterward — read the event log before re-dispatching.
213
+ The flip side of that completeness: the log contains whatever the run read or wrote, so treat it as
214
+ sensitive as the repo itself, and note that it grows with the transcript (tens of KB for a trivial run,
215
+ much more for a long one).
216
+
217
+ ## The commit boundary
218
+
219
+ The helper never commits — by design, not omission. Under `--yolo` Command Code *can* write `.git`,
220
+ which is the reason: a run that commits itself is a run you must unpick before you can review it. The
221
+ robust contract is: Command Code edits the working tree, the orchestrator reviews and commits. See
222
+ [review-and-land.md](review-and-land.md).
@@ -0,0 +1,81 @@
1
+ # Multi-task queues
2
+
3
+ The single-task loop scales to a queue, and that's where delegation pays off most — a removal split
4
+ across layers, a migration touching many files, a refactor sweep. The discipline that makes a queue
5
+ trustworthy is sequencing and bookkeeping, not parallelism.
6
+
7
+ ## Run sequentially, one commit per task
8
+
9
+ Resist the urge to fan out the whole queue at once. Run tasks **one at a time, in dependency order**,
10
+ landing each (review + gates + commit) before dispatching the next. Three reasons:
11
+
12
+ - **Later tasks assume earlier ones landed.** Task 3's brief can say "the X added in the previous step
13
+ exists" only if the previous step actually committed.
14
+ - **One commit per task** keeps the history reviewable and any single step revertible.
15
+ - **Each review is honest.** A clean working tree before each dispatch means the next task's
16
+ `touchedFiles` shows only *its* changes, not a pile-up from earlier tasks.
17
+
18
+ With Command Code there's a fourth reason, and it's the strongest: an implementation run has no
19
+ filesystem sandbox. Two concurrent `--yolo` runs in one tree can interleave writes to the same file with
20
+ nothing arbitrating between them, and the resulting diff belongs to neither task. If you do need
21
+ parallelism, give each run its own tree — `git worktree add` per task, or a container — rather than
22
+ running two of them side by side in the same checkout. Default to sequential.
23
+
24
+ ## Carry decided constraints forward
25
+
26
+ Implementation surfaces facts the original plan didn't have: a helper got named, a fixture lives in a
27
+ specific place, an interface was chosen. When a later task depends on one of those, **fold it into that
28
+ task's brief** as an explicit line. Command Code has no memory of the earlier run, so a constraint that
29
+ emerged in task 2 must be restated in task 5's brief or it won't hold. This is the queue equivalent of
30
+ keeping briefs self-contained.
31
+
32
+ (`--session` does carry one run's context into its own rework, but that's for reworking a single task —
33
+ not a channel for handing task 2's discoveries to task 5. Each task in a queue gets a fresh dispatch.)
34
+
35
+ ## Keep a progress file
36
+
37
+ For anything longer than two or three tasks — especially a run the human steps away from — maintain a
38
+ single progress file alongside the work. It's the durable record that survives your own context limits
39
+ and lets the human catch up at a glance. A shape that works:
40
+
41
+ - **Status table** — each task: queued / at-implementer / reviewed+committed (with the commit hash).
42
+ - **Per-task review notes** — what landed, what you verified, the gate outcome. One short paragraph.
43
+ - **"Needs your eyes"** — design decisions Command Code made, non-blocking nitpicks, any write that
44
+ landed outside the brief's paths, anything you want the human to overrule or confirm. This is the
45
+ section they read first.
46
+ - **End-of-run checklist** — what happens after the last task (push, open/update the PR, manual checks
47
+ the human should do).
48
+
49
+ Update it as each task lands, not in a batch at the end — if the run is interrupted, the file is still
50
+ accurate.
51
+
52
+ ## Watch the per-task budget
53
+
54
+ Each dispatch has its own turn cap (Command Code's default is 100; `--max-turns` overrides it) and its
55
+ own `--timeout` if you set one. In a long queue those limits bite unevenly: the task in the middle that
56
+ touches twenty files is the one that stops at `stopReason: max_turns` with a half-applied change. Size
57
+ briefs so no single task needs the whole budget, and treat a capped task as an unfinished one — inspect
58
+ the tree, then re-dispatch or split, rather than letting the queue move on past it.
59
+
60
+ ## Close with a coherence check
61
+
62
+ Per-task review proves each step in isolation; it doesn't prove the steps cohere. After the last task,
63
+ verify the whole:
64
+
65
+ - Run the full test/build once more on the final tree — not just the last task's slice.
66
+ - Do a repo-wide check for the thing the queue was about (e.g. after a removal, grep the entire tree
67
+ for any surviving reference; after a rename, confirm no stragglers).
68
+ - For schema work, replay all the new migrations from a clean state and check for drift.
69
+ - Then push and open or update the PR, with a description that reflects what actually shipped.
70
+
71
+ ## When to stop and ask
72
+
73
+ Proceed without asking on anything that follows from the agreed plan — that's the point of the human
74
+ opting into the queue. Stop and surface when:
75
+
76
+ - A task can't be completed correctly within its brief's scope (a scope change is the human's call).
77
+ - A review finds something that calls the *plan* into question, not just the implementation.
78
+ - The gates reveal a problem that affects tasks already "done."
79
+
80
+ Then report where you are, what's committed, and what the open question is — and wait. A queue that
81
+ quietly works around a broken assumption produces a lot of commits in the wrong direction.
@@ -0,0 +1,144 @@
1
+ # Review and land
2
+
3
+ Command Code did the typing; you own the judgment. This is where delegation earns its keep or quietly
4
+ ships a mistake. The discipline is simple to state and easy to skip under time pressure: **verify
5
+ against reality, never against the self-report — and read the diff as generated code, which fails in
6
+ ways a green gate can't see.**
7
+
8
+ One thing to add to the usual routine here: the run had no sandbox. An implementation dispatch goes out
9
+ under `--yolo`, so "did it stay inside the brief's paths?" is a question you answer from `touchedFiles`,
10
+ not one the tooling answered for you.
11
+
12
+ ## Check the tests before trusting the gates
13
+
14
+ If the diff touches existing tests, review those edits *first* — before the gate re-run means anything.
15
+ A weakened assertion, an added skip, or a deleted test makes the gate measure less than it did before
16
+ the run; green is only meaningful if the yardstick wasn't shortened.
17
+
18
+ - **Unbriefed edits to existing tests are a contract change, not part of the fix.** The brief asked for
19
+ an implementation; nothing in it authorized moving the goalposts. Flag them, don't absorb them.
20
+ - **Skipped, disabled, or commented-out tests added in this diff:** treat the underlying test as failing
21
+ until proven otherwise, whatever the annotation's comment claims.
22
+ - **Loosened assertions** (exact match relaxed to contains/truthy, error-type checks broadened, tolerance
23
+ widened): same treatment.
24
+
25
+ ## Re-run the gates yourself
26
+
27
+ `result.json` carries Command Code's own claim that the gates passed. Treat that as a claim, not
28
+ evidence — re-run the project's actual test/lint/build commands in the working tree and read the output.
29
+ And keep the result in proportion: **passing is necessary, not sufficient.** An implementer can *game* a
30
+ gate, not just misreport it — that is what the test check above and the sweep below exist to catch.
31
+
32
+ For changes with their own verification shape, go further:
33
+
34
+ - **Migrations / schema:** round-trip them (apply, reverse, re-apply on a scratch target) and check for
35
+ drift, rather than trusting that "the migration is reversible."
36
+ - **Removals / renames:** grep the codebase for dangling references to whatever was removed.
37
+ - **Anything stateful:** exercise the actual behavior, don't just confirm it compiles.
38
+
39
+ ## Read the diff against the brief
40
+
41
+ Open the diff (`touchedFiles` in the result is your starting list) and hold it against what you asked
42
+ for:
43
+
44
+ - **Out-of-scope writes** — this is the first check here, not an afterthought. Under `--yolo` there was
45
+ nothing stopping a write outside `--cd` or outside the paths the brief named. `touchedFiles` is a
46
+ `git status` review aid, not containment proof: it misses ignored files and anything outside the
47
+ repository. A worktree isolates the checkout but not the process. Use a container or another
48
+ OS-enforced boundary when writes outside the target tree are unacceptable.
49
+ - **Scope creep** — did it change things the brief said to leave untouched? Unasked refactors, renames,
50
+ "while I was here" edits. These are the most common quality problem in delegated work.
51
+ - **Scope shortfall** — did it do the whole task, including the edge cases and cleanup, or stop at the
52
+ first plausible version? A `stopReason` of `max_turns` in `result.json` is a strong hint of a run that
53
+ stopped mid-task rather than finishing.
54
+ - **Quiet judgment calls** — sometimes Command Code makes a defensible decision the brief didn't
55
+ anticipate. Don't just accept it because it looks reasonable; understand it and decide.
56
+ - **A commit it made itself** — the brief forbids it, but nothing enforced that. Compare `HEAD` with
57
+ the pre-dispatch baseline, then inspect status, staged and unstaged diffs, and the intervening log.
58
+ If the whole range belongs to the run, `git reset --soft <recorded-baseline>` and review it as a diff.
59
+
60
+ ## The implementer sweep
61
+
62
+ Generated code fails in systematic ways that gates are structurally blind to — each of these can sit in
63
+ a diff whose tests are all green. Walk them against every diff before you commit:
64
+
65
+ - **Hardcoded success or fixture data** on a path the brief says does real work — a canned
66
+ `{status: "ok"}` or default return passes tests *by design*. If Command Code couldn't implement
67
+ something, the diff should fail loudly, not pretend.
68
+ - **Catch-all error handling that returns a default** instead of propagating — the suppressed failure is
69
+ exactly what the gate would have caught. A broad catch is only acceptable with a recovery path the
70
+ contract documents.
71
+ - **Unverified imports and API calls** — confirm every new dependency, method, and signature exists in
72
+ the *installed* version (read the lockfile or the package, don't trust plausibility).
73
+ - **Dead weight** — unused imports, helpers nothing calls, unreachable branches, "Step 1/Step 2"
74
+ comment scaffolding, comments that restate the line below them.
75
+ - **A second way to do what the file already does** — a new HTTP client, error idiom, or logging style
76
+ introduced beside the existing one instead of reusing it.
77
+ - **New tests that assert internals** — asserting that an internal helper was called, or mocking the
78
+ project's own functions to isolate a "unit." Green, brittle, and worthless as regression cover.
79
+ - **Near-duplicate test bodies** differing by one value — fold into one data-driven test or drop the
80
+ copies; bloat reads as coverage but isn't.
81
+ - **Speculative surface** — optional parameters, config flags, or abstractions with no caller in this
82
+ diff or the repo. Delegated work gets the concrete behavior the brief asked for, nothing extra.
83
+ - **Guards for impossible cases** — null/type checks for values the code's own contract already
84
+ excludes. Noise that buries the validation that matters at real trust boundaries.
85
+
86
+ Anything the sweep catches goes back to Command Code as a delta brief (below) or gets fixed in the tree
87
+ before commit — and either way is reported to the user (see "Surface, don't absorb").
88
+
89
+ If the `guard-skills` package is installed, run the relevant guard on the diff for the full treatment —
90
+ `clean-code-guard` on production code, `test-guard` on tests, `docs-guard` on documentation. The sweep
91
+ above is the built-in floor; the guards go deeper.
92
+
93
+ ## The commit boundary
94
+
95
+ When the gates pass and the diff holds, **you commit** — the orchestrator, never Command Code. This
96
+ isn't a workaround for a missing feature; it's the deliberate boundary. Under `--yolo` Command Code is
97
+ perfectly capable of committing, and that is precisely the problem: committing should be the act of the
98
+ party that verified the work, and a self-committed run has to be unpicked before it can be reviewed.
99
+ Write a clear message describing what landed. If your project attributes co-authorship, that's the place
100
+ for it.
101
+
102
+ From dispatch until that commit, the uncommitted working tree is the authoritative copy of the
103
+ implementer's work — the only one you can commit from, and often the only copy at all. Never run
104
+ `git checkout`, `reset`, `clean`, or a branch switch in the workspace between those two points —
105
+ however messy an interrupted run looks, inspect it first: `git status`, `git diff`, `git diff --cached`
106
+ for anything the implementer staged (plain `git diff` is blind to the index), and open any untracked
107
+ files (`??` in `git status`) directly — they are the implementer's new files, and no diff shows their
108
+ contents. The tree is evidence, not clutter. After that inspection the verdict can legitimately be to
109
+ discard — work built on a premise you have since corrected, for example — and then `git checkout`/`clean`
110
+ is the right tool. The ban is on reflexive cleanup before anyone has looked.
111
+
112
+ ## Reworking: send the delta, not the whole task
113
+
114
+ If the review turns up problems, don't restate the entire brief. Continue the same Command Code session
115
+ with just the correction:
116
+
117
+ ```bash
118
+ echo "The fix is right, but the test mocks the DB session - use the real migrated fixture instead, and
119
+ drop the now-unused import." | node "<skill-dir>/scripts/relay.mjs" --session <sessionId> --cd /path/to/repo
120
+ ```
121
+
122
+ (`<skill-dir>` is this skill's install directory — see [dispatch-and-poll.md](dispatch-and-poll.md).
123
+ `<sessionId>` is the field of that name from the prior `result.json`.)
124
+
125
+ `--session <sessionId>` keeps the context from the first run, so a short delta is enough; use
126
+ `--continue-last` only when no session id came back, since "most recent" is global and another run can
127
+ steal it. Then review again — rework gets the same gate-rerun, test check, diff-read, and sweep as the
128
+ original, no shortcuts. Repeat until it's right, then commit.
129
+
130
+ ## Surface, don't absorb
131
+
132
+ The human opted into delegation, so committing verified, gate-passing work is the agreed contract.
133
+ But keep them in the loop on anything that changes the shape of the work:
134
+
135
+ - **Report design decisions** Command Code made, and any defensible-but-unrequested turns it took.
136
+ - **Note non-blocking nitpicks** you chose not to block on, so the human can overrule you.
137
+ - **Report any write outside the brief's paths**, and any `readOnlyViolation: true` on a read-only
138
+ dispatch, even when the change itself looks harmless. Those say something about the run's containment,
139
+ which is the human's call to weigh, not yours to normalize.
140
+ - **Stop and ask** if correct completion requires going beyond the brief — don't expand the mandate on
141
+ your own. A scope change is the human's call, not yours or Command Code's.
142
+
143
+ For a multi-task run, capture these in the progress file rather than letting them scroll past — see
144
+ [multi-task-queues.md](multi-task-queues.md).
@@ -0,0 +1,147 @@
1
+ # Writing the brief
2
+
3
+ A brief is the entire task as Command Code will see it. It runs in a fresh process with **no memory of
4
+ your conversation, no access to your prior notes, and no shared context** — only the text you send and
5
+ whatever it can read from the working tree (including the repo's own `AGENTS.md`, which it picks up
6
+ automatically, and any skills it discovers there).
7
+ If a constraint isn't in the brief or discoverable in the repo, it doesn't exist for Command Code. The
8
+ single most common failure is a brief that assumes context it doesn't have.
9
+
10
+ ## The shape that works
11
+
12
+ Command Code responds best to compact, block-structured prompts with XML tags rather than long prose.
13
+ State the task, what "done" looks like, how to behave by default, and the few constraints that actually
14
+ matter. Add a block only when the task needs it — don't ship empty ceremony.
15
+
16
+ ```xml
17
+ <task>
18
+ One or two sentences: the concrete job and where it lives. Then the specifics — current state, what to
19
+ change, and explicitly what to leave untouched. The "leave untouched" list is what keeps Command Code
20
+ from wandering into unrelated refactors.
21
+ </task>
22
+
23
+ <verification_loop>
24
+ Run these before finishing and fix anything they surface, don't just report it:
25
+ <the project's real test command>
26
+ <the project's real lint/format command>
27
+ <the project's real build/typecheck command>
28
+ Confirm the working tree shows only the intended changes afterward.
29
+ </verification_loop>
30
+
31
+ <action_safety>
32
+ Keep changes scoped to the task. No unrelated refactors, renames, or cleanup unless required for
33
+ correctness. Do NOT run git add or git commit — the orchestrator commits after reviewing. Leave the
34
+ work uncommitted in the working tree.
35
+ </action_safety>
36
+
37
+ <structured_output_contract>
38
+ End with a report in this exact shape:
39
+ 1. What changed and why
40
+ 2. Files touched
41
+ 3. Gate outcomes (paste the test/lint counts)
42
+ 4. Anything you deviated on, left open, or want a decision on
43
+ </structured_output_contract>
44
+ ```
45
+
46
+ That four-block skeleton covers most implementation tasks. Reach for the extra blocks when the task
47
+ profile calls for them:
48
+
49
+ - **Debugging / open-ended fixes** — add `<completeness_contract>` (resolve fully, don't stop at the
50
+ first plausible fix) and `<missing_context_gating>` (don't guess missing repo facts; find them or
51
+ state what's unknown).
52
+ - **Review / diagnosis (read-only)** — add `<grounding_rules>` (ground every claim in evidence; label
53
+ inferences) and run with `--read-only` so the write, edit, and shell tools stay withheld.
54
+ - **Research / recommendations** — add `<research_mode>` (separate observed facts, inferences, open
55
+ questions).
56
+
57
+ ## Path discipline is scope guidance
58
+
59
+ An implementation run goes out under `--yolo`, which means no filesystem boundary: Command Code can
60
+ write anywhere the process can reach, not just under `--cd`. Name the files or directories it may
61
+ change, say plainly that everything else is off limits, and keep `<action_safety>` in every
62
+ write-capable brief. That is guidance, not a sandbox. A worktree isolates the checkout but does not
63
+ contain the process; use a container or another OS-enforced boundary when writes outside the target
64
+ tree are unacceptable. `touchedFiles` is only a review aid: it cannot show ignored files or writes
65
+ outside the repository.
66
+
67
+ ## `git commit` is not blocked, only forbidden
68
+
69
+ Sibling delegates can rely on a sandbox refusing to write `.git`. This one cannot: under `--yolo`,
70
+ Command Code can commit, so the brief has to tell it not to. Record `HEAD` before dispatch and keep the
71
+ "do NOT run git add or git commit" line. If `HEAD` changed, inspect status, staged and unstaged diffs,
72
+ and the intervening log first. Only after confirming the whole commit range belongs to the run, use
73
+ `git reset --soft <recorded-baseline>` so you can review that range as a diff.
74
+
75
+ ## Discover the real gates — don't hardcode
76
+
77
+ `<verification_loop>` is only useful if it names the project's *actual* commands. Read the repo's
78
+ `AGENTS.md` / `CLAUDE.md` / `Makefile` / `package.json` first and copy the real ones in (`make test`,
79
+ `npm run lint`, `cargo test`, `pytest -q`, whatever it is). A brief that says "run the tests" without
80
+ naming them gets you an implementer that guesses — or skips.
81
+
82
+ ## Honor the repo's conventions
83
+
84
+ Command Code reads the repo's `AGENTS.md` automatically, so house rules there (style, forbidden
85
+ patterns, commit conventions) already apply. If the project forbids certain things in code — say,
86
+ spec/ticket IDs in comments, process language like "MVP"/"for now"/"phase N", or specific test
87
+ conventions, whatever the repo's own conventions ban — restate the load-bearing ones in the brief too,
88
+ because compliance is only as reliable as what's in front of it.
89
+
90
+ ## One task per brief
91
+
92
+ Keep each brief to a single, bounded job. "Review this, fix what you find, update the docs, and
93
+ suggest a roadmap" produces a muddled run; split it into separate dispatches. One brief → one run →
94
+ one commit keeps review and rollback clean, and lets a later task assume the earlier one landed.
95
+
96
+ Turns are capped (Command Code's own default is 100; `--max-turns` changes it). A brief bundling four
97
+ jobs is also the brief most likely to hit that cap and stop mid-way, reported as `stopReason:
98
+ max_turns` with a half-finished tree.
99
+
100
+ ## Premises freeze at dispatch
101
+
102
+ The implementer starts from the brief's facts and there is no steering channel mid-run. Audit the
103
+ fact block before sending — ownership, target branch, constraints, anything a judgment call rests
104
+ on. If a premise turns out wrong while the run is live, stop the run and re-dispatch a corrected
105
+ brief rather than discounting the output afterward; for a write-capable run, inspect the working
106
+ tree and reconcile any partial or premise-contaminated edits — keep or revert them — before the
107
+ re-dispatch.
108
+
109
+ ## Expect environment preamble in the reply
110
+
111
+ The final message may carry environment noise on top of your requested report — a banner injected by
112
+ the repo's `AGENTS.md`, extra text from an MCP server or skill you have configured locally, taste
113
+ notes from Command Code's own learning. That comes from your setup, not a relay defect. The
114
+ `<structured_output_contract>` is your defense: ask for a clearly delimited report section so you can
115
+ find the real output regardless of what wraps it.
116
+
117
+ ## A worked example
118
+
119
+ ```xml
120
+ <task>
121
+ In the payments service at services/billing/, the refund path double-charges when a refund is retried
122
+ after a network timeout (the idempotency key isn't checked before re-submitting). Make the refund
123
+ submission idempotent: check for an existing refund by idempotency key before creating a new one.
124
+ Touch only services/billing/refund.py and its tests. Leave the charge path, the API routes, and the
125
+ data models untouched, and do not write outside services/billing/.
126
+ </task>
127
+
128
+ <verification_loop>
129
+ Run and make green before finishing:
130
+ pytest tests/billing/ -q
131
+ ruff check services/billing/
132
+ Confirm git status shows only refund.py and its test file changed.
133
+ </verification_loop>
134
+
135
+ <action_safety>
136
+ Scope strictly to the refund idempotency fix. No unrelated refactors. Do NOT git add or commit; leave
137
+ changes in the working tree for review.
138
+ </action_safety>
139
+
140
+ <structured_output_contract>
141
+ Report: (1) the root cause and your fix, (2) files touched, (3) pytest + ruff outcomes with counts,
142
+ (4) anything you left open or want decided.
143
+ </structured_output_contract>
144
+ ```
145
+
146
+ Send this with `relay.mjs` (see [dispatch-and-poll.md](dispatch-and-poll.md)); review the result and
147
+ commit it yourself (see [review-and-land.md](review-and-land.md)).