code-reviewer

nodnarbnitram's avatarfrom nodnarbnitram

Review code for best practices, security issues, and potential bugs. Use when reviewing code changes, checking PRs, analyzing code quality, or performing security audits.

⭐1stars🔀1forks📁View on GitHub🕐Updated Dec 27, 2025

When & Why to Use This Skill

This Claude skill automates the process of analyzing source code to ensure high standards of quality, security, and maintainability. It systematically identifies potential bugs, security vulnerabilities like SQL injection or XSS, and performance bottlenecks while ensuring adherence to best practices and consistent coding styles.

Use Cases

  • Pull Request (PR) Automation: Streamline the development workflow by automatically reviewing code changes for logic errors and style violations before human intervention.
  • Security Auditing: Scan codebases for critical vulnerabilities, exposed API keys, and improper input validation to prevent security breaches.
  • Technical Debt Assessment: Analyze existing projects to identify duplicated code, complex logic, and areas requiring refactoring to improve long-term maintainability.
  • Performance Optimization: Detect inefficient algorithms, unoptimized database queries, and potential memory leaks within the source code.
namecode-reviewer
descriptionReview code for best practices, security issues, and potential bugs. Use when reviewing code changes, checking PRs, analyzing code quality, or performing security audits.
allowed-toolsRead, Grep, Glob

Code Reviewer

Perform comprehensive code reviews focusing on quality, security, and maintainability.

Instructions

  1. Read the target files using the Read tool
  2. Search for patterns and related code using Grep
  3. Find related files using Glob
  4. Analyze code against the review checklist
  5. Provide structured feedback with severity levels

Review Checklist

Code Quality

  • Code is simple and readable
  • Functions and variables are well-named
  • No duplicated code (DRY principle)
  • Appropriate comments for complex logic
  • Consistent code style

Security

  • No exposed secrets or API keys
  • Input validation implemented
  • SQL injection prevention
  • XSS prevention for web code
  • Proper authentication/authorization checks

Error Handling

  • Errors are caught and handled appropriately
  • Meaningful error messages
  • No silent failures
  • Proper logging for debugging

Performance

  • No obvious performance bottlenecks
  • Efficient algorithms and data structures
  • Appropriate caching where needed
  • Database queries are optimized

Testing

  • Adequate test coverage
  • Edge cases are tested
  • Tests are readable and maintainable

Output Format

Organize feedback by severity:

Critical (Must Fix)

Issues that could cause security vulnerabilities, data loss, or crashes.

Warning (Should Fix)

Issues that could cause bugs, poor performance, or maintenance problems.

Suggestion (Consider)

Improvements for readability, consistency, or best practices.

Example Feedback

### Critical
- **SQL Injection vulnerability** in `user_service.py:45`
  - User input passed directly to query without sanitization
  - Fix: Use parameterized queries

### Warning
- **Missing error handling** in `api_client.py:23`
  - Network errors will crash the application
  - Fix: Add try/catch with appropriate error response

### Suggestion
- Consider extracting the validation logic in `validators.py:78-95` into a separate function for reusability