codex-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<EXTREMELY-IMPORTANT> This skill orchestrates an external reviewer and must stay disciplined.
Non-negotiable rules:
  1. Read the real diff before writing Codex instructions.
  2. Make the instructions specific to the changed areas and likely risks.
  3. Never pass secrets or credential values into review instructions.
  4. Carry forward exclusion lists on later rounds.
  5. Verify returned findings before acting on them.
</EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT> 该技能用于协调外部评审工具,必须严格遵循规则。
不可妥协的规则:
  1. 编写Codex指令前,先查看实际差异内容。
  2. 指令需针对变更区域和潜在风险定制。
  3. 绝不能将密钥或凭证值传入评审指令。
  4. 后续评审轮次需沿用排除列表。
  5. 在根据评审结果执行操作前,先验证结果的准确性。
</EXTREMELY-IMPORTANT>

Codex Review

Codex评审

Inputs

输入参数

  • $request
    : Optional scope hint such as
    last commit
    ,
    uncommitted
    ,
    auth focus
    , or
    round 2
  • $request
    :可选的范围提示,例如
    last commit
    uncommitted
    auth focus
    round 2

Goal

目标

Use
codex review
to get an external review pass that:
  • reads the right diff scope
  • focuses on the actual risk areas in the change set
  • returns structured findings instead of generic commentary
使用
codex review
完成一次外部评审,需满足:
  • 读取正确的差异范围
  • 聚焦变更集中的实际风险区域
  • 返回结构化的评审结果,而非泛泛的评论

Step 0: Verify Codex availability

步骤0:验证Codex可用性

Check:
  • which codex
  • whatever minimal auth or environment check is needed for the current setup
If the CLI is unavailable or not authenticated, explain the blocker and stop.
Success criteria: Codex can be invoked successfully from the current repository.
检查:
  • which codex
  • 当前环境所需的最低权限或环境检查
若CLI不可用或未完成认证,说明阻塞原因并终止流程。
成功标准:可从当前仓库成功调用Codex。

Step 1: Resolve review scope

步骤1:确定评审范围

Determine whether to review:
  • the full branch against its base
  • uncommitted changes
  • a specific commit
Read the real diff summary and changed-file list before building instructions.
If there is no diff, stop and say so explicitly.
Success criteria: The exact review target is explicit and backed by a real diff.
明确评审对象:
  • 完整分支与其基准分支的对比
  • 未提交的变更
  • 特定提交
在编写指令前,先读取实际差异摘要和变更文件列表。
若不存在差异,需明确告知并终止流程。
成功标准:评审目标明确,且有实际差异作为依据。

Step 2: Write focused review instructions

步骤2:编写针对性评审指令

Build a small temporary instruction file that includes:
  • what changed
  • the most relevant risk areas
  • any previously fixed issues to exclude on later rounds
  • an instruction to verify findings against the actual code
  • a compact expected output format
Keep the instructions concrete. Generic prompts produce weak reviews.
Success criteria: The instruction file is specific to the actual change set.
生成一个临时的小型指令文件,包含:
  • 变更内容
  • 最相关的风险区域
  • 后续轮次中需排除的已修复问题
  • 验证评审结果与实际代码一致性的要求
  • 简洁的预期输出格式
指令需具体明确,泛泛的提示会导致评审效果不佳。
成功标准:指令文件针对实际变更集定制。

Step 3: Run
codex review

步骤3:运行
codex review

Use the right invocation shape for the selected scope:
  • --base <branch>
    for branch review
  • --uncommitted
    for working-tree review
  • --commit <sha>
    for a single commit
Key flags:
  • sandbox_permissions
    -- codex needs disk read access to verify findings:
    -c 'sandbox_permissions=["disk-full-read-access","disk-full-write-access","network-full-access"]'
  • instructions
    -- point to the focused instruction file from Step 2:
    -c 'instructions="/tmp/codex-review-instructions.md"'
  • --title "<description>"
    -- descriptive review title
Always capture stderr with
2>&1
(codex logs to stderr).
If the review is expected to be long-running, background execution is acceptable.
Success criteria: Codex runs against the intended scope and returns parseable output.
根据选定的范围使用正确的调用格式:
  • 分支评审使用
    --base <branch>
  • 工作区评审使用
    --uncommitted
  • 单一提交评审使用
    --commit <sha>
关键参数:
  • sandbox_permissions
    -- Codex需要磁盘读取权限来验证结果:
    -c 'sandbox_permissions=["disk-full-read-access","disk-full-write-access","network-full-access"]'
  • instructions
    -- 指向步骤2生成的针对性指令文件:
    -c 'instructions="/tmp/codex-review-instructions.md"'
  • --title "<description>"
    -- 描述性的评审标题
始终通过
2>&1
捕获stderr(Codex日志输出到stderr)。
若评审预计耗时较长,可后台执行。
成功标准:Codex针对预期范围运行,并返回可解析的输出。

Step 4: Summarize findings

步骤4:总结评审结果

Report:
  • review scope
  • findings by priority
  • file and line references when available
  • explicit clean result when no material findings are returned
If the user wants fixes, verify each finding locally before changing code.
Success criteria: The user gets a clear, scoped review summary instead of raw CLI output.
报告内容:
  • 评审范围
  • 按优先级排序的评审发现
  • 可用时提供文件和行号引用
  • 若未发现实质性问题,明确给出无问题结果
若用户需要修复代码,在修改前需先本地验证每个评审发现。
成功标准:用户获得清晰、聚焦的评审总结,而非原始CLI输出。

Step 5: Iterate only with exclusions

步骤5:仅基于排除项迭代评审

On later rounds:
  • add fixed findings to the exclusion section
  • narrow the scope to new changes where possible
  • avoid paying for repeated generic full-branch reviews
Success criteria: Follow-up rounds look for new issues rather than re-reporting old ones.
后续轮次评审:
  • 将已修复的问题添加到排除列表
  • 尽可能将范围缩小到新的变更
  • 避免重复付费进行泛泛的全分支评审
成功标准:后续轮次仅查找新问题,而非重复报告已修复的旧问题。

Guardrails

防护规则

  • Do not run this skill proactively; it is explicit-user-only.
  • Do not put secrets, tokens, or private config values in the instruction file.
  • Do not trust findings blindly without local verification.
  • Do not use Codex review as a substitute for reading the diff first.
  • 不得主动运行该技能,仅在用户明确要求时执行。
  • 不得将密钥、令牌或私有配置值放入指令文件。
  • 不得盲目信任评审结果,需先本地验证。
  • 不得用Codex评审替代先查看差异内容的步骤。

Output Contract

输出约定

Report:
  1. the review scope
  2. the main focus areas given to Codex
  3. findings by priority with locations when available
  4. explicit clean result if nothing material was found
  5. whether a next round should exclude previously fixed issues
需报告:
  1. 评审范围
  2. 提供给Codex的核心聚焦领域
  3. 按优先级排序的评审发现(含可用的位置信息)
  4. 若未发现实质性问题,明确给出无问题结果
  5. 下一轮评审是否需排除已修复的问题