Community程式設計與開發github.com

codex-review

Codex 程式碼審查結案工具:處理本機未提交變更、PR 分支與主分支比較、平行測試。

codex-review 是什麼?

此技能利用 Codex 的內建程式碼審查(`codex review`)作為結案檢查,與 Guardian 的 `auto_review` 核准路由不同。它適用於多種情境,包括使用者要求進行第二模型審查、在編輯程式碼後提交前確認、以及審查本機或 PR 分支上的修復內容。技能會提供詳細的合約指南,要求將審查結果視為建議,並且必須手動驗證每個發現,拒絕不切實際的邊界情況或過度複雜的修復。它支援三種審查模式:`--uncommitted` 用於本機未提交變更,`--base origin/main` 用於分支/PR 工作,以及 `--commit HEAD` 用於已提交的變更。為了提升效率,技能預設使用子代理過濾,僅回傳可採納的發現與簡短理由。它還包含一個輔助腳本,可自動選擇正確的差異模式,並支援平行測試,以在審查與測試之間取得平衡,最終確保所有可採納的發現都已解決。此技能與 Codex 原生整合,並提供輔助命令以簡化流程。

相容平台~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 Review

執行 Codex 內建的程式碼審查作為結案檢查。這是指 codex review 指令,而非 Guardian 的 auto_review 核准路由。

在以下情況使用:

  • 使用者要求進行 Codex 審查 / autoreview / 第二模型審查
  • 進行非微小的程式碼編輯後,在最終/提交/發布前
  • 審查本機分支或 PR 分支上的修復內容

合約

  • 將審查結果視為建議。切勿盲目套用。
  • 透過閱讀實際的程式碼路徑和相關檔案來驗證每個發現。
  • 當發現依賴於外部行為時,請閱讀相依套件的文件/原始碼/型別。
  • 拒絕不切實際的邊界情況、推測性的風險、大規模重寫以及會使程式碼庫過於複雜的修復。
  • 偏好在其所有權邊界內進行小型修復;除非能明顯改善錯誤類別,否則不進行重構。
  • 持續進行,直到 Codex 審查沒有回報任何被接受/可處理的發現。
  • 如果審查觸發的修更改變了程式碼,請重新執行重點測試並重新執行 Codex 審查。
  • 切勿切換或覆寫審查模型。如果審查達到模型容量上限,請使用相同模型重試相同指令數次。輔助工具預設在 yolo/完全存取模式下執行巢狀審查;僅在有意測試沙盒行為時使用 --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],即使說明文字有歧義。如果需要自訂指示,請先執行純粹的 base 審查,然後再進行本機/手動的後續處理。

如果存在一個開放的 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 的工作使用提交審查。在推送後,針對 origin/main 審查乾淨的 main 通常會得到空的差異。對於小型堆疊,請明確審查每個提交,或在合併前使用 --base 審查分支。

平行結案

如果格式化會變更程式碼行位置,請先進行格式化。然後可以平行執行測試和審查:

scripts/codex-review --parallel-tests "<focused test command>"

取捨:測試可能會強制變更程式碼,從而使審查結果過時。如果測試或審查導致程式碼編輯,請重新執行受影響的測試並重新執行審查,直到沒有被接受/可處理的發現為止。一旦該次重新執行成功結束,就停止;不要為了冗餘的確認而再花費一個漫長的審查週期。

情境效率

Codex 審查通常很嘈雜。當子代理可用時,預設使用子代理過濾。要求子代理執行審查並僅回傳:

  • 其接受的可處理發現
  • 其拒絕的發現,附上一行理由
  • 需要重新執行的確切檔案/測試

僅在變更很小或子代理不可用時,才內嵌執行。

輔助工具

內建的輔助工具:

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

如果是從 agent-scripts 安裝,路徑為:

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

該輔助工具:

  • 優先選擇本機 dirty --uncommitted 模式
  • 否則,如果 gh pr view 有效,則使用當前的 PR 基底
  • 否則,對於非 main 分支使用 origin/main
  • 對已提交的工作(尤其是落地後的乾淨 main)使用 --mode commit --commit <ref>
  • 對於 PR/分支工作,應保持 --mode auto 或強制設為 --mode branch;提交後不要強制設為 --mode local
  • 除非設定了 --output 或 CODEX_REVIEW_OUTPUT,否則僅寫入 stdout
  • 支援 --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.

相關技能