讓 Codex 對你的 git diff 做一次有紀律的 code review:分三軌(正確性 bug/可簡化重用/安全)逐項列出,每個發現都標信心等級、給可貼的修正,並明確說「沒問題就說沒問題」,不無病呻吟。
不用離開網站,直接看這組 prompt 跑出來長怎樣(AI 即時生成,扣 1 點)。
不只複製貼上 — 下載後放到 ~/.claude/skills/rigorous-diff-review/SKILL.md,之後每個 session 自動可用(觸發時自動載入)。
mkdir -p ~/.claude/skills/rigorous-diff-review && mv ~/Downloads/SKILL.md ~/.claude/skills/rigorous-diff-review/SKILL.mdNew-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\skills\rigorous-diff-review" | Out-Null; Move-Item "$env:USERPROFILE\Downloads\SKILL.md" "$env:USERPROFILE\.claude\skills\rigorous-diff-review\SKILL.md"何時用:提交 PR 前、或請人 review 前,先讓 Codex 自己過一遍,省 reviewer 時間。為何有效:① 強迫它先 `git diff` 抓真實 diff(不是憑空評論),② 三軌分開跑避免「只看正確性、漏掉安全」,③ 信心等級+可貼 patch 讓你能快速採納或駁回,④ 明確允許「沒問題就說沒問題」破解 AI 愛無中生有湊發現的毛病。技巧:在 Codex 用 `codex exec --sandbox read-only "<貼上此 prompt>"` 跑成唯讀審查最安全;{{FOCUS_AREAS}} 留空它就以正確性為重,填「並發安全」「SQL 注入」可聚焦。Claude Code 直接貼進對話即可。
[TRACK A] [CONFIDENCE: high] src/cart.ts:42 What: applyDiscount 在 items 為空陣列時回傳 NaN Why it matters: 空購物車結帳會把 NaN 寫進訂單金額,下游付款端會拋錯 Fix: const subtotal = items.reduce((a, i) => a + i.price, 0); if (items.length === 0) return 0; [TRACK B] [CONFIDENCE: medium] src/cart.ts:55 What: 手寫的 round-to-2 與既有 utils/money.ts 的 toCents() 重複 Why it matters: 兩套四捨五入邏輯會在邊界分歧(0.005) Fix: import { toCents } from '../utils/money' Track C: no issues found VERDICT: merge-after-fixes。先修 src/cart.ts:42 的空陣列 NaN,這會直接影響結帳。
以上為此 Prompt 丟進 Claude Code / Codex 後可得到的描述性成果,實際畫面會因填入的變數而有差異。
[BASE_REF]要 diff 的基準(如 main、HEAD~1、某 commit hash);留空預設 HEAD(即未提交的工作區變更)
[FOCUS_AREAS]想特別聚焦的面向(如「並發與資源洩漏」「輸入驗證」),留空則以正確性為主
填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。
You are reviewing the current uncommitted change in this repository. Be a rigorous, skeptical reviewer — but only flag things you can defend. Do NOT invent problems to look useful.
## Step 0 — Gather the diff yourself
Run `git diff {{BASE_REF}}` (default to `git diff HEAD` if no base is given) and, if helpful, `git diff {{BASE_REF}} --stat`. Read the FULL surrounding context of each changed file, not just the hunk — open the file and read the functions the change touches and their callers. If an AGENTS.md / CLAUDE.md exists, read it for project conventions before judging style.
## Step 1 — Review on three independent tracks
Go through the diff three separate times, one lens each:
**Track A — Correctness (highest priority).** Logic errors, off-by-one, wrong operator, inverted condition, null/undefined/None deref, unhandled error path, async/await or promise misuse, race conditions, resource leaks (unclosed handles/connections), incorrect edge-case handling (empty input, zero, negative, very large), broken invariants, wrong type coercion. For each: explain the concrete input/scenario that triggers the bug.
**Track B — Simplification & reuse.** Duplicated logic that already exists elsewhere in the repo (search to confirm before claiming it), dead code, needless abstraction, a stdlib/existing-helper call that replaces hand-rolled code, over-broad scope, complex expression that has a clearer equivalent. Only suggest if it's a genuine, net simplification — not a lateral rewrite to your taste.
**Track C — Security.** Injection (SQL/command/template), missing input validation on a trust boundary, secrets/keys/tokens committed or logged, authz/authn check missing on a sensitive path, unsafe deserialization, SSRF/path-traversal, unparameterized queries, sensitive data in error messages. Flag only real, reachable issues in THIS diff.
## Step 2 — Output format
For each finding, output exactly:
```
[TRACK A/B/C] [CONFIDENCE: high/medium/low] file:line
What: <one-line description>
Why it matters: <the concrete failing scenario or risk>
Fix: <a minimal, ready-to-paste code suggestion or diff>
```
Order findings by track (A → B → C), then by confidence (high first). At the end, give a 2-3 line VERDICT: is this safe to merge, merge-after-fixes, or needs-rework — and the single most important thing to address.
## Hard rules
- If a track has no real issues, write `Track X: no issues found` and move on. Empty is a valid, good result.
- Never mark a guess as `high` confidence. Use `low` when you couldn't fully verify (e.g. behavior depends on code you couldn't read).
- Do NOT rewrite the whole file or restyle code that works. Scope = the diff.
- Cite real `file:line`. Do not fabricate line numbers — read the file to get them right.
- Focus on {{FOCUS_AREAS}} if specified; otherwise weight Track A heaviest.
這組 prompt 專為 Claude Code / Codex 設計。把 prompt 內 2 個方括號 [變數] 換成你自己的內容,貼進 Claude Code / Codex 執行即可。難度中等,照變數說明填好後即可上手。
完整 prompt 免費開放閱讀,不用註冊;登入後可一鍵複製、收藏與留言。
prompt 文字本身你可自由使用與修改。但 AI 生成物(圖/音樂/影片/文字)的商用授權,取決於你在 Claude Code / Codex 使用的方案與其官方服務條款,請以該工具的授權規範為準。
Studio engineer 視角拆解 Suno 致命弱點(油炸 vocals、高頻 artifact)+ 4 步驟 DAW workflow + Suno Studio 修音 prompt
提案產生器 / 會議處理器 / 內容再利用 / 週五回顧 / 收工 reset — 試了 40 個只有這 5 個沒被丟掉、各省 30+ 分鐘 / 次。
適合:部落格、Medium、Notion 公開頁、Substack — 任何支援 iframe / HTML 嵌入的地方。對方點「看完整」會回到本站、是 prompt 庫的免費 backlink。
<iframe src="https://prompt.luvai.net/embed/codex-rigorous-diff-review" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>
You are reviewing the current uncommitted change in this repository. Be a rigorous, skeptical reviewer — but only flag things you can defend. Do NOT invent problems to look useful.
## Step 0 — Gather the diff yourself
Run `git diff {{BASE_REF}}` (default to `git diff HEAD` if no base is given) and, if helpful, `git diff {{BASE_REF}} --stat`. Read the FULL surrounding context of each changed file, not just the hunk — open the file and read the functions the change touches and their callers. If an AGENTS.md / CLAUDE.md exists, read it for project conventions before judging style.
## Step 1 — Review on three independent tracks
Go through the diff three separate times, one lens each:
**Track A — Correctness (highest priority).** Logic errors, off-by-one, wrong operator, inverted condition, null/undefined/None deref, unhandled error path, async/await or promise misuse, race conditions, resource leaks (unclosed handles/connections), incorrect edge-case handling (empty input, zero, negative, very large), broken invariants, wrong type coercion. For each: explain the concrete input/scenario that triggers the bug.
**Track B — Simplification & reuse.** Duplicated logic that already exists elsewhere in the repo (search to confirm before claiming it), dead code, needless abstraction, a stdlib/existing-helper call that replaces hand-rolled code, over-broad scope, complex expression that has a clearer equivalent. Only suggest if it's a genuine, net simplification — not a lateral rewrite to your taste.
**Track C — Security.** Injection (SQL/command/template), missing input validation on a trust boundary, secrets/keys/tokens committed or logged, authz/authn check missing on a sensitive path, unsafe deserialization, SSRF/path-traversal, unparameterized queries, sensitive data in error messages. Flag only real, reachable issues in THIS diff.
## Step 2 — Output format
For each finding, output exactly:
```
[TRACK A/B/C] [CONFIDENCE: high/medium/low] file:line
What: <one-line description>
Why it matters: <the concrete failing scenario or risk>
Fix: <a minimal, ready-to-paste code suggestion or diff>
```
Order findings by track (A → B → C), then by confidence (high first). At the end, give a 2-3 line VERDICT: is this safe to merge, merge-after-fixes, or needs-rework — and the single most important thing to address.
## Hard rules
- If a track has no real issues, write `Track X: no issues found` and move on. Empty is a valid, good result.
- Never mark a guess as `high` confidence. Use `low` when you couldn't fully verify (e.g. behavior depends on code you couldn't read).
- Do NOT rewrite the whole file or restyle code that works. Scope = the diff.
- Cite real `file:line`. Do not fabricate line numbers — read the file to get them right.
- Focus on {{FOCUS_AREAS}} if specified; otherwise weight Track A heaviest.
把方括號 [ ] 內的變數換成你的內容,丟進 Claude Code / Codex。
六個月在 Claude / GPT-4 / Gemini 上用人工 rater A/B 測 200+ prompt 後寫的。包含 persona+constraint stacking / anti-example / role reversal QA / cognitive scaffold / emotional priming / uncertainty CoT / steelman first。
一年的 role-play system prompt + 14-step framework 後總結:真正改變品質的是 5 個單行 prompt。沒有 role、沒有 markdown、沒有「you are an expert」。