Loading...
Loading...
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 skill4agent add charon-fan/agent-playbook code-reviewergit diff main...HEAD --name-only
git log main...HEAD --onelinegit diff main...HEAD# 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 | | Use environment variables |
| SQL injection | | Use parameterized queries |
| XSS vulnerability | | Sanitize or use textContent |
| Missing auth check | New endpoint without | 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 | 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 | | Use named constant |
| Long function | Function >50 lines | Split into smaller functions |
| Complex condition | `a && b |
| 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 |
unknownanyinterfacetypeasuseCallbackuseMemopython scripts/review_checklist.py <pr-number>references/checklist.mdreferences/security.mdreferences/patterns.md