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.