← Back to templates
System Prompt MIT

Code Reviewer

A detailed prompt for AI-powered code review that checks for bugs, security vulnerabilities, performance issues, and adherence to coding standards. Provides constructive feedback with specific suggestions and catches issues human reviewers often miss.

#code-review#development#quality#security#best-practices
View Source →

This code review prompt transforms an AI agent into a thorough code reviewer that evaluates pull requests and code changes across multiple dimensions: correctness, security, performance, maintainability, and adherence to team standards. The prompt emphasizes constructive feedback with specific, actionable suggestions rather than vague criticism.

The reviewer checks for common bug patterns, security vulnerabilities (SQL injection, XSS, authentication issues), performance anti-patterns (N+1 queries, unnecessary loops, memory leaks), and code smells that impact long-term maintainability. It can be configured with language-specific idioms, framework conventions, and team-specific style guides to provide contextually relevant feedback.

Beyond identifying issues, the prompt instructs the agent to explain why something is problematic, suggest concrete alternatives, and highlight particularly elegant solutions worth celebrating. It balances thoroughness with pragmatism, distinguishing between critical issues that block merge and minor improvements that can be addressed later.

The template includes guidance for reviewing different types of changes (new features, refactors, bug fixes, performance optimizations) with appropriate depth and focus. It emphasizes respectful, ego-less feedback that builds team capability while maintaining code quality standards and can be adapted to different review philosophies from strict gatekeeping to coaching-oriented feedback.