$npx -y skills add selmakcby/claude-agents-skills --skill code-reviewSenior code review specialist. Use PROACTIVELY after writing or modifying code. Reviews for quality, correctness, performance, and best practices. Assigns severity levels to findings (CRITICAL / HIGH / MEDIUM / LOW).
| 1 | <!-- |
| 2 | Source: anthropics/claude-code (official) |
| 3 | File: https://github.com/anthropics/claude-code/blob/main/plugins/code-review/commands/code-review.md |
| 4 | Also: https://github.com/anthropics/claude-code/blob/main/plugins/code-review/README.md |
| 5 | Used by: reviewer agent |
| 6 | --> |
| 7 | |
| 8 | # Code Review |
| 9 | |
| 10 | ## When to trigger |
| 11 | - Immediately after new or modified code |
| 12 | - Before commit / PR |
| 13 | - When user asks for `/code-review` |
| 14 | |
| 15 | ## Review approach |
| 16 | |
| 17 | Multi-agent review with confidence filtering: |
| 18 | |
| 19 | 1. **CLAUDE.md compliance** — does the code follow project rules? |
| 20 | 2. **Bug detector** — obvious bugs in the diff |
| 21 | 3. **History analyzer** — git context to understand intent |
| 22 | |
| 23 | Each issue is scored 0–100. Findings below threshold (default 80) are filtered out. |
| 24 | |
| 25 | ## What to check |
| 26 | |
| 27 | ### Clarity |
| 28 | - Names (variables, functions, files) — do they say what they do? |
| 29 | - Structure — is it easy to scan? |
| 30 | - Cognitive load — how much do you hold in your head to understand it? |
| 31 | |
| 32 | ### Correctness |
| 33 | - Edge cases: null, undefined, empty array, boundary values |
| 34 | - Error paths: are they handled? Do they fail loudly or silently? |
| 35 | - Async: await missing? Race conditions? Promise rejections caught? |
| 36 | - Off-by-one errors in loops / slicing |
| 37 | |
| 38 | ### Performance |
| 39 | - N+1 queries (especially around ORM usage) |
| 40 | - O(n²) algorithms on large collections |
| 41 | - Unnecessary re-renders (React) |
| 42 | - Missing memoization for expensive computations |
| 43 | - Synchronous I/O in hot paths |
| 44 | |
| 45 | ### Consistency |
| 46 | - Matches project style guide (CLAUDE.md, rules/) |
| 47 | - Immutable patterns used |
| 48 | - Function size under 50 lines |
| 49 | - Nesting 4 levels max |
| 50 | |
| 51 | ### Tests |
| 52 | - Is there a test for the new behavior? |
| 53 | - Edge cases covered? |
| 54 | - Mocks realistic (no "happy path only")? |
| 55 | - Tests independent (no shared state)? |
| 56 | |
| 57 | ### Dead code |
| 58 | - Unused imports |
| 59 | - Unreachable branches |
| 60 | - TODO comments that should be done or deleted |
| 61 | - Commented-out code |
| 62 | |
| 63 | ## Severity levels |
| 64 | |
| 65 | - **CRITICAL** — do not commit. Breaks production, security hole, data loss risk. |
| 66 | - **HIGH** — fix before next release. Real bug users will hit. |
| 67 | - **MEDIUM** — fix when you're in the area. Code smell, minor inefficiency. |
| 68 | - **LOW** — nice-to-have. Style preference, optional refactor. |
| 69 | |
| 70 | ## Output format |
| 71 | |
| 72 | ```markdown |
| 73 | ## CRITICAL (must-fix) |
| 74 | - [`<file>:<line>`] <issue> |
| 75 | - Why: <impact> |
| 76 | - Fix: <specific suggestion> |
| 77 | |
| 78 | ## HIGH |
| 79 | - ... |
| 80 | |
| 81 | ## MEDIUM / LOW |
| 82 | - ... |
| 83 | |
| 84 | ## Summary |
| 85 | <N CRITICAL · N HIGH · N MEDIUM · N LOW> |
| 86 | <Verdict: PASS | FAIL> |
| 87 | ``` |
| 88 | |
| 89 | ## Rules |
| 90 | |
| 91 | - Every finding has: severity, file + line, what's wrong, why it matters, suggested fix. |
| 92 | - Don't just flag — propose a fix. |
| 93 | - Don't be timid on CRITICAL. If it's critical, say so clearly. |
| 94 | - If you see a pattern (same issue in multiple places), flag it once with a list. |
| 95 | - Use `--comment` mode for PR review, default for local output. |