agentsclimarketplace

Codex delegation

Skill em411/supercodex/skills/codex-delegation

Internal contract for delegating implementation work to Codex GPT-5.6 models - model tiering, preflight, dispatch rules, fix cycles, failure fallback, and ledger requirementsFrom its SKILL.md

Install
npx -y skills add em411/supercodex --skill codex-delegation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 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.

SKILL.md

4.6 KB, as published. Nobody here has run it

Codex Delegation

This is the orchestrator-side contract for every Codex delegation in supercodex. Workflow skills (subagent-driven-development, executing-plans, systematic-debugging) reference this skill instead of restating these rules.

Model tiering (single source of truth)

Task classModel--effort
Complex implementation, debugging, rescuegpt-5.6-solhigh
Standard plan tasksgpt-5.6-terrahigh
Mechanical work (renames, boilerplate, config edits, doc moves)gpt-5.6-lunamedium

Classify each task before dispatch:

  • Mechanical: the plan step is fully prescriptive — exact content or commands given, no design judgment needed. → luna.
  • Complex: novel algorithms, cross-cutting changes, debugging an unknown fault, tasks a reviewer previously bounced twice. → sol.
  • Everything else → terra.

The orchestrator chooses the tier. The codex-implementer agent never picks models itself.

Preflight (once per session, before the first delegation)

Run:

node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" setup --json

Healthy: exit code 0 and the JSON reports the Codex CLI present and authenticated. Unhealthy (non-zero exit, error output, CLI missing, unauthenticated): tell the user Codex is unavailable and why — suggest running supercodex:setup for guided fixes — then enter fallback mode for the rest of the session (see below). Do not re-run preflight per task.

If the JSON reports supportsGpt56: false, the CLI is too old for the tiering models: warn the user once (upgrade command is in nextSteps), then dispatch without --model so Codex uses its supported default — stay on Codex rather than falling back, and record the actual model in the ledger.

Dispatching a task

  • Always dispatch through the supercodex:codex-implementer agent — never call the runtime from the orchestrator directly. The wrapper keeps Codex transcripts out of your context.
  • Give the wrapper: the complete task prompt (composed per supercodex:codex-prompting), plus exact flags: --model, --effort, and --background when the task is open-ended, multi-step, or likely to run long. Small, clearly bounded tasks run foreground.
  • Every dispatch is write-capable; read-only delegation is not used in supercodex (Claude does its own reading). Choose the write mode:
    • --full-access (default for local development repos and worktrees the user owns): Codex runs without sandbox restrictions, so it can commit its own work and spawn test processes. Expect commits in the implementer's report.
    • --write (restricted sandbox): use when the workspace is untrusted or the user asks for containment. Codex's sandbox mounts .git read-only and may block nested process spawning — in this mode YOU make the commits after independently re-running the task's tests, and note the workaround in the ledger.

Fix cycles

When a Claude reviewer returns Critical/Important findings on a Codex task, dispatch a new codex-implementer call with --resume-last and ONLY the delta instructions (the findings and what to change). The Codex session retains its own context; do not restate the whole task.

Reading results

The wrapper returns the runtime's stdout unchanged. Treat it as:

  • Success: a summary of what Codex did plus its change/verification report. Proceed to review.
  • Failure: empty output, an error report, or output showing Codex made no changes for a task that required them.

Failure & fallback ladder

  1. First failure: retry once — --resume-last if a Codex session exists for this task, otherwise a fresh dispatch.
  2. Second failure: fall back to Claude. Dispatch a classic implementer subagent using skills/subagent-driven-development/implementer-prompt.md with the same task brief. Announce the substitution to the user in one line ("Codex unavailable/failed for Task N — implemented by Claude subagent") and record it in the ledger.
  3. Usage-limit errors count as failures. Preflight failure puts the whole session in fallback mode: skip the ladder and dispatch Claude implementers directly (still announced once).

Work never stalls silently, and the user always knows which model wrote what.

Ledger

For every task, the progress ledger records: implementing model (gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna / claude-fallback), effort, and the number of fix cycles.

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.