| name | code-review-checklist |
| description | Systematic code review guidelines and checklist. Use this skill when reviewing code, conducting pull request reviews, or establishing code quality standards. Provides comprehensive review criteria covering functionality, design, testing, security, and documentation. Complements the code-quality agent. |
Code Review Checklist
Overview
This skill provides a systematic approach to code reviews, ensuring consistent quality standards across your codebase. Use it to conduct thorough, constructive code reviews that improve code quality and team knowledge sharing.
When to Use This Skill
- Reviewing pull requests
- Conducting pair programming sessions
- Establishing code review standards for your team
- Self-reviewing code before submitting
- Mentoring junior developers on code quality
- Complementing the code-quality agent for comprehensive reviews
Core Review Categories
1. Functionality & Correctness
Does the code work as intended?
Questions to Ask:
- What happens if this API call fails?
- Are all user inputs validated?
- What if the array is empty?
- Are there any race conditions?
2. Design & Architecture
Is the code well-designed?
Red Flags:
- God classes (doing too much)
- Excessive method parameters (>3-4)
- Deep nesting (>3 levels)
- Duplicate code (DRY violation)
- Overly clever code (premature optimization)
3. Readability & Maintainability
Can others understand and maintain this code?
Naming Conventions:
function d(a, b) { return a + b; }
const x = 42;
function calculateTotalPrice(basePrice, taxRate) {
return basePrice * (1 + taxRate);
}
const MAX_RETRY_ATTEMPTS = 3;
4. Testing
Is the code adequately tested?
Test Quality Checks:
- Tests follow AAA pattern (Arrange, Act, Assert)
- Mocks/stubs are used appropriately
- Tests are independent (no shared state)
- Test data is meaningful, not random
5. Security
Is the code secure?
OWASP Top 10 Considerations:
- Injection flaws
- Broken authentication
- Sensitive data exposure
- XML external entities (XXE)
- Broken access control
- Security misconfiguration
- Cross-site scripting (XSS)
- Insecure deserialization
- Using components with known vulnerabilities
- Insufficient logging & monitoring
6. Performance
Will this code perform well at scale?
Performance Anti-Patterns:
- Synchronous I/O in loops
- Missing database indexes
- Loading entire datasets into memory
- Unnecessary object creation
- Inefficient algorithms (O(n²) where O(n) possible)
7. Documentation
Is the code adequately documented?
Good Comment Example:
retry_delay = base_delay * (2 ** attempt)
retry_delay = base_delay * (2 ** attempt)
8. Dependencies & Libraries
Are dependencies managed properly?
9. Error Handling & Logging
Are errors handled gracefully?
Logging Best Practices:
logger.error('Payment processing failed', {
orderId: order.id,
userId: user.id,
amount: payment.amount,
errorCode: error.code
});
console.log('Error');
10. Code Style & Consistency
Does the code follow team standards?
Review Process Guidelines
Before You Review
-
Understand the context
- Read the PR description
- Review linked issues/tickets
- Understand the "why" behind the change
-
Set aside time
- Don't rush reviews
- Block dedicated time for thorough analysis
- Review in multiple sessions if large PR
-
Check CI/CD
- Ensure tests pass
- Check build succeeds
- Review test coverage reports
During Review
-
Be constructive
- Praise good code
- Suggest, don't demand
- Explain your reasoning
- Offer alternatives
-
Use review labels
- Nitpick: Minor suggestion, not blocking
- Question: Seeking clarification
- Suggestion: Proposed improvement
- Issue: Needs to be addressed before merge
-
Focus on what matters
- Prioritize functionality and security
- Don't bike-shed over style (use linters)
- Consider technical debt trade-offs
Giving Feedback
Good Feedback Examples:
✅ "Great use of the factory pattern here! This makes the code much
more testable. Consider extracting the validation logic into a
separate validator class for even better separation of concerns."
✅ "Question: What happens if the API returns a 429 (rate limit)?
Should we implement exponential backoff here?"
✅ "Suggestion: Instead of nested if statements, consider using
early returns to reduce complexity:
[code example]"
Avoid:
❌ "This is wrong."
❌ "Why didn't you use X pattern?"
❌ "This code is terrible."
❌ Rewriting entire sections without explanation
Review Size Guidelines
Small PR (< 200 lines):
- Ideal size
- 15-30 minutes to review
- Easy to understand and test
Medium PR (200-500 lines):
- Acceptable
- 30-60 minutes to review
- May need to be split across sessions
Large PR (> 500 lines):
- Request split into smaller PRs
- Difficult to review thoroughly
- Higher chance of bugs slipping through
Self-Review Checklist
Before submitting your PR, review your own code:
Team-Specific Considerations
Customize this checklist for your team:
- Technology-specific checks (React hooks rules, async/await patterns)
- Business logic validation (pricing calculations, data transformations)
- Compliance requirements (GDPR, HIPAA, SOX)
- Company coding standards (internal style guides)
- Performance benchmarks (API response time < 200ms)
Quick Reference: Review Commands
Inline Comments:
- Be specific: Reference line numbers
- Provide examples: Show better alternatives
- Link to docs: Reference style guides
Approval Criteria:
- All tests pass
- No security vulnerabilities
- Meets acceptance criteria
- Documentation updated
- Code quality standards met
Request Changes When:
- Bugs or logic errors present
- Security issues found
- Tests are missing or inadequate
- Breaks existing functionality
- Violates architectural principles
Resources
For deeper dives, see:
.claude/skills/README.md - Skills system overview
- OWASP guidelines for security reviews
- Google's Code Review Developer Guide
- Team-specific style guides