Code Review
Scannednpx machina-cli add skill ruslan-korneev/python-backend-claude-plugins/code-review --openclawCode Review Skill
This skill should be used when the user asks for "code review", "review my changes", "review this PR", "check my code", "pre-merge review", "review diff", or mentions reviewing code quality, implementation correctness, or preparing changes for merge.
Overview
Code review following the Review Pyramid methodology — a prioritized approach that focuses on what matters most.
The Review Pyramid
▲
/|\ 5. Code Style (Nit) ← Least important, automatable
/ | \
/ | \ 4. Tests
/ | \
/ | \ 3. Documentation
/ | \
/ | \ 2. Implementation Semantics ← High priority
/ | \
/________|________\ 1. API Semantics ← Most critical, review first
Key insight: Review from bottom to top. API and implementation issues are far more important than style issues.
Two-Phase Review Strategy
Phase 1: Quick Review (Automated Checks)
Fast first pass using quick-reviewer agent (sonnet):
- Linting (ruff check)
- Type checking (mypy)
- Security pattern scanning
- Test file existence
Phase 2: Deep Review (Human-Like Analysis)
Thorough analysis using code-reviewer agent (opus):
- API semantics (breaking changes, naming, contracts)
- Implementation correctness (business logic, edge cases)
- Security (detailed analysis)
- Documentation completeness
- Test quality
When to Use
| Trigger | Action |
|---|---|
| "Review my staged changes" | /review:diff staged |
| "Review before I merge" | /review:diff main --mode=full |
| "Quick check my code" | /review:diff --mode=quick |
| "Deep review this feature" | /review:diff main --task="..." --mode=deep |
Best Practices
- Always provide task context with
--taskflag for accurate business logic review - Run quick review first to catch obvious issues
- Review branch against target before merging
- Fix critical issues first — API/Implementation > Style
References
pyramid.md— Detailed explanation of the Review Pyramidapi-semantics.md— API review checklistimplementation.md— Implementation review checklistsecurity.md— Security review checklisttesting.md— Test review checklist
Source
git clone https://github.com/ruslan-korneev/python-backend-claude-plugins/blob/master/plugins/tech-lead/skills/code-review/SKILL.mdView on GitHub Overview
This skill guides code reviews using the Review Pyramid, prioritizing API semantics and implementation correctness before style. It defines a two-phase process: automated quick checks and a deep human-like analysis. It helps reviewers catch critical issues before merging changes.
How This Skill Works
First run Phase 1 automated checks with a quick-reviewer to catch obvious problems (linting, type checks, security patterns, test existence). Then perform Phase 2 deep review with a code-reviewer to assess API semantics, implementation correctness, security, documentation, and tests.
When to Use It
- Review my staged changes (diff staged)
- Review before I merge (diff main --mode=full)
- Quick check my code (diff --mode=quick)
- Deep review this feature (diff main --mode=deep)
- Review a PR diff to verify changes before merge
Quick Start
- Step 1: Run Phase 1 Quick Review with quick-reviewer (linting, mypy, security pattern scans, test file existence).
- Step 2: Run Phase 2 Deep Review with code-reviewer (API semantics, implementation correctness, security, docs, tests).
- Step 3: Address issues, then re-run the appropriate diff review (e.g., /review:diff main --mode=deep) before merging.
Best Practices
- Always provide task context with --task for accurate business logic review
- Run quick review first to catch obvious issues
- Review branch against target before merging
- Fix critical issues first — API/Implementation > Style
- Follow the Review Pyramid order: API semantics first, then implementation, then tests and docs, then style
Example Use Cases
- A PR introduces new API endpoints; you run Phase 1 checks, then assess API semantics and edge cases in Phase 2.
- You validate implementation correctness and security considerations for a feature flag change.
- You perform automated lint/type/security checks before doing a deep review of a complex module.
- You review the diff against main with --mode=full to ensure no breaking changes are introduced.
- You prepare notes on test coverage gaps and documentation updates during the deep review.