SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

[No.136] 3 God-tier Claude Code Review Prompts — PR Diff Template Practical Pack

For those who find PR reviews ending in a diff nightmare, I have compiled 3 types of prompts for Claude that you can use by copy-pasting.
By specifying the perspective, output format, and reader, you can easily standardize the quality and speed of your feedback.


What this article includes

  • Prompts ①②③ — Full text ready to use by just replacing the square brackets `[…]`

  • This week's PR checklist — 5 items to fill out before pasting

  • Snippets save labels — Short names for IDE / Notion

  • 3 common mistakes — Dumping, no diffs, no perspective


One move to try this week

This week's PR — Paste Prompt ① and use the output directly as a draft for your review comments.


Prompt ① — Security, Bugs, Performance (3 points each)

あなたはシニアエンジニアです。以下のコード/差分をレビューしてください。

【観点】
- セキュリティ: 重大度順に最大3点
- バグ: 再現しうるものを最大3点
- 性能: ボトルネックになりうるものを最大3点

【出力形式】
各観点を見出し+箇条書き。各項目に「重大度(高/中/低)」と「修正案1行」を付ける。

【コード/差分】
[ここに diff または該当ファイルを貼る]

Prompt ② — Inferring change intent → Listing risks

以下は git diff のみです。コミットメッセージはありません。

1. 変更の意図を2文で推測する
2. 意図と実装のズレがありうる箇所を列挙
3. 本番で起きうるリスクを優先度順に5つ

【diff】
[ここに diff を貼る]

Prompt ③ — Explanation for Juniors + Improvement suggestions

以下のレビュー指摘を、Juniorエンジニア向けに説明してください。

- 専門用語は平易語に置き換える
- 「なぜ問題か」「どう直すか」を各指摘2文以内
- 最後に「学びの要点」を3行

【指摘または diff】
[ここに貼る]

Checklist before pasting

  • [ ] Diff only or did you add one line of necessary context (file name, purpose)?

  • [ ] Secret information (API keys, personal data) masked?

  • [ ] Perspective written in the prompt? (No dumping allowed)

  • [ ] Is it based on the premise that a human will do a final check instead of merging as-is?

  • [ ] Have you saved good outputs to Snippets?


Snippets save names (example)

  • `claude-review-sec-bug-perf`

  • `claude-review-diff-risk`

  • `claude-review-junior-explain`


Reference


Disclaimer

This is an introduction to general-purpose prompt techniques. Please follow your company's policy regarding the external transmission of confidential code. Claude's output must always be verified by a human.


Edo Tech Kawaraban — Survival Strategy in the AI Era

いいなと思ったら応援しよう!