code-review-agent-skill
v1.0.0
Published
Universal code review skill for Claude Code and OpenCode AI agents - SOLID, security, performance analysis
Downloads
94
Maintainers
Readme
Code Review Agent
Universal code review skill for Claude Code and OpenCode AI agents. Performs structured reviews with a senior engineer lens, covering SOLID principles, security, performance, and code quality.
Features
- ✅ SOLID Principles - Detect SRP, OCP, LSP, ISP, DIP violations
- 🔒 Security Scan - XSS, injection, SSRF, race conditions, auth gaps, secrets leakage
- ⚡ Performance - N+1 queries, CPU hotspots, missing cache, memory issues
- 🛡️ Error Handling - Swallowed exceptions, async errors, missing boundaries
- 📏 Boundary Conditions - Null handling, empty collections, off-by-one, numeric limits
- 🗑️ Removal Planning - Identify dead code with safe deletion plans
Installation
Install globally via npm:
npm install -g code-review-agentOr use npx without installation:
npx code-review-agent init --ai claudeUsage
Initialize in Your Project
Navigate to your project directory and run:
For Claude Code:
code-review-agent init --ai claudeFor OpenCode:
code-review-agent init --ai opencodeThis will:
- Create the skill directory structure (
.claude/skills/code-review-expert/or.opencode/skills/code-review-expert/) - Copy all skill files and reference checklists
- Update
CLAUDE.mdorAGENTS.mdwith skill reference
Run Code Review
After initialization, simply run in your AI agent:
/code-review-expertThe skill will automatically review your current git changes.
Command Options
code-review-agent init [options]
Options:
--ai <platform> AI platform: claude or opencode (default: "claude")
--force Overwrite existing files
-h, --help Display help
-V, --version Display versionWorkflow
- Preflight - Scope changes via
git diff - SOLID + Architecture - Check design principles
- Removal Candidates - Find dead/unused code
- Security Scan - Vulnerability detection
- Code Quality - Error handling, performance, boundaries
- Output - Findings by severity (P0-P3)
- Confirmation - Ask user before implementing fixes
Severity Levels
| Level | Name | Action | |-------|------|--------| | P0 | Critical | Must block merge | | P1 | High | Should fix before merge | | P2 | Medium | Fix or create follow-up | | P3 | Low | Optional improvement |
Directory Structure
After initialization, your project will have:
your-project/
├── .claude/ # For Claude Code
│ └── skills/
│ └── code-review-expert/
│ ├── SKILL.md
│ ├── agent.yaml
│ └── references/
│ ├── solid-checklist.md
│ ├── security-checklist.md
│ ├── code-quality-checklist.md
│ └── removal-plan.md
└── CLAUDE.md # Updated with skill reference
# OR
your-project/
├── .opencode/ # For OpenCode
│ └── skills/
│ └── code-review-expert/
│ ├── SKILL.md
│ ├── agent.yaml
│ └── references/
│ ├── solid-checklist.md
│ ├── security-checklist.md
│ ├── code-quality-checklist.md
│ └── removal-plan.md
└── AGENTS.md # Updated with skill referenceExamples
Example 1: Review with Fix
User: /code-review-expert
Agent: [Performs review, finds 3 P1 issues, 5 P2 issues]
Agent: How would you like to proceed?
1. Fix all
2. Fix P0/P1 only
3. Fix specific items
4. No changes
User: 2
Agent: [Implements fixes for P1 issues]Example 2: Review Only
User: /code-review-expert
Agent: [Performs review, finds no critical issues]
Agent: ✅ Clean review - no blocking issues found.
Checked: SOLID, security, performance, error handlingCustomization
You can customize the skill by editing the installed files:
SKILL.md- Modify workflow and review criteriareferences/*.md- Add/remove checklist itemsagent.yaml- Change display name or default prompt
Contributing
Issues and pull requests are welcome!
License
MIT
Related Projects
- Claude Code - AI-powered coding assistant
- OpenCode - Open source AI coding platform
- code-review-expert - Original skill implementation
Support
For issues or questions:
- File an issue on GitHub
- Check existing documentation in the skill files
