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.
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,171 @@
1
+ # Dispatch and poll
2
+
3
+ `scripts/relay.mjs` is the dispatch layer. It wraps `grok -p` (headless mode), runs the brief under
4
+ an explicit autonomy profile, captures everything, and writes a structured `result.json`. Your job
5
+ collapses to: run one command, then read one file. Everything Grok-specific lives in the helper, which
6
+ is what keeps the loop portable across orchestrators.
7
+
8
+ ## Before the first run: check the binary
9
+
10
+ Two gotchas, both worth 30 seconds:
11
+
12
+ ```bash
13
+ command -v grok # the active binary; a stale install can shadow a current one
14
+ grok version # recorded into result.json so a stale binary is visible after the fact
15
+ grok login # or: grok login --device-auth / export XAI_API_KEY=...
16
+ ```
17
+
18
+ Grok Build is an early beta gated behind an eligible xAI subscription (SuperGrok / X Premium+). An
19
+ auth failure or missing beta access shows up as a failed run, not as `grok_unavailable`.
20
+
21
+ ## Dispatching
22
+
23
+ ```bash
24
+ node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
25
+ ```
26
+
27
+ (`<skill-dir>` is wherever this skill is installed — the folder containing its `SKILL.md`. On Claude
28
+ Code it's the printed "Base directory for this skill"; on other orchestrators substitute that install
29
+ path. See [`SKILL.md`](../SKILL.md) if you need to locate it.)
30
+
31
+ Options:
32
+
33
+ | Flag | Effect |
34
+ | --- | --- |
35
+ | `--brief <file>` | The brief. Omit it to read the brief from stdin (`node relay.mjs … < brief.txt`). |
36
+ | `--cd <dir>` | Working root for Grok (default: current directory); passed as `--cwd`. |
37
+ | `--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. |
38
+ | `--model <name>` | Grok model (default: Grok's own configured default). |
39
+ | `--effort <level>` | Reasoning effort for this run (`--effort`). |
40
+ | `--max-turns <n>` | Maximum number of agent turns for this run (`--max-turns`). |
41
+ | `--read-only` | Review/diagnosis intent (`--sandbox read-only --permission-mode plan`). **Best-effort, not enforced** — grok can still edit the tree headlessly. The relay reports a tri-state Git-visible change tripwire. |
42
+ | `--full-access` | Unrestricted auto-approve (`--always-approve --sandbox off`); opt-in. |
43
+ | `--resume-last` | Continue the most recent Grok session for this cwd; send only the delta brief. |
44
+ | `--session <id>` | Continue a specific session id; mutually exclusive with `--resume-last`. |
45
+ | `--timeout <dur>` | Relay-side watchdog (e.g. `30m`, `2h`); on expiry the child is killed and `result.json` gets `status: "timeout"`. Off by default. |
46
+ | `--out-dir <dir>` | Where artifacts go (default: a fresh dir under the system temp dir). |
47
+
48
+ Default autonomy (neither `--read-only` nor `--full-access`) is **workspace-write**:
49
+ `--always-approve --sandbox workspace`. Grok's native default is `ask`, which would hang a headless
50
+ pipe; the relay always sets autonomy explicitly.
51
+
52
+ Artifacts default to the system temp dir on purpose: the repo under review stays clean, so the
53
+ touched-files report shows only Grok's edits and nothing of the helper's own.
54
+
55
+ ## The result
56
+
57
+ `<out-dir>/result.json` is the contract. Fields:
58
+
59
+ - `schema` — the result-format version (currently `delegate-relay.result.v1`)
60
+ - `tool` — `"grok"`
61
+ - `status` — `completed` | `failed` | `timeout` | `aborted` | `grok_unavailable`
62
+ - `exitCode` — mirrors Grok's exit code; `128` plus the signal number if the child was killed; `127` if `grok` isn't on PATH; on a `timeout` the relay forces a non-zero code even when the child exited `0` after the watchdog's SIGTERM
63
+ - `signal` — the signal that killed the child, otherwise `null`
64
+ - `grokVersion` — the binary that actually ran
65
+ - `sessionId` — feed this to a later `--session <id>` (or use `--resume-last`)
66
+ - `finalMessage` — Grok's own final report (the `<structured_output_contract>` you asked for), assembled from the streaming-json `text` events
67
+ - `usage` — token counts from the run's end event (`input_tokens` / `output_tokens` / `total_tokens`); `null` if none were reported
68
+ - `touchedFiles` — `git status --porcelain` lines in the working root: your review starting point. `null` (not `[]`) when git can't report; `[]` means git ran and the tree is clean
69
+ - `briefPath` / `eventsPath` / `finalPath` — the exact brief relay sent, the raw streaming-json event stream, and the final-message file
70
+ - `workdir`, `autonomy`, `model`, `effort`, `resumeLast`, `startedAt`, `finishedAt`
71
+ - `readOnlyViolation` — present on dispatched `--read-only` runs: `true` when parsed git porcelain or
72
+ the working-tree/index fingerprint of an already-dirty Git-visible path proves a change; `false`
73
+ when coverage is complete and detects none; `null` when coverage is incomplete. Ignored paths,
74
+ submodule internals, perfect restores, and attribution remain outside it — the diff review, not this flag, is the guarantee
75
+ - `stderrTail` — last ~20 stderr lines; present on every run that did not complete (`failed`, `timeout`, `aborted`), absent on `completed`, `grok_unavailable`, and launch failures
76
+ - `error` — present on a launch failure, and on `timeout` and `aborted` runs
77
+
78
+ The helper also prints a summary to stdout and exits with Grok's exit code, so a wrapping script can
79
+ branch on success/failure directly.
80
+
81
+ ## Waiting for completion
82
+
83
+ The helper blocks until Grok finishes. Back it with whatever your orchestrator offers:
84
+
85
+ - **Claude Code:** run the `Bash` call with `run_in_background: true`; you're notified on completion,
86
+ then read `result.json`.
87
+ - **Plain shell / other agents:** foreground for short tasks, or background and poll — `node relay.mjs
88
+ … &` in bash/zsh (including Git Bash/WSL), or your shell's equivalent (`Start-Job` in PowerShell,
89
+ `start /b` in cmd). A run is done when `result.json` exists with a `status`. **But** a pre-run usage
90
+ error (bad args, empty brief) exits with code 2 *before* writing any file — so check the exit code
91
+ too, don't only watch for the file. (A missing `grok` binary exits 127 but *does* write a
92
+ `result.json` with status `grok_unavailable`.)
93
+
94
+ Trust the working tree and the process state over any progress display. A run is finished when the
95
+ process has exited and `result.json` is written — not when a status line says so.
96
+
97
+ ## When a run misbehaves
98
+
99
+ - **`status: grok_unavailable` (exit 127):** `grok` isn't on PATH or isn't found. Install with
100
+ `npm i -g @xai-official/grok` and `grok login`, then re-dispatch.
101
+ - **an `error` mentioning `version preflight` (`failed`, or `timeout` at exit 124):** the bounded
102
+ `grok version` probe exited non-zero or hung past its cap (10s, or `--timeout` when shorter), so
103
+ grok was never dispatched; only the relay's own artifacts may already exist under `--out-dir`.
104
+ Check the install by running `grok version` yourself.
105
+ - **`status: timeout`:** the `--timeout` watchdog killed the run. The working tree may hold a
106
+ half-applied change — inspect it before deciding between a longer `--timeout`, a smaller brief,
107
+ or a resume.
108
+ - **`status: aborted`:** the relay itself was killed (its parent's timeout, a stopped task, a
109
+ closed terminal) and forwarded the kill to grok. The result is written before the relay exits;
110
+ inspect the working tree before re-dispatching. On native Windows a hard kill of the relay is
111
+ uncatchable (Node supports no `SIGTERM` handler there), so this status may never get written -
112
+ a relay process that is gone without a `result.json` is an aborted run; inspect the working
113
+ tree and `events.jsonl` directly.
114
+ - **`status: failed` with `signal: "SIGKILL"`:** the host ended the child — commonly the OOM killer
115
+ or a supervisor timeout, not an implementer error. Free up host memory or split the task into
116
+ smaller briefs, then re-dispatch.
117
+ - **`status: failed`:** read `result.json`'s `stderrTail` and the tail of `eventsPath` for the cause.
118
+ Common causes: an auth lapse, missing beta access, an invalid `--model`, or a sandbox that blocked
119
+ something the task needed. Fix the cause and re-dispatch; don't paper over it by doing the work
120
+ yourself unless that's what the user wants.
121
+ - **Empty `finalMessage`:** Grok exited before producing a final message, or the streaming-json event
122
+ shape didn't match the extractor. Treat as a failed run; the events log usually shows where it
123
+ stopped — and is the source of truth for tightening the parser.
124
+
125
+ ## Recovering lost work
126
+
127
+ `events.jsonl` in the run directory records every event the implementer streamed. If finished
128
+ work is lost — the run killed late, or the working tree damaged afterward — read the event log
129
+ before re-dispatching: it identifies which files and tool commands were involved, which scopes
130
+ what needs redoing. Whether it also carries the edit contents depends on what the CLI streams,
131
+ so treat any reconstruction as unverified until it matches a working-tree diff — when the tree
132
+ still holds the work, preserve the tree rather than replaying the log.
133
+
134
+ ## What the helper is doing (and the alternatives)
135
+
136
+ Under the hood the helper runs roughly:
137
+
138
+ ```bash
139
+ # fresh run (default workspace-write autonomy)
140
+ grok --no-auto-update --no-alt-screen --output-format streaming-json --cwd <repo> \
141
+ --always-approve --sandbox workspace --prompt-file <brief.txt>
142
+
143
+ # resume most recent session for this cwd
144
+ grok --no-auto-update --no-alt-screen --output-format streaming-json --cwd <repo> \
145
+ --continue --always-approve --sandbox workspace --prompt-file <delta.txt>
146
+
147
+ # resume a specific session
148
+ grok --no-auto-update --no-alt-screen --output-format streaming-json --cwd <repo> \
149
+ --resume <id> --always-approve --sandbox workspace --prompt-file <delta.txt>
150
+ ```
151
+
152
+ `--no-auto-update` and `--no-alt-screen` are always set so automated runs don't check for updates or
153
+ take over the terminal. Autonomy flags are re-passed on resume because headless permission mode may
154
+ not inherit.
155
+
156
+ **Prompt delivery:** the brief is handed to grok via `--prompt-file`, never argv — so it stays out of
157
+ the host process list, isn't bounded by the OS argument-length cap, and a brief that begins with `-`
158
+ can't be misread as a flag. The relay writes the brief you pass (via `--brief` or stdin) to a file and
159
+ points `--prompt-file` at it.
160
+
161
+ Two alternatives exist if you ever want them, but the helper is the recommended path:
162
+
163
+ - **Raw `grok --prompt-file`** — fine for one-offs; you give up the captured `result.json`,
164
+ touched-files summary, and session-id extraction the helper does for you.
165
+ - **`grok agent stdio` (ACP)** — richer IDE/tool integration over JSON-RPC. Out of scope for this
166
+ skill; the headless single-turn path is the one the relay drives.
167
+
168
+ ## The commit boundary
169
+
170
+ The helper never commits — by design, not omission. The robust contract is: Grok edits the working
171
+ tree, the orchestrator reviews and commits. See [review-and-land.md](review-and-land.md).
@@ -0,0 +1,67 @@
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
+ Parallelism is occasionally worth it for genuinely independent tasks on separate files, but it
19
+ sacrifices the clean-tree-per-task property and makes review harder. Default to sequential.
20
+
21
+ ## Carry decided constraints forward
22
+
23
+ Implementation surfaces facts the original plan didn't have: a helper got named, a fixture lives in a
24
+ specific place, an interface was chosen. When a later task depends on one of those, **fold it into that
25
+ task's brief** as an explicit line. Each fresh dispatch starts a **new** Grok session with no memory of
26
+ the earlier run (unless you deliberately `--resume-last` / `--session`), so a constraint that emerged
27
+ in task 2 must be restated in task 5's brief or it won't hold. This is the queue equivalent of keeping
28
+ briefs self-contained.
29
+
30
+ ## Keep a progress file
31
+
32
+ For anything longer than two or three tasks — especially a run the human steps away from — maintain a
33
+ single progress file alongside the work. It's the durable record that survives your own context limits
34
+ and lets the human catch up at a glance. A shape that works:
35
+
36
+ - **Status table** — each task: queued / at-implementer / reviewed+committed (with the commit hash).
37
+ - **Per-task review notes** — what landed, what you verified, the gate outcome. One short paragraph.
38
+ - **"Needs your eyes"** — design decisions Grok made, non-blocking nitpicks, anything you want the
39
+ human to overrule or confirm. This is the section they read first.
40
+ - **End-of-run checklist** — what happens after the last task (push, open/update the PR, manual checks
41
+ the human should do).
42
+
43
+ Update it as each task lands, not in a batch at the end — if the run is interrupted, the file is still
44
+ accurate.
45
+
46
+ ## Close with a coherence check
47
+
48
+ Per-task review proves each step in isolation; it doesn't prove the steps cohere. After the last task,
49
+ verify the whole:
50
+
51
+ - Run the full test/build once more on the final tree — not just the last task's slice.
52
+ - Do a repo-wide check for the thing the queue was about (e.g. after a removal, grep the entire tree
53
+ for any surviving reference; after a rename, confirm no stragglers).
54
+ - For schema work, replay all the new migrations from a clean state and check for drift.
55
+ - Then push and open or update the PR, with a description that reflects what actually shipped.
56
+
57
+ ## When to stop and ask
58
+
59
+ Proceed without asking on anything that follows from the agreed plan — that's the point of the human
60
+ opting into the queue. Stop and surface when:
61
+
62
+ - A task can't be completed correctly within its brief's scope (a scope change is the human's call).
63
+ - A review finds something that calls the *plan* into question, not just the implementation.
64
+ - The gates reveal a problem that affects tasks already "done."
65
+
66
+ Then report where you are, what's committed, and what the open question is — and wait. A queue that
67
+ quietly works around a broken assumption produces a lot of commits in the wrong direction.
@@ -0,0 +1,130 @@
1
+ # Review and land
2
+
3
+ Grok did the typing; you own the judgment. This is where delegation earns its keep or quietly ships a
4
+ mistake. The discipline is simple to state and easy to skip under time pressure: **verify against
5
+ reality, never against the self-report — and read the diff as generated code, which fails in ways a
6
+ green gate can't see.**
7
+
8
+ ## Check the tests before trusting the gates
9
+
10
+ If the diff touches existing tests, review those edits *first* — before the gate re-run means anything.
11
+ A weakened assertion, an added skip, or a deleted test makes the gate measure less than it did before
12
+ the run; green is only meaningful if the yardstick wasn't shortened.
13
+
14
+ - **Unbriefed edits to existing tests are a contract change, not part of the fix.** The brief asked for
15
+ an implementation; nothing in it authorized moving the goalposts. Flag them, don't absorb them.
16
+ - **Skipped, disabled, or commented-out tests added in this diff:** treat the underlying test as failing
17
+ until proven otherwise, whatever the annotation's comment claims.
18
+ - **Loosened assertions** (exact match relaxed to contains/truthy, error-type checks broadened, tolerance
19
+ widened): same treatment.
20
+
21
+ ## Re-run the gates yourself
22
+
23
+ `result.json` carries Grok's own claim that the gates passed. Treat that as a claim, not evidence —
24
+ re-run the project's actual test/lint/build commands in the working tree and read the output. And keep
25
+ the result in proportion: **passing is necessary, not sufficient.** An implementer can *game* a gate,
26
+ not just misreport it — that is what the test check above and the sweep below exist to catch.
27
+
28
+ For changes with their own verification shape, go further:
29
+
30
+ - **Migrations / schema:** round-trip them (apply, reverse, re-apply on a scratch target) and check for
31
+ drift, rather than trusting that "the migration is reversible."
32
+ - **Removals / renames:** grep the codebase for dangling references to whatever was removed.
33
+ - **Anything stateful:** exercise the actual behavior, don't just confirm it compiles.
34
+
35
+ ## Read the diff against the brief
36
+
37
+ Open the diff (`touchedFiles` in the result is your starting list) and hold it against what you asked
38
+ for:
39
+
40
+ For `--read-only`, treat `readOnlyViolation: true` as proof of a detected Git-visible change and
41
+ `null` as incomplete coverage. `false` does not cover ignored paths, submodule internals, perfect
42
+ restores, or attribution; inspect the actual diff.
43
+
44
+ - **Scope creep** — did Grok change things the brief said to leave untouched? Unasked refactors,
45
+ renames, "while I was here" edits. These are the most common quality problem in delegated work.
46
+ - **Scope shortfall** — did it do the whole task, including the edge cases and cleanup, or stop at the
47
+ first plausible version?
48
+ - **Quiet judgment calls** — sometimes Grok makes a defensible decision the brief didn't anticipate.
49
+ Don't just accept it because it looks reasonable; understand it and decide.
50
+
51
+ ## The implementer sweep
52
+
53
+ Generated code fails in systematic ways that gates are structurally blind to — each of these can sit in
54
+ a diff whose tests are all green. Walk them against every diff before you commit:
55
+
56
+ - **Hardcoded success or fixture data** on a path the brief says does real work — a canned
57
+ `{status: "ok"}` or default return passes tests *by design*. If Grok couldn't implement something,
58
+ the diff should fail loudly, not pretend.
59
+ - **Catch-all error handling that returns a default** instead of propagating — the suppressed failure is
60
+ exactly what the gate would have caught. A broad catch is only acceptable with a recovery path the
61
+ contract documents.
62
+ - **Unverified imports and API calls** — confirm every new dependency, method, and signature exists in
63
+ the *installed* version (read the lockfile or the package, don't trust plausibility).
64
+ - **Dead weight** — unused imports, helpers nothing calls, unreachable branches, "Step 1/Step 2"
65
+ comment scaffolding, comments that restate the line below them.
66
+ - **A second way to do what the file already does** — a new HTTP client, error idiom, or logging style
67
+ introduced beside the existing one instead of reusing it.
68
+ - **New tests that assert internals** — asserting that an internal helper was called, or mocking the
69
+ project's own functions to isolate a "unit." Green, brittle, and worthless as regression cover.
70
+ - **Near-duplicate test bodies** differing by one value — fold into one data-driven test or drop the
71
+ copies; bloat reads as coverage but isn't.
72
+ - **Speculative surface** — optional parameters, config flags, or abstractions with no caller in this
73
+ diff or the repo. Delegated work gets the concrete behavior the brief asked for, nothing extra.
74
+ - **Guards for impossible cases** — null/type checks for values the code's own contract already
75
+ excludes. Noise that buries the validation that matters at real trust boundaries.
76
+
77
+ Anything the sweep catches goes back to Grok as a delta brief (below) or gets fixed in the tree before
78
+ commit — and either way is reported to the user (see "Surface, don't absorb").
79
+
80
+ If the `guard-skills` package is installed, run the relevant guard on the diff for the full treatment —
81
+ `clean-code-guard` on production code, `test-guard` on tests, `docs-guard` on documentation. The sweep
82
+ above is the built-in floor; the guards go deeper.
83
+
84
+ ## The commit boundary
85
+
86
+ When the gates pass and the diff holds, **you commit** — the orchestrator, never Grok. This isn't a
87
+ workaround for a missing feature; it's the deliberate boundary. Committing should be the act of the
88
+ party that verified the work. Write a clear message describing what landed. If your project attributes
89
+ co-authorship, that's the place for it.
90
+
91
+ From dispatch until that commit, the uncommitted working tree is the authoritative copy of the
92
+ implementer's work — the only one you can commit from, and often the only copy at all. Never run `git checkout`, `reset`, `clean`, or a branch switch in the
93
+ workspace between those two points — however messy an interrupted run looks, inspect it first:
94
+ `git status`, `git diff`, `git diff --cached` for anything the implementer staged (plain
95
+ `git diff` is blind to the index), and open any untracked files (`??` in `git status`) directly —
96
+ they are the implementer's new files, and no diff shows their contents. The tree is evidence,
97
+ not clutter. After that inspection the
98
+ verdict can legitimately be to discard — work built on a premise you have since corrected, for
99
+ example — and then `git checkout`/`clean` is the right tool. The ban is on reflexive cleanup
100
+ before anyone has looked.
101
+
102
+ ## Reworking: send the delta, not the whole task
103
+
104
+ If the review turns up problems, don't restate the entire brief. Continue the same Grok session with
105
+ just the correction:
106
+
107
+ ```bash
108
+ echo "The fix is right, but the test mocks the DB session - use the real migrated fixture instead, and
109
+ drop the now-unused import." | node "<skill-dir>/scripts/relay.mjs" --resume-last --cd /path/to/repo
110
+ ```
111
+
112
+ (`<skill-dir>` is this skill's install directory — see [dispatch-and-poll.md](dispatch-and-poll.md).)
113
+
114
+ `--resume-last` keeps Grok's context from the first run (via `grok --continue`), so a short delta is
115
+ enough. To resume a specific session from `result.json`'s `sessionId`, pass `--session <id>` instead.
116
+ Then review again — rework gets the same gate-rerun, test check, diff-read, and sweep as the original,
117
+ no shortcuts. Repeat until it's right, then commit.
118
+
119
+ ## Surface, don't absorb
120
+
121
+ The human opted into delegation, so committing verified, gate-passing work is the agreed contract.
122
+ But keep them in the loop on anything that changes the shape of the work:
123
+
124
+ - **Report design decisions** Grok made, and any defensible-but-unrequested turns it took.
125
+ - **Note non-blocking nitpicks** you chose not to block on, so the human can overrule you.
126
+ - **Stop and ask** if correct completion requires going beyond the brief — don't expand the mandate on
127
+ your own. A scope change is the human's call, not yours or Grok's.
128
+
129
+ For a multi-task run, capture these in the progress file rather than letting them scroll past — see
130
+ [multi-task-queues.md](multi-task-queues.md).
@@ -0,0 +1,119 @@
1
+ # Writing the brief
2
+
3
+ A brief is the entire task as Grok will see it. Grok 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 repo rules it discovers via `grok inspect`, and
6
+ the repo's own `AGENTS.md` when present).
7
+ If a constraint isn't in the brief or discoverable in the repo, it doesn't exist for Grok. The single
8
+ most common failure is a brief that assumes context Grok doesn't have.
9
+
10
+ ## The shape that works
11
+
12
+ Grok responds best to compact, block-structured prompts with XML tags rather
13
+ than long prose. State the task, what "done" looks like, how to behave by default, and the few
14
+ constraints that actually 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 Grok from
20
+ 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), tell Grok in the brief not to edit anything, and run with `--read-only`. Note
54
+ `--read-only` is best-effort on grok, not a hard block — verify `touchedFiles` after the run.
55
+ - **Research / recommendations** — add `<research_mode>` (separate observed facts, inferences, open
56
+ questions).
57
+
58
+ ## Discover the real gates — don't hardcode
59
+
60
+ `<verification_loop>` is only useful if it names the project's *actual* commands. Read the repo's
61
+ `CLAUDE.md` / `AGENTS.md` / `Makefile` / `package.json` first and copy the real ones in (`make test`,
62
+ `npm run lint`, `cargo test`, `pytest -q`, whatever it is). A brief that says "run the tests" without
63
+ naming them gets you a Grok that guesses — or skips.
64
+
65
+ ## Honor the repo's conventions
66
+
67
+ Grok discovers project configuration for the current directory (`grok inspect` shows rules, skills,
68
+ plugins, hooks, and MCP servers). House rules in the repo (style, forbidden patterns, commit
69
+ conventions) already apply when configured. If the project forbids certain things in code — say,
70
+ spec/ticket IDs in comments, process language like "MVP"/"for now"/"phase N", or specific test
71
+ conventions — restate the load-bearing ones in the brief too, because compliance is only as reliable
72
+ as what's in front of the implementer.
73
+
74
+ ## One task per brief
75
+
76
+ Keep each brief to a single, bounded job. "Review this, fix what you find, update the docs, and
77
+ suggest a roadmap" produces a muddled run; split it into separate dispatches. One brief → one Grok
78
+ run → one commit keeps review and rollback clean, and lets a later task assume the earlier one landed.
79
+
80
+ ## Premises freeze at dispatch
81
+
82
+ The implementer starts from the brief's facts and there is no steering channel mid-run. Audit the
83
+ fact block before sending — ownership, target branch, constraints, anything a judgment call rests
84
+ on. If a premise turns out wrong while the run is live, stop the run and re-dispatch a corrected
85
+ brief rather than discounting the output afterward; for a write-capable run, inspect the working
86
+ tree and reconcile any partial or premise-contaminated edits — keep or revert them — before the
87
+ re-dispatch.
88
+
89
+ ## A worked example
90
+
91
+ ```xml
92
+ <task>
93
+ In the payments service at services/billing/, the refund path double-charges when a refund is retried
94
+ after a network timeout (the idempotency key isn't checked before re-submitting). Make the refund
95
+ submission idempotent: check for an existing refund by idempotency key before creating a new one.
96
+ Touch only services/billing/refund.py and its tests. Leave the charge path, the API routes, and the
97
+ data models untouched.
98
+ </task>
99
+
100
+ <verification_loop>
101
+ Run and make green before finishing:
102
+ pytest tests/billing/ -q
103
+ ruff check services/billing/
104
+ Confirm git status shows only refund.py and its test file changed.
105
+ </verification_loop>
106
+
107
+ <action_safety>
108
+ Scope strictly to the refund idempotency fix. No unrelated refactors. Do NOT git add or commit; leave
109
+ changes in the working tree for review.
110
+ </action_safety>
111
+
112
+ <structured_output_contract>
113
+ Report: (1) the root cause and your fix, (2) files touched, (3) pytest + ruff outcomes with counts,
114
+ (4) anything you left open or want decided.
115
+ </structured_output_contract>
116
+ ```
117
+
118
+ Send this with `relay.mjs` (see [dispatch-and-poll.md](dispatch-and-poll.md)); review the result and
119
+ commit it yourself (see [review-and-land.md](review-and-land.md)).
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: kimi-delegate
3
+ description: Delegate coding tasks to the Kimi Code CLI (`kimi`) only when the user
4
+ explicitly 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
+ metadata:
14
+ version: 0.5.0
15
+ ---
16
+ # Kimi Delegate
17
+
18
+ ## When to Use
19
+
20
+ - You want to delegate a bounded coding task to a separate `kimi` implementer (`Kimi Code`) and then review its diff yourself.
21
+ - The user explicitly asked for delegation to this implementer.
22
+
23
+ You are the **orchestrator**. Hand a bounded coding task to a separate **implementer** - the Kimi Code
24
+ CLI - then review what it produced and land it yourself. You write the brief and own the judgment;
25
+ Kimi does the typing in its own session; you verify and commit.
26
+
27
+ The loop needs only a shell command and file access, so any comparable orchestrator can drive it.
28
+
29
+ ## When NOT to use this
30
+
31
+ - The task is small enough to do inline; delegation overhead is not worth it.
32
+ - The `kimi` CLI is not installed or authenticated.
33
+ - You need a CLI-enforced read-only implementer. Headless Kimi has no read-only mode.
34
+
35
+ ## Prerequisites (check once)
36
+
37
+ 1. Install Kimi Code with `brew install kimi-code` on macOS/Linux, or use the native installer from
38
+ the [official Kimi Code documentation](https://moonshotai.github.io/kimi-code/en/).
39
+ 2. Authenticate with `kimi login` (device-code flow, no TUI), or use `/login` in the TUI.
40
+ 3. Confirm `kimi --version` succeeds.
41
+ 4. Work in, or point `--cd` at, the target git repository.
42
+
43
+ ## Choose the model alias
44
+
45
+ Kimi uses `default_model` from its `config.toml` when `--model` is omitted. To choose another model
46
+ alias, pass `--model <alias from your kimi config>`. Model aliases are user-defined config keys; use
47
+ one the human has configured rather than inventing one.
48
+
49
+ ## The loop
50
+
51
+ Run these five steps per task. Steps 1, 4, and 5 require judgment; 2 and 3 are mechanical.
52
+
53
+ ### 1. Write the brief
54
+
55
+ Kimi sees only the text you send plus what it can inspect in the workspace - no chat history or shared
56
+ context. Include the goal, current state, what to change, what to leave untouched, the project's
57
+ **actual** gates, and a report contract. Tell Kimi not to commit. Keep one task per brief. See
58
+ [references/writing-the-brief.md](references/writing-the-brief.md).
59
+
60
+ ### 2. Dispatch
61
+
62
+ Use the bundled helper. It wraps Kimi's headless prompt mode, captures the structured event stream,
63
+ and writes `result.json`. (`<skill-dir>` is the installed folder containing this `SKILL.md`.)
64
+
65
+ ```bash
66
+ node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
67
+ # choose a configured model alias: add --model <alias from your kimi config>
68
+ # resume the most recent session: add --resume-last (delta brief only)
69
+ # resume a specific session: add --session <id> (delta brief only)
70
+ # hard time limit (watchdog): add --timeout 2h (the 30m default suits short runs; implementation briefs routinely need 1-2h)
71
+ # see all options: node .../relay.mjs --help
72
+ ```
73
+
74
+ The child process's cwd pins the workspace. Use repeatable `--add-dir` flags only for extra workspace
75
+ directories. The relay writes artifacts under the system temp dir by default and never commits. See
76
+ [references/dispatch-and-poll.md](references/dispatch-and-poll.md).
77
+
78
+ ### 3. Wait for completion
79
+
80
+ The helper blocks until Kimi finishes. Run it with the orchestrator's background-command facility, or
81
+ background it in the shell and poll for `result.json`. A pre-run usage error exits 2 and writes no
82
+ result; a missing `kimi` exits 127 and writes `status: "kimi_unavailable"`.
83
+
84
+ Trust process state and the working tree over a progress display. Completion means the process exited
85
+ and `result.json` exists. Kimi's full report is the `finalMessage` field in `result.json` (also printed
86
+ in full on stdout between the report markers).
87
+
88
+ ### 4. Review - do not trust the self-report
89
+
90
+ Treat Kimi's final message and gate claims as claims:
91
+
92
+ - Re-run the project's gates yourself.
93
+ - Read the diff against the brief, starting with `touchedFiles`.
94
+ - Run relevant guard skills if installed.
95
+ - Round-trip migrations and grep for dangling references after removals or renames.
96
+
97
+ See [references/review-and-land.md](references/review-and-land.md).
98
+
99
+ ### 5. Land it
100
+
101
+ The implementer edits the working tree; **the orchestrator commits.** Commit only after the gates pass
102
+ and the diff holds. If rework is needed, send a delta brief with `--resume-last` or `--session <id>`,
103
+ then review again.
104
+
105
+ ## Autonomy and permissions
106
+
107
+ In headless `-p` mode, Kimi always runs in **auto permission mode** and never asks for approval. Kimi
108
+ rejects `--prompt` combined with `--yolo`, `--auto`, or `--plan`, so the relay passes none of them and
109
+ offers no `--read-only` or `--full-access` option. There is no CLI-enforced read-only mode: inspect
110
+ `touchedFiles` and the diff after every run. That diff, not a flag, is the guarantee of what changed.
111
+
112
+ ## Authorization model
113
+
114
+ Delegation is something the human opts into. Once they have ("run this queue", "proceed"), committing
115
+ verified, gate-passing work is the agreed contract. Two limits remain: **surface, don't absorb**
116
+ (report Kimi's design decisions, defensible-but-unasked turns, and non-blocking nitpicks) and **stop
117
+ for scope changes** (if correct completion needs going beyond the brief, ask instead of expanding the
118
+ mandate). See [references/review-and-land.md](references/review-and-land.md).
119
+
120
+ ## References
121
+
122
+ - [references/writing-the-brief.md](references/writing-the-brief.md) - structure, report contract,
123
+ real gates, argv delivery, and delta briefs.
124
+ - [references/dispatch-and-poll.md](references/dispatch-and-poll.md) - flags, artifacts,
125
+ `result.json`, polling, and failure recovery.
126
+ - [references/review-and-land.md](references/review-and-land.md) - review checklist, commit boundary,
127
+ and rework through Kimi sessions.
128
+ - [references/multi-task-queues.md](references/multi-task-queues.md) - sequential queues, constraint
129
+ carry-forward, progress tracking, and the final coherence pass.
130
+
131
+
132
+ ## Limitations
133
+
134
+ - Docs-only import — executable `scripts/relay.mjs` not included; see upstream for full runtime. Requires `kimi` CLI, Node 18+, git.
135
+ - Relay never commits — it only returns structured result JSON; you review and land the commit.
136
+
137
+ > Adapted from [amElnagdy/delegate-skills](https://github.com/amElnagdy/delegate-skills) (MIT) — docs-only, runtime not bundled.