Skip to content

Claude Skills - Code Review

One-Liner

Code Review Skills is a multi-dimensional code quality analysis system — Through structured review dimensions and automated checks, it discovers code issues and provides fix recommendations.

Pain Points Solved

Pain PointCurrent StateClaude Code Workflow Solution
Incomplete review dimensionsManual review easily misses dimensions6-dimension automatic review
Chaotic issue classificationHard to distinguish severityStructured issue classification
Vague fix recommendationsLacks specific fix solutionsActionable fix recommendations
Repeated review processEach review repeats same stepsAutomated scanning and reporting

Skills List

SkillFunctionTrigger
review-codeMulti-dimensional code review (6 dimensions)/review-code <target>
review-cycleCode review and fix loop/review-cycle <target>

Skills Details

review-code

One-Liner: Multi-dimensional code review — Analyzes correctness, readability, performance, security, testing, architecture six dimensions

Trigger:

/review-code <target-path>
/review-code src/auth/**
/review-code --dimensions=sec,perf src/**

Features:

  • 6-dimension review: Correctness, readability, performance, security, test coverage, architecture consistency
  • Layered execution: Quick scan identifies high-risk areas, deep review focuses on key issues
  • Structured reports: Classified by severity, provides file locations and fix recommendations
  • State-driven: Autonomous mode, dynamically selects next action based on review progress

Architecture Overview:

┌─────────────────────────────────────────────────────────────────┐
│  ⚠️ Phase 0: Specification Study (Mandatory Prerequisite)       │
│              → Read specs/review-dimensions.md                   │
│              → Understand review dimensions and issue standards  │
└───────────────┬─────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│           Orchestrator (State-driven decision)                   │
│           → Read state → Select review action → Execute → Update│
└───────────────┬─────────────────────────────────────────────────┘

    ┌───────────┼───────────┬───────────┬───────────┐
    ↓           ↓           ↓           ↓           ↓
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Collect │ │ Quick   │ │ Deep    │ │ Report  │ │Complete │
│ Context │ │ Scan    │ │ Review  │ │ Generate│ │         │
└─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘
     ↓           ↓           ↓           ↓
┌─────────────────────────────────────────────────────────────────┐
│                     Review Dimensions                            │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐            │
│  │Correctness│ │Readability│ │Performance│ │ Security │            │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘            │
│  ┌──────────┐ ┌──────────┐                                       │
│  │ Testing  │ │Architecture│                                      │
│  └──────────┘ └──────────┘                                       │
└─────────────────────────────────────────────────────────────────┘

⚠️ Mandatory Prerequisites:

Do not skip: Before executing any review operations, you must completely read the following documents.

Specification Documents (required):

DocumentPurposePriority
specs/review-dimensions.mdReview dimension definitions and checkpointsP0 - Highest
specs/issue-classification.mdIssue classification and severity standardsP0 - Highest
specs/quality-standards.mdReview quality standardsP1

Template Files (read before generation):

DocumentPurpose
templates/review-report.mdReview report template
templates/issue-template.mdIssue record template

Execution Flow:

Phase 0: Specification Study (Mandatory - Do not skip)
  → Read: specs/review-dimensions.md
  → Read: specs/issue-classification.md
  → Understand review standards and issue classification

Action: collect-context
  → Collect target files/directories
  → Identify tech stack and language
  → Output: state.context

Action: quick-scan
  → Quick scan overall structure
  → Identify high-risk areas
  → Output: state.risk_areas, state.scan_summary

Action: deep-review (per dimension)
  → Deep review per dimension
  → Record discovered issues
  → Output: state.findings[]

Action: generate-report
  → Aggregate all findings
  → Generate structured report
  → Output: review-report.md

Action: complete
  → Save final state
  → Output review summary

Review Dimensions:

DimensionFocus AreasKey Checks
CorrectnessLogic correctnessBoundary conditions, error handling, null checks
ReadabilityCode readabilityNaming conventions, function length, comment quality
PerformancePerformance efficiencyAlgorithm complexity, I/O optimization, resource usage
SecuritySecurityInjection risks, sensitive data, permission control
TestingTest coverageTest adequacy, boundary coverage, maintainability
ArchitectureArchitecture consistencyDesign patterns, layering, dependency management

Issue Severity Levels:

LevelPrefixDescriptionRequired Action
Critical[C]Blocking issue, must fix immediatelyMust fix before merge
High[H]Important issue, needs fixShould fix
Medium[M]Suggested improvementConsider fixing
Low[L]Optional optimizationNice to have
Info[I]Informational suggestionReference only

Output Structure:

.workflow/.scratchpad/review-code-{timestamp}/
├── state.json                    # Review state
├── context.json                  # Target context
├── findings/                     # Issue findings
│   ├── correctness.json
│   ├── readability.json
│   ├── performance.json
│   ├── security.json
│   ├── testing.json
│   └── architecture.json
└── review-report.md              # Final review report

review-cycle

One-Liner: Code review and fix loop — Complete cycle of reviewing code, discovering issues, fixing and verifying

Trigger:

/review-cycle <target-path>
/review-cycle --full <target-path>

Features:

  • Review code to discover issues
  • Generate fix recommendations
  • Execute fixes
  • Verify fix effectiveness
  • Loop until passing

Loop Flow:

Review Code → Find Issues → [Has issues] → Fix Code → Verify → [Still has issues] → Fix Code
                          ↑______________|

Use Cases:

  • Self-review before PR
  • Code quality improvement
  • Refactoring verification
  • Security audit

Best Practices

  1. Read specifications completely: Must read specs/ documents before executing review
  2. Multi-dimensional review: Use --dimensions to specify focus areas, or use default all dimensions
  3. Quick scan: Use quick-scan first to identify high-risk areas, then deep review
  4. Structured reports: Use generated review-report.md as fix guide
  5. Continuous improvement: Use review-cycle to continuously improve until quality standards are met

Usage Examples

bash
# Full review (6 dimensions)
/review-code src/auth/**

# Review only security and performance
/review-code --dimensions=sec,perf src/api/

# Review and fix loop
/review-cycle --full src/utils/

# Review specific file
/review-code src/components/Header.tsx

Issue Report Example

### [C] SQL Injection Risk

**Location**: `src/auth/login.ts:45`

**Issue**: User input directly concatenated into SQL query without sanitization.

**Severity**: Critical - Must fix before merge

**Recommendation**:
```typescript
// Before (vulnerable):
const query = `SELECT * FROM users WHERE username='${username}'`;

// After (safe):
const query = 'SELECT * FROM users WHERE username = ?';
await db.query(query, [username]);

Reference: specs/review-dimensions.md - Security section

Released under the MIT License.