agentleFS
mehdiozdemirmehdiozdemir/awesome-agent-skills/skills/code-review/SKILL.md

code-reviewer

Skill2 starsChanged 10 months agoMITView on GitHub

Comprehensive code review for bugs, security vulnerabilities, performance issues, best practices violations, and code quality problems. Use when reviewing pull requests, analyzing code changes, auditing implementations, or performing quality checks on any codebase.

182 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-doc-updater, git-precommit and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • u9401066Skill

    git-doc-updater

    Auto-check and update key documentation before Git commits to keep docs in sync with code. Triggers: docs, 文檔, 更新文檔, sync docs, release, 發布.

    Also in 5 projects that use this

  • u9401066Skill

    git-precommit

    Orchestrate pre-commit workflow including Memory Bank sync, README/CHANGELOG/ROADMAP updates. Triggers: GIT, gc, push, commit, 提交, 準備 commit, 要提交了, git commit, pre-commit, 推送.

    Also in 5 projects that use this

  • JeffallanSkill

    shopify-expert

    Builds and debugs Shopify themes (.liquid files, theme.json, sections), develops custom Shopify apps (shopify.app.toml, OAuth, webhooks), and implements Storefront API integrations for headless storefronts. Use when building or customizing Shopify themes, creating Hydrogen or custom React storefronts, developing Shopify apps, implementing checkout UI extensions or Shopify Functions, optimizing performance, or integrating third-party services. Invoke for Liquid templating, Storefront API, app development, checkout customization, Shopify Plus features, App Bridge, Polaris, or Shopify CLI workflows.

    Also in 5 projects that use this

  • JeffallanSkill

    spec-miner

    Reverse-engineering specialist that extracts specifications from existing codebases. Use when working with legacy or undocumented systems, inherited projects, or old codebases with no documentation. Invoke to map code dependencies, generate API documentation from source, identify undocumented business logic, figure out what code does, or create architecture documentation from implementation. Trigger phrases: reverse engineer, old codebase, no docs, no documentation, figure out how this works, inherited project, legacy analysis, code archaeology, undocumented features.

    Also in 6 projects that use this

  • +4 more from u9401066
  • +4 more from Jeffallan

The file

Show its rules and text

We split this skill into the rules it gives an agent

54 rules. 0 are common, 52 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 155 edited versions we read keep these.

  • 52

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When reviewing code, analyze across these dimensions:

    line 12
  2. Distinctive:

    Check for hardcoded credentials, API keys, or sensitive data

    line 16
  3. Distinctive:

    Verify proper input validation and sanitization

    line 17
  4. Distinctive:

    Check for insecure cryptographic practices

    line 19
  5. Distinctive:

    Check for null/undefined reference errors

    line 24
  6. Distinctive:

    Check for memory leaks and resource management

    line 27
  7. Distinctive:

    Verify error handling and exception management

    line 28
  8. Distinctive:

    Check for unnecessary loops and redundant operations

    line 33
  9. Distinctive:

    Verify adherence to language-specific conventions

    line 39
  10. Distinctive:

    Check code readability and maintainability

    line 40
  11. Distinctive:

    Check function/method length and complexity

    line 43
  12. Distinctive:

    Verify proper separation of concerns

    line 44
  13. Distinctive:

    Check for SOLID principles violations

    line 49
  14. Distinctive:

    Check for proper abstraction layers

    line 53
  15. Distinctive:

    Follow this structured approach when reviewing code:

    line 57
  16. Distinctive:

    Security first: - Check for vulnerabilities

    line 67
  17. Distinctive:

    Correctness: - Verify logical correctness and bug-free implementation

    line 68
  18. Distinctive:

    Check for proper async/await usage vs promises

    line 166
  19. Distinctive:

    Verify type safety (TypeScript)

    line 167
  20. Very specific:

    Look for common pitfalls: == vs ===, variable hoisting, closure issues

    line 168
  21. Distinctive:

    Check for proper React hooks usage and dependencies

    line 169
  22. Distinctive:

    Verify proper event listener cleanup

    line 170
  23. Distinctive:

    Verify proper exception handling (avoid bare except)

    line 174
  24. Distinctive:

    Look for mutable default arguments

    line 175
  25. Very specific:

    Check for proper context managers (with statements)

    line 176
  26. Distinctive:

    Verify proper async/await usage

    line 177
  27. Distinctive:

    Check for proper exception handling

    line 180
  28. Distinctive:

    Verify resource cleanup (try-with-resources)

    line 181
  29. Distinctive:

    Look for potential NullPointerExceptions

    line 182
  30. Distinctive:

    Check thread safety in concurrent code

    line 183
  31. Distinctive:

    Verify proper use of generics

    line 184
  32. Distinctive:

    Check error handling (never ignore errors)

    line 187
  33. Distinctive:

    Verify proper goroutine and channel usage

    line 188
  34. Distinctive:

    Look for potential race conditions

    line 189
  35. Distinctive:

    Check for proper defer usage

    line 190
  36. Distinctive:

    Check for SQL injection vulnerabilities

    line 194
  37. Distinctive:

    Verify proper indexing strategies

    line 195
  38. Distinctive:

    Look for N+1 queries

    line 196
  39. Distinctive:

    Check for inefficient JOINs

    line 197
  40. Distinctive:

    Check for unnecessary re-renders

    line 203
  41. Distinctive:

    Verify proper key usage in lists

    line 204
  42. Distinctive:

    Verify proper state management

    line 206
  43. Distinctive:

    Look for memory leaks in effects

    line 207
  44. Distinctive:

    Verify error handling middleware

    line 211
  45. Distinctive:

    Look for callback hell

    line 212
  46. Distinctive:

    Check for proper async error handling

    line 213
  47. Distinctive:

    Check for ORM N+1 queries

    line 217
  48. Distinctive:

    Check for SQL injection in raw queries

    line 219
  49. Distinctive:

    Verify proper form validation

    line 220
  50. Distinctive:

    Check for proper dependency injection

    line 224
  51. Distinctive:

    Look for N+1 queries with JPA

    line 226
  52. Distinctive:

    Before completing the review, verify:

    line 245
  53. Distinctive:

    When suggesting improvements, reference:

    line 331
  54. Distinctive:

    Consider project-specific conventions if provided

    line 343

“Common” is measured: kept by at least 6 in 10 of the 155 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Reviewer Skill

This skill provides thorough code review capabilities across all programming languages and frameworks. Use this whenever you need to analyze code for quality, security, performance, or maintainability concerns.

Review Scope

When reviewing code, analyze across these dimensions:

1. Security Analysis

  • Identify potential security vulnerabilities (SQL injection, XSS, CSRF, etc.)
  • Check for hardcoded credentials, API keys, or sensitive data
  • Verify proper input validation and sanitization
  • Review authentication and authorization implementations
  • Check for insecure cryptographic practices
  • Identify potential data leakage points

2. Bug Detection

  • Identify logical errors and edge cases
  • Check for null/undefined reference errors
  • Detect off-by-one errors and boundary conditions
  • Identify race conditions and concurrency issues
  • Check for memory leaks and resource management
  • Verify error handling and exception management

3. Performance Issues

  • Identify inefficient algorithms and data structures
  • Detect N+1 query problems in database operations
  • Check for unnecessary loops and redundant operations
  • Identify memory-intensive operations
  • Review caching strategies and opportunities
  • Analyze computational complexity (Big O)

4. Code Quality & Best Practices

  • Verify adherence to language-specific conventions
  • Check code readability and maintainability
  • Identify code duplication and suggest DRY improvements
  • Review naming conventions (variables, functions, classes)
  • Check function/method length and complexity
  • Verify proper separation of concerns
  • Assess test coverage and testability

5. Architecture & Design

  • Review design patterns usage and appropriateness
  • Check for SOLID principles violations
  • Identify tight coupling and low cohesion
  • Review dependency management
  • Assess scalability considerations
  • Check for proper abstraction layers

Review Process

Follow this structured approach when reviewing code:

Step 1: Initial Assessment

  1. Understand the context and purpose of the code changes
  2. Identify the programming language and framework
  3. Note any stated requirements or constraints
  4. Review related documentation if provided

Step 2: Systematic Analysis

Analyze the code in this order:

  1. Security first - Check for vulnerabilities
  2. Correctness - Verify logical correctness and bug-free implementation
  3. Performance - Identify optimization opportunities
  4. Quality - Review code structure and best practices
  5. Architecture - Assess design decisions

Step 3: Categorized Findings

Organize findings by severity:

🔴 Critical Issues (Must fix immediately)

  • Security vulnerabilities
  • Data loss risks
  • System crashes or breaking bugs
  • Complete functional failures

🟠 Major Issues (Should fix before merge)

  • Performance bottlenecks
  • Logic errors in non-critical paths
  • Poor error handling
  • Significant maintainability concerns

🟡 Minor Issues (Nice to fix)

  • Code style inconsistencies
  • Minor optimizations
  • Naming improvements
  • Documentation gaps

💡 Suggestions (Optional improvements)

  • Refactoring opportunities
  • Alternative approaches
  • Design pattern recommendations
  • Future enhancement ideas

Step 4: Provide Solutions

For each issue:

  1. Explain the problem clearly with specific line references
  2. Describe the impact (security, performance, maintainability)
  3. Provide concrete fix with code examples when possible
  4. Explain why the fix is better

Output Format

Structure your review as follows:

# Code Review Summary

## Overview
[Brief summary of what was reviewed and general assessment]

## Findings Summary
- Critical: X issues
- Major: Y issues
- Minor: Z issues
- Suggestions: W items

---

## 🔴 Critical Issues

### Issue 1: [Title]
**Location:** `file.js:42-45`
**Problem:** [Description]
**Impact:** [Security/Performance/Functional impact]
**Fix:** 
```language
[Code example showing the fix]

Explanation: [Why this fix works]


🟠 Major Issues

[Same format as Critical]


🟡 Minor Issues

[Same format, can be more concise]


💡 Suggestions

[Same format, focus on improvements]


Positive Aspects

[Highlight what was done well]


Overall Assessment

[Summary and recommendation: Approve/Request Changes/Reject]


## Language-Specific Guidelines

### JavaScript/TypeScript
- Check for proper async/await usage vs promises
- Verify type safety (TypeScript)
- Look for common pitfalls: `==` vs `===`, variable hoisting, closure issues
- Check for proper React hooks usage and dependencies
- Verify proper event listener cleanup

### Python
- Check PEP 8 compliance
- Verify proper exception handling (avoid bare except)
- Look for mutable default arguments
- Check for proper context managers (`with` statements)
- Verify proper async/await usage

### Java
- Check for proper exception handling
- Verify resource cleanup (try-with-resources)
- Look for potential NullPointerExceptions
- Check thread safety in concurrent code
- Verify proper use of generics

### Go
- Check error handling (never ignore errors)
- Verify proper goroutine and channel usage
- Look for potential race conditions
- Check for proper defer usage
- Verify context propagation

### SQL
- Check for SQL injection vulnerabilities
- Verify proper indexing strategies
- Look for N+1 queries
- Check for inefficient JOINs
- Verify transaction handling

## Framework-Specific Checks

### React
- Check for unnecessary re-renders
- Verify proper key usage in lists
- Check useEffect dependencies
- Verify proper state management
- Look for memory leaks in effects

### Node.js/Express
- Check middleware ordering
- Verify error handling middleware
- Look for callback hell
- Check for proper async error handling
- Verify CORS configuration

### Django
- Check for ORM N+1 queries
- Verify CSRF protection
- Check for SQL injection in raw queries
- Verify proper form validation
- Check middleware configuration

### Spring Boot
- Check for proper dependency injection
- Verify transaction boundaries
- Look for N+1 queries with JPA
- Check exception handling
- Verify security configuration

## Common Anti-Patterns to Flag

1. **God Objects/Classes** - Single class doing too much
2. **Magic Numbers** - Unexplained numeric constants
3. **Deep Nesting** - Excessive indentation levels (>3-4)
4. **Long Methods** - Functions over 50-100 lines
5. **Premature Optimization** - Complex optimizations without profiling
6. **Copy-Paste Programming** - Duplicated code blocks
7. **Cargo Cult Programming** - Code without understanding
8. **Golden Hammer** - Using same solution for everything
9. **Spaghetti Code** - Unclear control flow
10. **Shotgun Surgery** - Changes requiring edits in many places

## Review Checklist

Before completing the review, verify:

- [ ] All security concerns addressed
- [ ] Critical bugs identified
- [ ] Performance issues noted
- [ ] Code follows project conventions
- [ ] Error handling is appropriate
- [ ] Tests are adequate (if applicable)
- [ ] Documentation is clear
- [ ] Dependencies are justified
- [ ] No hardcoded secrets
- [ ] Resource cleanup is proper

## Tone and Communication

- Be constructive and respectful
- Focus on the code, not the person
- Explain the "why" behind suggestions
- Acknowledge good practices
- Offer learning resources when helpful
- Distinguish between opinions and standards
- Be specific with examples
- Prioritize actionable feedback

## When to Escalate

Flag for human review if you find:
- Critical security vulnerabilities requiring immediate attention
- Fundamental architectural problems
- Regulatory compliance issues
- Licensing violations
- Extremely complex logic requiring domain expertise

## Examples

### Example 1: Security Issue

Issue: SQL Injection Vulnerability

Location: user_service.py:23 Problem: User input directly interpolated into SQL query Impact: 🔴 Critical - Allows arbitrary SQL execution, potential data breach

Current Code:

query = f"SELECT * FROM users WHERE username = '{username}'"
cursor.execute(query)

Fixed Code:

query = "SELECT * FROM users WHERE username = %s"
cursor.execute(query, (username,))

Explanation: Using parameterized queries prevents SQL injection by properly escaping user input. The database driver handles sanitization, eliminating the attack vector.


### Example 2: Performance Issue

Issue: N+1 Query Problem

Location: order_controller.js:15-20 Problem: Fetching related data in a loop instead of using eager loading Impact: 🟠 Major - Performance degrades linearly with number of orders

Current Code:

const orders = await Order.findAll();
for (const order of orders) {
  order.customer = await Customer.findByPk(order.customerId); // N+1!
}

Fixed Code:

const orders = await Order.findAll({
  include: [{ model: Customer }]
});

Explanation: Eager loading fetches all related customers in a single query using JOIN, reducing database round-trips from N+1 to 2 queries total.


## Additional Resources

When suggesting improvements, reference:
- Official language/framework documentation
- Security best practices (OWASP, CWE)
- Performance optimization guides
- Design pattern catalogs
- Community style guides

## Notes

- Adapt review depth to the scope of changes
- For small PRs, focus on critical issues
- For major refactors, provide comprehensive analysis
- Consider project-specific conventions if provided
- Balance thoroughness with pragmatism
- Remember that perfect code doesn't exist - focus on meaningful improvements

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.