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:
- Read the real diff before writing Codex instructions.
- Make the instructions specific to the changed areas and likely risks.
- Never pass secrets or credential values into review instructions.
- Carry forward exclusion lists on later rounds.
- Verify returned findings before acting on them.
<EXTREMELY-IMPORTANT>
该技能用于协调外部评审工具,必须严格遵循规则。
不可妥协的规则:
- 编写Codex指令前,先查看实际差异内容。
- 指令需针对变更区域和潜在风险定制。
- 绝不能将密钥或凭证值传入评审指令。
- 后续评审轮次需沿用排除列表。
- 在根据评审结果执行操作前,先验证结果的准确性。
Codex Review
Codex评审
Inputs
输入参数
- : Optional scope hint such as
$request,last commit,uncommitted, orauth focusround 2
- :可选的范围提示,例如
$request、last commit、uncommitted或auth focusround 2
Goal
目标
Use to get an external review pass that:
codex review- 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
codex review步骤3:运行 codex review
codex reviewUse the right invocation shape for the selected scope:
- for branch review
--base <branch> - for working-tree review
--uncommitted - for a single commit
--commit <sha>
Key flags:
- -- codex needs disk read access to verify findings:
sandbox_permissions-c 'sandbox_permissions=["disk-full-read-access","disk-full-write-access","network-full-access"]' - -- point to the focused instruction file from Step 2:
instructions-c 'instructions="/tmp/codex-review-instructions.md"' - -- descriptive review title
--title "<description>"
Always capture stderr with (codex logs to stderr).
2>&1If 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>
关键参数:
- -- Codex需要磁盘读取权限来验证结果:
sandbox_permissions-c 'sandbox_permissions=["disk-full-read-access","disk-full-write-access","network-full-access"]' - -- 指向步骤2生成的针对性指令文件:
instructions-c 'instructions="/tmp/codex-review-instructions.md"' - -- 描述性的评审标题
--title "<description>"
始终通过 捕获stderr(Codex日志输出到stderr)。
2>&1若评审预计耗时较长,可后台执行。
成功标准: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:
- the review scope
- the main focus areas given to Codex
- findings by priority with locations when available
- explicit clean result if nothing material was found
- whether a next round should exclude previously fixed issues
需报告:
- 评审范围
- 提供给Codex的核心聚焦领域
- 按优先级排序的评审发现(含可用的位置信息)
- 若未发现实质性问题,明确给出无问题结果
- 下一轮评审是否需排除已修复的问题