code-reviewer

📁 qinzhen001/skills 📅 2 days ago
1
总安装量
1
周安装量
#53494
全站排名
安装命令
npx skills add https://github.com/qinzhen001/skills --skill code-reviewer

Agent 安装分布

amp 1
opencode 1
kimi-cli 1
codex 1
claude-code 1

Skill 文档

Code Reviewer

Overview

This skill enables systematic code review by analyzing code for common issues including bugs, security vulnerabilities, performance problems, and style inconsistencies. It provides actionable feedback organized by severity level.

Workflow

Step 1: Gather Context

To perform a thorough review, first collect the necessary context:

  1. Identify the programming language and framework
  2. Read the target files or code snippets provided by the user
  3. If reviewing a diff/change, understand the before and after states
  4. Check for related configuration files (linters, formatters, tsconfig, etc.)

Step 2: Run Automated Analysis

Execute the bundled review script to perform automated checks:

python3 {SKILL_DIR}/scripts/review.py <file_path> [--lang <language>]

The script performs static analysis including:

  • Syntax validation
  • Common anti-pattern detection
  • Complexity metrics (cyclomatic complexity)
  • Import/dependency analysis

Step 3: Manual Review

After automated analysis, perform a manual review focusing on these categories (ordered by priority):

Critical Issues

  • Security vulnerabilities: SQL injection, XSS, hardcoded secrets, insecure deserialization
  • Data loss risks: Missing error handling for I/O, unchecked destructive operations
  • Race conditions: Concurrent access without synchronization

High Priority

  • Bugs: Null pointer risks, off-by-one errors, type mismatches, unhandled edge cases
  • Error handling: Missing try/catch, swallowed exceptions, unclear error messages
  • Resource leaks: Unclosed files/connections, missing cleanup

Medium Priority

  • Performance: Unnecessary loops, N+1 queries, missing indexes, large memory allocations
  • Design: Violation of SOLID principles, tight coupling, missing abstractions
  • Testability: Untestable code, missing dependency injection

Low Priority

  • Style: Naming conventions, code formatting, comment quality
  • Documentation: Missing/outdated docstrings, unclear variable names
  • Best practices: Language-specific idioms, modern syntax usage

Step 4: Generate Report

Present the review as a structured report:

## Code Review Summary

**Files reviewed**: [list of files]
**Language**: [detected language]
**Overall assessment**: [brief summary]

### Critical Issues (X found)
- [issue description with file:line reference]

### High Priority (X found)
- [issue description with file:line reference]

### Medium Priority (X found)
- [issue description with file:line reference]

### Low Priority (X found)
- [issue description with file:line reference]

### Positive Observations
- [things done well]

### Recommendations
- [actionable improvement suggestions]

Review Guidelines

For detailed review checklists and language-specific guidelines, refer to references/review_guidelines.md.

Resources

scripts/

  • review.py — Automated code analysis script that performs static checks, complexity analysis, and common pattern detection. Supports Python, JavaScript/TypeScript, and general text analysis.

references/

  • review_guidelines.md — Comprehensive review checklists organized by language and category. Load this reference when performing in-depth reviews or when reviewing unfamiliar languages.