opencode-skills-collection 4.0.45 → 4.0.47

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,129 @@
1
+ # Writing the brief
2
+
3
+ A brief is the entire task as cline will see it. It runs in a separate process with **no memory of
4
+ your conversation and no shared context** - only the text you send and whatever it can inspect in
5
+ the workspace. If a constraint is not in the brief or discoverable in the repo, it does not exist
6
+ for cline.
7
+
8
+ Cline can auto-discover the workspace's `AGENTS.md`. Still restate load-bearing repo constraints in
9
+ the brief so the implementer does not have to infer which rules matter for this task.
10
+
11
+ ## Model choice
12
+
13
+ Cline picks a default model when `--model` is omitted, so a fresh dispatch does not require it.
14
+ Pass `--model <id>` only when the human asked for a specific model, or `--provider <name>` to
15
+ pick a provider. The relay forwards ids and provider names made of letters, digits, `. _ : / -`
16
+ only.
17
+
18
+ ## The shape that works
19
+
20
+ Use a compact, block-structured brief. State the task, what done means, the few constraints that
21
+ matter, and the report cline must return.
22
+
23
+ ```xml
24
+ <task>
25
+ One or two sentences: the concrete job and where it lives. Then the specifics - current state, what to
26
+ change, and explicitly what to leave untouched. The leave-untouched list prevents unrelated refactors.
27
+ </task>
28
+
29
+ <verification_loop>
30
+ Run these before finishing and fix anything they surface, do not just report it:
31
+ <the project's real test command>
32
+ <the project's real lint/format command>
33
+ <the project's real build/typecheck command>
34
+ Confirm the working tree shows only the intended changes afterward.
35
+ </verification_loop>
36
+
37
+ <action_safety>
38
+ Keep changes scoped to the task. No unrelated refactors, renames, or cleanup unless required for
39
+ correctness. Do NOT run git add or git commit - the orchestrator commits after reviewing. Leave the
40
+ work uncommitted in the working tree.
41
+ </action_safety>
42
+
43
+ <structured_output_contract>
44
+ End with a report in this exact shape:
45
+ 1. What changed and why
46
+ 2. Files touched
47
+ 3. Gate outcomes (include test/lint counts)
48
+ 4. Anything you deviated on, left open, or want a decision on
49
+ </structured_output_contract>
50
+ ```
51
+
52
+ Add extra blocks only when the task needs them:
53
+
54
+ - **Debugging or open-ended fixes** - add `<completeness_contract>` (resolve fully, not just the
55
+ first plausible cause) and `<missing_context_gating>` (find missing repo facts or state what is
56
+ unknown).
57
+ - **Research or recommendations** - add `<research_mode>` (separate observed facts, inferences,
58
+ and open questions), and dispatch with `--plan`; the relay pairs it with
59
+ `--auto-approve false` to prevent a switch to act mode.
60
+
61
+ ## Always ask for the report explicitly
62
+
63
+ The relay builds `finalMessage` from cline's final `run_result` event text. Without a closing
64
+ summary, the edits may exist but the result is hard to review. The `<structured_output_contract>`
65
+ block makes the expected report explicit.
66
+
67
+ ## Discover the real gates
68
+
69
+ Read the repo's `AGENTS.md`, `CLAUDE.md`, `Makefile`, `package.json`, or equivalent first and copy
70
+ the actual commands into `<verification_loop>`. A brief that says only "run the tests" makes the
71
+ implementer guess or skip them.
72
+
73
+ ## Honor repo conventions
74
+
75
+ Restate the load-bearing house rules in the brief. Cline can inspect the workspace, but the
76
+ important constraints should be directly in front of it.
77
+
78
+ ## One task per brief
79
+
80
+ Keep each brief bounded. One brief -> one cline run -> one reviewed commit keeps the diff and
81
+ rollback clean. Split mixed implementation, review, documentation, and roadmap requests into
82
+ separate dispatches.
83
+
84
+ ## Premises freeze at dispatch
85
+
86
+ The implementer starts from the brief's facts and there is no steering channel mid-run. Audit the
87
+ fact block before sending - ownership, target branch, constraints, anything a judgment call rests
88
+ on. If a premise turns out wrong while the run is live, stop the run and re-dispatch a corrected
89
+ brief rather than discounting the output afterward; inspect the working tree and reconcile any
90
+ partial or premise-contaminated edits - keep or revert them - before the re-dispatch.
91
+
92
+ ## A worked example
93
+
94
+ ```xml
95
+ <task>
96
+ In the payments service at services/billing/, the refund path double-charges when a refund is retried
97
+ after a network timeout. Make refund submission idempotent: check for an existing refund by idempotency
98
+ key before creating a new one. Touch only services/billing/refund.py and its tests. Leave the charge
99
+ path, API routes, and data models untouched.
100
+ </task>
101
+
102
+ <verification_loop>
103
+ Run and make green before finishing:
104
+ pytest tests/billing/ -q
105
+ ruff check services/billing/
106
+ Confirm git status shows only refund.py and its test file changed.
107
+ </verification_loop>
108
+
109
+ <action_safety>
110
+ Scope strictly to the refund idempotency fix. No unrelated refactors. Do NOT git add or commit; leave
111
+ changes in the working tree for review.
112
+ </action_safety>
113
+
114
+ <structured_output_contract>
115
+ Report: (1) the root cause and fix, (2) files touched, (3) pytest and ruff outcomes with counts,
116
+ (4) anything left open or needing a decision.
117
+ </structured_output_contract>
118
+ ```
119
+
120
+ ## Brief delivery
121
+
122
+ The relay streams the full brief on stdin and passes only a fixed positional instruction. Current
123
+ Cline JSON mode checks for a positional prompt before reading piped input, so a pure stdin launch
124
+ does not work; the fixed instruction satisfies that guard without exposing the brief in argv or
125
+ subjecting it to command-line length and Windows shell-quoting limits. Keep secrets out of the
126
+ brief anyway: it is preserved in the run's `brief.txt` artifact.
127
+
128
+ Dispatch with [dispatch-and-poll.md](dispatch-and-poll.md), then review and commit with
129
+ [review-and-land.md](review-and-land.md).
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: codex-delegate
3
+ description: Delegate coding tasks to the OpenAI Codex CLI only when the user explicitly
4
+ requests it, while the orchestrator retains review and landing responsibility.
5
+ risk: safe
6
+ category: agent-orchestration
7
+ source: https://github.com/amElnagdy/delegate-skills
8
+ source_repo: amElnagdy/delegate-skills
9
+ source_type: community
10
+ date_added: '2026-08-26'
11
+ license: MIT
12
+ license_source: https://github.com/amElnagdy/delegate-skills/blob/master/LICENSE
13
+ compatibility: Requires the `codex` CLI (OpenAI Codex) installed and authenticated,
14
+ Node 18+, and git. The orchestrating agent must be able to run shell commands and
15
+ read files. Shell examples assume bash/zsh (macOS/Linux, or Git Bash/WSL on Windows).
16
+ metadata:
17
+ version: 0.5.0
18
+ ---
19
+ # Codex Delegate
20
+
21
+ ## When to Use
22
+
23
+ - You want to delegate a bounded coding task to a separate `codex` implementer (`OpenAI Codex`) and then review its diff yourself.
24
+ - The user explicitly asked for delegation to this implementer.
25
+
26
+ You are the **orchestrator**. This skill lets you hand a bounded coding task to a separate
27
+ **implementer** — the OpenAI Codex CLI — then review what it produced and land it yourself. You write
28
+ the brief and own the judgment; Codex does the typing in its own sandbox; you verify and commit.
29
+
30
+ Nothing here is specific to one orchestrating agent. The loop needs only the ability to run a shell
31
+ command and read a file, so it works the same whether you are Claude Code, OpenCode with a selected
32
+ model, or any comparable agent. (It is designed for and run on Claude Code; treat other orchestrators
33
+ as designed-for, not yet proven.)
34
+
35
+ ## When NOT to use this
36
+
37
+ - The task is small enough to just do inline — delegation overhead is not worth it.
38
+ - The `codex` CLI is not installed or not authenticated (run `codex login`).
39
+ - You want to write the code yourself, or you only need a review (use Codex's own `review` command).
40
+
41
+ ## Prerequisites (check once)
42
+
43
+ 1. `codex --version` succeeds. If not, install (`npm i -g @openai/codex`) and `codex login`.
44
+ 2. **Confirm which `codex` is on PATH.** Multiple installs are common (e.g. a current npm/nvm copy and
45
+ a stale Homebrew one). `command -v codex` shows the active one and `codex --version` its version —
46
+ an old binary predates flags this skill relies on (`codex exec --json`, `-o`, `exec resume`). The
47
+ relay also records the version it ran into `result.json`, so a stale binary is visible after the fact.
48
+ 3. You are in (or will point `--cd` at) the target git repository.
49
+
50
+ ## The loop
51
+
52
+ Run these five steps per task. Steps 1, 4, and 5 are your judgment; 2 and 3 are mechanical.
53
+
54
+ ### 1. Write the brief
55
+
56
+ Codex sees **only** the text you send — no repo memory, no chat history, no shared context. Everything the
57
+ task needs goes in the brief: the goal, the current state, what to change, what to leave untouched,
58
+ the project's **actual** gate commands (discover them from the repo's CLAUDE.md/AGENTS.md/Makefile —
59
+ do not assume), and a report contract. Tell Codex it will **not** commit (you will). Keep one task per
60
+ brief. Full guidance and a template: [references/writing-the-brief.md](references/writing-the-brief.md).
61
+
62
+ ### 2. Dispatch
63
+
64
+ Send the brief to Codex with the bundled helper. It wraps `codex exec`, captures the run, and writes a
65
+ structured `result.json` — so your only job is "run a command, read a file." (`<skill-dir>` below is
66
+ this skill's installed directory — the folder containing this `SKILL.md`, i.e. the directory you loaded
67
+ the skill from. Claude Code prints it as "Base directory for this skill" when the skill loads; on other
68
+ orchestrators use that same directory — if unsure where it landed, run
69
+ `find ~ -name relay.mjs -path '*codex-delegate*'` and substitute the directory above it.)
70
+
71
+ ```bash
72
+ node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
73
+ # read-only (review/diagnosis, no edits): add --read-only
74
+ # continue the exact Codex session: add --session <threadId> (from result.json; send only the delta brief)
75
+ # fallback when no thread id is available: add --resume-last
76
+ # hard time limit (watchdog): add --timeout 2h (default: off; implementation runs routinely need 1-2h)
77
+ # see all options: node .../relay.mjs --help
78
+ ```
79
+
80
+ The helper defaults to a write-capable (`workspace-write`) sandbox and writes its artifacts to a temp
81
+ dir, so the repo under review stays clean. It **never commits** — see step 5. Mechanics, flags, and the
82
+ `result.json` shape: [references/dispatch-and-poll.md](references/dispatch-and-poll.md).
83
+
84
+ ### 3. Wait for completion
85
+
86
+ The helper blocks until Codex finishes, so back it with whatever your orchestrator offers and resume
87
+ when it returns:
88
+
89
+ - **Claude Code:** run the Bash call with `run_in_background: true`; you are notified on completion.
90
+ - **Plain shell / other agents:** run it in the foreground for short tasks, or background it and poll
91
+ the result file — `… &` in bash/zsh (including Git Bash/WSL), or your shell's equivalent (`Start-Job`
92
+ in PowerShell, `start /b` in cmd). The run is done when `result.json` exists with a `status`. (A
93
+ pre-run usage error — bad args or an empty brief — instead exits with code 2 and a stderr message and
94
+ writes no result file, so check the exit code too. A missing `codex` binary exits 127 but *does* write
95
+ a `result.json` with status `codex_unavailable`.)
96
+
97
+ Do not trust progress trackers over reality: a run is finished when `result.json` is written and the
98
+ process has exited. Read the working tree, not a status line. The implementer's full report is
99
+ the `finalMessage` field in `result.json` (also printed in full on stdout between the report markers).
100
+
101
+ ### 4. Review — do not trust the self-report
102
+
103
+ Codex's `result.json` includes its own summary and gate claims. **Re-verify, don't accept:**
104
+
105
+ - **Re-run the project's gates yourself** (the test/lint/build commands from step 1). Never take
106
+ "gates passed" on faith.
107
+ - **Read the diff** against the brief: did Codex do what was asked, nothing more (scope creep) and
108
+ nothing less? `touchedFiles` in the result is your starting point.
109
+ - **Run the relevant guard skills** on the diff if you have them installed (clean-code-guard,
110
+ test-guard, etc. from `guard-skills`) — this skill produces the work; those skills judge it.
111
+ - For schema/migration changes, round-trip them; for removals, grep for dangling references.
112
+
113
+ Full checklist: [references/review-and-land.md](references/review-and-land.md).
114
+
115
+ ### 5. Land it
116
+
117
+ Because Codex's sandbox cannot reliably write `.git` (it varies by version, OS, and path), **the
118
+ orchestrator commits.** Only after the gates pass and the diff holds:
119
+
120
+ - Commit the verified work yourself, with a clear message.
121
+ - If it needs changes, send a delta brief with `--session <threadId>` from the prior `result.json`
122
+ (use `--resume-last` only when no thread id is available), and review again.
123
+
124
+ ## Read-only second opinions
125
+
126
+ The relay doubles as a clean way to get an adversarial second opinion with no write risk: dispatch
127
+ `--read-only` with a brief that lists the agreed points, then each contested point with both
128
+ positions, and ask Codex to defend or concede each — deliverable in its final message, touching no
129
+ files. Any delegation skill whose implementer offers a read-only mode supports the same use, but
130
+ check how hard that mode's guarantee is first: Codex's sandbox enforces it, while Grok's is
131
+ best-effort and only flagged after the fact (`readOnlyViolation`) — for those implementers,
132
+ verify `touchedFiles` came back empty instead of assuming no edits.
133
+
134
+ ## Authorization model
135
+
136
+ Delegation is something the human opts into. Once they have ("run this queue", "proceed"), committing
137
+ verified, gate-passing work is the agreed contract — that is the whole point. Two limits on that
138
+ mandate: **surface, don't absorb** (report Codex's design decisions, defensible-but-unasked turns, and
139
+ non-blocking nitpicks rather than silently keeping them) and **stop for scope changes** (if correct
140
+ completion needs going beyond the brief, ask — don't expand the mandate yourself). The full treatment
141
+ is in [references/review-and-land.md](references/review-and-land.md).
142
+
143
+ ## If you have the openai-codex plugin
144
+
145
+ The official openai-codex Claude Code plugin is excellent and **complementary** — `codex-delegate`
146
+ builds on the same `codex` CLI, it doesn't replace the plugin. They point in different directions:
147
+
148
+ - The plugin's `codex:codex-rescue` agent is a **forwarder**: it hands one task to Codex and returns
149
+ the output. It deliberately does not poll, review, or commit.
150
+ - The plugin's review command and stop-review gate run the **inverse** direction: **Codex reviews your work**.
151
+ - `codex-delegate` is the **orchestration loop in the other direction**: *you* drive Codex to
152
+ implement across one task or a queue, and *you* review and land each result. That loop — brief →
153
+ dispatch → poll → review → commit, with the orchestrator owning the commit — is what the plugin
154
+ leaves to you, and what this skill encodes.
155
+
156
+ If you have the plugin installed, its companion CLI is an optional alternative dispatch backend; the
157
+ bundled `relay.mjs` is the default because it adds no install of its own beyond the `codex` binary
158
+ (Node and `git`, which the relay also needs, are prerequisites for every skill here).
159
+
160
+ ## References
161
+
162
+ - [references/writing-the-brief.md](references/writing-the-brief.md) — how to write a brief Codex can
163
+ execute blind: structure, XML blocks, the report contract, embedding the real gate commands.
164
+ - [references/dispatch-and-poll.md](references/dispatch-and-poll.md) — `relay.mjs` flags, the
165
+ `result.json` contract, backgrounding per orchestrator, and recovery when a run misbehaves.
166
+ - [references/review-and-land.md](references/review-and-land.md) — the review checklist, the commit
167
+ boundary, and the exact-session rework cycle.
168
+ - [references/multi-task-queues.md](references/multi-task-queues.md) — running a sequential queue:
169
+ carrying constraints forward, progress tracking, and the end-of-run coherence check.
170
+
171
+
172
+ ## Limitations
173
+
174
+ - Docs-only import — executable `scripts/relay.mjs` not included; see upstream for full runtime. Requires `codex` CLI, Node 18+, git.
175
+ - Relay never commits — it only returns structured result JSON; you review and land the commit.
176
+
177
+ > Adapted from [amElnagdy/delegate-skills](https://github.com/amElnagdy/delegate-skills) (MIT) — docs-only, runtime not bundled.
@@ -0,0 +1,161 @@
1
+ # Dispatch and poll
2
+
3
+ `scripts/relay.mjs` is the dispatch layer. It wraps `codex exec`, runs the brief in a sandbox, captures
4
+ everything, and writes a structured `result.json`. Your job collapses to: run one command, then read
5
+ one file. Everything Codex-specific lives in the helper, which is what keeps the loop portable across
6
+ orchestrators.
7
+
8
+ ## Before the first run: check the binary
9
+
10
+ Two gotchas, both worth 30 seconds:
11
+
12
+ ```bash
13
+ command -v codex # the active binary; a stale install (e.g. Homebrew) can shadow a current one
14
+ codex --version # an old binary predates `exec --json`, `-o`, and `exec resume`
15
+ codex login status # must be authenticated
16
+ ```
17
+
18
+ The Codex CLI moves fast and behavior shifts between versions, so the helper records the version it
19
+ actually ran into `result.json` — if something behaves oddly, check which binary answered.
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 Codex (default: current directory). |
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>` | Codex model (default: Codex's own configured default). |
39
+ | `--effort <level>` | Reasoning effort, passed to Codex as `-c model_reasoning_effort=<level>` (default: Codex's own configured default). The relay accepts a bare token; Codex and the model own the supported levels. Applies to fresh and resumed runs. |
40
+ | `--sandbox <mode>` | `read-only` \| `workspace-write` \| `danger-full-access` (default: `workspace-write`). `danger-full-access` requires explicit human authorization for that run. |
41
+ | `--read-only` | Shortcut for `--sandbox read-only` — review/diagnosis with no edits. |
42
+ | `--resume-last` | Continue the most recent Codex session; send only the delta brief (see review-and-land). "Most recent" is global, so an unrelated Codex run can steal it — prefer `--session`. |
43
+ | `--session <id>` | Continue one specific thread by id (the `threadId` from a prior `result.json`); send only the delta brief. Mutually exclusive with `--resume-last`; an empty id is rejected. |
44
+ | `--clean-env` | Pass only runtime basics (`PATH`, home, locale, temp, `CODEX_HOME`, and Windows equivalents) to Codex and its version preflight. This changes inherited variables only; it does not protect files or other same-user secrets. |
45
+ | `--keep-env <name>` | Keep one additional variable under `--clean-env`; repeat for each required environment-backed auth, custom-provider credential, proxy, certificate, or MCP variable. The name must be set and use portable environment-variable syntax. |
46
+ | `--skip-git-repo-check` | Allow running outside a git repo. |
47
+ | `--timeout <dur>` | Relay-side watchdog (e.g. `30m`, `2h`); on expiry the child is killed and `result.json` gets `status: "timeout"`. Off by default. |
48
+ | `--out-dir <dir>` | Where artifacts go (default: a fresh dir under the system temp dir). |
49
+
50
+ Artifacts default to the system temp dir on purpose: the repo under review stays clean, so the
51
+ touched-files report shows only Codex's edits and nothing of the helper's own.
52
+
53
+ `--clean-env` is not a broader security boundary: Codex can still access files and other same-user
54
+ secrets available through `HOME`, `CODEX_HOME`, OS facilities, and the selected sandbox. File- or
55
+ OS-backed auth and normal configuration still load, but direct environment-backed auth
56
+ (`CODEX_API_KEY` or `CODEX_ACCESS_TOKEN`) needs that variable named with `--keep-env`.
57
+ `OPENAI_API_KEY` can still matter as a custom-provider credential; provider, proxy, certificate, or
58
+ MCP settings that reference any stripped variable likewise need it named with `--keep-env`. The same
59
+ filtered environment is used for preflight and dispatch.
60
+
61
+ ## The result
62
+
63
+ `<out-dir>/result.json` is the contract. Fields:
64
+
65
+ - `schema` — the result-format version (currently `delegate-relay.result.v1`)
66
+ - `status` — `completed` | `failed` | `timeout` | `aborted` | `codex_unavailable`
67
+ - `exitCode` — mirrors Codex's exit code; `128` plus the signal number if the child was killed; `127` if `codex` 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
68
+ - `signal` — the signal that killed the child, otherwise `null`
69
+ - `codexVersion` — the binary that actually ran
70
+ - `threadId` — feed this to a later `--session <id>` (exact thread; preferred) or `--resume-last` (global "most recent", which another Codex run can steal)
71
+ - `finalMessage` — Codex's own final report (the `<structured_output_contract>` you asked for)
72
+ - `touchedFiles` — `git status --porcelain` lines in the working root: your review starting point. `null` (not `[]`) when git can't report — `git` missing, or a non-repo run under `--skip-git-repo-check`; `[]` means git ran and the tree is clean
73
+ - `briefPath` / `eventsPath` / `finalPath` — the exact brief relay sent, the raw JSONL event stream, and the final-message file
74
+ - `workdir`, `sandbox`, `model`, `effort`, `resumeLast`, `session`, `cleanEnv`, `keepEnv`, `startedAt`, `finishedAt` — `sandbox` is the applied mode, or a note that Codex used its active config on an unqualified resume; `session` is the explicit session id, or `null` for fresh and `--resume-last` runs; `keepEnv` records names only, never values
75
+ - `stderrTail` — last ~20 stderr lines; present on every run that did not complete (`failed`, `timeout`, `aborted`), absent on `completed`, `codex_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 Codex'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 Codex 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 `codex` binary exits 127 but *does* write a
92
+ `result.json` with status `codex_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: codex_unavailable` (exit 127):** `codex` isn't on PATH or isn't found. Install
100
+ (`npm i -g @openai/codex`) and `codex login`, then re-dispatch.
101
+ - **an `error` mentioning `version preflight` (`failed`, or `timeout` at exit 124):** the bounded
102
+ `codex --version` probe exited non-zero or hung past its cap (10s, or `--timeout` when shorter), so
103
+ codex was never dispatched; only the relay's own artifacts may already exist under `--out-dir`.
104
+ Check the install by running `codex --version` yourself.
105
+ - **`status: failed`:** read `result.json`'s `stderrTail` and the tail of `eventsPath` for the cause.
106
+ Common causes: an auth lapse, an invalid `--model` or unsupported `--effort`, or a sandbox that
107
+ blocked something the task needed. Fix the cause and re-dispatch; don't paper over it by doing the
108
+ work yourself unless that's what the user wants.
109
+ - **`status: timeout`:** the `--timeout` watchdog killed the run. The working tree may hold a
110
+ half-applied change — inspect it before deciding between a longer `--timeout`, a smaller brief,
111
+ or a resume.
112
+ - **`status: aborted`:** the relay itself was killed (its parent's timeout, a stopped task, a
113
+ closed terminal) and forwarded the kill to codex. The result is written before the relay exits;
114
+ inspect the working tree before re-dispatching. On native Windows a hard kill of the relay is
115
+ uncatchable (Node supports no `SIGTERM` handler there), so this status may never get written -
116
+ a relay process that is gone without a `result.json` is an aborted run; inspect the working
117
+ tree and `events.jsonl` directly.
118
+ - **`status: failed` with `signal: "SIGKILL"`:** the host ended the child — commonly the OOM killer
119
+ or a supervisor timeout, not an implementer error. Free up host memory or split the task into
120
+ smaller briefs, then re-dispatch.
121
+ - **Empty `finalMessage`:** Codex exited before producing a final message. Treat as a failed run;
122
+ the events log usually shows where it stopped.
123
+
124
+ ## Recovering lost work
125
+
126
+ `events.jsonl` in the run directory records every event the implementer streamed. If finished
127
+ work is lost — the run killed late, or the working tree damaged afterward — read the event log
128
+ before re-dispatching: it identifies which files and tool commands were involved, which scopes
129
+ what needs redoing. It cannot rebuild the changes themselves — Codex's JSON stream currently
130
+ reports a file change as its path and kind only, without the diff contents — so when the tree
131
+ still holds the work, preserve the tree, and otherwise re-dispatch with the log as the map of
132
+ what was lost.
133
+
134
+ ## What the helper is doing (and the alternatives)
135
+
136
+ Under the hood the helper runs roughly:
137
+
138
+ ```bash
139
+ codex exec --json -o <final.txt> -s workspace-write [-m model] [-c model_reasoning_effort=<level>] - < brief.txt # fresh run
140
+ codex exec [-s mode] resume --last --json -o <final.txt> [-m model] [-c model_reasoning_effort=<level>] - < delta-brief.txt # resume
141
+ ```
142
+
143
+ On resume, the helper places an explicit `--sandbox`/`--read-only` or fleet-lane sandbox before the
144
+ `resume` subcommand so Codex applies it to the resumed turn. Without one, Codex uses its active config.
145
+ The helper sets the child process's working directory instead of forwarding `-C`.
146
+
147
+ Two alternatives exist if you ever want them, but the helper is the recommended path:
148
+
149
+ - **Raw `codex exec`** — fine for one-offs; you give up the captured `result.json`, touched-files
150
+ summary, and thread-id extraction the helper does for you.
151
+ - **The openai-codex Claude Code plugin's companion CLI** (`task`/`status`/`result`) — richer job
152
+ tracking if you have that plugin installed. It runs Codex as a background job behind a broker process,
153
+ so you track jobs through `queued`/`running` states; the bundled helper instead spawns `codex`
154
+ in-process and blocks until completion, so the only state to track is whether `result.json` exists —
155
+ which is why it's the default here.
156
+
157
+ ## The commit boundary
158
+
159
+ The helper never commits — by design, not omission. Whether Codex's sandbox can write `.git` varies by
160
+ version, OS, and execution path, so relying on it is a coin flip. The robust contract is: Codex edits
161
+ the working tree, the orchestrator reviews and commits. See [review-and-land.md](review-and-land.md).
@@ -0,0 +1,66 @@
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. Codex has no memory of the earlier run, so a constraint that
26
+ emerged in task 2 must be restated in task 5's brief or it won't hold. This is the queue equivalent of
27
+ keeping briefs self-contained.
28
+
29
+ ## Keep a progress file
30
+
31
+ For anything longer than two or three tasks — especially a run the human steps away from — maintain a
32
+ single progress file alongside the work. It's the durable record that survives your own context limits
33
+ and lets the human catch up at a glance. A shape that works:
34
+
35
+ - **Status table** — each task: queued / at-implementer / reviewed+committed (with the commit hash).
36
+ - **Per-task review notes** — what landed, what you verified, the gate outcome. One short paragraph.
37
+ - **"Needs your eyes"** — design decisions Codex made, non-blocking nitpicks, anything you want the
38
+ human to overrule or confirm. This is the section they read first.
39
+ - **End-of-run checklist** — what happens after the last task (push, open/update the PR, manual checks
40
+ the human should do).
41
+
42
+ Update it as each task lands, not in a batch at the end — if the run is interrupted, the file is still
43
+ accurate.
44
+
45
+ ## Close with a coherence check
46
+
47
+ Per-task review proves each step in isolation; it doesn't prove the steps cohere. After the last task,
48
+ verify the whole:
49
+
50
+ - Run the full test/build once more on the final tree — not just the last task's slice.
51
+ - Do a repo-wide check for the thing the queue was about (e.g. after a removal, grep the entire tree
52
+ for any surviving reference; after a rename, confirm no stragglers).
53
+ - For schema work, replay all the new migrations from a clean state and check for drift.
54
+ - Then push and open or update the PR, with a description that reflects what actually shipped.
55
+
56
+ ## When to stop and ask
57
+
58
+ Proceed without asking on anything that follows from the agreed plan — that's the point of the human
59
+ opting into the queue. Stop and surface when:
60
+
61
+ - A task can't be completed correctly within its brief's scope (a scope change is the human's call).
62
+ - A review finds something that calls the *plan* into question, not just the implementation.
63
+ - The gates reveal a problem that affects tasks already "done."
64
+
65
+ Then report where you are, what's committed, and what the open question is — and wait. A queue that
66
+ quietly works around a broken assumption produces a lot of commits in the wrong direction.