| name | code-review |
| description | Review code for bugs, security vulnerabilities, performance issues, and style problems. Provide actionable feedback with severity levels and fix suggestions. Use when the user asks to review, audit, or check code quality, or wants a second pair of eyes on a pull request, diff, or code change.
|
| license | MIT |
| metadata | {"author":"welcome","version":"1.0"} |
Code Review
When to use this skill
Use this skill when the user needs to:
- Review code for correctness, bugs, or logic errors
- Audit code for security vulnerabilities
- Check for performance issues or anti-patterns
- Review a pull request or diff
- Get feedback on code style and maintainability
- Validate error handling and edge cases
Review Process
Follow this checklist for every review. Check categories in order of severity.
1. Security (Critical)
2. Correctness (High)
3. Performance (Medium)
4. Maintainability (Low)
Output Format
For each finding, use this structure:
### [SEVERITY] Brief title
**File**: `path/to/file.py` line 42-48
**Category**: Security | Correctness | Performance | Maintainability
**Problem**: Clear description of what's wrong and why it matters.
**Suggestion**:
```python
# Before (problematic)
query = f"SELECT * FROM users WHERE id = {user_id}"
# After (fixed)
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
Severity levels:
- **CRITICAL**: Security vulnerability or data loss risk. Must fix before merge.
- **HIGH**: Bug that will cause incorrect behavior. Should fix before merge.
- **MEDIUM**: Performance issue or code smell. Fix soon.
- **LOW**: Style or maintainability suggestion. Nice to have.
## Review Summary Template
After reviewing all code, provide a summary:
```markdown
## Review Summary
**Overall**: APPROVE / REQUEST CHANGES / NEEDS DISCUSSION
**Findings**: X critical, Y high, Z medium, W low
### Critical/High Items (must address)
1. [Brief description + location]
### Medium Items (should address)
1. [Brief description + location]
### Low Items (optional)
1. [Brief description + location]
### Positive Observations
- [Good patterns or practices noticed]
Language-Specific Checks
Python
- Mutable default arguments (
def f(items=[]) — use None instead)
- Bare
except: clauses (catch specific exceptions)
== vs is for None checks (use is None)
- f-strings with user input in SQL/shell commands
JavaScript/TypeScript
== vs === (prefer strict equality)
- Missing
await on async functions
- Prototype pollution via unchecked object spread
innerHTML with user content (use textContent)
Go
- Unchecked errors (
err assigned but not checked)
- Goroutine leaks (unbuffered channels, missing context cancellation)
- Race conditions on shared maps
Rust
unwrap() in production code (use ? or handle the error)
- Missing
Send/Sync bounds for concurrent types
Gotchas
- Review the change, not the whole file: Focus on what's new or modified. Don't nitpick existing code unless it interacts with the change.
- Severity matters more than count: One critical security issue outweighs ten style suggestions. Lead with the most important findings.
- Suggest, don't rewrite: Provide enough of a fix to be clear, but don't refactor their entire approach unless asked.
- Check the tests: If there are tests, verify they actually test the behavior, not just run without errors. Missing tests for new behavior is a finding.
- Consider the context: A quick prototype has different standards than production code. Calibrate accordingly.
Validation
After completing a review:
- Every finding has a file location and a clear suggestion
- Severity levels are consistent (don't call style issues "critical")
- The summary accurately reflects the findings
- Positive patterns are acknowledged, not just problems