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,159 @@
1
+ ---
2
+ name: copilot-delegate
3
+ description: Delegate coding tasks to the GitHub Copilot CLI (`copilot`) only when
4
+ the user explicitly requests it, while the orchestrator retains review and landing
5
+ responsibility.
6
+ risk: safe
7
+ category: agent-orchestration
8
+ source: https://github.com/amElnagdy/delegate-skills
9
+ source_repo: amElnagdy/delegate-skills
10
+ source_type: community
11
+ date_added: '2026-08-26'
12
+ license: MIT
13
+ license_source: https://github.com/amElnagdy/delegate-skills/blob/master/LICENSE
14
+ compatibility: Requires the `copilot` CLI installed and authenticated (`copilot login`),
15
+ Node 18+ to run the relay (the copilot CLI itself requires Node 22+), and git. The
16
+ orchestrator must be able to run shell commands and read files.
17
+ metadata:
18
+ version: 0.5.0
19
+ ---
20
+ # Copilot Delegate
21
+
22
+ ## When to Use
23
+
24
+ - You want to delegate a bounded coding task to a separate `copilot` implementer (`GitHub Copilot CLI`) and then review its diff yourself.
25
+ - The user explicitly asked for delegation to this implementer.
26
+
27
+ You are the **orchestrator**. Delegate a bounded coding task to a separate **implementer** — the
28
+ GitHub Copilot CLI — then review what it produced and land it yourself. You write the brief and own
29
+ the judgment; the implementer makes changes in its own session in a clean working tree; you verify
30
+ and commit.
31
+
32
+ The loop needs only a shell command and file access, so any comparable orchestrator can drive it.
33
+
34
+ ## When NOT to use this
35
+
36
+ - The task is small enough to do inline; delegation overhead is not worth it.
37
+ - The `copilot` CLI is not installed or authenticated.
38
+ - You need a hard sandbox. Copilot exposes sandbox controls, but they are upstream-experimental
39
+ (MXC-based, controlled via the `/sandbox` command and settings, disabled by default) — this relay
40
+ does not configure them. `--read-only` only disables edit tools (`--mode plan`); shell commands
41
+ still run. If project files must not change at all, dispatch against a clean or isolated worktree.
42
+
43
+ ## Prerequisites (check once)
44
+
45
+ 1. Install `copilot` (`npm install -g @github/copilot`; the CLI requires Node 22+, the relay
46
+ itself runs on Node 18+ — the relay probes `copilot version`).
47
+ 2. Authenticate: run `copilot login` (interactive web/device flow), or set
48
+ `COPILOT_GITHUB_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN` in the environment.
49
+ 3. Confirm `copilot version` succeeds.
50
+ 4. Work in, or point `--cd` at, the target git repository.
51
+
52
+ ## Choose the model (optional)
53
+
54
+ Copilot picks a default model (`auto`). To choose another, pass `--model <name>`.
55
+ The relay accepts letters, digits, and `. _ : / -` only (the value reaches a shell on Windows).
56
+
57
+ ## Choose the effort (optional)
58
+
59
+ Copilot supports a reasoning effort dial: `--effort <level>` with values
60
+ `low`, `medium`, `high`, `xhigh`, or `max`. The relay rejects any other value
61
+ before dispatch.
62
+
63
+ ## The loop
64
+
65
+ Run these five steps per task. Steps 1, 4, and 5 require judgment; 2 and 3 are mechanical.
66
+
67
+ ### 1. Write a brief
68
+
69
+ Copilot sees only the text you send. It cannot read your conversation: the brief must stand alone
70
+ with the goal, current state, what to change, what to leave untouched, the project's **real**
71
+ gates, and a report contract. Keep each brief to a single task. Write it to a file and pass it as
72
+ the relay's `--brief`. See [references/writing-the-brief.md](references/writing-the-brief.md).
73
+
74
+ ### 2. Dispatch
75
+
76
+ Use the bundled relay. It runs `copilot -p` with `--output-format json --no-color --stream off`,
77
+ captures the JSONL event stream, and writes `result.json`.
78
+
79
+ ```bash
80
+ node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
81
+ # choose a model: add --model <name>
82
+ # set reasoning effort: add --effort <level>
83
+ # read-only planning pass: add --read-only (forces --mode plan)
84
+ # full tool autonomy: add --allow-all-tools
85
+ # hard time limit (watchdog): add --timeout 2h (the 30m default suits brief runs)
86
+ # resume a session: add --session <id> or --resume-last
87
+ # see all options: node .../relay.mjs --help
88
+ ```
89
+
90
+ The child's cwd pins the workspace. The relay writes artifacts under the system temp dir by
91
+ default and never commits. See [references/dispatch-and-poll.md](references/dispatch-and-poll.md).
92
+
93
+ ### 3. Wait for completion
94
+
95
+ The relay blocks until copilot finishes. Run it with the orchestrator's background-command
96
+ facility, or background it in the shell and poll for `result.json`. A pre-run usage error exits 2
97
+ and writes no result; a missing `copilot` exits 127 and writes `status: "copilot_unavailable"`.
98
+
99
+ Completion means the process exited and `result.json` exists — trust process state and the
100
+ working tree, not the progress display. Copilot's final assistant message is the `finalMessage`
101
+ field of `result.json`.
102
+
103
+ ### 4. Review — do not trust the self-report
104
+
105
+ - Re-run the project's gates yourself.
106
+ - Read the diff against the brief, starting with `touchedFiles`.
107
+ - Run relevant guard skills if installed.
108
+
109
+ See [references/review-and-land.md](references/review-and-land.md).
110
+
111
+ ### 5. Land it
112
+
113
+ If the work is good, commit it. The relay never commits — the diff and `result.json` are the
114
+ record; run `git status` and `git diff` first to confirm exactly what changed. If the group has a
115
+ PR flow, make the commit and push a branch; let human review happen. If the diff is wrong or
116
+ incomplete, re-dispatch a corrected brief in a fresh run and review again.
117
+
118
+ ## Autonomy and permissions
119
+
120
+ Without `--allow-all-tools`, copilot auto-denies tool calls in headless mode: the process exits 0
121
+ but the relay detects the denial events and reports `status: "failed"` with the CLI's own error
122
+ message and a hint to pass `--allow-all-tools`. This is the honest default — the orchestrator sees
123
+ the failure rather than a silent no-op.
124
+
125
+ `--allow-all-tools` explicitly grants full tool autonomy and requires explicit human authorization
126
+ for that run. A request to delegate to Copilot is not by itself consent to unrestricted tools.
127
+ `--read-only` selects `--mode plan`,
128
+ which disables edit tools so project files can't be changed by direct edits; it works without
129
+ `--allow-all-tools`. Shell commands still run in plan mode, so it guards against edits, not
130
+ against everything. The two flags are mutually exclusive.
131
+
132
+ Copilot also exposes sandbox controls, but they are upstream-experimental (MXC-based, controlled
133
+ via the `/sandbox` command and settings, disabled by default). This relay does not configure them.
134
+
135
+ ## Authorization model
136
+
137
+ Delegation is something the human opts into. Once briefed, copilot works as a tool you approved use
138
+ of. The boundary is: **do not accept conclusions from the self-report**; verify everything on
139
+ disk. For anything touching credentials, production data, or irreversible operations, stop and ask
140
+ the human first instead of encoding it in a brief.
141
+
142
+ ## References
143
+
144
+ - [references/writing-the-brief.md](references/writing-the-brief.md) — structure, scope, gates,
145
+ brief delivery.
146
+ - [references/dispatch-and-poll.md](references/dispatch-and-poll.md) — flags, artifacts,
147
+ `result.json`, and failure recovery.
148
+ - [references/review-and-land.md](references/review-and-land.md) — what to verify before calling
149
+ the diff done, at the end of a run.
150
+ - [references/multi-task-queues.md](references/multi-task-queues.md) — sequential queues,
151
+ constraint carry-forward, progress tracking, and the final coherence pass.
152
+
153
+
154
+ ## Limitations
155
+
156
+ - Docs-only import — executable `scripts/relay.mjs` not included; see upstream for full runtime. Requires `copilot` CLI, Node 18+, git.
157
+ - Relay never commits — it only returns structured result JSON; you review and land the commit.
158
+
159
+ > Adapted from [amElnagdy/delegate-skills](https://github.com/amElnagdy/delegate-skills) (MIT) — docs-only, runtime not bundled.
@@ -0,0 +1,143 @@
1
+ # Dispatch and poll
2
+
3
+ `scripts/relay.mjs` wraps copilot's headless JSONL mode, captures its event stream, and writes
4
+ a `result.json`. Run one command, then read one file.
5
+
6
+ ## Before the first run
7
+
8
+ ```bash
9
+ command -v copilot
10
+ copilot version
11
+ ```
12
+
13
+ Install `copilot` (`npm install -g @github/copilot`; the CLI requires Node 22+, the relay itself
14
+ runs on Node 18+); on Windows it installs as an npm `.cmd` shim
15
+ (the relay launches it with `shell:true`). Authenticate with `copilot login` or set
16
+ `COPILOT_GITHUB_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN`. A headless run that is not authenticated
17
+ fails with `status: "failed"` (exit 1).
18
+
19
+ ## Dispatching
20
+
21
+ ```bash
22
+ node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
23
+ ```
24
+
25
+ `<skill-dir>` is the installed folder containing this skill's `SKILL.md`.
26
+
27
+ | Flag | Effect |
28
+ | --- | --- |
29
+ | `--brief <file>` | Brief path. Omit it to read the brief from stdin. |
30
+ | `--cd <dir>` | Working root and child process cwd (default: current directory). |
31
+ | `--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. |
32
+ | `--model <name>` | Copilot model (default: copilot's own default, `auto`). Token-validated: letters, digits, `. _ : / -`. |
33
+ | `--effort <level>` | Reasoning effort (`low`\|`medium`\|`high`\|`xhigh`\|`max`). Rejected before dispatch if unknown. |
34
+ | `--read-only` | Read-only plan mode (`--mode plan`); works without `--allow-all-tools`. Mutually exclusive with `--allow-all-tools`. |
35
+ | `--allow-all-tools` | Full tool autonomy; requires explicit human authorization for that run. Without this, headless tool calls are auto-denied and the relay reports `status: "failed"`. Mutually exclusive with `--read-only`. |
36
+ | `--resume-last` | Resume the most recent session (`--continue`). |
37
+ | `--session <id>` | Resume a specific session (`--resume=<id>`). Mutually exclusive with `--resume-last`. |
38
+ | `--timeout <dur>` | Relay watchdog (default: `30m`; h/m/s strings). Copilot has no timeout flag. |
39
+ | `--out-dir <dir>` | Artifact directory (default: a fresh directory under the system temp dir). |
40
+ | `-h`, `--help` | Print the relay's header help. |
41
+
42
+ The child cwd pins the workspace. The relay does not pass copilot's `--add-dir`.
43
+
44
+ ## Artifacts and result fields
45
+
46
+ Artifacts live outside the repo by default, so they do not appear in `touchedFiles`; an
47
+ `--out-dir` inside the worktree can make the artifacts appear there:
48
+
49
+ - `brief.txt` — the exact brief.
50
+ - `events.jsonl` — raw copilot stdout events (every JSONL event copilot emitted).
51
+ - `final.txt` — the last non-ephemeral `assistant.message` content; absent if none was emitted.
52
+ - `stderr.txt` — complete stderr.
53
+ - `result.json` — the stable `delegate-relay.result.v1` contract.
54
+
55
+ `result.json` fields:
56
+
57
+ - `schema`, `tool` (`"copilot"`), `status` (`completed` | `failed` | `timeout` | `aborted` | `copilot_unavailable`), `exitCode`, and `signal` (`null` unless the child died on a signal).
58
+ - `workdir`, `model`, `effort`, `readOnly`, `allowAllTools`, `resumed`, `copilotVersion`,
59
+ `startedAt`, and `finishedAt`.
60
+ - `sessionId` — parsed from the `result` event's `sessionId` field; available for resume.
61
+ - `finalMessage` — text of the last non-ephemeral `assistant.message` event.
62
+ - `touchedFiles` — `git status --porcelain` lines for the **final working tree under `--cd` only**,
63
+ not an attribution of copilot's edits: anything already dirty before dispatch shows up too.
64
+ Dispatch from a clean tree when you want the list to read as "what copilot changed". `null` means
65
+ git could not report; `[]` means git ran and the tree is clean.
66
+ - `briefPath`, nullable `finalPath`, `eventsPath`, and `stderrPath`. `finalPath` is `null` when
67
+ copilot emitted no non-ephemeral assistant message and `final.txt` was not created.
68
+ - `stderrTail` — the last 20 non-empty stderr lines on any run that did not complete (`failed`,
69
+ `timeout`, `aborted`).
70
+ - `error` — present on denial failures (with the CLI's own denial message plus a hint to pass
71
+ `--allow-all-tools`), preflight failures, when the relay watchdog fires (`timeout`), and on an
72
+ `aborted` run.
73
+
74
+ ## Waiting for completion
75
+
76
+ The relay blocks. Use the orchestrator's background-command facility, or background it in a shell
77
+ and poll for `result.json`. The run is done only when the process exits and the file contains a
78
+ `status`. The result file is written atomically, so a partial read is impossible.
79
+
80
+ A pre-run usage error exits 2 and writes no result. A missing `copilot` exits 127 and writes
81
+ `status: "copilot_unavailable"`.
82
+
83
+ ## When a run misbehaves
84
+
85
+ - **`status: "copilot_unavailable"` (exit 127):** copilot is not on PATH. Install it, authenticate,
86
+ and re-dispatch.
87
+ - **`status: "failed"` with a denial error:** copilot auto-denied a tool call in headless mode.
88
+ The error message includes the CLI's own denial text and a hint to pass `--allow-all-tools`.
89
+ Re-dispatch with `--allow-all-tools` to grant full tool permissions.
90
+ - **`status: "failed"`:** read `stderrTail`, `stderrPath`, and the tail of `events.jsonl`. Common
91
+ causes: an unknown `--model`, expired credentials, or a provider error.
92
+ - **`status: "failed"` with an `error` mentioning `version preflight`:** the bounded
93
+ `copilot version` probe failed or hung, so copilot was never dispatched. Check the install
94
+ (`copilot version` yourself).
95
+ - **`status: "aborted"`:** the relay itself was killed (its parent's timeout, a stopped task, a
96
+ closed terminal) and forwarded the kill to copilot. The result is written before the relay exits;
97
+ inspect the working tree before re-dispatching.
98
+ - **`status: "timeout"`:** the `--timeout` watchdog killed the run; `error` reads
99
+ `copilot did not finish within --timeout <dur>; killed by the relay watchdog`. Increase
100
+ `--timeout` or split the task.
101
+ - **Empty `finalMessage`:** inspect `touchedFiles` and the diff. Add a
102
+ `<structured_output_contract>` to the next brief to require a closing report.
103
+
104
+ ## Recovering lost work
105
+
106
+ `events.jsonl` in the run directory records every JSONL event the implementer streamed. If finished
107
+ work is lost — the run killed late, or the working tree damaged afterward — read the event log
108
+ before re-dispatching: it identifies which files and tool commands were involved, which scopes
109
+ what needs redoing.
110
+
111
+ ## What the relay runs
112
+
113
+ The launch is equivalent to:
114
+
115
+ ```bash
116
+ copilot --output-format json --no-color --stream off \
117
+ [--mode plan] [--allow-all-tools] \
118
+ [--continue | --resume=<id>] \
119
+ [--model <name>] [--effort <level>] \
120
+ -p @<brief.txt>
121
+ ```
122
+
123
+ The child process cwd pins the workspace. Only token-validated model/effort/session values and
124
+ fixed text reach the `shell:true` launch on native Windows; the brief is delivered via `-p @<file>`
125
+ (the CLI's @-prefixed file prompt channel), with the brief path quoted for the shell on Windows.
126
+ On resume (`--continue` / `--resume=<id>`) the relay wraps the reference in a fixed directive —
127
+ `Execute the instructions in the referenced file, then report what you did. Do not just summarize
128
+ the file: @<file>` — because a bare `@<file>` reference in a resumed session is echoed back instead
129
+ of executed (verified on copilot 1.0.78). The directive is relay-authored fixed text, so no user
130
+ content ever reaches the shell-quoted value on Windows. Fresh runs deliver the bare `@<file>`,
131
+ which copilot executes correctly.
132
+ Before dispatch the relay runs a bounded `copilot version` preflight (10s cap) so a
133
+ hung or crashing CLI fails fast and explicitly instead of hanging the run.
134
+
135
+ Copilot's JSONL events include ephemeral events (mcp status, skills_loaded, etc.) which the relay
136
+ skips, `assistant.message` events whose `data.content` becomes `finalMessage`, and a final
137
+ `result` event carrying `sessionId` and `usage.codeChanges`. Tool execution events with
138
+ `success: false` and `error.code: "denied"` trigger the denial-detection path.
139
+
140
+ ## The commit boundary
141
+
142
+ The relay never commits. Copilot edits the working tree; the orchestrator reviews, re-runs the
143
+ gates, and commits. See [review-and-land.md](review-and-land.md).
@@ -0,0 +1,58 @@
1
+ # Multi-task queues
2
+
3
+ The single-task loop scales to a queue: a removal across layers, a migration across files, or a
4
+ refactor sweep. Sequencing and bookkeeping make it trustworthy.
5
+
6
+ ## Run sequentially, one commit per task
7
+
8
+ Run tasks **one at a time, in dependency order**, landing each after review and gates before
9
+ dispatching the next:
10
+
11
+ ```bash
12
+ node "<skill-dir>/scripts/relay.mjs" --brief task-01.txt --cd /path/to/repo --allow-all-tools
13
+ ```
14
+
15
+ - Later briefs can rely on earlier work only after it lands.
16
+ - One commit per task keeps history reviewable and each step revertible.
17
+ - A clean tree before each dispatch keeps `touchedFiles` honest.
18
+
19
+ Use parallel runs only for genuinely independent tasks in separate working trees. Sequential is
20
+ the default because it preserves clean task boundaries.
21
+
22
+ ## Carry decided constraints forward
23
+
24
+ Fresh copilot sessions do not remember earlier tasks. If task 2 chooses a helper name, fixture
25
+ location, or interface that task 5 needs, write that fact into task 5's brief.
26
+
27
+ Use `--session <id>` to resume a previous session with a delta brief when continuity matters.
28
+ `--resume-last` resumes the most recent session.
29
+
30
+ ## Keep a progress file
31
+
32
+ For more than two or three tasks, maintain one progress file beside the work:
33
+
34
+ - **Status table** — queued / at-implementer / reviewed+committed, with the commit hash.
35
+ - **Per-task review notes** — what landed, what you verified, and gate outcomes.
36
+ - **Needs your eyes** — design decisions, non-blocking nitpicks, and questions for the human.
37
+ - **End-of-run checklist** — the final cross-task verification.
38
+
39
+ Update it when each task lands, not in one batch at the end.
40
+
41
+ ## Close with a coherence check
42
+
43
+ After the last task:
44
+
45
+ - Run the full test/build once more.
46
+ - Search repo-wide for the thing the queue changed.
47
+ - Replay migrations from a clean state and check drift when applicable.
48
+ - Push and open or update the PR only after the final tree is coherent.
49
+
50
+ ## When to stop and ask
51
+
52
+ Proceed on work that follows from the agreed plan. Stop and surface when:
53
+
54
+ - A task cannot be completed correctly within its brief.
55
+ - Review calls the plan itself into question.
56
+ - Gates reveal a problem affecting already-landed tasks.
57
+
58
+ Report the landed state, commit hashes, and open question, then wait.
@@ -0,0 +1,80 @@
1
+ # Review and land
2
+
3
+ The implementer made the changes; you own the judgment. Verify against reality, never the
4
+ self-report, and read the diff as generated code because a green gate cannot catch every failure
5
+ mode.
6
+
7
+ ## Check tests before trusting gates
8
+
9
+ If the diff touches existing tests, review those edits first:
10
+
11
+ - Treat unbriefed test edits as a contract change, not part of the fix.
12
+ - Treat newly skipped, disabled, or commented-out tests as failing until proven otherwise.
13
+ - Treat loosened assertions the same way: contains/truthy replacing exact matches, broadened
14
+ error types, and widened tolerances all weaken the gate.
15
+
16
+ ## Re-run the gates yourself
17
+
18
+ `result.json` carries copilot's claims, not evidence. Re-run the project's actual test, lint, and
19
+ build commands in the working tree and read their output. Passing is necessary, not sufficient.
20
+
21
+ ## Read the diff against the brief
22
+
23
+ Start with `touchedFiles`, open the diff, and compare it to the brief:
24
+
25
+ - **Scope creep** — changes the brief excluded.
26
+ - **Scope shortfall** — missed behavior, edges, or cleanup.
27
+ - **Quiet judgment calls** — defensible but unasked decisions that need review.
28
+
29
+ ## The implementer sweep
30
+
31
+ Check every diff for patterns gates often miss:
32
+
33
+ - Hardcoded success or fixture data on a real-work path.
34
+ - Catch-all error handling that returns a default instead of propagating or recovering.
35
+ - Imports, dependencies, methods, and signatures not present in the installed version.
36
+ - Unused imports, uncalled helpers, unreachable branches, and scaffolding comments.
37
+ - A second client, error idiom, or logging style beside the repo's existing one.
38
+ - Tests that assert internals instead of behavior, or near-duplicate test bodies.
39
+ - Optional parameters, config flags, and abstractions with no caller.
40
+ - Guards for impossible cases that hide trust-boundary validation.
41
+
42
+ Send anything blocking back to copilot as a delta brief, or fix it in the tree, and report either
43
+ choice to the human. Run relevant guard skills if installed.
44
+
45
+ ## The commit boundary
46
+
47
+ When the gates pass and the diff holds, **the orchestrator commits**, never the implementer.
48
+ Write a clear message describing what landed.
49
+
50
+ From dispatch until that commit, the uncommitted working tree is the authoritative copy of the
51
+ implementer's work — the only one you can commit from, and often the only copy at all. Never run
52
+ `git checkout`, `reset`, `clean`, or a branch switch in the workspace between those two points —
53
+ however messy an interrupted run looks, inspect it first: `git status`, `git diff`,
54
+ `git diff --cached` for anything the implementer staged (plain `git diff` is blind to the index),
55
+ and commit the intended files explicitly.
56
+
57
+ ## Rework: re-dispatch a corrected brief
58
+
59
+ Re-dispatch the correction with the needed context:
60
+
61
+ ```bash
62
+ echo "The fix is right, but the tests mock the DB session: use the real migrated fixture and
63
+ remove the unused import." | node "<skill-dir>/scripts/relay.mjs" --cd /path/to/repo --allow-all-tools
64
+ ```
65
+
66
+ Use `--session <id>` from the previous run's `result.json` to resume the session with the delta
67
+ brief, or dispatch a fresh run. Each correction gets the same test review, diff review, and
68
+ implementer sweep.
69
+
70
+ ## Surface, do not absorb
71
+
72
+ The human opted into delegation, so committing verified, gate-passing work is the contract. Keep
73
+ them in the loop when the work changes shape:
74
+
75
+ - Report design decisions and defensible-but-unrequested turns.
76
+ - Note non-blocking nitpicks you did not block on.
77
+ - Stop and ask if correct completion requires going beyond the brief.
78
+
79
+ For a queue, keep these notes in the progress file described in
80
+ [multi-task-queues.md](multi-task-queues.md).
@@ -0,0 +1,140 @@
1
+ # Writing the brief
2
+
3
+ A brief is the entire task as copilot 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 copilot.
7
+
8
+ Copilot 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 and effort choice
12
+
13
+ Copilot picks a default model when `--model` is omitted, so a fresh dispatch does not require it.
14
+ Pass `--model <name>` only when the human asked for a specific model. `--effort <level>` sets the
15
+ reasoning effort (`low`, `medium`, `high`, `xhigh`, `max`). The relay rejects any other effort
16
+ value before dispatch. Model values still accept letters, digits, and `. _ : / -` 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 copilot 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 `--read-only`; copilot runs in `--mode plan`, which
59
+ disables edit tools so project files can't be changed by direct edits (shell commands still
60
+ run). If the repository must not change at all, dispatch against a clean or isolated worktree.
61
+
62
+ ## Always ask for the report explicitly
63
+
64
+ The relay builds `finalMessage` from the last non-ephemeral `assistant.message` event. Without a
65
+ closing summary, the edits may exist but the result is hard to review. The
66
+ `<structured_output_contract>` block makes the expected report explicit.
67
+
68
+ ## Discover the real gates
69
+
70
+ Read the repo's `AGENTS.md`, `CLAUDE.md`, `Makefile`, `package.json`, or equivalent first and copy
71
+ the actual commands into `<verification_loop>`. A brief that says only "run the tests" makes the
72
+ implementer guess or skip them.
73
+
74
+ ## Honor repo conventions
75
+
76
+ Restate the load-bearing house rules in the brief. Copilot can inspect the workspace, but the
77
+ important constraints should be directly in front of it.
78
+
79
+ ## One task per brief
80
+
81
+ Keep each brief bounded. One brief -> one copilot run -> one reviewed commit keeps the diff and
82
+ rollback clean. Split mixed implementation, review, documentation, and roadmap requests into
83
+ separate dispatches.
84
+
85
+ ## Premises freeze at dispatch
86
+
87
+ The implementer starts from the brief's facts and there is no steering channel mid-run. Audit the
88
+ fact block before sending — ownership, target branch, constraints, anything a judgment call rests
89
+ on. If a premise turns out wrong while the run is live, stop the run and re-dispatch a corrected
90
+ brief rather than discounting the output afterward; inspect the working tree and reconcile any
91
+ partial or premise-contaminated edits — keep or revert them — before the re-dispatch.
92
+
93
+ ## A worked example
94
+
95
+ ```xml
96
+ <task>
97
+ In the payments service at services/billing/, the refund path double-charges when a refund is retried
98
+ after a network timeout. Make refund submission idempotent: check for an existing refund by idempotency
99
+ key before creating a new one. Touch only services/billing/refund.py and its tests. Leave the charge
100
+ path, API routes, and data models untouched.
101
+ </task>
102
+
103
+ <verification_loop>
104
+ Run and make green before finishing:
105
+ pytest tests/billing/ -q
106
+ ruff check services/billing/
107
+ Confirm git status shows only refund.py and its test file changed.
108
+ </verification_loop>
109
+
110
+ <action_safety>
111
+ Scope strictly to the refund idempotency fix. No unrelated refactors. Do NOT git add or commit; leave
112
+ changes in the working tree for review.
113
+ </action_safety>
114
+
115
+ <structured_output_contract>
116
+ Report: (1) the root cause and fix, (2) files touched, (3) pytest and ruff outcomes with counts,
117
+ (4) anything left open or needing a decision.
118
+ </structured_output_contract>
119
+ ```
120
+
121
+ ## Brief delivery
122
+
123
+ The relay hands the brief to copilot via `-p @<brief.txt>` — the CLI's
124
+ `@`-prefixed file prompt channel (verified on copilot 1.0.78), the same shape
125
+ grok's relay uses with `--prompt-file`. The brief content never rides argv —
126
+ only the `@<brief.txt>` reference does, plus a fixed execution directive on
127
+ resume. The content stays out of the host process list, isn't bounded by the
128
+ OS arg-length cap, and a brief that starts with "-" cannot be misread as a
129
+ flag. On a shared machine keep secrets out of the brief anyway — reference
130
+ them by a path or environment variable the workspace can read. The brief is
131
+ also preserved in the run's `brief.txt` artifact.
132
+
133
+ On resume (`--session` / `--resume-last` with a delta brief) the relay wraps
134
+ the reference in a fixed directive so the resumed session executes it rather
135
+ than echoing the file back (see [dispatch-and-poll.md](dispatch-and-poll.md)).
136
+ The delta brief itself is unchanged; write it exactly as you would for a fresh
137
+ dispatch.
138
+
139
+ Dispatch with [dispatch-and-poll.md](dispatch-and-poll.md), then review and commit with
140
+ [review-and-land.md](review-and-land.md).