codex-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Codex Review

Codex代码审查

Run an independent code review via the OpenAI Codex CLI (
codex review
). The value is a second opinion from a different model family than the one that wrote the code — Codex catches things Claude misses due to author bias.
Complements
brains-trust
(generic multi-model opinions). This skill is specialised: git-aware, uses a tuned review prompt, saves structured output.
通过OpenAI Codex CLI(
codex review
)执行独立代码审查。其价值在于提供与编写代码所用模型家族不同的第二意见——Codex能发现Claude因作者偏见而遗漏的问题。
该工具是
brains-trust
(通用多模型意见工具)的补充。此技能具有专业性:支持Git、使用经过调优的审查提示词、保存结构化输出。

When to Use

使用场景

  • After a meaningful change, before committing or shipping
  • Before opening a PR, to self-review with an independent reviewer
  • When something feels off but you can't articulate what
  • Periodic whole-app reviews for projects in active development
  • When the user explicitly asks for an "independent" or "second opinion" review
Do NOT use for:
  • Trivial changes (typos, one-line fixes)
  • Research questions or architecture discussions — use
    brains-trust
    instead
  • Auto-fixing issues — this is advisory only
  • 在完成重要变更后、提交或发布前
  • 发起PR前,借助独立审查者进行自我审查
  • 感觉代码存在问题但无法明确描述时
  • 对活跃开发中的项目进行定期全应用审查
  • 用户明确要求“独立”或“第二意见”审查时
请勿用于:
  • 微小变更(拼写错误、单行修复)
  • 研究问题或架构讨论——请改用
    brains-trust
  • 自动修复问题——此工具仅提供建议

Preflight

预检步骤

  1. Confirm Codex CLI is installed:
    bash
    which codex
    If missing: tell the user to install it (
    brew install codex
    on macOS, or see https://github.com/openai/codex) and stop. Do not continue.
  2. Confirm auth: the first
    codex review
    call will fail clearly if not logged in. If that happens, instruct the user to run
    codex login
    and stop.
  1. 确认已安装Codex CLI:
    bash
    which codex
    若未安装:告知用户进行安装(macOS系统使用
    brew install codex
    ,或查看https://github.com/openai/codex)并终止流程,请勿继续。
  2. 确认身份验证:首次调用
    codex review
    时,若未登录会明确报错。若出现此情况,指导用户运行
    codex login
    并终止流程。

Determine scope

确定审查范围

Pick the scope flag based on what the user asked for:
User intentFlag
"codex review" / "review the app" / "full review" / defaultno flag (reviews whole app at current HEAD)
"review my changes" / "review what I just did" / "review uncommitted"
--uncommitted
"review this branch vs main" / "review the PR"
--base main
(or the branch they name)
"review commit abc123"
--commit abc123
Default is whole-app review. A bare "codex review" with no qualifier means review the entire codebase at HEAD — not just uncommitted changes. Only use
--uncommitted
if the user specifically refers to their recent/uncommitted work.
If ambiguous, ask once. Don't guess on commits or branches.
根据用户需求选择范围参数:
用户意图参数
"codex review" / "审查应用" / "全面审查" / 默认情况无参数(审查当前HEAD版本的整个应用)
"审查我的变更" / "审查我刚做的修改" / "审查未提交内容"
--uncommitted
"审查此分支与main分支的差异" / "审查PR"
--base main
(或用户指定的分支)
"审查提交abc123"
--commit abc123
默认是全应用审查。 不带任何限定词的“codex review”意味着审查HEAD版本的整个代码库——而非仅未提交的变更。仅当用户明确提及最近/未提交的工作时,才使用
--uncommitted
参数。
若意图不明确,询问一次即可。请勿猜测提交或分支信息。

Run the review

执行审查

The canonical review prompt lives in
prompt.md
next to this skill. Pipe it via stdin to avoid shell escaping:
bash
mkdir -p .jez/reviews
TS=$(date +%Y-%m-%d-%H%M)
OUT=".jez/reviews/codex-${TS}.md"
SKILL_DIR="$(dirname "$0")"  # or use the skill's absolute path
标准审查提示词存放在此技能旁的
prompt.md
文件中。通过标准输入管道传递提示词以避免Shell转义问题:
bash
mkdir -p .jez/reviews
TS=$(date +%Y-%m-%d-%H%M)
OUT=".jez/reviews/codex-${TS}.md"
SKILL_DIR="$(dirname "$0")"  # 或使用技能的绝对路径

Example: uncommitted changes

示例:审查未提交变更

cat "${SKILL_DIR}/prompt.md" | codex review --uncommitted - 2>&1 | tee "$OUT"

Other scopes:

```bash
cat "${SKILL_DIR}/prompt.md" | codex review --uncommitted - 2>&1 | tee "$OUT"

其他范围的执行命令:

```bash

Vs base branch

与基准分支对比

cat prompt.md | codex review --base main - 2>&1 | tee "$OUT"
cat prompt.md | codex review --base main - 2>&1 | tee "$OUT"

Specific commit

特定提交

cat prompt.md | codex review --commit abc123 - 2>&1 | tee "$OUT"
cat prompt.md | codex review --commit abc123 - 2>&1 | tee "$OUT"

Current HEAD (no scope flag)

当前HEAD版本(无范围参数)

cat prompt.md | codex review - 2>&1 | tee "$OUT"

`codex review` can take several minutes on a large diff. Let it run.
cat prompt.md | codex review - 2>&1 | tee "$OUT"

对于大型差异,`codex review`可能需要数分钟时间,请等待其运行完成。

Summarise for the user

向用户总结结果

After Codex finishes:
  1. Print the output path:
    Report saved to .jez/reviews/codex-<timestamp>.md
  2. Read the saved report and extract the top findings (anything under Critical and High)
  3. Show them inline in the chat, with file:line references intact
  4. Offer to action specific findings: "Want me to fix the SQL injection in
    auth.ts:42
    ?"
Codex完成审查后:
  1. 输出报告路径:
    报告已保存至.jez/reviews/codex-<timestamp>.md
  2. 读取保存的报告,提取最重要的发现(所有严重高优先级内容)
  3. 在聊天中直接展示这些内容,保留文件:行号的引用
  4. 主动提出处理特定发现:“需要我修复
    auth.ts:42
    中的SQL注入问题吗?”

Rules

规则

  • Advisory only. Never auto-apply Codex's suggestions. Read the findings, discuss with the user, fix with their approval.
  • Don't leak Claude's reasoning into the prompt. The
    prompt.md
    file is deliberately neutral — Codex reviews the code, not Claude's narrative about the code. Independence is the whole point.
  • Save to
    .jez/reviews/
    , never
    .claude/
    (protected directory).
  • One report per run. Don't overwrite — the timestamp makes each run unique so the user can compare.
  • Report what Codex actually found. Don't soften, editorialise, or skip findings you disagree with. If you think Codex is wrong about something, say so as your own opinion after showing what Codex said.
  • 仅提供建议。 切勿自动应用Codex的建议。需先阅读发现内容,与用户讨论,在获得用户批准后再进行修复。
  • 请勿将Claude的推理内容加入提示词。
    prompt.md
    文件刻意保持中立——Codex仅审查代码,而非Claude对代码的描述。独立性是此工具的核心价值。
  • 保存至
    .jez/reviews/
    目录
    ,切勿保存至
    .claude/
    (受保护目录)。
  • 每次运行生成一份报告。 请勿覆盖——时间戳确保每次运行的报告唯一,方便用户对比。
  • 如实报告Codex的发现。 请勿弱化、编辑或跳过你不认同的发现。若你认为Codex的某个发现有误,可在展示Codex的结论后,提出你自己的观点。

Verification

验证标准

The skill is working if:
  • Preflight correctly detects a missing
    codex
    binary
  • The right scope flag is chosen based on user intent
  • The report file appears in
    .jez/reviews/
    with a sensible timestamp
  • The file contains severity-prioritised findings with file:line refs
  • Claude surfaces the top findings without auto-fixing them
若满足以下条件,则说明技能运行正常:
  • 预检步骤能正确检测到缺失的
    codex
    二进制文件
  • 根据用户意图选择了正确的范围参数
  • 报告文件出现在
    .jez/reviews/
    目录中,且带有合理的时间戳
  • 文件包含按严重性排序的发现,且带有文件:行号引用
  • Claude展示了最重要的发现,但未自动修复问题