codex-integration
This skill provides guidance on using OpenAI's Codex CLI for detail-oriented code analysis. Use when the user explicitly invokes "/codex", asks to "use codex", "run codex", "have codex review", or when Claude determines that Codex's sharp-eyed analysis would complement its work on code review, bug hunting, or planning tasks.
What this skill does
# Codex Integration OpenAI's Codex CLI is a complementary tool for detail-oriented code analysis. Codex excels at thorough, meticulous review work - think of it as a "sharp-eyed second opinion" for code. ## When to Use Codex **Ideal use cases:** - Deep code review for security vulnerabilities or correctness issues - Thorough bug hunting in complex code paths - Detailed implementation planning with attention to edge cases - Getting a second perspective on critical code - Exploratory analysis requiring meticulous attention **Not ideal for:** - Simple, straightforward tasks Claude handles well alone - Interactive debugging sessions (Codex exec is non-interactive) - Tasks where speed matters more than depth - Trivial code changes or obvious fixes ## Invocation Methods ### Method 1: Explicit /codex Command Users invoke directly with optional flags: ``` /codex review the authentication middleware for security issues /codex --model gpt-5.4 analyze this algorithm /codex --sandbox workspace-write generate tests for this module ``` **Available flags:** | Flag | Values | Default | |------|--------|---------| | `--model` | any model name | gpt-5.4 | | `--sandbox` | read-only, workspace-write, danger-full-access | read-only | ### Method 2: Spawning codex-agent When Claude determines Codex would add value, spawn the `codex-agent` subagent: ``` "Let me have Codex take a detailed look at this code for potential bugs..." [Spawn codex-agent with task description] [Synthesize Codex's findings with own analysis] ``` The agent always uses safe defaults (gpt-5.4, read-only sandbox). ## CLI Reference Core command pattern for non-interactive execution (use inline prompt, not piped stdin): ```bash codex exec \ --model gpt-5.4 \ --sandbox read-only \ "<prompt>" \ 2>&1 ``` **Key flags:** - `--model, -m` - Model to use (gpt-5.4 recommended for code tasks) - `--sandbox, -s` - Execution permissions (read-only safest) - `2>&1` - Capture all output **Note:** Interactive slash commands like `/review` only work in Codex's interactive mode, not via `codex exec`. ## Error Handling ### Codex Not Installed If `codex` command not found, show: ``` Codex CLI is not installed. To install: brew install codex Then authenticate: codex login For more info: https://developers.openai.com/codex/cli ``` ### Common Issues - **API key issues**: User needs to run `codex login` to authenticate - **Timeout**: Complex tasks may take time. Be patient or try a simpler task description. - **Sandbox errors**: If Codex needs to write files, user must specify `--sandbox workspace-write` ## Best Practices 1. **Start with defaults** - gpt-5.4 works well for most tasks 2. **Keep read-only sandbox** - Unless task explicitly requires file modifications 3. **Be specific in prompts** - Tell Codex exactly what to look for 4. **Synthesize results** - When using codex-agent, combine Codex's findings with Claude's analysis ## Prompting Best Practices gpt-5.4 responds best to explicit, scoped prompts with concrete constraints. ### Core Principles 1. **Scope discipline** - Be explicit about boundaries - DO: "Review ONLY the auth flow. Do NOT suggest unrelated improvements." - DON'T: "Review this code" (too open-ended) 2. **Bias toward action** - Request concrete output - DO: "List specific bugs found with file:line references" - DON'T: "Tell me what you think about this code" 3. **No preambles** - Skip status updates - Add to prompts: "Skip preambles. Lead with findings." 4. **Structured output** - Request specific formats - "Format: `file.ts:line` - issue description" ### Task-Specific Prompt Templates #### Security Review ``` Review <file/module> for security vulnerabilities. Focus ONLY on: auth, injection, data exposure, access control. Do NOT suggest style changes or refactoring. Format each finding as: `file:line` - severity - issue Skip preambles. ``` #### Bug Hunting ``` Find bugs in <file/module>. Look for: edge cases, off-by-one, null handling, race conditions. ONLY report actual bugs, not style issues. Format: `file:line` - bug description - suggested fix Skip preambles. Lead with findings. ``` #### Implementation Planning ``` Create implementation plan for: <feature>. Constraints: <existing patterns to follow>. Output structure: 1. Overview 2. Files to modify (with line ranges) 3. Implementation steps 4. Edge cases to handle Do NOT include code samples unless critical. Skip preambles. ``` #### Code Review ``` Review <file> for correctness and reliability. Focus ONLY on: logic errors, missing error handling, incorrect assumptions. Ignore: style, naming, formatting. Format: `file:line` - issue - recommendation Skip preambles. ```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.