Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Meta-skill for routing tasks to the right skills before any action, response, or implementation work begins.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
codex-tools.md
1# Codex Tool Mapping23Skills use Claude Code tool names. When you encounter these in a skill, use your platform equivalent:45| Skill references | Codex equivalent |6|-----------------|------------------|7| `Task` tool (dispatch subagent) | `spawn_agent` (see [Named agent dispatch](#named-agent-dispatch)) |8| Multiple `Task` calls (parallel) | Multiple `spawn_agent` calls |9| Task returns result | `wait` |10| Task completes automatically | `close_agent` to free slot |11| `TodoWrite` (task tracking) | `update_plan` |12| `Skill` tool (invoke a skill) | Skills load natively — just follow the instructions |13| `Read`, `Write`, `Edit` (files) | Use your native file tools |14| `Bash` (run commands) | Use your native shell tools |1516## Subagent dispatch requires multi-agent support1718Add to your Codex config (`~/.codex/config.toml`):1920```toml21[features]22multi_agent = true23```2425This enables `spawn_agent`, `wait`, and `close_agent` for skills like `dispatching-parallel-agents` and `subagent-driven-development`.2627## Named agent dispatch2829Claude Code skills reference named agent types like `superpowers:code-reviewer`.30Codex does not have a named agent registry — `spawn_agent` creates generic agents31from built-in roles (`default`, `explorer`, `worker`).3233When a skill says to dispatch a named agent type:34351. Find the agent's prompt file (e.g., `agents/code-reviewer.md` or the skill's36local prompt template like `code-quality-reviewer-prompt.md`)372. Read the prompt content383. Fill any template placeholders (`{BASE_SHA}`, `{WHAT_WAS_IMPLEMENTED}`, etc.)394. Spawn a `worker` agent with the filled content as the `message`4041| Skill instruction | Codex equivalent |42|-------------------|------------------|43| `Task tool (superpowers:code-reviewer)` | `spawn_agent(agent_type="worker", message=...)` with `code-reviewer.md` content |44| `Task tool (general-purpose)` with inline prompt | `spawn_agent(message=...)` with the same prompt |4546### Message framing4748The `message` parameter is user-level input, not a system prompt. Structure it49for maximum instruction adherence:5051```52Your task is to perform the following. Follow the instructions below exactly.5354<agent-instructions>55[filled prompt content from the agent's .md file]56</agent-instructions>5758Execute this now. Output ONLY the structured response following the format59specified in the instructions above.60```6162- Use task-delegation framing ("Your task is...") rather than persona framing ("You are...")63- Wrap instructions in XML tags — the model treats tagged blocks as authoritative64- End with an explicit execution directive to prevent summarization of the instructions6566### When this workaround can be removed6768This approach compensates for Codex's plugin system not yet supporting an `agents`69field in `plugin.json`. When `RawPluginManifest` gains an `agents` field, the70plugin can symlink to `agents/` (mirroring the existing `skills/` symlink) and71skills can dispatch named agent types directly.7273## Environment Detection7475Skills that create worktrees or finish branches should detect their76environment with read-only git commands before proceeding:7778```bash79GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)80GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)81BRANCH=$(git branch --show-current)82```8384- `GIT_DIR != GIT_COMMON` → already in a linked worktree (skip creation)85- `BRANCH` empty → detached HEAD (cannot branch/push/PR from sandbox)8687See `using-git-worktrees` Step 0 and `finishing-a-development-branch`88Step 1 for how each skill uses these signals.8990## Codex App Finishing9192When the sandbox blocks branch/push operations (detached HEAD in an93externally managed worktree), the agent commits all work and informs94the user to use the App's native controls:9596- **"Create branch"** — names the branch, then commit/push/PR via App UI97- **"Hand off to local"** — transfers work to the user's local checkout9899The agent can still run tests, stage files, and output suggested branch100names, commit messages, and PR descriptions for the user to copy.101