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.