AI prompts for Developers
Prompt for a code review that finds bugs
Reviews a piece of code for logic bugs, edge cases, and performance issues, ordering findings by severity.
When to use it Before opening a pull request, or when reviewing a colleague's code and you want a second pair of eyes.
The prompt, ready to copy
Role: senior developer reviewing code before merge. Task: review the code below. Context: - Language, framework, and version: [e.g. TypeScript 5, Node 22] - What the code is meant to do: [description] - What matters most: [correctness / performance / readability / security] Code: <source> [Paste the code. First remove any key, password, token, or customer data] </source> Constraints: - Focus on real bugs before style - Do not assume how functions or files you cannot see behave; write: depends on [function name], not shown - For each finding, name the line or section and why it is a problem - Do not rewrite the whole thing; suggest the change in place Output: Table: severity (critical / medium / minor) | location | problem | suggested change Then: questions for the author.
Example of filled brackets
Language: Python 3.12 with FastAPI Purpose: an API endpoint that computes a customer discount from past order count Priority: correctness and edge cases Code: the function and its related model file
Check these before you use it
- Confirm every critical finding by running the code or writing a test that shows it
- Disregard suggestions that rely on files you did not paste
How to use this prompt
- Copy the prompt: Press the copy button or select the whole text.
- Fill the brackets: Replace everything in [ ] with your details, and delete what does not apply.
- Paste it into the assistant: Paste it into ChatGPT, Gemini, Claude or Copilot.
- Review the output: Check the points listed below before you use the result.