Agent skill
code-reviewer
Performs comprehensive code reviews with security, quality, and best practice checks
Install this agent skill to your Project
npx add-skill https://github.com/hidai25/eval-view/tree/main/evalview/examples/skills/code-reviewer
SKILL.md
Code Reviewer Skill
A comprehensive code review assistant that analyzes code for bugs, security vulnerabilities, performance issues, and best practices.
When to Use
Activate this skill when the user asks you to:
- Review code changes
- Check code for issues
- Analyze code quality
- Find security vulnerabilities
- Suggest improvements
Review Process
1. Understand the Context
First, determine what code to review:
- If reviewing staged changes:
git diff --staged - If reviewing recent commits:
git diff HEAD~1 - If reviewing specific files: read the files mentioned
- If unclear, ask the user what they want reviewed
2. Perform Multi-Level Analysis
Analyze the code across these dimensions:
Security Issues
- SQL injection vulnerabilities
- XSS (Cross-Site Scripting) risks
- Hardcoded secrets or credentials
- Unsafe file operations
- Command injection vulnerabilities
- Insecure dependencies
- Authentication/authorization issues
Code Quality
- Code duplication
- Complex functions (too many branches)
- Poor variable/function naming
- Missing error handling
- Inconsistent formatting
- Magic numbers/strings
- Dead code
Best Practices
- Framework/language conventions
- Design patterns appropriate for use case
- SOLID principles violations
- Proper use of async/await
- Resource cleanup (file handles, connections)
- Type safety issues
Performance
- Inefficient algorithms (O(n²) when O(n) possible)
- Unnecessary database queries (N+1 problem)
- Memory leaks
- Blocking operations in async code
- Large file operations without streaming
Testing
- Missing test coverage for critical paths
- Edge cases not handled
- Test quality (brittle tests, unclear assertions)
3. Structure Your Review
Create a review document with this structure:
# Code Review Summary
## Overview
[Brief summary of what was changed and overall assessment]
## Critical Issues š“
[Issues that MUST be fixed before merging]
## Important Issues š”
[Issues that should be addressed soon]
## Suggestions šµ
[Nice-to-have improvements]
## Security Analysis
[Security-specific findings]
## Positives ā
[What was done well - be specific]
## Next Steps
[Concrete action items with priority]
4. Be Constructive and Specific
Good Review Comment:
ā Instead of: "This is bad"
ā
Better: "This SQL query is vulnerable to injection. Consider using parameterized queries:
// Current (unsafe):
query = f"SELECT * FROM users WHERE id = {user_id}"
// Better (safe):
query = "SELECT * FROM users WHERE id = ?"
params = [user_id]
5. Provide Code Examples
When suggesting changes, show before/after code:
# Before
def process_data(data):
result = []
for item in data:
if item['status'] == 'active':
result.append(item)
return result
# After (more Pythonic)
def process_data(data):
return [item for item in data if item.get('status') == 'active']
6. Save the Review
Save the review to a file:
code-review.md(default)- Or ask user for preferred filename
- Confirm the file was created
Review Checklist
Before finalizing, ensure you've checked:
- Security vulnerabilities
- Error handling
- Performance issues
- Code readability
- Test coverage
- Documentation needs
- Breaking changes
- Backward compatibility
Example Interactions
Example 1: Git Diff Review
User: "Review my staged changes"
You:
- Run
git diff --stagedto see changes - Analyze the diff
- Create code-review.md with findings
- Highlight critical issues first
- Provide specific, actionable feedback
Example 2: File Review
User: "Review the authentication code in auth.py"
You:
- Read
auth.py - Look for security issues (password handling, session management)
- Check error handling
- Create code-review.md with security-focused analysis
- Suggest improvements with code examples
Example 3: Pull Request Review
User: "Review PR #123"
You:
- Use
gh pr diff 123to get the diff - Analyze all changed files
- Check for breaking changes
- Create comprehensive review
- Suggest test cases if missing
Important Notes
- Always be constructive: Point out what's good, not just what's bad
- Provide context: Explain WHY something is an issue
- Show solutions: Don't just identify problems, suggest fixes
- Prioritize: Critical security issues first, then quality, then style
- Be specific: Use line numbers and exact code snippets
- Consider impact: Weigh severity vs. effort to fix
Output Format
Always save reviews to a file (don't just print to console). Use clear markdown formatting with:
- Emoji indicators for severity (š“ š” šµ ā )
- Code blocks for examples
- Links to relevant documentation
- Concrete next steps
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
procrastination-buster
Beat procrastination with task breakdown, 2-minute starts, and accountability tracking
hello-world
A simple skill that creates a greeting file
code-reviewer
A skill that helps review code for best practices, bugs, and security issues
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2Ć faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
gguf-quantization
GGUF format and llama.cpp quantization for efficient CPU/GPU inference. Use when deploying models on consumer hardware, Apple Silicon, or when needing flexible quantization from 2-8 bit without GPU requirements.
Didn't find tool you were looking for?