[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CPBXX1GM8ZTESRCCB3VBJ":3,"skill-same:01M78CPBXX1GM8ZTESRCCB3VBJ":159},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":46},"01M78CPBXX1GM8ZTESRCCB3VBJ","delegate-task",null,"Delegate a task to an external agent CLI harness — Claude Code, OpenAI Codex, OpenCode, GitHub Copilot, or Pi — and get back a normalised result with status (successful \u002F failed \u002F abandoned), a summary, what actually changed on disk measured against git, and total input and output token usage. Use when asked to \"use codex to ...\", \"delegate this to opencode\", \"have another agent do X\", \"run this task on a different model\", to get a second opinion from another harness, or to compare harnesses on the same task.","samykabu\u002Fsanduq","samykabu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1850884?v=4","01M78CNS8KTC9R087R7X1VRC7X","Samy K. Abushanab","01M78CNS98ED6XHA95XND8T105",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: delegate-task\ndescription: Delegate a task to an external agent CLI harness — Claude Code, OpenAI Codex, OpenCode, GitHub Copilot, or Pi — and get back a normalised result with status (successful \u002F failed \u002F abandoned), a summary, what actually changed on disk measured against git, and total input and output token usage. Use when asked to \"use codex to ...\", \"delegate this to opencode\", \"have another agent do X\", \"run this task on a different model\", to get a second opinion from another harness, or to compare harnesses on the same task.\nmetadata:\n  internal: true\n---\n\n# Delegate a task to another agent CLI\n\nRuns one task on an external agent CLI **in the background** and returns a normalised\nresult.\n\nDriver: `delegate.mjs`, in this skill's own directory (Node ≥ 18, no dependencies).\nBehaviour is defined by three contracts in `contracts\u002F` — read them before changing the driver.\n\n`start` returns a `run_id` immediately; `collect` retrieves the result. Nothing blocks you.\n\n## Resolve the driver and the runs directory first\n\nWhere this skill is installed decides where `delegate.mjs` lives, and run artifacts default to\nsitting **beside the driver**. Set both once per session, then use `$DELEGATE` in every command\nbelow:\n\n```bash\n# Claude Code plugin install (agent-tools@sanduq)\nDELEGATE=\"$CLAUDE_PLUGIN_ROOT\u002Fskills\u002Fdelegate-task\u002Fdelegate.mjs\"\n\n# npx skills install, or a copy committed into the repository\nDELEGATE=\".claude\u002Fskills\u002Fdelegate-task\u002Fdelegate.mjs\"\n\n# Keep run artifacts in the project being worked on, not next to the driver\nexport DELEGATE_RUNS_DIR=\"$PWD\u002F.delegate\u002Fruns\"\n```\n\n`DELEGATE_RUNS_DIR` is **required** for a plugin install: without it, artifacts from every project\naccumulate inside the shared plugin directory, and they contain your task text and the harness's\nraw output. Add `.delegate\u002F` to the project's `.gitignore`. Every command that touches a run\n— `start`, `status`, `collect`, `list`, `prune` — must see the same value.\n\n## Check what is available first\n\n```bash\nnode \"$DELEGATE\" doctor\n```\n\n`doctor` probes each CLI's version, so it distinguishes **not installed** from **installed but\nbroken** — and prints what `--sandbox` actually requests of each one.\n\n| harness | id | tier | resume | `--sandbox` requests |\n|---|---|---|---|---|\n| Claude Code | `claude` | verified | verified | `--permission-mode plan` |\n| OpenAI Codex | `codex` | verified | verified | `-s read-only` (CLI-enforced) |\n| OpenCode | `opencode` | verified | verified | `--agent plan` |\n| GitHub Copilot | `copilot` | **experimental** | experimental | `--mode plan` |\n| Pi | `pi` | **experimental** | experimental | `--no-approve --tools read,grep,find,ls` |\n\nPrefer `claude`, `codex`, or `opencode`.\n\n## Run a delegation\n\n```bash\nnode \"$DELEGATE\" start \\\n  --harness codex \\\n  --cwd \u002Fpath\u002Fto\u002Fworkspace \\\n  --timeout 600 \\\n  --task \"Add input validation to parse_config() and a test covering the bad-input path.\"\n```\n\nPrints `{\"run_id\": \"codex-…\", \"state\": \"running\", ...}` and returns. Then:\n\n```bash\nnode \"$DELEGATE\" collect codex-… --wait 300\n```\n\n`--wait N` polls for up to N seconds. Without it, `collect` exits 3 if the run is still going.\n\nOther commands:\n\n```bash\nnode \"$DELEGATE\" status \u003Crun_id>                 # starting|running|stalled|adrift|lost|done\nnode \"$DELEGATE\" collect \u003Crun_id> --json         # the machine-readable result — parse this\nnode \"$DELEGATE\" list                            # every run, oldest first\nnode \"$DELEGATE\" prune --keep 20 --yes           # delete old run artifacts\nnode \"$DELEGATE\" contract                        # machine-readable flags, fields, exit codes\n```\n\n## Reading the result\n\n```\nStatus       SUCCESSFUL\nBecause      harness_telemetry\n\nChanges\n  measured   greeting.txt\n  claimed    greeting.txt\n\nPermission   requested=bypass  applied=codex: --dangerously-bypass-approvals-and-sandbox\n```\n\nThree fields carry most of the meaning:\n\n- **`status`** — `successful` \u002F `failed` \u002F `abandoned`.\n- **`status_provenance.primary`** — *why* that status, in one word: `timeout`, `spawn_error`,\n  `signal`, `exit_code`, `parse_error`, `telemetry_incomplete`, `harness_telemetry`,\n  `self_report`, `head_moved`, `index_moved`, `relay_aborted`, `supervisor_lost`, `legacy`.\n  Never report a status without knowing which of these produced it. `evidence` lists **every**\n  observation that was true, not just the one that won.\n- **`dirty_paths_changed`** — what **git measured**, as opposed to `files_claimed`, which is what\n  the delegate *said*. `files_mismatch` flags disagreement.\n\n## Permissions\n\n**Default is full bypass.** The delegate runs arbitrary commands unattended.\n\n`--sandbox` requests each CLI's real read-only mode (table above) and turns on the tripwire:\n`read_only_violation` is `true` \u002F `false` \u002F **`null`**. `null` means *unknown* — git was\nunavailable or fingerprint coverage was incomplete. It is never collapsed to `false`.\n\n**`false` does not mean \"no writes occurred.\"** It means no covered final-state delta was\ndetected. It cannot see a write-then-revert, anything gitignored, or any write outside the repo.\n**`true` does not mean the delegate did it** — a concurrent edit in the same worktree looks\nidentical.\n\nThe envelope tells the delegate not to commit, but that is **policy, not enforcement**. What\nenforces it is measurement: if HEAD moves during the run window the result is forced to\nreview-required (`head_moved`) unless you passed `--allow-commit`.\n\n## Continuing a run\n\n```bash\nnode \"$DELEGATE\" start --harness codex --cwd \u003Csame dir> --resume \u003Crun_id> \\\n  --task \"The fix is right, but use the real fixture instead of a mock.\"\n```\n\nSend only the delta. Resume gets a **new** `run_id` with `parent_run_id` set, and refuses if the\nharness, the working directory, or the parent's session id do not line up.\n\nA resumed dispatch **repeats every policy rule** rather than assuming the parent session still\nhonours them.\n\n## Flags\n\n| flag | use |\n|---|---|\n| `--cwd DIR` | working directory — **always set it explicitly** |\n| `--model M` | override the model |\n| `--timeout SEC` | default 1800; validated up front; on expiry the tree is killed → `abandoned` |\n| `--deliverable TEXT` | what to hand back (\"a unified diff, do not commit\") |\n| `--constraint TEXT` | repeatable extra rule |\n| `--sandbox` | request the harness's read-only mode |\n| `--allow-commit` | permit committing, and stop treating a moved HEAD as review-required |\n| `--resume \u003Crun_id>` | continue a finished run's session with a delta task |\n| `--clean-env` \u002F `--keep-env N` | hand the CLI only runtime basics; repeat `--keep-env` per variable needed for auth |\n| `--raw` | send the task verbatim (loses status\u002Fsummary; incompatible with `--resume`) |\n\n## Gotchas\n\n1. **Exit code 0 does not mean the task was done** — and until this refactor, a **non-zero exit\n   did not mean it failed**. Adapters were handed the exit code and none read it, so a\n   success-shaped event plus exit 1 was published `successful`. Fixed; pinned by\n   `test\u002Frun.mjs` case `REPAIR-D1`. Always read `status_provenance`, never `exit_code` alone.\n2. **Token fields mean different things per harness.** Claude's `input_tokens` \u002F\n   `cache_creation` \u002F `cache_read` are **disjoint** — sum them (a probe reported `input_tokens: 2`\n   for a request that really sent 58,065). Codex's `input_tokens` is **inclusive** of\n   `cached_input_tokens` — subtract for the fresh count. Use `input_total` \u002F `input_fresh`;\n   `usage_raw` keeps the harness's own numbers for audit but is never displayed as a total.\n3. **Totals are not comparable across harnesses.** OpenCode emits one `step_finish` per step and\n   the driver sums them, so context re-sent each step is counted each time. Same trivial task:\n   66,341 (codex), 117,014 (claude), 426,523 (opencode). Not an efficiency ranking.\n4. **Delegating to `claude` has a ~58k token floor.** `claude -p` loads CLAUDE.md and every\n   discovered skill before reading the task.\n5. **Codex inherits your MCP servers.** If codex feels slow, read `runs\u002F\u003Crun_id>\u002Fstderr.log` —\n   the delay is usually MCP, not the model.\n6. **Codex emits `item.type: \"error\"` events on successful runs.** Only `turn.failed` or a\n   missing `turn.completed` counts.\n7. **Full bypass really is unsandboxed.** An OpenCode delegate once wrote a file *outside* its\n   `--cwd`. Use `--sandbox`, or a throwaway directory.\n8. **Not every harness reports every field.** Copilot emits no token counts at all\n   (`fidelity: \"unavailable\"` — zeroes mean *unknown*, not *free*). **Codex emits neither a cost\n   nor a model** anywhere in its JSONL, so `cost_usd` and `model` are null by nature, not by a\n   parsing failure — `cost_reported` \u002F `model_reported` say which, and the printed result reads\n   \"not reported by this harness\". Claude reports both; OpenCode reports cost.\n9. **Task text never reaches a shell.** Each CLI is resolved to a real executable and spawned\n   with `shell:false`.\n10. **`pi` persists a session in its own store.** `--no-session` is deliberately not passed —\n    without a session there is nothing to resume. Sessions land in\n    `~\u002F.pi\u002Fagent\u002Fsessions\u002F\u003Ccwd-slug>\u002F`, keyed by working directory; `prune` does not touch them.\n    Pi's auth is file-based (`~\u002F.pi\u002Fagent\u002Fauth.json`), so `--clean-env` does not break it.\n11. **A run whose supervisor is killed is `lost`, not stuck.** `collect` synthesises a terminal\n    result from the journal and logs. Its git delta is `null`: no run-start baseline survived, and\n    reporting `false` would be an assurance nothing measured.\n12. **Run ids are validated.** They must match `\u003Charness>-\u003C14 digits>-\u003C6 hex>`, and must resolve\n    directly under the runs directory. A caller-supplied id cannot traverse out of it.\n13. **A dead supervisor whose harness is still alive is `adrift`, not `lost`.** `collect` refuses\n    to publish, because a result written then would snapshot a run still in motion. Wait for the\n    child, or kill the pid `status` names. `prune` will not delete an adrift run either.\n14. **`DELEGATE_BIN_\u003CHARNESS>` overrides where a binary is found** — e.g.\n    `DELEGATE_BIN_CODEX=\u002Fopt\u002Fcodex\u002Fbin\u002Fcodex`. It is also how the test suite drives a fake harness\n    end to end without spending a token.\n\n## Troubleshooting\n\n| symptom | cause \u002F fix |\n|---|---|\n| `\u003Cbin> not found on PATH` | that CLI is not installed; run `doctor` |\n| `found \u003Cpath> but could not resolve what it launches` | the CLI is installed behind a non-npm `.cmd` shim this driver cannot decode |\n| `doctor` shows `BROKEN: probe timed out` | usually a cold start; re-run `doctor` before concluding anything |\n| `supervisor failed to start` (exit 5) | the detached supervisor never acknowledged; check `runs\u002F\u003Cid>\u002Fjournal.jsonl`. The run is finalised `failed` with `containment_evidence: \"the harness never launched\"`; if the journal holds only `created` and `terminal` and the supervisor pid is gone, no agent ran |\n| `run \u003Cid> still executing` (exit 3) | add `--wait \u003Cseconds>` |\n| `Refusing to publish … still running` (exit 6) | the run is `adrift`: the supervisor died but the harness lives. Wait, or kill the pid it names |\n| `another process is finalising this run` (exit 7) | a live writer holds the claim; retry in a moment |\n| `written by a different driver` (exit 8) | the result carries an unknown schema; this build will not guess at it |\n| status `abandoned`, provenance `supervisor_lost` | the supervisor was killed; inspect the working tree before re-dispatching |\n| status `failed`, provenance `head_moved` \u002F `index_moved` | something committed or staged during the run; the tree is preserved, review it |\n| Summary reads `(no summary produced)` | the delegate never emitted the result block; read `runs\u002F\u003Crun_id>\u002Fstdout.log` |\n\n## Files\n\nRun artifacts live in `$DELEGATE_RUNS_DIR\u002F\u003Crun_id>\u002F` (`prompt.txt`, `meta.json`, `journal.jsonl`,\n`stdout.log`, `stderr.log`, `result.json`). Unset, `DELEGATE_RUNS_DIR` defaults to `runs\u002F` beside\nthe driver — which is the shared plugin directory on a plugin install, so set it. Cap log size\nwith `DELEGATE_MAX_LOG_BYTES` (default 32 MB per stream) and the post-cap retention window with\n`DELEGATE_LOG_TAIL_BYTES` (default 512 KB).\n\nPast the cap the driver keeps **complete parsed records** rather than a byte suffix, so telemetry\nstill parses. Records the window cannot hold are counted in **`records_dropped`** — a non-zero\nvalue means the status is still sound but the delegate's own final answer may be incomplete.\n\n⚠️ **Artifacts hold your task text, the full prompt and the harness's raw output — treat them as\nsensitive.** Finalisation masks token shapes and credential-looking `NAME=value` pairs in\n`stdout.log` and `stderr.log` (not in `result.json`). On POSIX the runs directory is `chmod 0700`;\non Windows permissions are inherited and this driver cannot restrict them. A successful `collect`\ndeletes finished runs older than `DELEGATE_PRUNE_DAYS` days (default 30; `0` disables); clean up\nsooner with `prune`.\n\n## Going deeper\n\n- For a batch of known local CLI checks, read [the native check-runner contract](contracts\u002Fcheck-runner.md).\n  It covers JSON argv plans, immutable attempts, bounded collection and PowerShell invocation.\n  Use the same reference for `collect --summary`, heartbeat-only diagnostics and opt-in startup deadlines.\n\n- `contracts\u002Fstatus-precedence.md` — how a status is decided, and the cross-product to test\n- `contracts\u002Fgit-fields.md` — what the tripwire measures and what it cannot see\n- `contracts\u002Fresult-schema-v2.md` — the result shape, v1 backward read, journal, single-writer\n- `references\u002Fwriting-the-brief.md` — how to write a task the delegate can execute blind\n- `references\u002Freviewing-the-result.md` — how to review what comes back, including the sweep\n- `references\u002Ftask-queues.md` — running several dependent tasks without losing the thread\n\nTests: `node test\u002Frun.mjs`, from this skill's directory.\nExecution regressions: `node --test test\u002Fexecution.test.mjs` (Node\u002FPython CLI fixtures).\n","# Delegate a task to another agent CLI\n\nRuns one task on an external agent CLI **in the background** and returns a normalised\nresult.\n\nDriver: `delegate.mjs`, in this skill's own directory (Node ≥ 18, no dependencies).\nBehaviour is defined by three contracts in `contracts\u002F` — read them before changing the driver.\n\n`start` returns a `run_id` immediately; `collect` retrieves the result. Nothing blocks you.\n\n## Resolve the driver and the runs directory first\n\nWhere this skill is installed decides where `delegate.mjs` lives, and run artifacts default to\nsitting **beside the driver**. Set both once per session, then use `$DELEGATE` in every command\nbelow:\n\n```bash\n# Claude Code plugin install (agent-tools@sanduq)\nDELEGATE=\"$CLAUDE_PLUGIN_ROOT\u002Fskills\u002Fdelegate-task\u002Fdelegate.mjs\"\n\n# npx skills install, or a copy committed into the repository\nDELEGATE=\".claude\u002Fskills\u002Fdelegate-task\u002Fdelegate.mjs\"\n\n# Keep run artifacts in the project being worked on, not next to the driver\nexport DELEGATE_RUNS_DIR=\"$PWD\u002F.delegate\u002Fruns\"\n```\n\n`DELEGATE_RUNS_DIR` is **required** for a plugin install: without it, artifacts from every project\naccumulate inside the shared plugin directory, and they contain your task text and the harness's\nraw output. Add `.delegate\u002F` to the project's `.gitignore`. Every command that touches a run\n— `start`, `status`, `collect`, `list`, `prune` — must see the same value.\n\n## Check what is available first\n\n```bash\nnode \"$DELEGATE\" doctor\n```\n\n`doctor` probes each CLI's version, so it distinguishes **not installed** from **installed but\nbroken** — and prints what `--sandbox` actually requests of each one.\n\n| harness | id | tier | resume | `--sandbox` requests |\n|---|---|---|---|---|\n| Claude Code | `claude` | verified | verified | `--permission-mode plan` |\n| OpenAI Codex | `codex` | verified | verified | `-s read-only` (CLI-enforced) |\n| OpenCode | `opencode` | verified | verified | `--agent plan` |\n| GitHub Copilot | `copilot` | **experimental** | experimental | `--mode plan` |\n| Pi | `pi` | **experimental** | experimental | `--no-approve --tools read,grep,find,ls` |\n\nPrefer `claude`, `codex`, or `opencode`.\n\n## Run a delegation\n\n```bash\nnode \"$DELEGATE\" start \\\n  --harness codex \\\n  --cwd \u002Fpath\u002Fto\u002Fworkspace \\\n  --timeout 600 \\\n  --task \"Add input validation to parse_config() and a test covering the bad-input path.\"\n```\n\nPrints `{\"run_id\": \"codex-…\", \"state\": \"running\", ...}` and returns. Then:\n\n```bash\nnode \"$DELEGATE\" collect codex-… --wait 300\n```\n\n`--wait N` polls for up to N seconds. Without it, `collect` exits 3 if the run is still going.\n\nOther commands:\n\n```bash\nnode \"$DELEGATE\" status \u003Crun_id>                 # starting|running|stalled|adrift|lost|done\nnode \"$DELEGATE\" collect \u003Crun_id> --json         # the machine-readable result — parse this\nnode \"$DELEGATE\" list                            # every run, oldest first\nnode \"$DELEGATE\" prune --keep 20 --yes           # delete old run artifacts\nnode \"$DELEGATE\" contract                        # machine-readable flags, fields, exit codes\n```\n\n## Reading the result\n\n```\nStatus       SUCCESSFUL\nBecause      harness_telemetry\n\nChanges\n  measured   greeting.txt\n  claimed    greeting.txt\n\nPermission   requested=bypass  applied=codex: --dangerously-bypass-approvals-and-sandbox\n```\n\nThree fields carry most of the meaning:\n\n- **`status`** — `successful` \u002F `failed` \u002F `abandoned`.\n- **`status_provenance.primary`** — *why* that status, in one word: `timeout`, `spawn_error`,\n  `signal`, `exit_code`, `parse_error`, `telemetry_incomplete`, `harness_telemetry`,\n  `self_report`, `head_moved`, `index_moved`, `relay_aborted`, `supervisor_lost`, `legacy`.\n  Never report a status without knowing which of these produced it. `evidence` lists **every**\n  observation that was true, not just the one that won.\n- **`dirty_paths_changed`** — what **git measured**, as opposed to `files_claimed`, which is what\n  the delegate *said*. `files_mismatch` flags disagreement.\n\n## Permissions\n\n**Default is full bypass.** The delegate runs arbitrary commands unattended.\n\n`--sandbox` requests each CLI's real read-only mode (table above) and turns on the tripwire:\n`read_only_violation` is `true` \u002F `false` \u002F **`null`**. `null` means *unknown* — git was\nunavailable or fingerprint coverage was incomplete. It is never collapsed to `false`.\n\n**`false` does not mean \"no writes occurred.\"** It means no covered final-state delta was\ndetected. It cannot see a write-then-revert, anything gitignored, or any write outside the repo.\n**`true` does not mean the delegate did it** — a concurrent edit in the same worktree looks\nidentical.\n\nThe envelope tells the delegate not to commit, but that is **policy, not enforcement**. What\nenforces it is measurement: if HEAD moves during the run window the result is forced to\nreview-required (`head_moved`) unless you passed `--allow-commit`.\n\n## Continuing a run\n\n```bash\nnode \"$DELEGATE\" start --harness codex --cwd \u003Csame dir> --resume \u003Crun_id> \\\n  --task \"The fix is right, but use the real fixture instead of a mock.\"\n```\n\nSend only the delta. Resume gets a **new** `run_id` with `parent_run_id` set, and refuses if the\nharness, the working directory, or the parent's session id do not line up.\n\nA resumed dispatch **repeats every policy rule** rather than assuming the parent session still\nhonours them.\n\n## Flags\n\n| flag | use |\n|---|---|\n| `--cwd DIR` | working directory — **always set it explicitly** |\n| `--model M` | override the model |\n| `--timeout SEC` | default 1800; validated up front; on expiry the tree is killed → `abandoned` |\n| `--deliverable TEXT` | what to hand back (\"a unified diff, do not commit\") |\n| `--constraint TEXT` | repeatable extra rule |\n| `--sandbox` | request the harness's read-only mode |\n| `--allow-commit` | permit committing, and stop treating a moved HEAD as review-required |\n| `--resume \u003Crun_id>` | continue a finished run's session with a delta task |\n| `--clean-env` \u002F `--keep-env N` | hand the CLI only runtime basics; repeat `--keep-env` per variable needed for auth |\n| `--raw` | send the task verbatim (loses status\u002Fsummary; incompatible with `--resume`) |\n\n## Gotchas\n\n1. **Exit code 0 does not mean the task was done** — and until this refactor, a **non-zero exit\n   did not mean it failed**. Adapters were handed the exit code and none read it, so a\n   success-shaped event plus exit 1 was published `successful`. Fixed; pinned by\n   `test\u002Frun.mjs` case `REPAIR-D1`. Always read `status_provenance`, never `exit_code` alone.\n2. **Token fields mean different things per harness.** Claude's `input_tokens` \u002F\n   `cache_creation` \u002F `cache_read` are **disjoint** — sum them (a probe reported `input_tokens: 2`\n   for a request that really sent 58,065). Codex's `input_tokens` is **inclusive** of\n   `cached_input_tokens` — subtract for the fresh count. Use `input_total` \u002F `input_fresh`;\n   `usage_raw` keeps the harness's own numbers for audit but is never displayed as a total.\n3. **Totals are not comparable across harnesses.** OpenCode emits one `step_finish` per step and\n   the driver sums them, so context re-sent each step is counted each time. Same trivial task:\n   66,341 (codex), 117,014 (claude), 426,523 (opencode). Not an efficiency ranking.\n4. **Delegating to `claude` has a ~58k token floor.** `claude -p` loads CLAUDE.md and every\n   discovered skill before reading the task.\n5. **Codex inherits your MCP servers.** If codex feels slow, read `runs\u002F\u003Crun_id>\u002Fstderr.log` —\n   the delay is usually MCP, not the model.\n6. **Codex emits `item.type: \"error\"` events on successful runs.** Only `turn.failed` or a\n   missing `turn.completed` counts.\n7. **Full bypass really is unsandboxed.** An OpenCode delegate once wrote a file *outside* its\n   `--cwd`. Use `--sandbox`, or a throwaway directory.\n8. **Not every harness reports every field.** Copilot emits no token counts at all\n   (`fidelity: \"unavailable\"` — zeroes mean *unknown*, not *free*). **Codex emits neither a cost\n   nor a model** anywhere in its JSONL, so `cost_usd` and `model` are null by nature, not by a\n   parsing failure — `cost_reported` \u002F `model_reported` say which, and the printed result reads\n   \"not reported by this harness\". Claude reports both; OpenCode reports cost.\n9. **Task text never reaches a shell.** Each CLI is resolved to a real executable and spawned\n   with `shell:false`.\n10. **`pi` persists a session in its own store.** `--no-session` is deliberately not passed —\n    without a session there is nothing to resume. Sessions land in\n    `~\u002F.pi\u002Fagent\u002Fsessions\u002F\u003Ccwd-slug>\u002F`, keyed by working directory; `prune` does not touch them.\n    Pi's auth is file-based (`~\u002F.pi\u002Fagent\u002Fauth.json`), so `--clean-env` does not break it.\n11. **A run whose supervisor is killed is `lost`, not stuck.** `collect` synthesises a terminal\n    result from the journal and logs. Its git delta is `null`: no run-start baseline survived, and\n    reporting `false` would be an assurance nothing measured.\n12. **Run ids are validated.** They must match `\u003Charness>-\u003C14 digits>-\u003C6 hex>`, and must resolve\n    directly under the runs directory. A caller-supplied id cannot traverse out of it.\n13. **A dead supervisor whose harness is still alive is `adrift`, not `lost`.** `collect` refuses\n    to publish, because a result written then would snapshot a run still in motion. Wait for the\n    child, or kill the pid `status` names. `prune` will not delete an adrift run either.\n14. **`DELEGATE_BIN_\u003CHARNESS>` overrides where a binary is found** — e.g.\n    `DELEGATE_BIN_CODEX=\u002Fopt\u002Fcodex\u002Fbin\u002Fcodex`. It is also how the test suite drives a fake harness\n    end to end without spending a token.\n\n## Troubleshooting\n\n| symptom | cause \u002F fix |\n|---|---|\n| `\u003Cbin> not found on PATH` | that CLI is not installed; run `doctor` |\n| `found \u003Cpath> but could not resolve what it launches` | the CLI is installed behind a non-npm `.cmd` shim this driver cannot decode |\n| `doctor` shows `BROKEN: probe timed out` | usually a cold start; re-run `doctor` before concluding anything |\n| `supervisor failed to start` (exit 5) | the detached supervisor never acknowledged; check `runs\u002F\u003Cid>\u002Fjournal.jsonl`. The run is finalised `failed` with `containment_evidence: \"the harness never launched\"`; if the journal holds only `created` and `terminal` and the supervisor pid is gone, no agent ran |\n| `run \u003Cid> still executing` (exit 3) | add `--wait \u003Cseconds>` |\n| `Refusing to publish … still running` (exit 6) | the run is `adrift`: the supervisor died but the harness lives. Wait, or kill the pid it names |\n| `another process is finalising this run` (exit 7) | a live writer holds the claim; retry in a moment |\n| `written by a different driver` (exit 8) | the result carries an unknown schema; this build will not guess at it |\n| status `abandoned`, provenance `supervisor_lost` | the supervisor was killed; inspect the working tree before re-dispatching |\n| status `failed`, provenance `head_moved` \u002F `index_moved` | something committed or staged during the run; the tree is preserved, review it |\n| Summary reads `(no summary produced)` | the delegate never emitted the result block; read `runs\u002F\u003Crun_id>\u002Fstdout.log` |\n\n## Files\n\nRun artifacts live in `$DELEGATE_RUNS_DIR\u002F\u003Crun_id>\u002F` (`prompt.txt`, `meta.json`, `journal.jsonl`,\n`stdout.log`, `stderr.log`, `result.json`). Unset, `DELEGATE_RUNS_DIR` defaults to `runs\u002F` beside\nthe driver — which is the shared plugin directory on a plugin install, so set it. Cap log size\nwith `DELEGATE_MAX_LOG_BYTES` (default 32 MB per stream) and the post-cap retention window with\n`DELEGATE_LOG_TAIL_BYTES` (default 512 KB).\n\nPast the cap the driver keeps **complete parsed records** rather than a byte suffix, so telemetry\nstill parses. Records the window cannot hold are counted in **`records_dropped`** — a non-zero\nvalue means the status is still sound but the delegate's own final answer may be incomplete.\n\n⚠️ **Artifacts hold your task text, the full prompt and the harness's raw output — treat them as\nsensitive.** Finalisation masks token shapes and credential-looking `NAME=value` pairs in\n`stdout.log` and `stderr.log` (not in `result.json`). On POSIX the runs directory is `chmod 0700`;\non Windows permissions are inherited and this driver cannot restrict them. A successful `collect`\ndeletes finished runs older than `DELEGATE_PRUNE_DAYS` days (default 30; `0` disables); clean up\nsooner with `prune`.\n\n## Going deeper\n\n- For a batch of known local CLI checks, read [the native check-runner contract](contracts\u002Fcheck-runner.md).\n  It covers JSON argv plans, immutable attempts, bounded collection and PowerShell invocation.\n  Use the same reference for `collect --summary`, heartbeat-only diagnostics and opt-in startup deadlines.\n\n- `contracts\u002Fstatus-precedence.md` — how a status is decided, and the cross-product to test\n- `contracts\u002Fgit-fields.md` — what the tripwire measures and what it cannot see\n- `contracts\u002Fresult-schema-v2.md` — the result shape, v1 backward read, journal, single-writer\n- `references\u002Fwriting-the-brief.md` — how to write a task the delegate can execute blind\n- `references\u002Freviewing-the-result.md` — how to review what comes back, including the sweep\n- `references\u002Ftask-queues.md` — running several dependent tasks without losing the thread\n\nTests: `node test\u002Frun.mjs`, from this skill's directory.\nExecution regressions: `node --test test\u002Fexecution.test.mjs` (Node\u002FPython CLI fixtures).\n",{"name":5,"metadata":24,"description":7},{"internal":25},true,"main","276b695318e79284abed40e4f534ff5c5ab47edf","extensions\u002Fworkflow\u002Fassets\u002Fdelegate-task","https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq","https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fwiki","https:\u002F\u002Fgithub.com\u002Fsamykabu","A highly experienced IT professional specializing in software development, project management, and systems solutions.","2026-11-10 01:41:44",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":25},[36,39,42],{"tool":37,"command":38},"npx","npx skills add samykabu\u002Fsanduq --skill delegate-task",{"tool":40,"command":41},"bunx","bunx skills add samykabu\u002Fsanduq --skill delegate-task",{"tool":43,"command":44},"pnpm","pnpm dlx skills add samykabu\u002Fsanduq --skill delegate-task","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002FSKILL.md",[47,53,59,63,67,71,75,79,85,89,93,97,101,105,109,115,119,123,127,131,135,139,143,147,151,155],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},".gitignore","OTHER","其他",6,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002F.gitignore",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"assets\u002Fdelegate-parallel-fanout.html","ASSET","资产文件",15092,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fassets\u002Fdelegate-parallel-fanout.html",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"assets\u002Fdelegate-parallel-fanout.png",106935,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fassets\u002Fdelegate-parallel-fanout.png",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"assets\u002Fdelegate-parallel-fanout.svg",12313,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fassets\u002Fdelegate-parallel-fanout.svg",{"path":68,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":69,"sourceHtmlUrl":70},"assets\u002Fdelegate-run-lifecycle.html",15563,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fassets\u002Fdelegate-run-lifecycle.html",{"path":72,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":73,"sourceHtmlUrl":74},"assets\u002Fdelegate-run-lifecycle.png",93725,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fassets\u002Fdelegate-run-lifecycle.png",{"path":76,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":77,"sourceHtmlUrl":78},"assets\u002Fdelegate-run-lifecycle.svg",13386,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fassets\u002Fdelegate-run-lifecycle.svg",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"bounded.mjs","SCRIPT","脚本",13083,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fbounded.mjs",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"check-identity.mjs",1818,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcheck-identity.mjs",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"check-receipt.mjs",6204,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcheck-receipt.mjs",{"path":94,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":95,"sourceHtmlUrl":96},"check-runner.mjs",19927,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcheck-runner.mjs",{"path":98,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":99,"sourceHtmlUrl":100},"containment-linux.py",6043,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontainment-linux.py",{"path":102,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":103,"sourceHtmlUrl":104},"containment-windows.ps1",10124,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontainment-windows.ps1",{"path":106,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":107,"sourceHtmlUrl":108},"containment.mjs",4515,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontainment.mjs",{"path":110,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":113,"sourceHtmlUrl":114},"contracts\u002Fcheck-runner.md","REFERENCE","参考文档",14532,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontracts\u002Fcheck-runner.md",{"path":116,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":117,"sourceHtmlUrl":118},"contracts\u002Fgit-fields.md",5156,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontracts\u002Fgit-fields.md",{"path":120,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":121,"sourceHtmlUrl":122},"contracts\u002Fresult-schema-v2.md",11291,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontracts\u002Fresult-schema-v2.md",{"path":124,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":125,"sourceHtmlUrl":126},"contracts\u002Fstatus-precedence.md",5025,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fcontracts\u002Fstatus-precedence.md",{"path":128,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":129,"sourceHtmlUrl":130},"delegate.mjs",100604,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fdelegate.mjs",{"path":132,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":133,"sourceHtmlUrl":134},"job-windows.ps1",3350,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fjob-windows.ps1",{"path":136,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":137,"sourceHtmlUrl":138},"process-tools.mjs",3979,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Fprocess-tools.mjs",{"path":140,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":141,"sourceHtmlUrl":142},"README.ar.md",28908,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002FREADME.ar.md",{"path":144,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":145,"sourceHtmlUrl":146},"README.md",24401,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002FREADME.md",{"path":148,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":149,"sourceHtmlUrl":150},"references\u002Freviewing-the-result.md",6079,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Freferences\u002Freviewing-the-result.md",{"path":152,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":153,"sourceHtmlUrl":154},"references\u002Ftask-queues.md",4001,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Freferences\u002Ftask-queues.md",{"path":156,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":157,"sourceHtmlUrl":158},"references\u002Fwriting-the-brief.md",4677,"https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fworkflow\u002Fassets\u002Fdelegate-task\u002Freferences\u002Fwriting-the-brief.md",[160],{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":19},"01M78CP0QZ2SM6VBQSN89WXDDN","illustrate","Draws diagrams, charts, and technical illustrations (44 types) as self-contained HTML with inline SVG, plus optional SVG\u002FPNG\u002FPDF export, in the project's tracked color and font theme. Use this skill whenever the user asks to draw, diagram, visualize, chart, map, sketch, or illustrate something, even without saying 'illustrate': architecture or system design, infrastructure, cloud or deployment topology, data flow, flowcharts, sequence, state machines, ER or database schema, UML class, dependency graphs, org charts, timelines, Gantt, swimlanes, process or workflow maps, user journeys, kanban, story maps, quadrants, Venn, pyramids, fishbone root-cause, Sankey, Wardley maps, bar, line, scatter, heatmap, waterfall, treemap, radar, or polar charts, and exploded or axonometric views. Also use to redraw .drawio, Mermaid (.mmd), or .excalidraw files, add a diagram to docs, a PR, or a spec, set up the illustration theme, or export a diagram. Not for photos or AI-generated raster images.","https:\u002F\u002Fgithub.com\u002Fsamykabu\u002Fsanduq\u002Fblob\u002Fmain\u002Fextensions\u002Fillustrate\u002Fskill\u002FSKILL.md",[],[]]