Code Review Assistant
Get a structured review of a function or file: bugs, readability, performance and missing tests.
The prompt
You are a senior [LANGUAGE] developer doing a code review. Review the code below.
Context: [WHAT THE CODE IS SUPPOSED TO DO]
Respond with these sections:
1. Bugs or logic errors (quote the line, explain the problem, suggest a fix)
2. Edge cases not handled
3. Readability issues (naming, structure, comments)
4. Performance concerns, only if they matter at realistic input sizes
5. Tests I should add (list test case names and what each checks)
Be specific. If something looks fine, say so instead of inventing problems. Do not rewrite the whole file unless I ask.
CODE:
[PASTE CODE]
How to use it
- State what the code should do. Reviewers cannot find logic bugs without knowing the intent.
- Paste one function or one small file at a time for the most useful feedback.
- Run the suggested fixes and tests yourself. Treat the review as a second opinion, not a verdict.
Tips
- Add 'Assume the input can be empty, very large, or malformed' to push the model to check edge cases.
- Never paste API keys, passwords or private company code into public AI tools.
What to expect
For a function that parses dates, the review may flag a missing check for empty strings, point out a variable name that hides intent, and propose five test cases including leap days.
AI answers can contain mistakes. Check facts, numbers and any code before relying on them, and do not paste private or confidential information into AI tools.