AgentSkillsCN

codex-cli

使用 Codex CLI 执行代码审查、分析与技术研究。当用户说出“Codex”或“/Codex”,或提出深度代码审查、全代码库分析、漏洞调查、重构建议、基础设施/K8s/Terraform 审查、CI/CD 流水线分析,或需要超越简单 grep/读取操作的技术研究时,即可触发此技能。

SKILL.md
--- frontmatter
name: codex-cli
description: Execute code review, analysis, and technical research using Codex CLI. Trigger when user says "codex" or "/codex", or requests deep code review, codebase-wide analysis, bug investigation, refactoring proposals, infrastructure/K8s/Terraform review, CI/CD pipeline analysis, or technical research that goes beyond simple grep/read operations.

Codex CLI

Command Template

bash
codex exec \
  --model {MODEL} \
  --config model_reasoning_effort="{LEVEL}" \
  --sandbox {SANDBOX_MODE} \
  {AUTO_FLAG} \
  --skip-git-repo-check \
  -C {WORKING_DIR} \
  "{PROMPT}" \
  {SUPPRESS_FLAG}

Parameter Selection

Task TypeModelReasoningSandbox--full-auto
Complex bug investigationgpt-5.3-codexxhighread-onlyNO
Large-scale refactoringgpt-5.3-codexhighworkspace-writeYES
Standard code reviewgpt-5.3-codexhighread-onlyNO
Infrastructure analysisgpt-5.3-codexhighread-onlyNO
CI/CD optimizationgpt-5.2mediumread-onlyNO
Quick code questiongpt-5.2mediumread-onlyNO

Parameter notes:

  • gpt-5.3-codex for code tasks, gpt-5.2 for general/infra tasks
  • Default sandbox to read-only; use workspace-write only when editing files
  • danger-full-access (network access) requires explicit user confirmation
  • Add --full-auto only with workspace-write
  • Append 2>/dev/null only if user requests hidden output

Prompt Format

code
TASK: {clear, specific action}
CONTEXT: {tech stack, environment, constraints}
FOCUS: {specific areas to examine}
OUTPUT: {desired format and detail level}

Rules

  • Always include --skip-git-repo-check, --model, --config model_reasoning_effort, --sandbox
  • Never use danger-full-access without user confirmation
  • Never use --full-auto with read-only

Session Continuation

Resume previous session (inherits model and sandbox settings):

bash
codex exec --skip-git-repo-check resume --last
# Or with additional instructions:
echo "{instructions}" | codex exec --skip-git-repo-check resume --last

References