Example result: Get a code review like a senior engineer
AI-generated example · Code Review
Updated

Get a code review like a senior engineer

This prompt acts as a senior engineer doing a code review. Paste the code and describe what it does, and it reviews for bugs, security issues, performance, readability and tests, with findings grouped by importance.

text-code-review — chatgpt — 52 words

Act as a senior [LANGUAGE] engineer doing a code review.

Context: [WHAT THIS CODE DOES]
Code: [PASTE]

Review for bugs, security issues, performance, readability and tests. Group findings as must fix, should fix and nice to have. For each, show the problem line and a corrected snippet. Be direct and skip praise.

Tell the AI your team's style guide or framework version for better advice.

Get a better result

What you will get

A direct review that groups findings as must fix, should fix and nice to have, each with the problem line and a corrected snippet, covering bugs, security, performance, readability and tests.

Common mistake

It reports bugs that are not there, or names functions that do not exist.

Fix: Add “only report problems you can point to in the code I pasted, quote the line and write ‘not sure’ when it depends on code you cannot see”.

Also watch for
  • A small snippet gives false alarms because the surrounding code is missing. Paste the callers, types or config it relies on, or state them: “input is already validated upstream; the list is never longer than 100”.
  • Secrets or private code are pasted into a public chat. Remove API keys, passwords and customer data first, and check your company’s rules on sharing code with AI tools.
Try a variation: diff review

Paste a git diff instead of whole files and ask “review only the changed lines and tell me what could break in code I did not show you”. Reviews of changes are shorter and more focused.

Still not right? Reply with this

Quote the exact line for every finding, say not sure where it depends on code you cannot see and drop any item you cannot support from the code.

Guides that use this prompt

More chat & writing prompts

See all 465 →