From my-skills
Delegates planning, implementation, and refactoring to Codex while Opus reviews. Helps reduce rework by keeping Opus as a reviewer/thinker only.
How this skill is triggered — by the user, by Claude, or both
Slash command
/my-skills:codexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The multi-tier subcontracting structure:
The multi-tier subcontracting structure:
人間 ←→ Opus ←→ Codex
Core principle: Opus only reads and thinks. It writes nothing but docs. Every hands-on artifact — the plan, the implementation, the refactor — is produced by Codex. Opus carries the human's intent down, reviews what comes back, and points out what's wrong; but the actual editing is always done by Codex, never by Opus.
Why this division:
The three hands-on stages, all delegated to Codex, all reviewed by Opus:
| Stage | Codex does | Opus does |
|---|---|---|
| Plan | Writes the plan — broad, deep, and short; token-efficient | Reviews as the critic ("ツッコミ役"); does not write the plan itself |
| Implementation | Writes the code via TDD | Reviews against the essence; does not hand-write the code |
| Refactor / cleanup | Applies the cleanup edits | Decides what to clean up and points it out; does not make the edits |
Opus writing the plan itself tends to over-dive into detail; staying the critic works better. Opus editing the cleanup itself tends to introduce mistakes; pointing out and letting Codex apply works better. The pattern is the same at every stage: Opus points, Codex edits.
Always carry the intent/essence down — that is the thing Codex is weakest at supplying for itself. Then add the stage-specific scope:
Delegate by invoking the codex CLI directly via Bash — this skill is
self-contained and does not call out to any external subagent. Run
Codex non-interactively with codex exec, passing a clear, specific
request. Never delegate vague requests ("fix this bug", "build the
feature", "make a plan", "clean this up"). Give Codex the essence and
the concrete scope so it executes thoroughly without drifting from the
point.
Base form (pass the prompt on stdin to avoid shell-quoting issues with long, multi-line instructions):
codex exec -s read-only -C <repo-dir> - <<'PROMPT'
<the essence + concrete scope>
PROMPT
Choose execution flags deliberately:
-s workspace-write for implementation and refactor work that edits
files. For review-purpose investigation, diagnosis, or research that
must not edit, keep the default -s read-only.run_in_background: true for large, open-ended, multi-step, or
long-running work. When unclear, prefer background.codex exec resume --last - <<'PROMPT' ... PROMPT. For
work that should start a new thread, use plain codex exec.
resume — -s/--sandbox and -C/--cd
are global options accepted by the top-level codex, not by the
resume subcommand (codex exec resume --help does not list them).
Put them before exec, e.g.
codex -C <repo-dir> -s workspace-write exec resume --last - <<'PROMPT' ... PROMPT.
Writing codex exec resume -s ... -C ... fails because resume does
not accept those flags. A resume thread does not reliably
inherit the previous run's sandbox mode, so pass -s explicitly when
the continuation needs write access — do not rely on inheritance or
fall back to a fresh thread just to get write access.-c model_reasoning_effort="<level>" where <level> is one
of none, minimal, low, medium, high, or xhigh.spark to
-m gpt-5.3-codex-spark.-C <repo-dir> so Codex operates in the
intended repository root.For refactor specifically: hand Codex the list of issues you found and have it apply the edits. Do not edit the files yourself.
For foreground runs, the result returns inline; no lifecycle management is needed.
For background runs, delegation is not fire-and-forget. Opus is
responsible for collecting and reviewing the result. When a codex exec
run is launched with run_in_background: true, the Bash tooling tracks
it as a background task — Opus is re-invoked when it exits, and uses the
standard task tools to manage its lifecycle:
TaskListTaskOutput <task-id>TaskStop <task-id>Capture each Codex run's last message to a file with
-o <path> (e.g. -o /tmp/codex-last.txt) so the result is easy to
read back after a long background run, and pass --json if you need to
inspect the event stream.
Whatever Codex returns is a draft, not an accepted change.
Opus's top review priority is root cause. No bandaids, no per-symptom carve-outs at sibling call sites, no local patch that leaves the broken state reachable. Take the long-term view: will a future caller re-reach the same state, and should the type system make that state impossible? Codex's "safe but dirty" output tends toward symptom-level fixes, so this is exactly what Opus must catch first.
Then interrogate the draft concretely:
This review step is exactly where Opus earns its place in the chain: Codex executes completely but can lose the thread and writes dirty code; Opus holds the thread and knows what clean looks like. If review finds problems, point them out and send them back to Codex to fix — don't fix them yourself.
Do not loop forever. If Opus sends a finding back to Codex and the same finding is still not fixed after a second round, stop re-delegating and switch tactics: change how the instruction is phrased, re-cut the scope, or question Opus's own premise.
Bring the Codex work through the normal TDD cycle:
Use the verify skill to confirm the result works with evidence.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub mizzy/my-skills --plugin my-skills