PluginBench
Skill
Review
Audit score 70

role-creator

am-will/codex-skills

Create and manage custom Codex agents via standalone TOML configuration files.

What is role-creator?

This skill lets you author, update, and troubleshoot custom Codex agents as standalone TOML files stored in global or project-level `.codex/agents/` directories. Use it when you need to define agent behavior, model selection, reasoning effort, and optional features like sandboxing or web search.

  • Define custom agents with required fields: name, description, and developer_instructions
  • Set model and reasoning effort (none|minimal|low|medium|high|xhigh) for agent behavior
  • Optionally configure nickname_candidates, sandbox_mode, web_search, and MCP servers
  • Store agents globally (~/.codex/agents/) or per-project (.codex/agents/)
  • Validate TOML syntax and required keys before deployment
  • Generate ready-to-run agent invocation examples

How to install role-creator

npx skills add https://github.com/am-will/codex-skills --skill role-creator
Prerequisites
  • Codex installation and access to ~/.codex/ directory
  • TOML validation tools (tomlq recommended for syntax checking)
  • Explicit confirmation of required inputs before file creation
Claude Code
Cursor
Windsurf
Cline

How to use role-creator

  1. 1.Gather required inputs: agent name, description, developer_instructions, model, and reasoning_effort
  2. 2.Confirm whether the agent is global or project-scoped and provide the output path
  3. 3.Specify optional settings (nickname_candidates, sandbox_mode, web_search, MCP servers) if needed
  4. 4.Run the write_role_config.sh script with your parameters
  5. 5.Validate the generated TOML file using tomlq
  6. 6.Invoke the agent using the returned JSON example with agent_type and message

Use cases

Good for
  • Create a specialized PR reviewer agent with high reasoning effort for security-focused code review
  • Set up a project-specific agent with custom instructions and sandbox restrictions for isolated execution
  • Define multiple agent variants with different models and reasoning levels for different task types
  • Update existing agent configurations without manual TOML editing
  • Establish reusable agent templates for team standardization
Who it's for
  • Codex users building custom agents for specialized workflows
  • Development teams standardizing agent behavior across projects
  • Engineers automating code review, testing, or documentation tasks
  • Anyone managing multiple agent configurations

role-creator FAQ

What are the required fields for a custom agent?

name (role identifier), description (short purpose), and developer_instructions (behavior definition). model and model_reasoning_effort are optional but recommended.

Where are custom agent files stored?

Global agents go in ~/.codex/agents/<agent-name>.toml; project agents go in <project>/.codex/agents/<agent-name>.toml. The agent file is the source of truth, not ~/.codex/config.toml.

What characters are allowed in nickname_candidates?

Only ASCII letters, digits, spaces, hyphens, and underscores. Values must be unique and non-empty when the field is present.

Should I set optional features like sandbox_mode or web_search by default?

No. Keep generated files minimal by default and only add optional keys when explicitly requested.

How do I invoke a custom agent after creating it?

Use the JSON format {"agent_type":"<name>","message":"<task>"} where <name> matches the agent's name field.

Full instructions (SKILL.md)

Source of truth, from am-will/codex-skills.


name: role-creator description: Create and update Codex custom agents using standalone custom-agent TOML files.

Role Creator

Overview

Use this skill to author, update, or troubleshoot custom Codex agents as standalone TOML files.

Current behavior:

  • Each custom agent is defined by one file:
    • Global: ~/.codex/agents/<agent-name>.toml
    • Project: <project>/.codex/agents/<agent-name>.toml
  • The agent file is the role source of truth.
  • ~/.codex/config.toml is only for global/runtime settings (for example [agents] thread limits), not per-role registration.

Non-Negotiable Inputs

Step 1 is required before writing files:

  • name (role identifier used by agent_type)
  • description (short, human-readable purpose)
  • developer_instructions
  • model (recommend gpt-5.3-codex unless requested)
  • model_reasoning_effort (none|minimal|low|medium|high|xhigh)
  • role scope (global or project)
  • output TOML path (canonical absolute path preferred)
  • whether to include nickname_candidates and exact values

Execution rule:

  • Do not infer required values.
  • Do not write until required inputs are explicitly confirmed.

Role file contract (current)

From Codex custom agent docs (/codex/subagents):

  • Required keys: name, description, developer_instructions.
  • Optional keys: nickname_candidates, model, model_reasoning_effort, sandbox_mode, web_search, mcp_servers, skills.config, etc.
  • name is the spawn identifier and source of truth.
  • description + developer_instructions define behavior and usage boundaries.
  • nickname_candidates is optional and used only for display.

nickname_candidates requirements:

  • Must be a non-empty list of unique values when present.
  • Allowed characters: ASCII letters, digits, spaces, hyphens, underscores.

Default policy for optional settings

  • Do not add sandboxing/MCP/web-search/model extras unless requested.
  • Keep generated files minimal by default.
  • If the user says "inherit defaults", omit optional keys instead of setting explicit values.

Workflow

  1. Collect and confirm required inputs.
  2. Resolve output path:
    • global → ~/.codex/agents/<name>.toml
    • project → <project>/.codex/agents/<name>.toml
  3. Create or update the file directly with required keys.
  4. Validate TOML parse and required keys.
  5. Return a ready-to-run example call:
{"agent_type":"<name>","message":"<task>"}

Commands

# 1) Write a standalone custom-agent file
/home/willr/Applications/skills/skills/role-creator/scripts/write_role_config.sh \
  --output ~/.codex/agents/reviewer.toml \
  --role-name reviewer \
  --description "PR reviewer focused on correctness, security, and risk." \
  --model gpt-5.4 \
  --reasoning high \
  --developer-instructions "Review code like an owner. Lead with concrete findings and residual risks."

# Optional: include nickname candidates for display
/home/willr/Applications/skills/skills/role-creator/scripts/write_role_config.sh \
  --output ~/.codex/agents/reviewer.toml \
  --role-name reviewer \
  --description "PR reviewer focused on correctness, security, and risk." \
  --model gpt-5.4 \
  --reasoning high \
  --developer-instructions "Review code like an owner. Lead with concrete findings and residual risks." \
  --nickname-candidates "Atlas,Delta,Echo" \
  --sandbox-mode read-only \
  --web-search disabled

Guardrails

  • If runtime returns unknown agent_type, verify the active scope and confirm the file exists at the expected path.
  • Check syntax first with tomlq or tomlq -C.
  • Keep role instructions operational and narrowly scoped to avoid drift.

References

  • Codex subagents docs: https://developers.openai.com/codex/subagents
  • Display nicknames: https://developers.openai.com/codex/subagents#display-nicknames
  • Reusable templates: templates/