Skip to content
CodingIntermediate

Review My Code Like a Senior Developer

Get a structured review of your code covering bugs, readability, and edge cases.

Prompt

Review this code as a senior developer would. Go in this order: 1) actual bugs or logic errors, 2) edge cases that would break it, 3) security concerns if any, 4) readability and naming, 5) anything that could be simpler. For each issue, show the specific line and suggest a fix. If the code is fine in one of these categories, say so briefly and move on — don't invent problems.

Language: {{language}}
What it should do: {{intent}}

Code:
{{code}}

Fill in these placeholders

  • {{language}}
  • {{intent}}
  • {{code}}

How to use it

Always state what the code is supposed to do — most review value comes from the gap between intent and implementation. Test suggested fixes before trusting them.

Example use case

Sanity-checking a function that handles user input before merging it.

Why this prompt works

Asking for a review without a focus produces style comments, because surface issues are the easiest to spot. Naming the concerns you care about, and asking for reasoning with each finding, forces the review deeper. Requiring an explanation also makes it checkable — you can evaluate the argument for a change rather than accepting the change on authority.

What good output looks like

Specific findings with reasoning, ordered by how much they matter, not a list of formatting preferences. If everything is about naming and spacing, tell it those are handled and ask about correctness and edge cases instead.

Common mistakes

  • Pasting code without saying what it is meant to do, so the reviewer cannot tell correct from incorrect.
  • Accepting refactors that make code shorter but harder to read.
  • Treating findings as facts. Some suggestions will be wrong; you are still the reviewer of the review.

Variations worth trying

  • Ask for findings ordered by severity so you are not weighing a naming nit against a real bug.
  • Add 'what would break this in production?' which produces different answers than a general review.
  • Ask what tests would catch the problems it found — often more valuable than the fixes.

Want to write prompts like this yourself? Prompt Engineering for Real Work covers the structure behind every template here — free, no sign-up.