Delegate
Agent Skills for Claude Code, Codex & OpenCode that review code for security, performance & clean code — Next.js & Laravel PR reviewers plus a stack-agnostic pre-push reviewer with a Pass/Warn/Fail scorecard.
npx -y skills add ezzatmakar/ai-code-skills --skill delegateAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Hand a task to a different model's CLI — Codex, OpenCode, Claude Code, Cursor, Gemini, or Aider — headlessly, then capture and summarize its answer. Use when you explicitly name a target — "delegate this to codex", "ask opencode to explain this file", "run this with cursor", "get a second opinion from claude", "have aider make this change" — to build a non-interactive invocation, confirm it, execute it (read-only by default; edit mode only on request), and report the result. Honors model, mode, timeout, and JSON output. Not a router: you must name the target; it never picks or substitutes a model for you.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.5 KB, as published. Nobody here has run it
Delegate to another model's CLI
Delegate a single task to a named model CLI — Codex, OpenCode, Claude Code, Cursor, Gemini, or Aider — run it headlessly, and bring the result back. This skill is an explicit dispatcher: the user names the target; it never routes, guesses, or substitutes a model. It defaults to read-only, and it always confirms the exact command before executing, because delegating spends the target's credits and — in edit mode — can modify files.
Two helpers do the mechanical work; resolve <skill-directory> from the loaded skill path:
<skill-directory>/scripts/detect-clis.sh— which targets are installed and how to invoke each.<skill-directory>/scripts/delegate.sh— build, preview (--dry-run), and run one delegation.
Read references/TARGETS.md for the per-tool adapter matrix (flags, model syntax, output capture, the codex off-PATH gotcha, gemini-absent handling, and cost notes).
Non-negotiable output
- Name the target or stop. This is not a router. If the user did not name a target, ask which one; never choose or substitute a model. If the named target is not installed, stop and report how to install it — do not fall back to another CLI.
- Read-only by default. Only pass
--mode editwhen the user explicitly asked to allow changes, and only after they confirm. Never enable a tool's dangerous bypass flag (danger-full-access,--dangerously-*). - Confirm before executing. Always show the resolved command (via
--dry-run), the mode, the model, the working directory, and that it will spend the target's credits — then get explicit confirmation. - Warn on self-delegation. Delegating to the CLI you are already running in spawns a fresh nested session (extra cost, loop risk). Call it out and confirm before proceeding; never chain it.
- Never put secrets in the prompt. It is sent verbatim to a third-party CLI on its own billing.
- Report faithfully. State the target, model, mode, exit code, and whether output was truncated by a timeout. Do not claim success on a non-zero exit. After an edit-mode run, tell the user to review the working tree.
Phase 0: Resolve inputs
Determine these before doing anything, then echo them back:
- Target (required, explicit): one of
codex,opencode,claude,cursor,gemini,aider. If missing, ask — do not guess. - Prompt: the task to delegate. Prefer passing it to
delegate.shvia--stdinand a quoted heredoc (quote-proof for multi-line prompts with backticks, quotes, or$). - Model (
--model, optional): pass through to the target. Usedelegate.sh --to <target> --list-modelsto discover options when the user is unsure. - Mode (
--mode, default read-only):editonly when the user explicitly wants the delegate to change files. - Timeout (
--timeout, default 600s;0disables), JSON (--json, only if structured output is wanted), and working dir (--cwd, default the current directory). - Whether to save the delegate's output to a file (optional) or just summarize it in chat.
Phase 1: Check availability
Run <skill-directory>/scripts/detect-clis.sh. Confirm the target is installed and note its resolved
binary path (codex is commonly resolved from inside ChatGPT.app). If the target is not installed, stop
and give the install hint from the table. Do not substitute another model.
Phase 2: Self-delegation and safety check
If the target is the same CLI you are currently running in (Claude Code → claude, Codex → codex,
OpenCode → opencode), warn that this spawns a fresh nested session with extra cost and loop risk, and
get explicit confirmation. If --mode edit, state plainly that the run may modify files and spend
credits.
Phase 3: Build and confirm (the gate)
Run delegate.sh with --dry-run to get the exact resolved command. Present to the user: target,
binary, model, mode, working directory, timeout, and the command itself. Require explicit confirmation
before executing — especially for --mode edit and for self-delegation. Never run on the user's behalf
without it.
<skill-directory>/scripts/delegate.sh --to <target> [--model M] [--mode read-only|edit] \
[--json] [--cwd DIR] --dry-run --stdin <<'PROMPT'
<the task>
PROMPT
Phase 4: Execute and capture
After confirmation, re-run the same command without --dry-run. Capture stdout and the exit code.
delegate.sh returns the target's own exit code (or 124 on timeout, 3 if the target vanished). On
failure or timeout, report the error and any partial output — do not silently retry.
A real delegation often runs for minutes. If you are invoking delegate.sh from a host whose shell
has a short foreground timeout (e.g. an agent Bash tool that caps at ~120s), run it in the background
and poll for completion — a foreground shell will otherwise kill the delegate mid-task. Bound the run
with delegate.sh's own --timeout rather than relying on the caller's shell limit.
Phase 5: Summarize back
Present a concise, host-neutral summary: which target and model ran, the mode, the exit status and
duration, then the delegate's final answer (and the raw output or a saved-file path if the user asked
for it). Note explicitly if output was truncated by a timeout. If the run was in edit mode, remind the
user to review the working tree (e.g. git status / git diff) — this skill does not review or apply
the delegate's changes for you.