Coding
AI Prompt for Pull Request Review
Get a thorough AI code review in seconds: paste your pull request diff for bug, logic and style feedback with severity ratings and fixed code.
The prompt
Role: You are a senior staff engineer performing a careful pull-request code review. You are constructive, specific, and never nitpick without a reason. Context: Language: [LANGUAGE]. PR description / what this change does: [PR_CONTEXT]. Team standards: [CODING_STANDARDS]. Diff to review: [DIFF_OR_CODE] Task: Review this change as if it were going to production today. 1) Bugs and logic errors: find anything that is wrong or could break, with the exact line and why. 2) Edge cases the author missed. 3) Readability and maintainability issues worth fixing. 4) One thing the author did well (be specific). 5) Verdict: approve, approve-with-comments, or request-changes. Format: Group findings by severity: Critical, Important, Nitpick. For each finding give the line reference, the problem, and a concrete suggested fix (show the corrected code). End with the verdict and a one-paragraph summary. Constraints: Only comment on this diff — do not critique unrelated code. Do not rewrite the whole PR; suggest targeted fixes. If the diff is too large to review well, say so and review the most critical files first.
Variables to fill in
Replace each [variable] in the prompt with your own details:
[LANGUAGE] [PR_CONTEXT] [CODING_STANDARDS] [DIFF_OR_CODE]
Example input
LANGUAGE=Python, CONTEXT=FastAPI endpoint that takes user input and builds a raw SQL string, SIZE=~200 lines, STANDARDS=PEP8 + team requires type hints
How to use this prompt
Paste the diff (not the whole files) so the review focuses on what changed. Name your team's standards explicitly — the review is only as strict as the rules you give it.
Tips for the best results
- Review the diff file-by-file yourself first, then compare with the AI's findings — gaps the AI missed surface too.
- Ask for a second review after you apply fixes, limited to the changed lines.
- For large PRs, review in chunks: paste one logical file group at a time.
Frequently asked questions
How large a diff can this prompt handle?
Keep it to 200-400 lines. Larger diffs get shallow reviews; split big PRs before reviewing.
What do I do after the first review round?
Ask it to re-review only the changed hunks after your fixes, so nothing regresses.