It does not create the skills an agent references -- for that, use skill-creator; agent-creator only wires the agent TOML and workflow around skills that already exist or are created alongside it. It also does not define hooks -- those live in the plugin's hooks/hooks.json, never in the agent file.
Agent Creator
Agent Workflow (MANDATORY)
Before ANY agent creation, delegate via spawn_agent — spawn 2 agents in parallel (single message, two spawn_agent calls). A Codex agent TOML has no tool-list field of its own — tool access is governed by sandbox_mode, not a per-agent list — so any internal delegation a generated agent performs must itself read as spawn_agent by bare agent name, never a Claude-style team-spawn primitive:
- explore-codebase - Check existing agents, analyze patterns
- research-expert - Fetch latest agent conventions
mcp__context7__query-docs is a direct MCP call, not a spawned agent — invoke it directly (alongside the 2 spawn_agent calls) to get examples from existing agents.
After creation, run bun test scripts/lib/agent-toml.test.ts then sniper for validation.
Overview
| Action |
When to Use |
| New Agent |
New domain/framework expert needed |
| Adapt |
Copy from similar agent (Next.js → React) |
| Update |
Add skills, change model tier |
Critical Rules
- Unique kebab-case
name - matches the filename, is what spawn_agent targets
- Complete TOML -
name; description with a Use when… / Do NOT use for… routing pattern; model as an explicit tier from the Model Tier Matrix below (never the bare gpt-5.6 alias) with a matching model_reasoning_effort; sandbox_mode; nickname_candidates ASCII-only, non-empty, no duplicates (Codex silently drops the whole agent otherwise — it never becomes spawnable); developer_instructions covering every section in required-sections.md, including the "Inherited rules (from AGENTS.md)" block
- Hooks belong to the plugin, not the agent -
plugins/<plugin>/hooks/hooks.json; there is no hooks field on a Codex agent
- Validate -
bun test scripts/lib/agent-toml.test.ts (checks the model matrix and agentRoleViolations), then sniper
- Internal delegation - every
developer_instructions describes delegation as spawn_agent calls by name; never a generic agent when a domain expert exists
Architecture
plugins/<plugin-name>/
├── agents/
│ └── <agent-name>.toml # Agent definition (TOML, not Markdown)
├── skills/
│ ├── skill-a/
│ └── solid-[stack]/
├── hooks/
│ └── hooks.json # Plugin-level Pre/Post tool validation
└── .codex-plugin/
└── plugin.json
→ See architecture.md for details
Reference Guide
Concepts
| Topic |
Reference |
When to Consult |
| Architecture |
architecture.md |
Understanding agent structure |
| Frontmatter / TOML fields |
frontmatter.md |
name, description, model, model_reasoning_effort, sandbox_mode, nickname_candidates, [[skills.config]] |
| Required Sections |
required-sections.md |
Mandatory developer_instructions content, incl. Inherited rules |
| Hooks |
hooks.md |
plugins/<plugin>/hooks/hooks.json Pre/Post tool validation |
| Registration |
registration.md |
Adding a brand-new plugin to the marketplace — not a per-agent step, agents/*.toml is auto-discovered |
Templates
| Template |
When to Use |
| agent-template.md |
Creating a new agent (TOML format) |
| agent-template-examples.md |
Worked Codex TOML agent examples (Next.js, Laravel) — abbreviated from the real shipped files |
| hook-scripts.md |
Porting check logic into *.native.ts hook entries — hooks.json only calls the Harness route |
| hook-scripts-reference.md |
Check-logic reference scripts (SOLID size/interface rules) to port into native-TS Codex hook entries |
| hook-scripts-reference-2.md |
Check-logic reference scripts (Swift SOLID, skill-read tracker) — continued from hook-scripts-reference.md |
Model Tier Matrix
Choose the tier explicitly — never the bare gpt-5.6 alias. Full rationale: docs/reference/creating-skills-agents.md (model policy section).
| Profile |
Use for |
Reasoning effort |
gpt-5.6-terra |
The 12 framework/stack experts (astro, go, laravel, nextjs, php, react, rust, shadcn-ui, swift, tailwindcss, tanstack-start, typescript) + 3 volume read/search agents added 2026-09-02 (explore-codebase, research-expert, websearch) — 15 total |
medium |
gpt-5.6-sol |
15 orchestration/release/validation/prompt-design agents (brainstorming, solid-orchestrator, commit, changelog-watcher, lessons-compactor, seo-expert, seo-content, seo-geo, seo-local, seo-cluster, seo-technical, seo-schema, sniper, prompt-engineer, challenger) |
medium |
gpt-5.6-sol |
Highest-judgment gates (design-expert, security-expert) |
high |
gpt-5.6-luna |
Bounded, deterministic, mechanical work with a strict, verifiable contract (sniper-faster, commit-detector, cartographer, seo-images, seo-sitemap) |
max |
Terra/medium (Terra's default effort) is the executor tier for the 12 framework experts: a 15-run codex exec 0.152.1 benchmark on 2026-09-02 (3 bounded coding tasks × 5 configs, hidden tests) passed every test on every tier while Terra medium was 1.7x faster and half the cost of Sol medium, and a 6-run repetition passed 6/6. Later the same day, owner decision "passe en terra medium" added explore-codebase, research-expert, and websearch to Terra/medium too — this trio is volume/read work (doc lookup, web search, codebase exploration), NOT covered by the coding-task benchmark; the known Terra risk below is unverified rather than measured for these three. Until 2026-09-02, Sol kept 3 judgment gates at high (challenger, security-expert, plus design-expert at xhigh); two same-day owner decisions ("seul le designer en high", then "security-expert en high") retired Sol xhigh fleet-wide and left exactly 2 agents at Sol/high — design-expert and security-expert — while challenger joined Sol/medium. Sol/medium also holds the analysis/orchestration agents and the coordinator session stays Sol high; Luna max keeps the 5 mechanical agents. sniper moved to Sol/medium on 2026-09-02 (owner decision): it validates code with tooling and tests, where the benchmark showed medium equal to high. prompt-engineer — previously a Sol/high judgment gate alongside challenger and security-expert — also moved to Sol/medium the same day (owner decision: "il est assez intelligent"), joining the analysis/research/coordination agents. Known risk: openai/codex#32389 (Terra intermittently returns an empty final response after tool use) is still open — the coordinator's on-disk PRD check plus the challenger and sniper gates turn it into a retry, never a silent bad merge; for the 3 volume agents, the same-day mitigation is procedural: a research/exploration agent whose final report is empty or truncated is relaunched immediately with the same brief, never accepted as "nothing found" (see plugins/ai-pilot/skills/lead-orchestration/SKILL.md and plugins/codex-rules/rules/03-agent-teams.md).
Quick Reference
Create New Agent
# 1. Research existing agents
→ explore-codebase + research-expert
# 2. Create the TOML
touch plugins/<plugin>/agents/<agent-name>.toml
# 3. Add/confirm plugins/<plugin>/hooks/hooks.json (never inside the agent TOML)
# 4. Validate
bun test scripts/lib/agent-toml.test.ts
→ sniper
Adapt Existing Agent
# 1. Copy similar agent
cp plugins/nextjs-expert/agents/nextjs-expert.toml plugins/new-plugin/agents/new-expert.toml
# 2. Adapt with sed
sed -i '' "s/nextjs/newstack/g; s/Next\.js/NewStack/g" agents/new-expert.toml
# 3. Update skills.config paths, model tier, nickname_candidates
Validation Checklist
Related: Skill Creator
When creating an agent, you often need to create skills too.
Use skill-creator to create skills for the agent:
| Scenario |
Action |
| New agent needs skills |
Create skills with skill-creator first |
| Agent references skills |
Ensure skills exist in skills/ |
| Adapting agent |
Adapt related skills too |
Best Practices
DO
- Use skill-creator for associated skills
- Reference the solid-[stack] skill for SOLID rules
- Include Gemini Design guidance inside
developer_instructions for UI agents
- Pick model + reasoning effort from the Model Tier Matrix, never guess
DON'T
- Write in French (English only)
- Skip the Agent Workflow section inside
developer_instructions
- Put a hooks table, a tool list, or a display color on the agent TOML
- Create an agent without its skills
- Assign the bare
gpt-5.6 alias, or put a judgment role (design-expert, security-expert at Sol/high; challenger, sniper, prompt-engineer at Sol/medium) on Terra or Luna
1---2name: agent-creator-23description: Use when creating expert agents. Generates agent.toml (model tier, sandbox_mode, developer_instructions with required sections) and wires skill references.4---56<objective>7Agent Creator scaffolds a complete Codex expert agent: `plugins/<plugin>/agents/<name>.toml` (`name`, `description`, `model` tier + `model_reasoning_effort`, `sandbox_mode`, `nickname_candidates`, `developer_instructions`), the mandatory Agent Workflow section inside `developer_instructions`, and skill wiring via `[[skills.config]]`. It covers three flows -- creating a brand-new domain/framework expert, adapting an existing agent to a new stack, and updating an agent's skills or model tier -- each ending with `bun test scripts/lib/agent-toml.test.ts` and a `sniper` pass.89It does not create the skills an agent references -- for that, use `skill-creator`; agent-creator only wires the agent TOML and workflow around skills that already exist or are created alongside it. It also does not define hooks -- those live in the plugin's `hooks/hooks.json`, never in the agent file.10</objective>1112# Agent Creator1314## Agent Workflow (MANDATORY)1516Before ANY agent creation, delegate via `spawn_agent` — spawn 2 agents in parallel (single message, two `spawn_agent` calls). A Codex agent TOML has no tool-list field of its own — tool access is governed by `sandbox_mode`, not a per-agent list — so any internal delegation a generated agent performs must itself read as `spawn_agent` by bare agent name, never a Claude-style team-spawn primitive:17181. **explore-codebase** - Check existing agents, analyze patterns192. **research-expert** - Fetch latest agent conventions2021`mcp__context7__query-docs` is a direct MCP call, not a spawned agent — invoke it directly (alongside the 2 `spawn_agent` calls) to get examples from existing agents.2223After creation, run `bun test scripts/lib/agent-toml.test.ts` then **sniper** for validation.2425---2627## Overview2829| Action | When to Use |30|--------|-------------|31| **New Agent** | New domain/framework expert needed |32| **Adapt** | Copy from similar agent (Next.js → React) |33| **Update** | Add skills, change model tier |3435---3637## Critical Rules38391. **Unique kebab-case `name`** - matches the filename, is what `spawn_agent` targets402. **Complete TOML** - `name`; `description` with a `Use when… / Do NOT use for…` routing pattern; `model` as an explicit tier from the Model Tier Matrix below (never the bare `gpt-5.6` alias) with a matching `model_reasoning_effort`; `sandbox_mode`; `nickname_candidates` ASCII-only, non-empty, no duplicates (Codex silently drops the whole agent otherwise — it never becomes spawnable); `developer_instructions` covering every section in [required-sections.md](references/required-sections.md), including the "Inherited rules (from AGENTS.md)" block413. **Hooks belong to the plugin, not the agent** - `plugins/<plugin>/hooks/hooks.json`; there is no hooks field on a Codex agent424. **Validate** - `bun test scripts/lib/agent-toml.test.ts` (checks the model matrix and `agentRoleViolations`), then **sniper**435. **Internal delegation** - every `developer_instructions` describes delegation as `spawn_agent` calls by name; never a generic agent when a domain expert exists4445---4647## Architecture4849```50plugins/<plugin-name>/51├── agents/52│ └── <agent-name>.toml # Agent definition (TOML, not Markdown)53├── skills/54│ ├── skill-a/55│ └── solid-[stack]/56├── hooks/57│ └── hooks.json # Plugin-level Pre/Post tool validation58└── .codex-plugin/59 └── plugin.json60```6162→ See [architecture.md](references/architecture.md) for details6364---6566## Reference Guide6768### Concepts6970| Topic | Reference | When to Consult |71|-------|-----------|-----------------|72| **Architecture** | [architecture.md](references/architecture.md) | Understanding agent structure |73| **Frontmatter / TOML fields** | [frontmatter.md](references/frontmatter.md) | `name`, `description`, `model`, `model_reasoning_effort`, `sandbox_mode`, `nickname_candidates`, `[[skills.config]]` |74| **Required Sections** | [required-sections.md](references/required-sections.md) | Mandatory `developer_instructions` content, incl. Inherited rules |75| **Hooks** | [hooks.md](references/hooks.md) | `plugins/<plugin>/hooks/hooks.json` Pre/Post tool validation |76| **Registration** | [registration.md](references/registration.md) | Adding a brand-new plugin to the marketplace — not a per-agent step, `agents/*.toml` is auto-discovered |7778### Templates7980| Template | When to Use |81|----------|-------------|82| [agent-template.md](references/templates/agent-template.md) | Creating a new agent (TOML format) |83| [agent-template-examples.md](references/templates/agent-template-examples.md) | Worked Codex TOML agent examples (Next.js, Laravel) — abbreviated from the real shipped files |84| [hook-scripts.md](references/templates/hook-scripts.md) | Porting check logic into `*.native.ts` hook entries — hooks.json only calls the Harness route |85| [hook-scripts-reference.md](references/templates/hook-scripts-reference.md) | Check-logic reference scripts (SOLID size/interface rules) to port into native-TS Codex hook entries |86| [hook-scripts-reference-2.md](references/templates/hook-scripts-reference-2.md) | Check-logic reference scripts (Swift SOLID, skill-read tracker) — continued from hook-scripts-reference.md |8788---8990## Model Tier Matrix9192Choose the tier explicitly — never the bare `gpt-5.6` alias. Full rationale: `docs/reference/creating-skills-agents.md` (model policy section).9394| Profile | Use for | Reasoning effort |95|---------|---------|-------------------|96| `gpt-5.6-terra` | The 12 framework/stack experts (astro, go, laravel, nextjs, php, react, rust, shadcn-ui, swift, tailwindcss, tanstack-start, typescript) + 3 volume read/search agents added 2026-09-02 (`explore-codebase`, `research-expert`, `websearch`) — 15 total | `medium` |97| `gpt-5.6-sol` | 15 orchestration/release/validation/prompt-design agents (brainstorming, solid-orchestrator, commit, changelog-watcher, lessons-compactor, seo-expert, seo-content, seo-geo, seo-local, seo-cluster, seo-technical, seo-schema, sniper, prompt-engineer, challenger) | `medium` |98| `gpt-5.6-sol` | Highest-judgment gates (`design-expert`, `security-expert`) | `high` |99| `gpt-5.6-luna` | Bounded, deterministic, mechanical work with a strict, verifiable contract (`sniper-faster`, `commit-detector`, `cartographer`, `seo-images`, `seo-sitemap`) | `max` |100101Terra/`medium` (Terra's default effort) is the executor tier for the 12 framework experts: a 15-run `codex exec` 0.152.1 benchmark on 2026-09-02 (3 bounded coding tasks × 5 configs, hidden tests) passed every test on every tier while Terra medium was 1.7x faster and half the cost of Sol medium, and a 6-run repetition passed 6/6. Later the same day, owner decision "passe en terra medium" added `explore-codebase`, `research-expert`, and `websearch` to Terra/medium too — this trio is volume/read work (doc lookup, web search, codebase exploration), NOT covered by the coding-task benchmark; the known Terra risk below is unverified rather than measured for these three. Until 2026-09-02, Sol kept 3 judgment gates at `high` (`challenger`, `security-expert`, plus `design-expert` at `xhigh`); two same-day owner decisions ("seul le designer en high", then "security-expert en high") retired Sol `xhigh` fleet-wide and left exactly 2 agents at Sol/high — `design-expert` and `security-expert` — while `challenger` joined Sol/medium. Sol/medium also holds the analysis/orchestration agents and the coordinator session stays Sol high; Luna `max` keeps the 5 mechanical agents. `sniper` moved to Sol/medium on 2026-09-02 (owner decision): it validates code with tooling and tests, where the benchmark showed medium equal to high. `prompt-engineer` — previously a Sol/high judgment gate alongside `challenger` and `security-expert` — also moved to Sol/medium the same day (owner decision: "il est assez intelligent"), joining the analysis/research/coordination agents. Known risk: openai/codex#32389 (Terra intermittently returns an empty final response after tool use) is still open — the coordinator's on-disk PRD check plus the challenger and sniper gates turn it into a retry, never a silent bad merge; for the 3 volume agents, the same-day mitigation is procedural: a research/exploration agent whose final report is empty or truncated is relaunched immediately with the same brief, never accepted as "nothing found" (see `plugins/ai-pilot/skills/lead-orchestration/SKILL.md` and `plugins/codex-rules/rules/03-agent-teams.md`).102103---104105## Quick Reference106107### Create New Agent108109```bash110# 1. Research existing agents111→ explore-codebase + research-expert112113# 2. Create the TOML114touch plugins/<plugin>/agents/<agent-name>.toml115116# 3. Add/confirm plugins/<plugin>/hooks/hooks.json (never inside the agent TOML)117118# 4. Validate119bun test scripts/lib/agent-toml.test.ts120→ sniper121```122123### Adapt Existing Agent124125```bash126# 1. Copy similar agent127cp plugins/nextjs-expert/agents/nextjs-expert.toml plugins/new-plugin/agents/new-expert.toml128129# 2. Adapt with sed130sed -i '' "s/nextjs/newstack/g; s/Next\.js/NewStack/g" agents/new-expert.toml131132# 3. Update skills.config paths, model tier, nickname_candidates133```134135---136137## Validation Checklist138139- [ ] `name` unique, kebab-case, matches the filename140- [ ] `description` follows `Use when… / Do NOT use for…`141- [ ] `model` is an explicit tier from the Model Tier Matrix, with a matching `model_reasoning_effort`142- [ ] `sandbox_mode` set (`read-only` / `workspace-write` / `danger-full-access`)143- [ ] `nickname_candidates` non-empty, ASCII, no duplicates144- [ ] `developer_instructions` covers every [required-sections.md](references/required-sections.md) section, incl. Inherited rules (from AGENTS.md)145- [ ] No hooks, tool-list, or display-color key on the agent TOML146- [ ] Every `[[skills.config]]` `path` resolves on disk147- [ ] `bun test scripts/lib/agent-toml.test.ts` passes148- [ ] `sniper` reports zero errors149150---151152## Related: Skill Creator153154**When creating an agent, you often need to create skills too.**155156Use **`skill-creator`** to create skills for the agent:157158| Scenario | Action |159|----------|--------|160| New agent needs skills | Create skills with skill-creator first |161| Agent references skills | Ensure skills exist in skills/ |162| Adapting agent | Adapt related skills too |163164---165166## Best Practices167168### DO169- Use skill-creator for associated skills170- Reference the solid-[stack] skill for SOLID rules171- Include Gemini Design guidance inside `developer_instructions` for UI agents172- Pick model + reasoning effort from the Model Tier Matrix, never guess173174### DON'T175- Write in French (English only)176- Skip the Agent Workflow section inside `developer_instructions`177- Put a hooks table, a tool list, or a display color on the agent TOML178- Create an agent without its skills179- Assign the bare `gpt-5.6` alias, or put a judgment role (design-expert, security-expert at Sol/high; challenger, sniper, prompt-engineer at Sol/medium) on Terra or Luna