skills/codex/SKILL.md
Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex in scripts/automation, or when needing a second agent to work on a task in parallel.
npx skillsauth add sundial-org/skills codexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Codex is OpenAI's coding agent. Use codex exec to run it non-interactively from any cli agent.
Use Codex when:
codex exec review for PR/diff reviewsDo NOT use Codex for:
# Analysis (read-only, default)
codex exec "describe the architecture of this codebase"
# Allow file edits
codex exec --full-auto "fix the failing tests"
# Code review
codex exec review --uncommitted
codex exec review --base main
# Structured JSON output
codex exec --output-schema schema.json -o result.json "extract metadata"
# Continue previous session (inherits original sandbox settings)
codex exec resume --last "now add tests"
Progress goes to stderr, final result to stdout. To capture only the result:
codex exec "summarize the repo" 2>/dev/null > summary.txt
To see progress while capturing result:
codex exec "generate changelog" 2>&1 | tee output.txt
In non-interactive mode, no approval prompts are possible. Permissions must be set upfront:
| Mode | Flag | Behavior |
|------|------|----------|
| Read-only | (default) | Reads anywhere, writes/commands blocked |
| Workspace-write | --full-auto | Pre-approves edits and commands in workspace |
| Full access | --yolo | No restrictions. Use in isolated environments only |
Choose based on task:
--full-auto--yolo (dangerous)Note: ~/.codex/config.toml can set project trust levels that override defaults.
Default model is gpt-5.2-codex. Override with -m:
codex exec -m gpt-5 "explain this code"
By default, the user should already be authenticated. If not, set CODEX_API_KEY:
CODEX_API_KEY=sk-... codex exec "task"
Built-in review subcommand:
# Review uncommitted changes
codex exec review --uncommitted
# Review against a base branch
codex exec review --base main
# Review a specific commit
codex exec review --commit abc123
Use --output-schema for JSON output. Important: OpenAI requires additionalProperties: false on all object types.
codex exec --output-schema schema.json -o result.json "extract API endpoints"
Schema example:
{
"type": "object",
"properties": {
"name": { "type": "string" },
"endpoints": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"method": { "type": "string" }
},
"required": ["path", "method"],
"additionalProperties": false
}
}
},
"required": ["name", "endpoints"],
"additionalProperties": false
}
Resume continues a previous session, inheriting its sandbox settings:
# Start a task
codex exec --full-auto "implement rate limiter"
# Continue later (inherits --full-auto from original)
codex exec resume --last "add unit tests"
# Or resume by session ID
codex exec resume <SESSION_ID> "follow-up task"
Note: Cannot pass --full-auto to resume; it inherits from the original session.
For programmatic use, --json outputs structured events:
codex exec --json "analyze code" 2>/dev/null | jq -c 'select(.type == "item.completed")'
Complex tasks typically take 60-120+ seconds. Simple analysis tasks complete in 10-30 seconds.
tail -f <output_file> to monitor long-running background tasksBreak complex work into focused tasks:
# Good: Focused, single-purpose tasks
codex exec --full-auto "add star ratings to the skill cards"
codex exec --full-auto "add a search filter to the toolbar"
# Avoid: Multi-feature requests in one task
codex exec --full-auto "add ratings, search, filters, modal, and animations"
Avoid running multiple Codex sessions on the same file simultaneously. While it may work, concurrent edits risk merge conflicts or overwrites.
Files over ~2000 lines slow execution as Codex reads the entire file multiple times. Consider:
Common errors:
--full-auto.additionalProperties: false in schema objects.gpt-5.2-codex.Codex reads AGENTS.md files for project instructions:
~/.codex/AGENTS.md - Global defaults<repo>/AGENTS.md - Project-specific# AGENTS.md
- Run `npm test` after modifying JS files
- Use pnpm for dependencies
development
Data visualization design based on Stanford CS448B. Use for: (1) choosing chart types, (2) selecting visual encodings, (3) critiquing visualizations, (4) building D3.js visualizations, (5) designing interactions/animations, (6) choosing colors, (7) visualizing networks, (8) visualizing text. Covers Bertin, Mackinlay, Cleveland & McGill.
testing
Guidelines for creating high-quality datasets for LLM post-training (SFT/DPO/RLHF). Use when preparing data for fine-tuning, evaluating data quality, or designing data collection strategies.
development
Fine-tune LLMs using the Tinker API. Covers supervised fine-tuning, reinforcement learning, LoRA training, vision-language models, and both high-level Cookbook patterns and low-level API usage.
data-ai
Calculate training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.