content/skills/ai-llm-skills/codex/SKILL.md
OpenAI Codex CLI wrapper — five modes: `codex review` for PR/diff/commit review, adversarial challenge for edge cases and security, consult for second opinions on code or architecture, live research with citations via `--search`, and apply/fix for approved code changes. Use when the user invokes /codex or explicitly wants the local Codex CLI.
npx skillsauth add bahayonghang/my-claude-code-settings 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.
Run Codex CLI for $ARGUMENTS.
codex reviewcodex execgpt-5.4 (referred to as $MODEL in recipes below)-c model_reasoning_effort=xhigh-c model_reasoning_effort=high--search--full-auto before --dangerously-bypass-approvals-and-sandboxcodex exec resume <session_id> "<follow-up>"command -v codexGet-Command codexnpm install -g @openai/codexcodex login status
codex loginTreat current local CLI help as the source of truth before constructing commands:
codex --help, codex exec --help, codex review --help, and codex resume --help when a recipe looks stale.--reasoning flag. Current Codex CLI exposes reasoning through -c model_reasoning_effort=<level>.codex review accepts either a review target flag (--uncommitted, --base, --commit) or a custom prompt, not both in the same command.codex review to codex exec with an explicit prompt over the repo or files.codex sessions list or codex --print-config; prefer codex resume --all, the session id printed by codex exec, or reading ~/.codex/config.toml directly.Keep danger-full-access and --dangerously-bypass-approvals-and-sandbox
available, but never use them by default.
Before using either bypass path:
read-only, workspace-write, or --full-auto first.Use this confirmation shape:
Codex needs <danger-full-access | full bypass> for this run to <reason>.
This would allow <scope>. Proceed?
This skill wraps the local Codex CLI (codex command). It is distinct from the
OMC orchestration layer's ask_codex MCP tool, which delegates to Codex as an
agent role (architect, planner, critic, etc.) via the MCP protocol.
codex review, codex exec, or Codex CLI featuresask_codex: orchestrator delegates analysis/review to Codex as a reasoning backendIf the user says "ask codex about X" without specifying CLI usage, defer to OMC's
MCP delegation. This skill activates on /codex invocation or explicit CLI intent.
If $ARGUMENTS is empty, ask the user for the task description.
Choose one primary mode:
review: PR, diff, branch, commit, uncommitted changes, merge readiness, or review-style second opinion. Prefer codex review.challenge: adversarial probing for edge cases, race conditions, security issues, or failure modes. Use codex exec with a read-only posture and an attack-minded prompt.consult: second opinion on a file, module, architecture decision, migration, or plan. Use codex exec without write access.research: latest docs, current product comparisons, citations, release notes, or vendor landscape. Use top-level --search with codex exec.apply/fix: generation, refactoring, debugging, or fixing approved findings. Only use when the user explicitly wants Codex to make changes.resume: follow-up on a previous non-interactive session via codex exec resume.If a task spans multiple modes, do them in this order:
review or challengeconsultresearchapply/fix| Keywords in $ARGUMENTS | → Mode |
|--------------------------------------------------|-------------|
| review, PR, diff, merge, branch, commit, changes | review |
| challenge, break, attack, adversarial, scary | challenge |
| consult, second opinion, what do you think, @file| consult |
| research, compare, latest, docs, citations | research |
| fix, apply, refactor, implement, write, generate | apply/fix |
| resume, continue, follow-up, session | resume |
If ambiguous, prefer read-only modes (review/challenge/consult) over write modes (apply/fix).
Before any Codex invocation, emit this block exactly once:
Planned AI Run
- Tool: Codex CLI
- Mode: <review | challenge | consult | research | apply/fix | resume>
- Model: <literal model id>
- Runtime: <model_reasoning_effort=xhigh | model_reasoning_effort=high | model_reasoning_effort=<level>; sandbox=<mode>>
- Search: <off | live>
- Access: <review-safe | workspace-write | confirmed danger-full-access | confirmed bypassed sandbox/approvals>
- Workdir: <path or current>
Rules:
codex review, pass model or sandbox overrides as top-level Codex options before the subcommand, for example codex -m $MODEL -s read-only review ....-c model_reasoning_effort=<level> in the final command. Never invent a --reasoning flag.codex review target selectors with a prompt. Use codex exec when the user needs both a fixed scope and custom focus.Search: live only for runs started with top-level --search.review, challenge, and consult should default to read-only or another review-safe posture.apply/fix should default to workspace-write / --full-auto.danger-full-access or full bypass only after explicit confirmation for that exact run.-C is omitted, show current for Workdir.| Mode | Command | Default flags |
|-----------|----------------------------------|----------------------------|
| Review | codex review | -m $MODEL -s read-only |
| Challenge | codex exec | -s read-only -c model_reasoning_effort=xhigh |
| Consult | codex exec | -s read-only -c model_reasoning_effort=xhigh |
| Research | codex --search exec | --skip-git-repo-check -c model_reasoning_effort=high |
| Apply/Fix | codex exec | --full-auto -c model_reasoning_effort=xhigh |
| Resume | codex exec resume <id> "<msg>" | inherits previous session |
For full command recipes, prompt templates, and shell-quoting notes, read $SKILL_DIR/references/REFERENCE.md.
Read $SKILL_DIR/references/REFERENCE.md for:
Codex runs commands inside a sandbox that restricts file system access. This is the single most common source of "Permission denied" errors, especially for git operations.
Even in workspace-write mode, Codex force-mounts .git/ as read-only after
writable roots are applied. Any git command that writes metadata — fetch, commit,
pull, push, checkout, merge, rebase, stash — will fail with:
error: cannot open '.git/FETCH_HEAD': Permission denied
| Sandbox mode | git read | git write | When to use |
|--------------|----------|-----------|-------------|
| read-only (default) | Yes | No | review, challenge, consult |
| workspace-write | Yes | No (.git/ stays read-only) | editing files only |
| --full-auto | Yes | No (same sandbox; sets -a on-request + -s workspace-write) | low-friction file edits |
| danger-full-access | Yes | Yes | apply/fix that needs git write |
| --dangerously-bypass-approvals-and-sandbox | Yes | Yes | last resort, unrestricted |
For any mode that needs git write access (commit, push, pull), you must use
danger-full-access or --dangerously-bypass-approvals-and-sandbox.
Do not switch to either mode until the user has explicitly confirmed the bypassed run.
-s read-only (default, safe)--skip-git-repo-check (no repo context needed)--full-auto (low-friction, sandboxed)danger-full-access after confirmation; use full bypass only as a confirmed last resortWindows:
bash.exe) fails inside Windows sandbox with "couldn't create signal pipe, Win32 error 5" (issue #15016).# ~/.codex/config.toml
[windows]
sandbox = "off"
Linux (bubblewrap):
.git/ and resolved gitdir: targets are force-mounted read-only after writable
roots, and --add-dir cannot override this (issue #14338).unprivileged_userns restriction can prevent the sandbox from starting
entirely (issue #9273).macOS:
git config --local core.fsmonitor false
To avoid the trust prompt on every run, add the project to config.toml:
# ~/.codex/config.toml
[projects."/path/to/your/project"]
trust_level = "trusted"
Use the built-in sandbox diagnostic to see what is being blocked:
codex sandbox <platform> --log-denials <command>
# Example:
codex sandbox macos --log-denials git diff
codex sandbox linux --log-denials git commit -m "test"
For full sandbox configuration details, read $SKILL_DIR/references/REFERENCE.md.
codex: command not found: tell the user to install @openai/codexcodex login status fails or shows no auth: tell the user to run codex login--search and an explicit request for URLs.git/: switch to danger-full-access or --dangerously-bypass-approvals-and-sandbox; see the Sandbox section abovegit config --local core.fsmonitor falsekernel.apparmor_restrict_unprivileged_userns sysctlcodex exec is the preferred general non-interactive entrypoint.codex review is the preferred review entrypoint for branch, diff, commit, and uncommitted review.~/.codex/config.toml and current CLI help.tools
文献深度解读助手,像研究生导师一样交互式解读 Zotero 库中的学术论文,面向计算机科学、深度学习、自动化等方向(个人向)。当用户提供文献题目、DOI、PDF 或要求解读某篇论文时触发,通过 Zotero MCP 优先获取全文,并根据用户意图自动选择快速筛选、导师深读或研究复盘模式。完整深读时先完成叙事类型判断、阅读前预检、novelty 校准和作者思考路径重建,再整体概览,并基于图例、正文和表格逐图详细解读(Zotero MCP 无法提取 PDF 图片,解读基于文字信息,必要时提醒上传图片)。适用于:(1)快速判断文献是否值得深读 (2)深入理解某篇论文 (3)学习文章中的方法和技术 (4)批判性分析研究设计 (5)寻找研究灵感。需要多篇论文综合、对比或找研究空白,或 arXiv/DOI 批量规范化时,改用 paper-workbench。
development
Review Codex, Claude, OpenAI, or other agent skill directories as reusable capability packages. Use when asked to audit, review, improve, score, rewrite, debrand, package, or document a SKILL.md, skill package, marketplace skill, or agent skill directory, especially when the user wants a comprehensive findings-first report with concrete patch recommendations and validation steps.
development
Turn vague or complex Codex tasks into strong `/goal` commands with outcome, verification, constraints, boundaries, iteration policy, completion evidence, and pause/block conditions. Use when the user asks for Codex goal instructions, Goal 指令, 目标指令, `/goal` prompts, 中文 Goal 模板, plan-to-goal interviews, success criteria, verification commands, or bounded agent work definitions.
tools
Write, debug, and validate ast-grep structural code search rules. Use this skill when the user needs syntax-aware code search, AST pattern matching, structural refactor discovery, language-construct queries, or searches that plain text tools like rg can miss, such as finding functions with particular descendants, calls inside specific contexts, missing error handling, React hook shapes, decorators, or other Tree-sitter-backed code structures.