Skip to main content
skill CX Codex

code-reviewer · alirezarezvani/claude-code-tresor — Claude Code skill: what it does, how to install

code-reviewer runs fast automated code quality, bug, and security checks when files are modified, saved, or staged.

MIT ★ 788 updated 2026-07-03

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add alirezarezvani/claude-code-tresor --skill code-reviewer -a claude-code
Open on GitHub

What code-reviewer does

This skill performs lightweight code audits triggered by file edits, git diff runs, or questions about quality. It operates strictly through read-only tools (Read, Grep, Glob) and needs no network permissions or special sandbox adjustments.

The checks catch missing null guards, unhandled errors, leaked secrets, SQL injection patterns, and missing keys in React loops. Deep architectural redesigns and full refactoring plans exceed this tool's scope: those scenarios require the @code-reviewer sub-agent instead.

What it helps with

  • catch missing null checks and undefined accesses before staging code
  • flag exposed API keys and plain SQL string concatenations
  • detect N+1 query patterns inside asynchronous loops
  • clean up dangling console statements and unformatted blocks

Example prompts for the agent

  • Review my staged git diff for security holes and bugs
  • Inspect the process_data function in data.py for unsafe dictionary access
  • Check UserCard.jsx for missing React dependencies or key props

How to install code-reviewer

1Skills CLI (Vercel)

npx skills add alirezarezvani/claude-code-tresor --skill code-reviewer -a claude-code

2Manually: put the files in place

~/.claude/skills/code-reviewer/SKILL.md

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about code-reviewer

How to install code-reviewer in Claude Code?

Run npx skills add alirezarezvani/claude-code-tresor --skill code-reviewer -a claude-code in your terminal.

What permissions does code-reviewer require?

It needs only read-only project access through Read, Grep, and Glob. It functions without network connectivity.

How does it differ from the @code-reviewer sub-agent?

The skill provides immediate inline alerts while you edit. The sub-agent delivers in-depth architectural explanations and comparative refactoring options.

Source text

SKILL.md · MIT
---
name: code-reviewer
description: Automatic code quality and best practices analysis. Use proactively when files are modified, saved, or committed. Analyzes code style, patterns, potential bugs, and security basics. Triggers on file changes, git diff, code edits, quality mentions.
allowed-tools: Read, Grep, Glob
---

# Code Reviewer Skill


Lightweight automatic code quality checks while you code.

## When I Activate

- ✅ Files modified or saved
- ✅ Git diff run
- ✅ Code mentioned in conversation
- ✅ User asks about code quality
- ✅ Before commits

## What I Check

### Quick Wins
- Code style and formatting issues
- Common anti-patterns
- Obvious bugs (null checks, undefined references)
- Basic security patterns (hardcoded secrets)
- Import/export issues
- Unused variables and functions

### What I Don't Do
- Deep architectural review → Use **@code-reviewer** sub-agent
- Comprehensive security audit → Use **security-auditor** skill
- Performance profiling → Use **@architect** sub-agent
- Full refactoring plans → Use **@code-reviewer** sub-agent

## Relationship with @code-reviewer Sub-Agent

**Me (Skill):** Fast, lightweight, real-time feedback
**@code-reviewer (Sub-Agent):** Deep analysis with examples and strategy

### Workflow

1. You write code
2. I auto-analyze (instant feedback)
3. I flag: "⚠️ Potential issue on line 42"
4. You want details → Invoke **@code-reviewer** sub-agent
5. Sub-agent provides comprehensive analysis

## Analysis Examples

### JavaScript/TypeScript

```javascript
// You write this code:
function getUser(id) {
  return db.query(`SELECT * FROM users WHERE id = ${id}`);
}

// I immediately flag:
// 🚨 Line 2: SQL injection vulnerability
// 💡 Use parameterized queries
```

### React

```javascript
// You write:
function UserList({ users }) {
  return users.map(user => <User data={user} />);
}

// I flag:
// ⚠️ Missing key prop in list rendering (line 2)
// 💡 Add key={user.id} to User component
```

### Python

```python
# You write:
def process_data(data):
    return data['user']['profile']['name']

# I flag:
# ⚠️ Potential KeyError - no safety checks (line 2)
# 💡 Use .get() or add try/except
```

## Check Categories

### Code Style
- Inconsistent naming conventions
- Missing semicolons (JavaScript)
- Improper indentation
- Long functions (>50 lines)
- Magic numbers

### Potential Bugs
- Null/undefined access without checks
- Array access without bounds checking
- Type mismatches (TypeScript)
- Unreachable code
- Infinite loops

### Basic Security
- Hardcoded API keys or secrets
- SQL injection patterns
- eval() or exec() usage
- Insecure random number generation
- Missing input validation

### Best Practices
- Missing error handling
- Console.log in production code
- Commented-out code blocks
- TODO comments without context
- Overly complex conditions

## Output Format

```
🤖 code-reviewer skill:
  [Severity] Issue description (file:line)
  💡 Quick fix suggestion
  📖 Reference: [link to learn more]
```

### Severity Levels
- 🚨 **CRITICAL**: Must fix (security, data loss)
- ⚠️ **HIGH**: Should fix (bugs, performance)
- 📋 **MEDIUM**: Consider fixing (maintainability)
- 💡 **LOW**: Nice to have (style, readability)

## When to Invoke Sub-Agent

After I flag issues, invoke **@code-reviewer** sub-agent for:
- Detailed explanation of the issue
- Multiple fix alternatives with pros/cons
- Architectural recommendations
- Refactoring strategies
- Best practice guidelines

**Example:**
```
Me: "⚠️ Potential N+1 query detected"
You: "@code-reviewer explain the N+1 issue and show optimal solution"
Sub-agent: [Provides comprehensive analysis with examples]
```

## Sandboxing Compatibility

**Works without sandboxing:** ✅ Yes (default, recommended for learning)
**Works with sandboxing:** ✅ Yes (no special configuration needed)

- **Filesystem**: Read-only access to project files
- **Network**: None required
- **Configuration**: None required

## Customization

Want different checks or patterns?

1. Copy this skill:
   ```bash
   cp -r ~/.claude/skills/development/code-reviewer ~/.claude/skills/development/my-code-reviewer
   ```

2. Edit `SKILL.md`:
   - Modify `description` to adjust triggers
   - Customize check categories
   - Add language-specific patterns

3. Restart Claude Code:
   ```bash
   claude --restart
   ```

See [../../TEMPLATES.md](../../TEMPLATES.md) for customization guide.

## Examples in Action

### TypeScript Function

```typescript
// Before:
async function fetchUsers(ids) {
  const users = [];
  for (let id of ids) {
    const user = await User.findById(id);  // N+1 query!
    users.push(user);
  }
  return users;
}

// I flag:
// ⚠️ N+1 query pattern detected (line 4)
// 💡 Use User.findByIds(ids) for batch loading

// After fix:
async function fetchUsers(ids) {
  return await User.findByIds(ids);
}
```

### React Component

```jsx
// Before:
function UserCard({ user }) {
  const [data, setData] = useState();

  useEffect(() => {
    fetch(`/api/users/${user.id}`)
      .then(res => res.json())
      .then(setData);
  }, []);  // Missing dependency!

  return <div>{data?.name}</div>;
}

// I flag:
// ⚠️ useEffect dependency array incomplete (line 6)
// 💡 Add user.id to dependencies: [user.id]

// After fix:
useEffect(() => {
  fetch(`/api/users/${user.id}`)
    .then(res => res.json())
    .then(setData);
}, [user.id]);
```

## Integration with /review Command

The `/review` command aggregates my findings with deep sub-agent analysis:

```bash
/review --scope staged --checks all

# Command workflow:
# 1. Collects my automatic findings
# 2. Invokes @code-reviewer sub-agent for deep analysis
# 3. Invokes @security-auditor sub-agent
# 4. Generates comprehensive report with priorities
```

## Performance Impact

- **Activation time**: < 100ms
- **Analysis time**: < 1 second per file
- **Memory usage**: Minimal (read-only)
- **Background operation**: Non-blocking

This skill operates asynchronously and won't slow down your coding workflow.

## Language Support

### Fully Supported
- JavaScript/TypeScript (ES6+, React, Node.js)
- Python (3.8+, Django, FastAPI)
- Java (Spring Boot patterns)
- Go (standard patterns)

### Partial Support
- Ruby, PHP, C#, Rust
- Framework-agnostic patterns apply

Want to add language-specific patterns? See customization guide above.

## Tips for Best Results

1. **Write code first, then review** - Let me catch issues as you go
2. **Don't ignore warnings** - Each flagged issue is worth reviewing
3. **Use sub-agent for learning** - Invoke @code-reviewer to understand "why"
4. **Customize for your stack** - Add project-specific patterns
5. **Combine with /review** - Use command for comprehensive pre-commit checks

## Related Tools

- **security-auditor skill**: Deeper security vulnerability scanning
- **test-generator skill**: Auto-suggest tests for your code
- **@code-reviewer sub-agent**: Comprehensive code review with examples
- **/review command**: Full workflow with multiple agents

## Learn More

- Architecture: [../../../ARCHITECTURE.md](../../../ARCHITECTURE.md)
- Templates: [../../TEMPLATES.md](../../TEMPLATES.md)
- Sub-agents: [../../../agents/README.md](../../../agents/README.md)

© alirezarezvani · MIT · alirezarezvani/claude-code-tresor

Similar skills

All skills for Code review and refactoring →

code-reviewer by other authors comes first.

code-reviewer https://github.com/Jeffallan code-reviewer analyzes code diffs and files to spot bugs, security vulnerabilities (SQL injection, XSS), code smells, N+1 queries, and returns a prioritized review report. Use for pull request reviews and code audits. CX Codex +1 7,100installs code-reviewer rmyndharis The code-reviewer Claude Code skill reviews code for security risks, performance issues, and maintainability concerns. Ask it to assess a change or inspect a production configuration. CX Codex +1 104installs code-reviewer Alireza Rezvani code-reviewer reviews pull requests, git diffs, and source files for security vulnerabilities and code smells before merging in Claude Code. CX Codex +1 1,130installs code-reviewer waybarrios code-reviewer is a Claude Code skill that checks code changes for bugs, security issues, and project-rule violations. It covers local diffs, files, and feature-dev review tasks. CX Codex +1 135installs code-reviewer zhaono1 code-reviewer reviews Git diffs and pull requests for security vulnerabilities, logic flaws, test coverage, and code quality. CX Codex +1 760installs generic-code-reviewer travisjneuman generic-code-reviewer inspects code diffs for security risks, runtime errors, bundle bloat, and WCAG AA gaps. It adapts checks to your project stack and enforces workflow rules from CLAUDE.md. CX Codex +1 147installs typescript-react-reviewer dotneet typescript-react-reviewer — a code review skill for TypeScript and React 19 apps. Catches hook anti-patterns, state mutations and type safety gaps before you merge. CX Codex +1 9,000installs generic-react-code-reviewer travisjneuman generic-react-code-reviewer walks your React/TypeScript diff for bugs, security holes, render costs and accessibility gaps. Fits right before a commit or when a pull request lands on your desk. CX Codex +1 148installs convex-reviewer convex convex-reviewer walks Convex code through auth, validator, index and reactivity checks. Useful before you ship backend functions. CX Codex +1 44,100installs tech-debt-analyzer ailabs-393 tech-debt-analyzer detects technical debt across JavaScript and TypeScript codebases using Python scripts, then structures findings into debt registers and architecture records. CX Codex +1 991installs multi-reviewer-patterns Seth Hobson The multi-reviewer-patterns skill coordinates parallel reviews across code-quality dimensions and merges the results into one report. Use it when a change needs several review angles. CX Codex +1 9,800installs

From the same set27

The whole set →
readme-updater readme-updater updates README automatically when project structure changes, dependencies are added, or new features land. CX Codex +1 ★ 788repo stars test-generator test-generator produces initial unit test scaffolding for new functions and UI components across popular testing libraries. CX Codex +1 ★ 788repo stars docs-gen The docs-gen command turns a codebase into API docs, guides, and reference material. Use it when you need a documentation site or automated deployment. CX Codex +1 ★ 788repo stars scaffold scaffold writes a project or component skeleton with source files, configs, tests and docs. Flags decide the framework and the extra pieces. CX Codex +1 ★ 788repo stars git-commit-helper The git-commit-helper skill reads staged changes and suggests a Conventional Commit message. Use it before committing or when you need help describing a diff. CX Codex +1 ★ 788repo stars config-safety-reviewer The config-safety-reviewer subagent checks configs for hardcoded values, incorrect timeouts, and pool limits before configuration changes. CX Codex ★ 788repo stars agent agent transforms Claude into an advanced prompt engineer. It designs production prompt architectures, guards against prompt injections, and tunes tokens for specific models. GP ChatGPT ★ 788repo stars test-engineer The test-engineer subagent examines code and plans tests from unit checks to integration and E2E scenarios. Use it when basic test scaffolding needs deeper coverage. CX Codex ★ 788repo stars

Project sponsors

Companies that keep this analytics open