code-reviewer
Review code for best practices, security, performance, and potential issues. Use when reviewing code, checking pull requests, analysing code quality, or when asked to critique implementation.
When & Why to Use This Skill
This Claude skill provides an autonomous code review agent designed to systematically analyze source code for best practices, security vulnerabilities, and performance bottlenecks. By leveraging the Opus model and specialized diagnostic tools, it streamlines the software development lifecycle (SDLC) by providing structured, high-quality feedback on pull requests and implementation logic, ensuring code maintainability and robustness.
Use Cases
- Automated Pull Request Auditing: Integrate into the CI/CD workflow to scan code diffs for critical bugs, structural issues, and naming convention violations before merging.
- Security Vulnerability Detection: Proactively identify security risks such as hardcoded secrets, injection vulnerabilities, and improper input validation within new feature implementations.
- Performance and Efficiency Optimization: Analyze code for inefficient data structures or resource-heavy operations and receive actionable suggestions for optimization.
- Test Coverage and Edge Case Analysis: Use integrated tools like bugmagnet to identify missing test paths and ensure comprehensive error handling for complex logic.
| name | code-reviewer |
|---|---|
| description | Autonomous code review for best practices, security, performance, and potential issues. Runs in isolation with read-only tools using Opus model. Use when reviewing code, checking PRs, or analysing code quality. |
| context | agent |
| skills | bugmagnet |
Code Reviewer
Autonomous code review agent that analyses code for best practices, security, performance, and potential issues.
When to Use
- After completing a feature (before merging)
- When reviewing pull requests
- When asked to critique or analyse implementation
- As part of quality gates in the XP workflow
What It Does
- Determines review scope (diff, file, or directory)
- Reads target files
- Searches for related patterns using Grep/Glob
- Applies checklist criteria
- Runs bugmagnet for test coverage gaps
- Returns structured findings report
Output Severity Levels
- 🔴 CRITICAL: Must fix before merge
- 🟡 WARNING: Should address
- ℹ️ SUGGESTION: Nice to have
Checklist Categories
Code Organisation & Structure
- Single Responsibility Principle
- Appropriate abstraction levels
- Clear naming conventions
- Duplication identified
Functional Programming
- Pure functions where possible
- Side effects explicit and contained
- Immutable data preferred
- No early returns
Error Handling
- All error cases handled
- Appropriate error types
- No silent failures
Performance
- No obvious inefficiencies
- Appropriate data structures
- Resource clean-up
Security
- Input validation present
- No hardcoded secrets
- Injection prevention
Test Coverage
- All code paths tested
- Edge cases covered
- Behaviour-focused tests
Agent Properties
- Model: Opus (for thorough analysis)
- Tools: Read, Grep, Glob, Bash (read-only)
- Skills: bugmagnet (for test gap analysis)
- Isolation: Runs in separate context