/desplega:delegate-workfrom desplega
Routes delegated work to the cheapest capable model: picks executors for sub-agents, tasks, and implementation slices. Use when spawning research, review, QA, UI, or search agents, or when choosing models for plan phases/steps.
Ships in desplega. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Claude (Opus 5.5 by default; Fable 5.1 only for hard problems) is the orchestrator: it thinks, designs, schedules, reviews, commits, and talks to the user. Everything else is delegated to the cheapest executor that clears the quality bar. Codex types; Claude judges.
This skill applies in BOTH modes:
Agent/Task, pick its model from the matrix below instead of the default.desplega:implementing / desplega:v-implementing (and run-phase / run-step), keep ALL of their orchestration semantics (autonomy modes, checkpoints, plan bookkeeping, commit strategy) — only the executor choice changes: instead of default phase-running/step-running sub-agents, route each phase/step per the matrix.Rankings 1–10, higher = better. Cost = subscription quota burned — both Claude and Codex run on flat-rate subs, so higher = lighter on that plan's rate limits (Fable burns the Claude quota fastest; Codex quota is comparatively abundant). Code = how hard a coding problem you can hand it unsupervised. Taste = UI/UX, code quality, API design, copy.
| executor | cost | code | taste | speed | role |
|---|---|---|---|---|---|
| fable-5.1 | 2 | 8 | 9 | 4 | hard problems only: deep long-horizon reasoning, novel architecture, high-stakes judgment |
| opus-5.5 | 5 | 9 | 9 | 6 | default orchestrator; UI implementation, complex review, browser E2E |
| sonnet-5.5 | 6 | 8 | 7 | 7 | routine review, API QA agents, standard sub-agent work |
| haiku-5.5 | 10 | 5 | 5 | 9 | search, locate, digest, sweeps, structure checks, bounded mechanical edits |
| codex gpt-6-astra | 5 | 10 | 6 | 4 | escalation only: hardest long-horizon or research-grade work |
| codex gpt-6.1-sol | 8 | 9 | 6 | 7 | default implementation, from everyday slices to gnarly debugging |
| codex gpt-6-luna | 10 | 4 | 3 | 10 | trivial mechanical code: renames, dep bumps, formatting sweeps |
(Context, from the Sept/Oct 2026 launches. Terminal-Bench 4.0 public board: Opus 5.5 64.8%, Sonnet 5.5 61.8%, GPT-6 Astra and GPT-6.1 Sol both 58.2%, GPT-6 Sol 49.4%, GPT-6 Luna 16.4%. Haiku 5.5 launch figure: 39.2%. GPT-6.1 Sol matches Astra on DeepSWE at ⅕ the price and uses far fewer output tokens per task than Claude models. Opus 5.5 beats Fable 5.1 on most coding evals at 40% of the price, but Fable keeps the edge on long-horizon reasoning. Sonnet 5.5 sits within a few points of Opus 5.5, but at max effort it burns more tokens than Opus: if a Sonnet task needs max, use Opus instead. Haiku 5.5 beats GPT-6 Luna on every published row, at the same price. Claude keeps the edge on taste and judgment; that's why review and UI stay Claude-side.)
Defaults, not limits. Standing permission to override: if a cheaper executor's output doesn't meet the bar, rerun or redo with a smarter one without asking. Judge the output, not the price tag. Escalating costs less than shipping mediocre work.
| work | executor | how |
|---|---|---|
| orchestration, spec-writing, architecture | Opus 5.5 (default session model) | stay in the main session; never delegated |
| hard problems: long-horizon reasoning, novel architecture with many unknowns, high-stakes design calls, or anything Opus 5.5 already got wrong twice | Fable 5.1 | if the session runs on Opus, recommend the user switch with /model, or spawn a focused Agent with model: "fable" and judge its answer in the main session |
| UI implementation (pages, components, styles, UX flows) | Opus 5.5 | Agent with model: "opus", background |
| code review — routine / per-phase | Sonnet 5.5 | Agent with model: "sonnet" |
| code review — complex, security-sensitive, cross-cutting, or reviewing Sol/Astra output | Opus 5.5 (+ optional parallel Codex review, see Verify ↓) | Agent with model: "opus" |
| API-level QA / E2E agents, plan-verification agents | Sonnet 5.5 | Agent with model: "sonnet" |
| browser E2E / driving the real UI | Opus 5.5 | Agent with model: "opus"; use a browser-automation agent for local URLs unless stated differently |
| search, locate, pattern-find, doc digests, plan-structure validation, log/test-output triage | Haiku 5.5 | Explore / locator agents with model: "haiku" |
| bounded mechanical edits that need session tools (MCP, browser, secrets), so Codex can't take them | Haiku 5.5 | Agent with model: "haiku" and an exact edit list; escalate to Sonnet on the first miss. No feature code, no design calls |
| bulk mechanical call-sequences (~10+ similar tool/API calls, any fan-out over a list) | a script | desplega:script-builder — cheapest executor of all; one summary re-enters context, raw payloads never do |
| raw code implementation from a frozen spec | Codex | variant by scope ↓, via codex-exec.sh |
Codex variant by scope (effort in parentheses):
gpt-6-luna (high): trivial and mechanical only. Renames, dep bumps, formatting, codemod-style sweeps. It is weak at agentic terminal work, so escalate to gpt-6.1-sol on the first miss. Anything with judgment (test fills, CI fixes, bug fixes) starts at gpt-6.1-sol medium.gpt-6.1-sol (medium): the default for a well-specified phase/step. Single vertical slice, clear verification, few unknowns. Also test/coverage fills, CI fixes, single-file bug fixes with a known repro.gpt-6.1-sol (high; xhigh for hard): multi-file backend phases, cross-package changes, subtle debugging, anything where the spec has known-unknowns.gpt-6-astra (high/xhigh; max only for the gnarliest long-horizon work): escalation rung. Use it after gpt-6.1-sol xhigh fails, or for research-grade work (hard science, theorem-style reasoning). It costs 5× Sol per token and does not beat 6.1 Sol on coding evals.gpt-5.6-* and gpt-6-sol still appear in the model list. Don't route to them.ultra (its own multi-agent mode). Parallelism is the orchestrator's job, via worktrees.Keep in Claude regardless of matrix: tasks where writing the spec IS the work (ambiguity = design); tiny edits (<~20 lines) where delegation overhead loses; anything needing session tools (MCP, browser, secrets); destructive/irreversible ops, pushes, GitHub mutations; judging delegated output — executors may contribute reviews, but the join and final verdict are never delegated, never skipped.
Heuristic: if the prompt reads as a work order → delegate; if writing it forces decisions → it's design, keep it.
When the harness exposes the Workflow tool AND the user has opted in (the desplega skills ask during setup — that answer IS the explicit opt-in the tool requires), fan-out runs as a workflow script instead of ad-hoc Agent calls. The matrix above still routes every executor; it just maps onto agent() opts:
model: "haiku" | "sonnet" | "opus" | "fable" (aliases resolve to the latest version of each family; "fable" only for hard-problem stages, per the routing table); omit model for work that must stay at orchestrator quality (it inherits the session model). effort follows the same logic: low for mechanical stages, higher tiers only for verify/judge stages.agentType opt.agent() can drive codex-exec.sh in its own worktree. Plan bookkeeping and commits stay orchestrator-side, as always.Prerequisite: the
codexCLI on PATH, authenticated, with access to the gpt-6 models (check~/.codex/models_cache.jsonfor the live slug list). If it's missing, the Codex rows of the matrix are unavailable. Route implementation work to Claude executors instead (Opus for hard slices, Sonnet for routine ones) and tell the user why.
${CLAUDE_PLUGIN_ROOT}/skills/delegate-work/scripts/codex-exec.sh
printf '%s' "$PROMPT" | codex-exec.sh -m gpt-6.1-sol -e medium \
-C <workdir> -o <report-file> -l <log-file>
-m model / -e reasoning effort — from the scope table above (script defaults: gpt-6.1-sol + high; env overrides CODEX_MODEL/CODEX_EFFORT still work).
-C working root — a git worktree for parallel work, repo root for sequential.
-o report file — Codex's final message; read THIS back, not the log.
-l log file — for monitoring only; keep raw logs out of the session.
-i image: attaches one image to the prompt. Repeat it for more images. The script stops on a missing file or a comma in the path, because codex drops a missing image without an error and splits -i values on commas.
Sandbox defaults to workspace-write (edits inside -C, reads anywhere). CODEX_BYPASS=1 only when a task genuinely must write outside its worktree.
Outside a git repo (a judge or review over frames, contact sheets or a /tmp dir): set CODEX_SANDBOX=read-only. A read-only run adds --skip-git-repo-check, so it runs in any dir. Write modes keep codex's git-repo check: they need a git worktree (or a dir trusted in ~/.codex/config.toml).
CODEX_SANDBOX=read-only codex-exec.sh -m gpt-6-astra -e xhigh -C <dir> \
-i <sheet-1.png> -i <sheet-2.png> -o <verdict-file> < <prompt-file>
Always background (run_in_background: true, timeout: 600000).
Prompt via stdin/temp file, never inline arg — the inline form can silently drop the prompt and hang on stdin (observed). A ~39-byte log means it hung.
Follow-up fixes: codex exec resume --last from the same dir is cheaper than a fresh run and keeps its context — use for review-fix rounds and crash recovery ("assess partial state via git status/diff first; don't redo, don't trust").
After 2 failed rounds on the same task: stop delegating, take over directly (or escalate the model one rung).
Codex starts with zero session context. Every prompt: goal, exact repo/paths (absolute plan path in the MAIN repo — worktrees don't contain untracked thoughts/), scope fence ("ONLY Phase N / step-N, don't touch X"), non-goals, verification commands to run, the standards line ("smallest diff that solves the problem; no speculative abstractions" — per desplega:engineering-standards), and the report shape (status completed/blocked/failed, files changed, verification output, notes). Codex must NOT edit the plan file — the orchestrator owns all plan bookkeeping.
Always clean up after use — the moment a slice is merged or abandoned: git worktree remove <path> + git branch -d codex/<slug>. Never leave stragglers; before ending a session, git worktree list must show only the main tree (and any worktree the user created themselves).
[Phase N] <name>, honors checkpoints.git worktree add -b codex/<slug> <path> <integration-branch>; fan out one Codex per ready step; merge back sequentially with --no-ff; remove worktree + branch after merge.bun install (or equivalent) in every fresh worktree BEFORE launching — a deps-less sandbox "verifies" nothing and ships unproven code.git commit inside linked worktrees (index lives under the main repo's .git → EPERM). Tell it not to commit; the orchestrator commits.git add -A.desplega:code-reviewing — two axes (Standards per desplega:engineering-standards, Spec against the phase body), parallel sub-agents Sonnet/Opus per the table, reported separately and never merged.codex exec review, or a gpt-6.1-sol review prompt via codex-exec.sh) in parallel with the two Claude axes, then join — dedupe findings, discard false positives, rank the rest. The JOIN and the final verdict stay Claude-side; a review is never delegated to a single executor and never skipped.Same as implementing/v-implementing: on blocked/failed or plan-vs-reality mismatch, AskUserQuestion (Adapt / Retry / Skip / Stop); in Autopilot use judgment and document it. Cleanup on abort: git worktree list → git worktree remove --force stragglers, delete codex/* branches.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub desplega-ai/ai-toolbox --plugin desplega26 skills in this plugin
/ask-userConventions for asking the user questions during a workflow via the AskUserQuestion tool. Other skills reference this to keep prompts consistent and structured./babysit-prKeep a GitHub PR moving until it is clean on its head commit. Each round fixes CI failures, handles review findings, rebases when needed, re-triggers the reviewers, and then waits in the background for the next event. Use when the user says "babysit the PR", "watch the PR until it's approved", "keep going until approved", "monitor the PR", or invokes /babysit-pr. Merges only when the user asks for it./brainstormingInteractive exploration of ideas through Socratic Q&A. Produces progressive documents that serve as lightweight pre-PRDs feeding into research./code-reviewingTwo-axis code review of a diff — Standards (is the code well built?) and Spec (does it actually solve the stated problem?) — run as parallel sub-agents and reported separately, never merged. Use when reviewing implementation output (a phase, a wave, a branch, a PR), when the user says "review the code", "review the diff", "review this phase", or when another desplega skill (implementing, v-implementing, verifying, delegate-work) calls for a per-phase or final code review. For reviewing DOCUMENTS (plans, research, brainstorms), use desplega:reviewing instead./commsRe-express something so it lands — re-explain your last reply in plain casual language, show the current topic visually (diagram, code-shape sketch, HTML artifact), do both at once, or rewrite artifact text into unambiguous ASD-STE100 English. Use when the user runs /desplega:comms, types /bro, says 'say it simpler', 'bro what', 'I don't follow', 'show me', 'draw this', 'visualize', 'disambiguate this', or 'STE100 rewrite'. Not for creative or marketing copy./design-docsCreate and maintain living per-system design docs at thoughts/*/design-docs/<system-slug>.md — Purpose, Glossary, numbered testable Invariants (normative for the code-reviewing Spec axis), Boundaries & Non-goals, Interfaces, Decision log, Amendment log. Use when the user says "create a design doc", "write down the invariants", "document the design/contract of X", or when researching/planning/one-shot finds a design doc for the touched system and needs the read-and-abide rules.Other plugins' skills for the same job