Loading...
Loading...
Perform code reviews following best practices from Code Smells and The Pragmatic Programmer. Use when asked to "review this code", "check for code smells", "review my PR", "audit the codebase", or need quality feedback on code changes. Supports both full codebase audits and focused PR/diff reviews. Outputs structured markdown reports grouped by severity.
npx skill4agent add montimage/skills code-review# Get changed files
git diff --name-only <base>..HEAD
git diff <base>..HEADgit log --format='%H' | head -100 | xargs -I{} git diff-tree --no-commit-id --name-only -r {} | sort | uniq -c | sort -rnCODE_REVIEW.md# Code Review Report
**Date**: YYYY-MM-DD
**Scope**: [PR #123 | Full Audit]
**Files Reviewed**: N
## Summary
| Severity | Count |
|----------|-------|
| Critical | X |
| Major | X |
| Minor | X |
| Info | X |
## Critical Issues
### [Category]: Issue Title
**File**: `path/to/file.ts:42`
**Smell**: [Code smell name]
Description of the issue.
**Before**:
```language
// problematic code// improved code
## Severity Levels
| Level | Description | Action |
|-------|-------------|--------|
| **Critical** | Security risks, bugs, data loss potential | Must fix before merge |
| **Major** | Code smells, maintainability blockers | Should fix soon |
| **Minor** | Style, minor improvements | Nice to have |
| **Info** | Suggestions, alternatives | Optional |
## Resources
- [references/code-smells.md](references/code-smells.md) - Complete catalog of code smells with examples