plugins/codex-skill/skills/codex-skill/SKILL.md
Leverage OpenAI Codex/GPT models for autonomous code implementation. Triggers: "codex", "use gpt", "gpt-5", "let openai", "full-auto", "用codex", "让gpt实现". Use this skill whenever the user wants to delegate coding tasks to OpenAI models, run code reviews via codex, or execute tasks in a sandboxed environment.
npx skillsauth add feiskyer/claude-code-settings codex-skillInstall 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.
You are operating in codex exec - a non-interactive automation mode for hands-off task execution.
Before using this skill, ensure Codex CLI is installed and configured:
Installation verification:
codex --version
First-time setup: If not installed, guide the user to install Codex CLI with command npm i -g @openai/codex or brew install codex.
Codex uses sandbox policies to control what operations are permitted:
Read-Only Mode (Default)
codex execWorkspace-Write Mode (Recommended for Programming)
--full-auto or -s workspace-write to enable file editingDanger-Full-Access Mode
-s danger-full-accessCodex uses the model configured in ~/.codex/config.toml by default. Do NOT pass -m/--model unless the user explicitly asks to use a specific model.
# Default: uses model from config.toml (recommended)
codex exec --full-auto "refactor the payment processing module"
# Only when user specifies a model explicitly:
codex exec -m gpt-5.2 --full-auto "implement the user authentication feature"
Control execution permissions with -s or --sandbox (possible values: read-only, workspace-write, danger-full-access):
codex exec "analyze the codebase structure and count lines of code"
codex exec -s read-only "review code quality and suggest improvements"
Analyze code without making any modifications.
codex exec -s workspace-write "implement the user authentication feature"
codex exec --full-auto "fix the bug in login flow"
Read and write files within the workspace. Must be explicitly enabled (not the default). Use this for most programming tasks.
codex exec -s danger-full-access "install dependencies and update the API integration"
Network access and system-level operations. Use only when necessary.
codex exec --full-auto "implement the user authentication feature"
Convenience alias for: -s workspace-write (enables file editing).
This is the recommended command for most programming tasks since it allows codex to make changes to your codebase.
Override any config.toml value inline with -c or --config:
# Override model for a single run
codex exec -c model="o3" --full-auto "implement the feature"
# Override sandbox permissions
codex exec -c 'sandbox_permissions=["disk-full-read-access"]' "analyze all files"
# Override nested config values using dotted paths
codex exec -c shell_environment_policy.inherit=all --full-auto "run build"
Enable or disable features with --enable and --disable:
codex exec --enable multi_agent --full-auto "implement feature across multiple files"
codex exec --disable plan_tool --full-auto "quick fix for typo"
Equivalent to -c features.<name>=true or -c features.<name>=false.
Attach images to the prompt with -i or --image:
codex exec -i screenshot.png "implement the UI shown in this screenshot"
codex exec -i mockup.png -i spec.png --full-auto "build this component matching the design"
Run code reviews with codex exec review:
# Review uncommitted changes (staged, unstaged, and untracked)
codex exec review --uncommitted
# Review changes against a base branch
codex exec review --base main
# Review a specific commit
codex exec review --commit abc1234
# Custom review instructions
codex exec review --base main "focus on security vulnerabilities and error handling"
# Review with a title for the summary
codex exec review --base main --title "Auth feature review"
# Output review as JSON
codex exec review --uncommitted --json -o review.json
Use saved profiles from ~/.codex/config.toml with -p or --profile:
codex exec -p production "deploy the latest changes"
codex exec --profile development "run integration tests"
Profiles can specify default model, sandbox mode, and other options.
Specify a different working directory with -C or --cd:
codex exec -C /path/to/project --full-auto "implement the feature"
codex exec --cd ~/projects/myapp --full-auto "run tests and fix failures"
Allow writing to additional directories outside the main workspace with --add-dir:
codex exec --full-auto --add-dir /tmp/output --add-dir ~/shared "generate reports in multiple locations"
codex exec --json "run tests and report results"
codex exec --json -s read-only "analyze security vulnerabilities"
Outputs structured JSON Lines format with reasoning, commands, file changes, and metrics.
Constrain the model's final response to match a JSON schema:
codex exec --output-schema schema.json "analyze the codebase and report findings"
codex exec -o report.txt "generate a security audit report"
codex exec -o results.json --json "run performance benchmarks"
Writes the final message to a file instead of stdout.
Run without persisting session files to disk:
codex exec --ephemeral --full-auto "quick one-off fix"
codex exec --skip-git-repo-check "analyze this non-git directory"
Bypasses the requirement for the directory to be a git repository.
# Resume the most recent session
codex exec resume --last "now implement the next feature"
# Resume a specific session by ID
codex exec resume <session-id> "continue working on the API"
# Show all sessions (not filtered by current directory)
codex exec resume --all
Use open-source models via local providers:
codex exec --oss "analyze this code"
codex exec --oss --local-provider ollama "refactor this function"
codex exec --oss --local-provider lmstudio "implement the feature"
EXTREMELY DANGEROUS — only use in externally sandboxed environments (containers, VMs)
codex exec --dangerously-bypass-approvals-and-sandbox "perform the task"
Skips ALL confirmation prompts and executes commands WITHOUT sandboxing.
Combine multiple flags for complex scenarios:
# Workspace write with JSON output
codex exec -s workspace-write --json "implement authentication and output results"
# Use profile with custom working directory
codex exec -p production -C /var/www/app "deploy updates"
# Full-auto with additional directories and output file
codex exec --full-auto --add-dir /tmp/logs -o summary.txt "refactor and log changes"
# Image-driven implementation with full-auto
codex exec -i design.png --full-auto "implement the UI matching this design"
# Config override with ephemeral mode
codex exec -c model_reasoning_effort="high" --ephemeral --full-auto "solve this complex bug"
# Code review with JSON output saved to file
codex exec review --base main --json -o review-report.json
Only pause for user input when encountering:
For all other decisions, proceed autonomously using best judgment.
Always conclude with a structured summary:
✓ Task completed successfully
Changes made:
- [List of files modified/created]
- [Key code changes]
Results:
- [Metrics: lines changed, files affected, tests run]
- [What now works that didn't before]
Verification:
- [Tests run, checks performed]
Next steps (if applicable):
- [Suggestions for follow-up tasks]
User: "Count the lines of code in this project by language"
codex exec "count the total number of lines of code in this project, broken down by language"
User: "Fix the authentication bug in the login flow"
codex exec --full-auto "fix the authentication bug in the login flow"
User: "Let codex implement dark mode support for the UI"
codex exec --full-auto "add dark mode support to the UI with theme context and style updates"
User: "Review my changes before I push"
codex exec review --uncommitted
User: "Build the UI from this mockup"
codex exec -i mockup.png --full-auto "implement the UI component matching this design"
User: "Install the new payment SDK and integrate it"
codex exec -s danger-full-access "install the payment SDK dependencies and integrate the API"
User: "Implement the API in the backend project"
codex exec -C ~/projects/backend --full-auto "implement the REST API endpoints for user management"
User: "Analyze this legacy codebase that's not in git"
codex exec --skip-git-repo-check "analyze the architecture and suggest modernization approach"
When errors occur:
If execution is interrupted:
development
Generate or edit images using OpenAI GPT Image API (gpt-image-2, gpt-image-1, etc). Triggers: "gpt image", "openai image", "generate image with openai", "draw image", "create image", "image generation", "AI drawing", "图片生成", "AI绘图", "生成图片", "画图". Use this skill whenever the user wants to generate or edit images and mentions OpenAI, GPT, or when OPENAI_API_KEY is available.
development
Create, refine, and benchmark agent skills. Use when building a new skill, updating an existing one, running evals, checking trigger quality, or improving a skill description.
development
Generate or edit images using Google Gemini API via nanobanana. Triggers: "nanobanana", "generate image", "create image", "edit image", "AI drawing", "图片生成", "AI绘图", "图片编辑", "生成图片".
development
Execute long-running, multi-session tasks autonomously using Claude Code headless mode or in-session hook-based loops. Supports structured task decomposition (for complex projects) and lightweight Ralph-style iteration (for TDD, bug fixing, refactoring). Use this skill whenever the user says "autonomous", "long-running task", "multi-session", "run this in the background", "keep working on this", "batch process", "iterate until done", "ralph loop", or wants any task that requires sustained, unattended execution.