Code Review

VerifiedSafe

Reviews code for bugs, security vulnerabilities, performance issues, and adherence to best practices. Provides actionable feedback with specific suggestions and code examples. Activates when you ask for code review, request feedback, or want to improve existing code.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude CodeCursorWindsurfCopilotCodex
#code-review#best-practices#bug-detection#security-review

Recommended for

Automated summary

Performs a comprehensive code review to identify bugs, security vulnerabilities, performance issues, and deviations from best practices.

Strengths

  • Systematic four-phase analysis covering critical, performance, quality, and best practices aspects.
  • Provides concrete suggestions with fixed code examples and severity-based prioritization.
  • Includes language-specific patterns for Python, JavaScript/TypeScript, and more.

Limitations

  • May not catch context-specific logic errors that require business understanding.
  • Style suggestions can be subjective and depend on team conventions.
  • For very small snippets, the analysis might be overly verbose.
When to use it

Use this skill before merging code or when requesting a review to get an exhaustive analysis of potential issues.

When not to use it

Do not use it if you want to write new code from scratch or generate unit tests.

Security analysis

Safe
Quality score90/100

The skill is purely instructional for code review; it does not instruct or involve any execution of code, system commands, or network operations. There are no destructive actions, data exfiltration, or unsafe patterns.

No concerns found

How this analysis is made

Examples

Review a Python function for bugs and security
Review my Python code for bugs and security issues:

def authenticate(username, password):
    query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'"
    return execute_query(query)
Performance review of a JavaScript loop
Can you review this JavaScript function for performance problems?

function processItems(items) {
    let result = [];
    for (let i = 0; i < items.length; i++) {
        for (let j = 0; j < items.length; j++) {
            if (items[i].id === items[j].refId) {
                result.push(items[i]);
            }
        }
    }
    return result;
}
Full code review with best practices focus
Review this code for best practices, naming conventions, and potential improvements:

class data:
    def __init__(self, x, y):
        self.a = x
        self.b = y
    
    def calc(self):
        return self.a * self.b

name: code-review description: Reviews code for bugs, security issues, performance problems, and best practices. Activates when user asks for code review, feedback on code, or wants to improve existing code. version: 1.0.0 triggers:

  • code review
  • review my code
  • check this code
  • find bugs
  • improve this code
  • code feedback
  • refactor
  • code quality
  • security review
  • performance review domain: code complexity: moderate dependencies: [] browser: false author: auto-generated created: 2025-01-25

Code Review

Overview

Performs comprehensive code reviews focusing on bugs, security vulnerabilities, performance issues, and adherence to best practices. Provides actionable feedback with specific suggestions and code examples.

Auto-Activation Conditions

This skill activates when:

  • ✅ User asks to review code or give feedback
  • ✅ Request mentions finding bugs or issues
  • ✅ User wants to improve or refactor code
  • ✅ Security or performance review requested
  • ✅ Keywords: review, bugs, improve, refactor, quality, security

Does NOT activate when:

  • ❌ User wants to write new code from scratch → use code generation skill
  • ❌ User needs documentation → use docs skill
  • ❌ User wants tests written → use testing skill

Instructions

Phase 1: Understand the Code

Before reviewing, identify:

context = {
    "language": "<detected programming language>",
    "purpose": "<what does this code do?>",
    "scope": "<function|class|module|full application>",
    "framework": "<if applicable: React, Django, etc.>",
    "review_focus": "<bugs|security|performance|all>"
}

Phase 2: Systematic Review

Review the code in this order:

1. Critical Issues (Fix Immediately)

  • Security vulnerabilities

    • SQL injection
    • XSS vulnerabilities
    • Hardcoded secrets/credentials
    • Insecure data handling
    • Missing input validation
  • Bugs & Logic Errors

    • Off-by-one errors
    • Null/undefined handling
    • Race conditions
    • Infinite loops
    • Wrong operator usage

2. Performance Issues

  • Unnecessary loops or iterations
  • N+1 query problems
  • Missing caching opportunities
  • Memory leaks
  • Inefficient algorithms

3. Code Quality

  • Naming conventions
  • Function length (should be < 20 lines)
  • Code duplication (DRY violations)
  • Missing error handling
  • Unclear logic flow

4. Best Practices

  • Language-specific idioms
  • Framework conventions
  • SOLID principles
  • Type safety
  • Documentation needs

Phase 3: Provide Feedback

Feedback Format

For each issue found:

### [SEVERITY] Issue Title

**Location**: `filename.py:line_number` or code snippet
**Category**: Security | Bug | Performance | Quality | Best Practice

**Problem**:
<Clear explanation of what's wrong>

**Impact**:
<What could happen if not fixed>

**Solution**:
```language
// Fixed code example

Why this is better: <Brief explanation>


#### Severity Levels
| Level | Description | Action |
|-------|-------------|--------|
| 🔴 CRITICAL | Security hole, data loss risk | Fix immediately |
| 🟠 HIGH | Bug that causes incorrect behavior | Fix before merge |
| 🟡 MEDIUM | Performance or maintainability issue | Should fix soon |
| 🟢 LOW | Style or minor improvement | Nice to have |

### Phase 4: Summary & Recommendations

Always end with:
```markdown
## Review Summary

| Category | Issues Found |
|----------|-------------|
| 🔴 Critical | X |
| 🟠 High | X |
| 🟡 Medium | X |
| 🟢 Low | X |

## Top 3 Priority Fixes
1. <Most important fix>
2. <Second priority>
3. <Third priority>

## Overall Assessment
<Brief overall impression and recommendation>

Review Patterns by Language

Python

# BAD: Mutable default argument
def add_item(item, items=[]):
    items.append(item)
    return items

# GOOD: Use None and create new list
def add_item(item, items=None):
    if items is None:
        items = []
    items.append(item)
    return items

JavaScript/TypeScript

// BAD: == instead of ===
if (value == null) { }

// GOOD: Strict equality
if (value === null || value === undefined) { }
// or
if (value == null) { } // Only case where == is acceptable

SQL (in code)

# BAD: SQL Injection vulnerability
query = f"SELECT * FROM users WHERE id = {user_id}"

# GOOD: Parameterized query
query = "SELECT * FROM users WHERE id = %s"
cursor.execute(query, (user_id,))

React

// BAD: Missing key in list
{items.map(item => <Item data={item} />)}

// GOOD: Unique key prop
{items.map(item => <Item key={item.id} data={item} />)}

Examples

Example 1: Python Function Review

Input:

def get_user(id):
    conn = sqlite3.connect('db.sqlite')
    result = conn.execute(f"SELECT * FROM users WHERE id = {id}")
    return result.fetchone()

Output:

### 🔴 CRITICAL: SQL Injection Vulnerability

**Location**: `get_user` function, line 3
**Category**: Security

**Problem**:
User input is directly interpolated into SQL query using f-string, allowing SQL injection attacks.

**Impact**:
Attacker could extract all data, delete tables, or gain unauthorized access by passing malicious input like `1; DROP TABLE users;--`

**Solution**:
```python
def get_user(id: int) -> Optional[tuple]:
    """Fetch user by ID from database."""
    conn = sqlite3.connect('db.sqlite')
    try:
        cursor = conn.execute(
            "SELECT * FROM users WHERE id = ?",
            (id,)
        )
        return cursor.fetchone()
    finally:
        conn.close()

Why this is better:

  • Parameterized query prevents SQL injection
  • Type hint documents expected input
  • Connection properly closed with try/finally
  • Docstring explains function purpose

🟠 HIGH: Resource Leak

Location: get_user function Category: Bug

Problem: Database connection is never closed, causing resource leaks.

Solution: See fixed code above with try/finally block.


### Example 2: React Component Review

**Input**:
```jsx
function UserList({users}) {
  const [filter, setFilter] = useState()

  const filtered = users.filter(u => u.name.includes(filter))

  return (
    <div>
      <input onChange={e => setFilter(e.target.value)} />
      {filtered.map(user => <UserCard user={user} />)}
    </div>
  )
}

Output:

### 🟠 HIGH: Potential Runtime Error

**Location**: Line 4, filter operation
**Category**: Bug

**Problem**:
`filter` state is initialized as `undefined`. Calling `includes(undefined)` won't crash, but `filter` being undefined on first render may cause unexpected behavior.

**Solution**:
```jsx
const [filter, setFilter] = useState('')

🟡 MEDIUM: Missing Key Prop

Location: Line 9, map rendering Category: Best Practice

Problem: React list items missing unique key prop, causing inefficient re-renders.

Solution:

{filtered.map(user => <UserCard key={user.id} user={user} />)}

🟡 MEDIUM: Performance - Unnecessary Recalculation

Location: Line 4 Category: Performance

Problem: Filter runs on every render, even when users array hasn't changed.

Solution:

const filtered = useMemo(
  () => users.filter(u => u.name.includes(filter)),
  [users, filter]
)

## Quality Checklist
Before completing review, verify:
- [ ] All code paths examined
- [ ] Security implications considered
- [ ] Edge cases identified
- [ ] Performance bottlenecks noted
- [ ] Fixes include code examples
- [ ] Severity levels assigned
- [ ] Summary provided
- [ ] Prioritized recommendations given

## Anti-Patterns in Reviews
- ❌ Vague feedback: "This could be better"
- ❌ No code examples for fixes
- ❌ Nitpicking style when there are real bugs
- ❌ Missing severity levels
- ❌ No explanation of WHY something is wrong
- ❌ Reviewing without understanding context

## Integration
- **Works with**: testing (suggest tests for bug-prone areas), documentation
- **Browser**: Not required

## Changelog
- v1.0.0 (2025-01-25): Initial creation

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/code-review-mm78nnx9/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/code-review-mm78nnx9' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/code-review-mm78nnx9/download' --output '.skill-downloads/code-review-mm78nnx9/SKILL.md.part' && mv '.skill-downloads/code-review-mm78nnx9/SKILL.md.part' '.skill-downloads/code-review-mm78nnx9/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/code-review-mm78nnx9/SKILL.md' && test -s '.skill-downloads/code-review-mm78nnx9/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/code-review' && cp -R '.skill-downloads/code-review-mm78nnx9' '.claude/skills/code-review'

Cursor
test -f '.skill-downloads/code-review-mm78nnx9/SKILL.md' && test -s '.skill-downloads/code-review-mm78nnx9/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/code-review' && cp -R '.skill-downloads/code-review-mm78nnx9' '.cursor/skills/code-review'

Codex
test -f '.skill-downloads/code-review-mm78nnx9/SKILL.md' && test -s '.skill-downloads/code-review-mm78nnx9/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/code-review' && cp -R '.skill-downloads/code-review-mm78nnx9' '.agents/skills/code-review'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/code-review-mm78nnx9'

openskills read 'code-review-mm78nnx9'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/code-review-mm78nnx9/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills