Ask Gemini to review a diff for correctness, security, and clarity, rank findings by severity with a concrete failure scenario each, and skip style nits unless they hide a bug.
提示词
Review this change for correctness, security, and clarity. For each finding: give a severity (blocker / major / minor), the specific failure scenario, and the smallest fix. Skip pure style nits unless they hide a bug. If the change looks safe, say so plainly. Diff: [DIFF].
替换变量
[DIFF]The diff or the changed files.
该用哪个模型
- Gemini 3.1 Pro — Severity judgement and failure scenarios need careful reasoning.
示例输入
- [DIFF] = a pull request touching auth middleware.
示例输出
我们只发布来自真实模型运行的示例输出。此模板尚未经过正式测试,因此不显示输出。请用上方的输入自行运行。
为何这一结构有效
- Severity + failure scenario filters out noise and false alarms.
- Permission to say "looks safe" reduces invented problems.
常见失败与修复
Every line gets a comment.
修复:Cap it: "Report at most the 5 most important findings."
已知局限
- A model review complements, not replaces, human review and tests.