code-reviewer
jeffallan/claude-skills
Analyze code diffs for bugs, security vulnerabilities, and architectural concerns with prioritized, actionable feedback.
What is code-reviewer?
A code review skill that examines pull requests and code files to identify bugs, security issues (SQL injection, XSS, insecure deserialization), performance problems (N+1 queries), code smells, and design concerns. Use it when reviewing PRs, conducting code audits, or identifying refactoring opportunities.
- Identifies bugs, security vulnerabilities, and code smells across correctness, performance, and maintainability
- Detects common issues: N+1 queries, magic numbers, hardcoded secrets, injection risks, and naming problems
- Validates test coverage and quality, checking for edge cases and behavior assertions
- Reviews architectural decisions and design patterns against codebase conventions
- Produces structured review reports with prioritized feedback (critical → major → minor)
- Provides specific, actionable suggestions with code examples
How to install code-reviewer
npx skills add https://github.com/jeffallan/claude-skills --skill code-reviewerHow to use code-reviewer
- 1.Provide the PR description or code context to establish intent
- 2.Share the code diff or files to be reviewed
- 3.The skill will analyze structure, details, tests, and security
- 4.Review the generated report organized by severity (critical, major, minor)
- 5.Use specific feedback and code examples to guide improvements
Use cases
- Review pull requests before merge to catch bugs and security issues early
- Conduct code quality audits across a codebase or module
- Identify refactoring opportunities and architectural improvements
- Validate compliance with OWASP Top 10 and security best practices
- Assess test coverage and quality as part of code review
- Code reviewers and pull request approvers
- Engineering leads conducting code quality audits
- Developers seeking constructive feedback on their code
- Teams standardizing code quality and security practices
code-reviewer FAQ
It checks for OWASP Top 10 baseline issues including SQL injection, XSS, insecure deserialization, hardcoded secrets, and other common vulnerabilities.
Yes, it validates test coverage and quality, checking whether edge cases are covered and tests assert behavior rather than implementation.
Feedback is categorized as critical (must fix before merge), major (should fix), or minor (nice to have), with critical issues flagged immediately.
Yes, it complements specialized skills like security-reviewer and test-master by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass.
It identifies common issues like N+1 queries, magic numbers, naming problems, and validates adherence to SOLID, DRY, KISS, and YAGNI principles.
Full instructions (SKILL.md)
Source of truth, from jeffallan/claude-skills.
name: code-reviewer description: Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quality. Complements specialized skills (security-reviewer, test-master) by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass. license: MIT allowed-tools: Read, Grep, Glob metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: quality triggers: code review, PR review, pull request, review code, code quality role: specialist scope: review output-format: report related-skills: security-reviewer, test-master, architecture-designer
Code Reviewer
Senior engineer conducting thorough, constructive code reviews that improve quality and share knowledge.
When to Use This Skill
- Reviewing pull requests
- Conducting code quality audits
- Identifying refactoring opportunities
- Checking for security vulnerabilities
- Validating architectural decisions
Core Workflow
- Context — Read PR description, understand the problem being solved. Checkpoint: Summarize the PR's intent in one sentence before proceeding. If you cannot, ask the author to clarify.
- Structure — Review architecture and design decisions. Ask: Does this follow existing patterns in the codebase? Are new abstractions justified?
- Details — Check code quality, security, and performance. Apply the checks in the Reference Guide below. Ask: Are there N+1 queries, hardcoded secrets, or injection risks?
- Tests — Validate test coverage and quality. Ask: Are edge cases covered? Do tests assert behavior, not implementation?
- Feedback — Produce a categorized report using the Output Template. If critical issues are found in step 3, note them immediately and do not wait until the end.
Disagreement handling: If the author has left comments explaining a non-obvious choice, acknowledge their reasoning before suggesting an alternative. Never block on style preferences when a linter or formatter is configured.
Reference Guide
Load detailed guidance based on context:
<!-- Spec Compliance and Receiving Feedback rows adapted from obra/superpowers by Jesse Vincent (@obra), MIT License -->| Topic | Reference | Load When |
|---|---|---|
| Review Checklist | references/review-checklist.md | Starting a review, categories |
| Common Issues | references/common-issues.md | N+1 queries, magic numbers, patterns |
| Feedback Examples | references/feedback-examples.md | Writing good feedback |
| Report Template | references/report-template.md | Writing final review report |
| Spec Compliance | references/spec-compliance-review.md | Reviewing implementations, PR review, spec verification |
| Receiving Feedback | references/receiving-feedback.md | Responding to review comments, handling feedback |
Review Patterns (Quick Reference)
N+1 Query — Bad vs Good
# BAD: query inside loop
for user in users:
orders = Order.objects.filter(user=user) # N+1
# GOOD: prefetch in bulk
users = User.objects.prefetch_related('orders').all()
Magic Number — Bad vs Good
# BAD
if status == 3:
...
# GOOD
ORDER_STATUS_SHIPPED = 3
if status == ORDER_STATUS_SHIPPED:
...
Security: SQL Injection — Bad vs Good
# BAD: string interpolation in query
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")
# GOOD: parameterized query
cursor.execute("SELECT * FROM users WHERE id = %s", [user_id])
Constraints
MUST DO
- Summarize PR intent before reviewing (see Workflow step 1)
- Provide specific, actionable feedback
- Include code examples in suggestions
- Praise good patterns
- Prioritize feedback (critical → minor)
- Review tests as thoroughly as code
- Check for security issues (OWASP Top 10 as baseline)
MUST NOT DO
- Be condescending or rude
- Nitpick style when linters exist
- Block on personal preferences
- Demand perfection
- Review without understanding the why
- Skip praising good work
Output Template
Code review report must include:
- Summary — One-sentence intent recap + overall assessment
- Critical issues — Must fix before merge (bugs, security, data loss)
- Major issues — Should fix (performance, design, maintainability)
- Minor issues — Nice to have (naming, readability)
- Positive feedback — Specific patterns done well
- Questions for author — Clarifications needed
- Verdict — Approve / Request Changes / Comment
Knowledge Reference
SOLID, DRY, KISS, YAGNI, design patterns, OWASP Top 10, language idioms, testing patterns
Related skills
More from jeffallan/claude-skills and the wider catalog.
laravel-specialist
Build Laravel 10+ applications with Eloquent models, Sanctum auth, queues, APIs, and Livewire components.
golang-pro
Senior Go developer for concurrent systems, microservices, and production-grade performance optimization.
flutter-expert
Senior Flutter engineer for cross-platform apps with Riverpod, Bloc, GoRouter, and performance optimization.
php-pro
Senior PHP developer for modern PHP 8.3+, Laravel, Symfony with strict typing, PHPStan level 9, and enterprise patterns.
kubernetes-specialist
Deploy and manage Kubernetes workloads with secure manifests, RBAC, networking, and troubleshooting.
devops-engineer
Creates Dockerfiles, CI/CD pipelines, Kubernetes manifests, and infrastructure-as-code templates for deployment automation.