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
- Collect and confirm required inputs.
- Resolve output path:
global → ~/.codex/agents/<name>.toml
project → <project>/.codex/agents/<name>.toml
- Create or update the file directly with required keys.
- Validate TOML parse and required keys.
- 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/
1---
2name: role-creator
3description: Create and update Codex custom agents using standalone custom-agent TOML files.
4metadata:
5 source: https://skillmd.com/skills/om-scogo/role-creator
6---
7
8# Role Creator
9
10## Overview
11
12Use this skill to author, update, or troubleshoot custom Codex agents as standalone TOML files.
13
14Current behavior:
15- Each custom agent is defined by one file:
16 - Global: `~/.codex/agents/<agent-name>.toml`
17 - Project: `<project>/.codex/agents/<agent-name>.toml`
18- The agent file is the role source of truth.
19- `~/.codex/config.toml` is only for global/runtime settings (for example `[agents]` thread limits), not per-role registration.
20
21## Non-Negotiable Inputs
22
23Step 1 is required before writing files:
24
25- `name` (role identifier used by `agent_type`)
26- `description` (short, human-readable purpose)
27- `developer_instructions`
28- `model` (recommend `gpt-5.3-codex` unless requested)
29- `model_reasoning_effort` (`none|minimal|low|medium|high|xhigh`)
30- role scope (`global` or `project`)
31- output TOML path (canonical absolute path preferred)
32- whether to include `nickname_candidates` and exact values
33
34Execution rule:
35- Do not infer required values.
36- Do not write until required inputs are explicitly confirmed.
37
38## Role file contract (current)
39
40From Codex custom agent docs (`/codex/subagents`):
41- Required keys: `name`, `description`, `developer_instructions`.
42- Optional keys: `nickname_candidates`, `model`, `model_reasoning_effort`, `sandbox_mode`, `web_search`, `mcp_servers`, `skills.config`, etc.
43- `name` is the spawn identifier and source of truth.
44- `description` + `developer_instructions` define behavior and usage boundaries.
45- `nickname_candidates` is optional and used only for display.
46
47`nickname_candidates` requirements:
48- Must be a non-empty list of unique values when present.
49- Allowed characters: ASCII letters, digits, spaces, hyphens, underscores.
50
51## Default policy for optional settings
52
53- Do not add sandboxing/MCP/web-search/model extras unless requested.
54- Keep generated files minimal by default.
55- If the user says "inherit defaults", omit optional keys instead of setting explicit values.
56
57## Workflow
58
591. Collect and confirm required inputs.
602. Resolve output path:
61 - `global` → `~/.codex/agents/<name>.toml`
62 - `project` → `<project>/.codex/agents/<name>.toml`
633. Create or update the file directly with required keys.
644. Validate TOML parse and required keys.
655. Return a ready-to-run example call:
66
67```json
68{"agent_type":"<name>","message":"<task>"}
69```
70
71## Commands
72
73```bash
74# 1) Write a standalone custom-agent file
75/home/willr/Applications/skills/skills/role-creator/scripts/write_role_config.sh \
76 --output ~/.codex/agents/reviewer.toml \
77 --role-name reviewer \
78 --description "PR reviewer focused on correctness, security, and risk." \
79 --model gpt-5.4 \
80 --reasoning high \
81 --developer-instructions "Review code like an owner. Lead with concrete findings and residual risks."
82
83# Optional: include nickname candidates for display
84/home/willr/Applications/skills/skills/role-creator/scripts/write_role_config.sh \
85 --output ~/.codex/agents/reviewer.toml \
86 --role-name reviewer \
87 --description "PR reviewer focused on correctness, security, and risk." \
88 --model gpt-5.4 \
89 --reasoning high \
90 --developer-instructions "Review code like an owner. Lead with concrete findings and residual risks." \
91 --nickname-candidates "Atlas,Delta,Echo" \
92 --sandbox-mode read-only \
93 --web-search disabled
94```
95
96## Guardrails
97
98- If runtime returns `unknown agent_type`, verify the active scope and confirm the file exists at the expected path.
99- Check syntax first with `tomlq` or `tomlq -C`.
100- Keep role instructions operational and narrowly scoped to avoid drift.
101
102## References
103
104- Codex subagents docs: `https://developers.openai.com/codex/subagents`
105- Display nicknames: `https://developers.openai.com/codex/subagents#display-nicknames`
106- Reusable templates: `templates/`