DEV Community

Suifeng023
Suifeng023

Posted on

Stop Asking AI to Review Your Pull Requests Like a Chatbot

Most AI code review prompts fail for a boring reason:

They ask for feedback instead of asking for a review artifact.

If you paste a diff into ChatGPT, Claude, or Copilot Chat and say:

Review this PR.

You will usually get a helpful-sounding summary, a few generic suggestions, and maybe one or two real issues.

That is not enough for production work.

A better AI review prompt should force the assistant to behave like a strict reviewer, separate certainty from suspicion, and return comments you can actually act on before a human reviewer spends time on the PR.

The wrong mental model

The wrong mental model is:

AI is my reviewer.

The safer mental model is:

AI is my pre-review checklist runner.

AI should not approve the pull request. It should help you find the obvious problems, missing context, weak tests, and risky assumptions before another person has to review it.

That means the output should be structured.

What I want from an AI PR review

When AI materially helped write a pull request, I want a pre-review pass that checks:

  • whether the implementation matches the stated goal
  • whether the PR expanded scope unnecessarily
  • logic errors or fragile assumptions
  • missing edge cases
  • API, schema, or contract changes
  • security and privacy risks
  • data integrity risks
  • performance concerns
  • weak or missing tests
  • maintainability problems
  • rollback or deployment risk

The important part is that I do not want a vague essay.

I want a review packet.

A better prompt shape

Use a prompt like this:

Act as a strict senior engineer reviewing this pull request before human review.

Context:
- Goal of the PR: [paste goal]
- Intended behavior: [paste expected behavior]
- Files changed: [paste file list]
- Diff or relevant code: [paste code]

Return:
1. Top 5 risks, ordered by severity
2. Specific review comments I should address before requesting review
3. Missing or weak tests
4. Possible security/privacy/data integrity concerns
5. Any unclear requirements or missing context
6. A final recommendation: ready for human review, needs changes, or needs more context

Rules:
- Do not approve the PR.
- If you are uncertain, say what evidence is missing.
- Prefer specific comments over general advice.
- Separate blocking issues from optional improvements.
Enter fullscreen mode Exit fullscreen mode

This works better because it gives the model a job, a structure, and constraints.

The PR template matters too

The prompt is only half the workflow.

Your pull request description should also make AI review easier. A good PR template should include:

  • what changed
  • why it changed
  • what is intentionally out of scope
  • screenshots or examples if relevant
  • tests run
  • known risks
  • rollback plan
  • whether AI helped generate or modify the code
  • whether an AI pre-review was completed

That last point is useful because it makes AI involvement visible without turning it into drama.

The team is not asking, "Did you use AI?"

The team is asking, "Did you do the review hygiene required for AI-assisted code?"

The real benefit

The real benefit is not that AI catches every bug.

It will not.

The benefit is that it reduces low-quality review requests.

Before a human reviewer sees the PR, you have already forced yourself to explain the goal, identify risk, check test coverage, and ask a second system to look for obvious mistakes.

That is valuable even when the AI misses something.

A simple rule for teams

Here is the rule I would use:

If AI materially helped write the PR, run a structured AI pre-review before requesting human review.

Not because AI is always right.

Because AI-assisted code can make it easier to ship code faster than your review process can absorb.

A structured pre-review slows the dangerous parts down just enough.


I also packaged my broader developer prompt workflows into a small downloadable markdown pack: Developer's Prompt Engineering Bible.

It includes prompt patterns for code review, debugging, architecture, testing, documentation, refactoring, DevOps, databases, and security.

If useful, you can get it here: https://payhip.com/b/ADsQI

Top comments (0)