Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

code-review-expert — Claude Code skill: review and install

Reviews current Git changes for architecture, security, and code quality issues. Use it before merging when you need prioritized findings and actionable fixes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add sanyuan0704/sanyuan-skills --skill code-review-expert -a claude-code
Open on GitHub

What code-review-expert does

The skill scopes the current changes with git status -sb, git diff --stat, and git diff, then checks SOLID principles, architecture, removal candidates, and security risks. Findings use severity levels P0–P3 and include suggested fixes. Reviews are read-only by default; it changes code only after the user explicitly asks.

Its checks draw on references/solid-checklist.md, references/removal-plan.md, references/security-checklist.md, and references/code-quality-checklist.md. The report lists files and change volume, groups findings by severity, and can include a removal plan. If the diff is empty, the skill asks whether to review staged changes or a specified commit range.

A diff over 500 lines is first summarized by file, then reviewed in batches. Check that the references/ files are available in the installed skill, since they supply the detailed review prompts.

What it helps with

  • Find security vulnerabilities and bugs in current Git changes
  • Identify SOLID violations and architectural issues
  • Separate safe deletions from code to remove later
  • Prioritize fixes and outline follow-up checks

Example prompts for the agent

  • Review the current Git changes for security issues and bugs, and group findings by P0–P3.
  • Check the current diff for SOLID and architecture problems; suggest minimal fixes without changing code.
  • Find unused code in the current changes and outline a removal plan with checks.

How to install code-review-expert

1Skills CLI (Vercel)

npx skills add sanyuan0704/sanyuan-skills --skill code-review-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/code-review-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/code-review-expert/

From the same set6

The whole set →

Similar

clojure-review metabase Reviews Clojure and ClojureScript code against Metabase engineering guidelines and flags styling mistakes in diffs. Claude Code CX Codex Cursor +1 2,000installs clojure-write metabase This skill guides REPL-driven Clojure and ClojureScript development and refactoring. Use it when functions need step-by-step checks. Claude Code CX Codex Cursor +1 2,000installs cmux-architecture manaflow-ai Guides modular Swift package architecture, strict 5-layer dependency inversion, and Swift 6 concurrency rules in the cmux codebase. Claude Code CX Codex Cursor +1 4,800installs design-review nexu-io Audits UI visually, fixes flaws with atomic commits, and captures before/after screenshots. Useful for tightening shipped interface code right before launch. Claude Code CX Codex Cursor +1 3,100installs typescript-pro https://github.com/Jeffallan Implements advanced TypeScript type systems, branded types, and tRPC configurations. Use it when building type-first APIs or complex discriminated unions. Claude Code CX Codex Cursor +1 14,200installs memory-safety-patterns Seth Hobson This skill applies ownership, RAII, smart pointers, and resource management to Rust, C++, and C. Use it for systems code or memory-bug debugging. Claude Code CX Codex Cursor 11,746installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs

Questions about code-review-expert

How do I install code-review-expert in Claude Code?

Run npx skills add sanyuan0704/sanyuan-skills --skill code-review-expert -a claude-code. The skill file is placed at ~/.claude/skills/code-review-expert/SKILL.md.

What does code-review-expert do?

It reviews current Git changes for architecture issues, SOLID violations, security risks, and code quality problems. Findings are prioritized and include suggested fixes.

Does the skill modify code during a review?

No. It provides review findings by default and makes changes only when the user explicitly asks.

Source text

SKILL.md · MIT
---
name: code-review-expert
description: "Expert code review of current git changes with a senior engineer lens. Detects SOLID violations, security risks, and proposes actionable improvements."
---

# Code Review Expert

## Overview

Perform a structured review of the current git changes with focus on SOLID, architecture, removal candidates, and security risks. Default to review-only output unless the user asks to implement changes.

## Severity Levels

| Level | Name | Description | Action |
|-------|------|-------------|--------|
| **P0** | Critical | Security vulnerability, data loss risk, correctness bug | Must block merge |
| **P1** | High | Logic error, significant SOLID violation, performance regression | Should fix before merge |
| **P2** | Medium | Code smell, maintainability concern, minor SOLID violation | Fix in this PR or create follow-up |
| **P3** | Low | Style, naming, minor suggestion | Optional improvement |

## Workflow

### 1) Preflight context

- Use `git status -sb`, `git diff --stat`, and `git diff` to scope changes.
- If needed, use `rg` or `grep` to find related modules, usages, and contracts.
- Identify entry points, ownership boundaries, and critical paths (auth, payments, data writes, network).

**Edge cases:**
- **No changes**: If `git diff` is empty, inform user and ask if they want to review staged changes or a specific commit range.
- **Large diff (>500 lines)**: Summarize by file first, then review in batches by module/feature area.
- **Mixed concerns**: Group findings by logical feature, not just file order.

### 2) SOLID + architecture smells

- Load `references/solid-checklist.md` for specific prompts.
- Look for:
  - **SRP**: Overloaded modules with unrelated responsibilities.
  - **OCP**: Frequent edits to add behavior instead of extension points.
  - **LSP**: Subclasses that break expectations or require type checks.
  - **ISP**: Wide interfaces with unused methods.
  - **DIP**: High-level logic tied to low-level implementations.
- When you propose a refactor, explain *why* it improves cohesion/coupling and outline a minimal, safe split.
- If refactor is non-trivial, propose an incremental plan instead of a large rewrite.

### 3) Removal candidates + iteration plan

- Load `references/removal-plan.md` for template.
- Identify code that is unused, redundant, or feature-flagged off.
- Distinguish **safe delete now** vs **defer with plan**.
- Provide a follow-up plan with concrete steps and checkpoints (tests/metrics).

### 4) Security and reliability scan

- Load `references/security-checklist.md` for coverage.
- Check for:
  - XSS, injection (SQL/NoSQL/command), SSRF, path traversal
  - AuthZ/AuthN gaps, missing tenancy checks
  - Secret leakage or API keys in logs/env/files
  - Rate limits, unbounded loops, CPU/memory hotspots
  - Unsafe deserialization, weak crypto, insecure defaults
  - **Race conditions**: concurrent access, check-then-act, TOCTOU, missing locks
- Call out both **exploitability** and **impact**.

### 5) Code quality scan

- Load `references/code-quality-checklist.md` for coverage.
- Check for:
  - **Error handling**: swallowed exceptions, overly broad catch, missing error handling, async errors
  - **Performance**: N+1 queries, CPU-intensive ops in hot paths, missing cache, unbounded memory
  - **Boundary conditions**: null/undefined handling, empty collections, numeric boundaries, off-by-one
- Flag issues that may cause silent failures or production incidents.

### 6) Output format

Structure your review as follows:

```markdown
## Code Review Summary

**Files reviewed**: X files, Y lines changed
**Overall assessment**: [APPROVE / REQUEST_CHANGES / COMMENT]

---

## Findings

### P0 - Critical
(none or list)

### P1 - High
1. **[file:line]** Brief title
  - Description of issue
  - Suggested fix

### P2 - Medium
2. (continue numbering across sections)
  - ...

### P3 - Low
...

---

## Removal/Iteration Plan
(if applicable)

## Additional Suggestions
(optional improvements, not blocking)
```

**Inline comments**: Use this format for file-specific findings:
```
::code-comment{file="path/to/file.ts" line="42" severity="P1"}
Description of the issue and suggested fix.
::
```

**Clean review**: If no issues found, explicitly state:
- What was checked
- Any areas not covered (e.g., "Did not verify database migrations")
- Residual risks or recommended follow-up tests

### 7) Next steps confirmation

After presenting findings, ask user how to proceed:

```markdown
---

## Next Steps

I found X issues (P0: _, P1: _, P2: _, P3: _).

**How would you like to proceed?**

1. **Fix all** - I'll implement all suggested fixes
2. **Fix P0/P1 only** - Address critical and high priority issues
3. **Fix specific items** - Tell me which issues to fix
4. **No changes** - Review complete, no implementation needed

Please choose an option or provide specific instructions.
```

**Important**: Do NOT implement any changes until user explicitly confirms. This is a review-first workflow.

## Resources

### references/

| File | Purpose |
|------|---------|
| `solid-checklist.md` | SOLID smell prompts and refactor heuristics |
| `security-checklist.md` | Web/app security and runtime risk checklist |
| `code-quality-checklist.md` | Error handling, performance, boundary conditions |
| `removal-plan.md` | Template for deletion candidates and follow-up plan |

© sanyuan0704 · MIT · sanyuan0704/sanyuan-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor