Community编程与开发github.com

codex-review

Codex 代码审查收尾:处理本地脏变更、PR 分支与主分支对比,并行运行测试。

codex-review 是什么?

Codex Review 是一个代码审查收尾技能,它利用 Codex 内置的 `codex review` 命令作为代码修改后的最终检查。该技能专为开发者设计,帮助他们在提交代码前,或在 PR 分支修复后,系统地进行代码审查。它明确区分了 Codex 的代码审查和 Guardian 的自动审批路由。该技能支持多种审查场景:对本地未提交的脏代码(`--uncommitted`)、对已推送的 PR 分支(`--base origin/main`)、对已提交的单个提交(`--commit HEAD`)。为了提升效率,技能建议在格式化代码后并行运行测试和审查,并通过子代理过滤审查噪音,只返回可操作的结果。其核心契约要求开发者将审查结果视为建议,需通过阅读真实代码路径来验证每个发现,拒绝不切实际的边界案例和过度复杂的重构,并持续运行直到审查不再返回任何可接受/可操作的问题。技能还附带了一个辅助脚本,能够自动选择审查模式,并支持并行测试和干运行。

兼容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/codex-review

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Codex 审查

运行 Codex 内置的代码审查作为收尾检查。这是代码审查(codex review),而非 Guardian 的 auto_review 审批路由。

在以下情况下使用:

  • 用户要求进行 Codex 审查 / 自动审查 / 第二模型审查
  • 在进行重要的代码编辑之后,在最终/提交/发布之前
  • 在修复后审查本地分支或 PR 分支

契约

  • 将审查输出视为建议。切勿盲目应用。
  • 通过阅读真实的代码路径和相邻文件来验证每一条发现。
  • 当发现依赖于外部行为时,阅读依赖项的文档/源码/类型。
  • 拒绝不切实际的边界情况、推测性风险、大规模重写以及使代码库过度复杂的修复。
  • 倾向于在正确的所有权边界内进行小修复;除非能明显改善错误类别,否则不要进行重构。
  • 持续进行,直到 Codex 审查不再返回任何接受/可操作的发现。
  • 如果审查触发的修复更改了代码,则重新运行聚焦的测试并重新运行 Codex 审查。
  • 切勿切换或覆盖审查模型。如果审查达到模型容量限制,请使用相同模型重试相同命令几次。辅助脚本默认在 yolo/full-access 模式下运行嵌套审查;仅当有意测试沙箱行为时使用 --no-yolo。
  • 一旦审查命令/辅助脚本以退出码 0 结束且没有接受/可操作的发现,立即停止。不要为了获得更漂亮的“干净”行、第二意见或更清晰的收尾措辞而额外直接运行一次 codex review。
  • 将辅助脚本的成功退出加上没有可操作发现视为干净的审查结果,即使底层的 Codex CLI 输出很简洁。
  • 如果拒绝某个发现是因为其是故意的/不值得修复,仅在以下情况下添加简短的内联代码注释:它能解释一个未来的审查者应该知道的真实不变条件或所有权决策。
  • 不要仅仅为了审查而推送。仅在用户要求推送/发布/更新 PR 时推送。

选择目标

本地脏数据:

codex review --uncommitted

仅当补丁当前在工作目录中处于未暂存/已暂存/未跟踪状态时才使用此模式。对于已提交、已推送或 PR 工作,改为将 Codex 指向提交或分支差异;不要仅仅因为辅助脚本文档首先提到了脏工作而强制使用 --mode local / --uncommitted。一个干净的 --uncommitted 审查仅证明没有本地补丁。

分支/PR 工作:

git fetch origin
codex review --base origin/main

不要与 --base 一起传递内联提示;当前 CLI 拒绝 --base + [PROMPT],即使帮助文本有歧义。如果需要自定义指令,请先运行基础的审查,然后手动进行本地/后续检查。

如果存在开放的 PR,请使用其实际的基础分支:

base=$(gh pr view --json baseRefName --jq .baseRefName)
codex review --base "origin/$base"

已提交的单个变更:

codex review --commit HEAD

或使用辅助脚本:

/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode commit --commit HEAD

对于已落地或已推送到 main 的工作,使用提交审查。审查干净的 main 与 origin/main 通常在推送后是一个空差异。对于小的堆栈,请明确审查每个提交,或使用 --base 在合并前审查分支。

并行收尾

如果可以改变代码行位置,请先格式化代码。然后可以并行运行测试和审查:

scripts/codex-review --parallel-tests "<聚焦的测试命令>"

权衡:测试可能会强制进行代码更改,从而使审查失效。如果测试或审查导致代码编辑,请重新运行受影响的测试并重新运行审查,直到没有留下可接受/可操作的发现。一旦重新运行成功退出,请停止;不要为了冗余确认而再花费一个长的审查周期。

上下文效率

Codex 审查通常噪音较多。当子代理可用时,默认使用子代理过滤器。让其运行审查并仅返回:

  • 其接受的可操作发现
  • 其拒绝的发现,附上一行原因
  • 需要重新运行的确切文件/测试

仅对于微小更改或在子代理不可用时才内联运行。

辅助脚本

捆绑的辅助脚本:

~/.codex/skills/codex-review/scripts/codex-review --help

如果从 agent-scripts 安装,路径为:

/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --help

该辅助脚本:

  • 首先选择脏数据的 --uncommitted 模式
  • 否则如果 gh pr view 成功,则使用当前 PR 基础分支
  • 否则对非 main 分支使用 origin/main
  • 对已提交的工作使用 --mode commit --commit <ref>,尤其是已落地的干净 main
  • 应为 PR/分支工作保留在 --mode auto 或强制设为 --mode branch;不要在提交后强制使用 --mode local
  • 除非设置了 --output 或 CODEX_REVIEW_OUTPUT,否则仅写入标准输出
  • 支持 --dry-run、--parallel-tests 和提交引用
  • 默认使用 --dangerously-bypass-approvals-and-sandbox 运行嵌套审查
  • 继续接受 --full-access;使用 --no-yolo 或 CODEX_REVIEW_YOLO=0 退出
  • 当所选审查命令以退出码 0 结束时,打印 codex-review clean: no accepted/actionable findings reported

最终报告

包括:

  • 所使用的审查命令
  • 运行的测试/证明
  • 接受/拒绝的发现,简要说明原因
  • 来自最终辅助脚本/审查运行的干净审查结果,或为何某个剩余发现被有意识地拒绝

不要仅仅为了改善最终报告的措辞而再次运行 Codex 审查。如果最终辅助脚本运行以退出码 0 结束且没有产生可接受/可操作的发现,则将该确切运行报告为干净。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

相关技能