Reviews pull requests and code changes for quality, security, and best practices. Use when user asks for code review, PR review, or mentions reviewing changes.
npx playbooks add skill charon-fan/agent-playbook --skill code-reviewer
A comprehensive code review skill that analyzes pull requests and code changes for quality, security, maintainability, and best practices.
This skill activates when you:
git diff main...HEAD --name-only
git log main...HEAD --oneline
git diff main...HEAD
Use this structured format for review feedback:
# Code Review
## Summary
Brief overview of the changes (2-3 sentences).
## Issues by Severity
### Critical
Must fix before merge.
- [ ] **Issue Title**: Description with file:line reference
### High
Should fix before merge unless there's a good reason.
- [ ] **Issue Title**: Description with file:line reference
### Medium
Consider fixing, can be done in follow-up.
- [ ] **Issue Title**: Description with file:line reference
### Low
Nice to have improvements.
- [ ] **Issue Title**: Description with file:line reference
## Positive Highlights
What was done well in this PR.
## Suggestions
Optional improvements that don't require immediate action.
## Approval Status
- [ ] Approved
- [ ] Approved with suggestions
- [ ] Request changes
| Issue | Pattern | Recommendation |
|-------|----------|----------------|
| Hardcoded secrets | const API_KEY = "sk-" | Use environment variables |
| SQL injection | \"SELECT * FROM...\" + user_input | Use parameterized queries |
| XSS vulnerability | innerHTML = user_input | Sanitize or use textContent |
| Missing auth check | New endpoint without @RequireAuth | Add authentication middleware |
| Issue | Pattern | Recommendation |
|-------|----------|----------------|
| N+1 query | Loop with database call | Use eager loading or batch queries |
| Unnecessary re-render | Missing dependencies in useEffect | Fix dependency array |
| Memory leak | Event listener not removed | Add cleanup in useEffect return |
| Inefficient loop | Nested loops O(n²) | Consider hash map or different algorithm |
| Issue | Pattern | Recommendation |
|-------|----------|----------------|
| Duplicate code | Similar blocks repeated | Extract to function |
| Magic number | if (status === 5) | Use named constant |
| Long function | Function >50 lines | Split into smaller functions |
| Complex condition | a && b || c && d | Extract to variable with descriptive name |
| Issue | Pattern | Recommendation |
|-------|----------|----------------|
| No tests | New feature without test file | Add unit tests |
| Untested edge case | Test only covers happy path | Add edge case tests |
| Brittle test | Test relies on implementation details | Test behavior, not implementation |
| Missing assertion | Test doesn't assert anything | Add proper assertions |
unknown instead of any for untyped valuesinterface for public APIs, type for unionsas assertions when possibleuseCallback/useMemo appropriately (not prematurely)Confirm the following:
Run the review checklist script:
python3 scripts/review_checklist.py --base main --output review-checklist.md
references/checklist.md - Complete review checklistreferences/security.md - Security review guidelinesreferences/patterns.md - Common patterns and anti-patternsWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.