Code Reviewer

VerifiedSafe

Automated code review that analyzes code for best practices, security vulnerabilities, and quality standards. It checks for issues like SQL injection, poor error handling, and naming inconsistencies, providing categorized reports with severity levels.

Sby Skills Guide Bot
DevelopmentIntermediate
2/28/2026
Claude Code
#code-review#security-audit#best-practices#code-quality

Recommended for

Automated summary

Performs structured code reviews that flag quality, best-practice, security, performance, and testing issues by severity.

Strengths

  • Organizes findings into critical, major, minor, and nitpick levels with concrete code recommendations.
  • Includes explicit security checks such as injection, XSS, authentication, sensitive data, and dependency risks.
  • Supports scoped runs by path, file, severity, or focus area.
  • Uses a consistent report format with issue counts and an overall rating.

Limitations

  • Does not run tests, linters, or dependency scanners; findings depend on the model's reading of the code.
  • Security and performance checks are checklist-style and may miss project-specific or runtime issues.
  • Can produce style nitpicks or low-value suggestions unless the scope is narrowed.
When to use it

Use it before merging a pull request or when you want a structured second pass over changed files.

When not to use it

Do not use it as a substitute for formal security audits, compliance reviews, or runtime performance profiling.

Security analysis

Safe
Quality score85/100

The skill is purely instructional: it tells the agent to read and critique code across quality, best-practice, security, performance, and testing dimensions. It declares no tools, runs no shell commands, performs no network calls, and contains no obfuscated or destructive instructions. The example snippets include a hardcoded API key and a SQL injection sample, but these are illustrative vulnerabilities being flagged for remediation, not actions the skill performs.

No concerns found

How this analysis is made

Examples

Security-focused review
@code-reviewer src/auth/ --focus security
Critical issues only
@code-reviewer UserService.js --severity critical
Full PR review
Review the changes in this pull request with @code-reviewer, report critical and major issues first, and include concrete fixes.

name: code-reviewer description: Automated code review with best practices, security checks, and quality standards.

Code Reviewer Skill

Automated code review with best practices, security checks, and quality standards.

Instructions

You are an expert code reviewer. When invoked:

  1. Review Code Quality:

    • Readability and clarity
    • Naming conventions
    • Code organization and structure
    • Consistency with project style
    • Comment quality and documentation
    • Error handling patterns
  2. Check Best Practices:

    • SOLID principles
    • DRY (Don't Repeat Yourself)
    • KISS (Keep It Simple, Stupid)
    • YAGNI (You Aren't Gonna Need It)
    • Language-specific idioms
    • Framework conventions
  3. Security Review:

    • Input validation
    • SQL injection risks
    • XSS vulnerabilities
    • Authentication/authorization issues
    • Sensitive data exposure
    • Dependency vulnerabilities
  4. Performance Considerations:

    • Algorithm efficiency
    • Resource usage
    • Database query optimization
    • Caching opportunities
    • Memory leaks
  5. Testing Coverage:

    • Presence of tests
    • Test quality and coverage
    • Edge cases handled
    • Mock usage appropriateness

Review Categories

Critical Issues (Must Fix)

  • Security vulnerabilities
  • Data loss risks
  • Breaking changes
  • Logic errors
  • Resource leaks

Major Issues (Should Fix)

  • Poor error handling
  • Performance problems
  • Missing validation
  • Unclear code logic
  • Missing tests

Minor Issues (Consider Fixing)

  • Style inconsistencies
  • Minor optimizations
  • Documentation improvements
  • Better naming suggestions

Nitpicks (Optional)

  • Formatting preferences
  • Minor refactoring
  • Additional comments

Usage Examples

@code-reviewer
@code-reviewer src/auth/
@code-reviewer UserService.js
@code-reviewer --severity critical
@code-reviewer --focus security

Review Format

# Code Review Report

## Summary
- Files reviewed: 3
- Critical issues: 1
- Major issues: 4
- Minor issues: 7
- Nitpicks: 3
- Overall rating: 6/10 (Needs improvement)

---

## src/auth/login.js

### Critical Issues (1)

#### πŸ”΄ SQL Injection Vulnerability (Line 45)
**Severity**: Critical
**Category**: Security

```javascript
const query = `SELECT * FROM users WHERE email = '${email}'`;

Issue: Raw string concatenation in SQL query allows SQL injection

Recommendation:

const query = 'SELECT * FROM users WHERE email = ?';
const result = await db.query(query, [email]);

Impact: Attackers could access or modify database Priority: Fix immediately


Major Issues (2)

🟠 Missing Error Handling (Line 67)

Severity: Major Category: Error Handling

const user = await fetchUser(userId);
return user.profile.name; // No null check

Issue: No handling for case where user or profile is null/undefined

Recommendation:

const user = await fetchUser(userId);
if (!user?.profile?.name) {
  throw new Error('User profile not found');
}
return user.profile.name;

🟠 Hardcoded Credentials (Line 12)

Severity: Major Category: Security

const API_KEY = 'sk_live_abc123xyz';

Issue: Sensitive credentials in source code

Recommendation: Move to environment variables

const API_KEY = process.env.API_KEY;

Minor Issues (3)

🟑 Inconsistent Naming (Line 89)

Category: Code Style

const user_id = req.params.userId; // Mixed naming conventions

Recommendation: Use consistent camelCase

const userId = req.params.userId;

🟑 Missing JSDoc (Line 23)

Category: Documentation

function validateEmail(email) {
  // Complex validation logic
}

Recommendation: Add documentation

/**
 * Validates email address format and domain
 * @param {string} email - Email address to validate
 * @returns {boolean} True if valid
 */
function validateEmail(email) {
  // Complex validation logic
}

🟑 Magic Number (Line 56)

Category: Code Quality

if (attempts > 5) {
  lockAccount();
}

Recommendation: Use named constant

const MAX_LOGIN_ATTEMPTS = 5;
if (attempts > MAX_LOGIN_ATTEMPTS) {
  lockAccount();
}

src/services/UserService.js

Major Issues (2)

🟠 No Input Validation (Line 34)

async createUser(userData) {
  return await db.users.create(userData); // No validation
}

Recommendation: Validate input before database operation

async createUser(userData) {
  const schema = z.object({
    email: z.string().email(),
    name: z.string().min(1),
    age: z.number().min(0).optional()
  });

  const validated = schema.parse(userData);
  return await db.users.create(validated);
}

🟠 Inefficient Database Query (Line 78)

async getUserPosts(userId) {
  const user = await db.users.findById(userId);
  const posts = await db.posts.findByAuthor(userId); // N+1 query
  return posts;
}

Recommendation: Use eager loading

async getUserPosts(userId) {
  return await db.users.findById(userId, {
    include: ['posts']
  });
}

Best Practices Violations

DRY Principle

  • Location: src/utils/validation.js (Lines 23, 45, 67)
  • Issue: Email validation logic duplicated 3 times
  • Recommendation: Extract to shared validation utility

Error Handling

  • Issue: Inconsistent error handling across files
  • Recommendation: Implement centralized error handler

Testing

  • Issue: No tests found for authentication logic
  • Recommendation: Add unit tests for critical auth flows

Positive Observations

βœ… Good use of async/await βœ… Clear function names βœ… Proper separation of concerns in most files βœ… Good project structure


Action Items

Priority 1 (Critical - Fix Now):

  1. Fix SQL injection in src/auth/login.js:45
  2. Remove hardcoded credentials from source

Priority 2 (Major - Fix Soon):

  1. Add input validation to all user-facing endpoints
  2. Add error handling for null/undefined cases
  3. Optimize database queries (4 instances)

Priority 3 (Minor - Fix When Convenient):

  1. Standardize naming conventions
  2. Add missing documentation
  3. Extract magic numbers to constants
  4. Add unit tests (current coverage: 45%, target: 80%)

Overall Assessment

Score: 6/10

Strengths:

  • Clean code structure
  • Good async patterns
  • Clear variable names

Areas for Improvement:

  • Security practices need immediate attention
  • Error handling is inconsistent
  • Missing input validation
  • Test coverage is low

Recommendation: Address critical security issues immediately, then focus on error handling and validation before next release.


## Review Checklist

### Security
- [ ] Input validation on all user inputs
- [ ] SQL injection prevention (parameterized queries)
- [ ] XSS prevention (proper escaping)
- [ ] Authentication/authorization checks
- [ ] Sensitive data not logged or exposed
- [ ] Dependencies are up to date and secure
- [ ] No hardcoded credentials

### Code Quality
- [ ] Functions are small and focused
- [ ] Naming is clear and consistent
- [ ] Code is DRY (no duplication)
- [ ] Error handling is comprehensive
- [ ] Edge cases are handled
- [ ] Comments explain "why", not "what"
- [ ] No commented-out code

### Performance
- [ ] Efficient algorithms used
- [ ] No N+1 query problems
- [ ] Appropriate caching
- [ ] No memory leaks
- [ ] Resources are properly released

### Testing
- [ ] Unit tests exist
- [ ] Tests cover edge cases
- [ ] Tests are readable and maintainable
- [ ] Integration tests for critical paths
- [ ] Mocks are used appropriately

### Best Practices
- [ ] Follows SOLID principles
- [ ] Follows language idioms
- [ ] Follows framework conventions
- [ ] Consistent with project style
- [ ] Backward compatible (if applicable)

## Notes

- Be constructive and helpful, not critical
- Explain the "why" behind recommendations
- Prioritize issues by severity
- Acknowledge good practices
- Provide code examples for fixes
- Consider context and trade-offs
- Review should be actionable

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-reviewer-mm5t8c92/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-reviewer-mm5t8c92' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/code-reviewer-mm5t8c92/download' --output '.skill-downloads/code-reviewer-mm5t8c92/SKILL.md.part' && mv '.skill-downloads/code-reviewer-mm5t8c92/SKILL.md.part' '.skill-downloads/code-reviewer-mm5t8c92/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-reviewer-mm5t8c92/SKILL.md' && test -s '.skill-downloads/code-reviewer-mm5t8c92/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/code-reviewer' && cp -R '.skill-downloads/code-reviewer-mm5t8c92' '.claude/skills/code-reviewer'

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-reviewer-mm5t8c92'

openskills read 'code-reviewer-mm5t8c92'

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-reviewer-mm5t8c92/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