Code Review
Perform a thorough code review of staged or unstaged changes.
What to review
- •
Security
- •No hardcoded secrets, tokens, API keys
- •No SQL injection, XSS, command injection vulnerabilities
- •Proper input validation
- •Secure authentication/authorization patterns
- •
Code quality
- •Clear and readable code
- •Appropriate error handling
- •No unnecessary complexity
- •Consistent naming conventions
- •
Performance
- •No obvious performance issues
- •Efficient algorithms and data structures
- •No N+1 queries or unnecessary loops
- •
Best practices
- •Follows project conventions
- •Proper use of types (if applicable)
- •No code duplication
- •Appropriate test coverage considerations
Process
- •Run
git difforgit diff --stagedto get changes - •Analyze each changed file
- •Check for issues in each category
- •Provide actionable feedback
Output format
For each issue found:
- •File: path/to/file.ext:line
- •Severity: Critical / Warning / Suggestion
- •Category: Security / Quality / Performance / Convention
- •Issue: Description of the problem
- •Fix: How to address it
End with a summary: total issues by severity, overall assessment.