code-review-skill
Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, Java 8, PHP, Ruby, Rails, Python, Django, FastAPI, Go, C#/.NET, Kotlin, Swift, Dart, Flutter, NestJS, C/C++, Zig, CSS/Less/Sass, Qt, and more. Covers architecture review, performance review, security audit, code quality anti-patterns, and common bugs across all ecosystems. Use when: reviewing pull requests, conducting PR reviews, code review, reviewing code changes, establishing review standards, mentoring developers, architecture reviews, security audits, performance reviews, checking code quality, finding bugs, giving feedback on code.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/awesome-skills-code-review-skill)HTML
<a href="/listings/awesome-skills-code-review-skill"><img src="/api/listings/awesome-skills-code-review-skill/badge.svg" alt="findsafeskills safety rating" /></a>Install
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
SKILL.md · Manifest · 232 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- ---
- name: code-review-skill
- description: |
- Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5,
- Rust, TypeScript, Java, Java 8, PHP, Ruby, Rails, Python, Django, FastAPI, Go, C#/.NET, Kotlin, Swift,
- Dart, Flutter, NestJS, C/C++, Zig, CSS/Less/Sass, Qt, and more.
- Covers architecture review, performance review, security audit, code quality anti-patterns,
- and common bugs across all ecosystems.
- Use when: reviewing pull requests, conducting PR reviews, code review, reviewing code changes,
- establishing review standards, mentoring developers, architecture reviews, security audits,
- performance reviews, checking code quality, finding bugs, giving feedback on code.
- allowed-tools:
- - Read
- - Grep
- - Glob
- - Bash
- - WebFetch
- ---
- # Code Review Skill
- Transform code reviews from gatekeeping to knowledge sharing through constructive feedback, systematic analysis, and collaborative improvement.
- ## When to Use This Skill
- - Reviewing pull requests and code changes
- - Establishing code review standards for teams
- - Mentoring junior developers through reviews
- - Conducting architecture reviews
- - Creating review checklists and guidelines
- - Improving team collaboration
- - Reducing code review cycle time
- - Maintaining code quality standards
- ## Core Principles
- ### 1. The Review Mindset
- **Goals of Code Review:**
- - Catch bugs and edge cases
- - Ensure code maintainability
- - Share knowledge across team
- - Enforce coding standards
- - Improve design and architecture
- - Build team culture
- **Not the Goals:**
- - Show off knowledge
- - Nitpick formatting (use linters)
- - Block progress unnecessarily
- - Rewrite to your preference
- ### 2. Effective Feedback
- **Good Feedback is:**
- - Specific and actionable
- - Educational, not judgmental
- - Focused on the code, not the person
- - Balanced (praise good work too)
- - Prioritized (critical vs nice-to-have)
- ```markdown
- ❌ Bad: "This is wrong."
- ✅ Good: "This could cause a race condition when multiple users
- access simultaneously. Consider using a mutex here."
- ❌ Bad: "Why didn't you use X pattern?"
- ✅ Good: "Have you considered the Repository pattern? It would
- make this easier to test. Here's an example: [link]"
- ❌ Bad: "Rename this variable."
- ✅ Good: "[nit] Consider `userCount` instead of `uc` for
- clarity. Not blocking if you prefer to keep it."
- ```
- ### 3. Review Scope
- **What to Review:**
- - Logic correctness and edge cases
- - Security vulnerabilities
- - Performance implications
- - Test coverage and quality
- - Error handling
- - Documentation and comments
- - API design and naming
- - Architectural fit
- **What Not to Review Manually:**
- - Code formatting (use Prettier, Black, etc.)
- - Import organization
- - Linting violations
- - Simple typos
- ## Review Process
- ### Phase 1: Context Gathering (2-3 minutes)
- Before diving into code, understand:
- 1. Read PR description and linked issue
- 2. Check PR size (>400 lines? Ask to split)
- 3. Review CI/CD status (tests passing?)
- 4. Understand the business requirement
- 5. Note any relevant architectural decisions
- > For large diffs, pipe the diff through [`scripts/pr-analyzer.py`](scripts/pr-analyzer.py) (`git diff main...HEAD | python scripts/pr-analyzer.py`) to triage complexity and get a suggested review approach before reading.
- ### Phase 2: High-Level Review (5-10 minutes)
- 1. **Architecture & Design** - Does the solution fit the problem?
- - For significant changes, consult [Architecture Review Guide](reference/architecture-review-guide.md)
- - Check: SOLID principles, coupling/cohesion, anti-patterns
- 2. **Performance Assessment** - Are there performance concerns?
- - For performance-critical code, consult [Performance Review Guide](reference/performance-review-guide.md)
- - Check: Algorithm complexity, N+1 queries, memory usage
- 3. **File Organization** - Are new files in the right places?
- 4. **Testing Strategy** - Are there tests covering edge cases?
- ### Phase 3: Line-by-Line Review (10-20 minutes)
- For each file, check:
- - **Logic & Correctness** - Edge cases, off-by-one, null checks, race conditions
- - **Security** - Input validation, injection risks, XSS, sensitive data
- - **Performance** - N+1 queries, unnecessary loops, memory leaks
- - **Maintainability** - Clear names, single responsibility, comments
- - **Reuse** - Before accepting new code, search for existing utilities/helpers that could replace it. Check adjacent files and shared modules for similar patterns. See [Universal Quality Guide](reference/code-quality-universal.md) for anti-patterns like parameter sprawl, leaky abstractions, nested conditionals, stringly-typed code, TOCTOU, and no-op updates.
- ### Phase 4: Summary & Decision (2-3 minutes)
- 1. Summarize key concerns
- 2. Highlight what you liked
- 3. Make clear decision:
- - ✅ Approve
- - 💬 Comment (minor suggestions)
- - 🔄 Request Changes (must address)
- 4. Offer to pair if complex
- ## Review Techniques
- ### Technique 1: The Checklist Method
- Use checklists for consistent reviews. See [Security Review Guide](reference/security-review-guide.md) for comprehensive security checklist.
- ### Technique 2: The Question Approach
- Instead of stating problems, ask questions:
- ```markdown
- ❌ "This will fail if the list is empty."
- ✅ "What happens if `items` is an empty array?"
- ❌ "You need error handling here."
- ✅ "How should this behave if the API call fails?"
- ```
- ### Technique 3: Suggest, Don't Command
- Use collaborative language:
- ```markdown
- ❌ "You must change this to use async/await"
- ✅ "Suggestion: async/await might make this more readable. What do you think?"
- ❌ "Extract this into a function"
- ✅ "This logic appears in 3 places. Would it make sense to extract it?"
- ```
- ### Technique 4: Differentiate Severity
- Use labels to indicate priority:
- - 🔴 `[blocking]` - Must fix before merge
- - 🟡 `[important]` - Should fix, discuss if disagree
- - 🟢 `[nit]` - Nice to have, not blocking
- - 💡 `[suggestion]` - Alternative approach to consider
- - 📚 `[learning]` - Educational comment, no action needed
- - 🎉 `[praise]` - Good work, keep it up!
- **Severity levels:** 🔴 / 🟡 / 🟢 are the three severity tiers used as the standard across all guides in this skill — 🔴 blocks the merge, 🟡 should be addressed, 🟢 is optional. The remaining markers (💡 / 📚 / 🎉) are non-blocking annotations.
- ## Language-Specific Guides
- 根据审查的代码语言,查阅对应的详细指南:
- | Language/Framework | Reference File | Key Topics |
- |-------------------|----------------|------------|
- | **React** | [React Guide](reference/react.md) | Hooks, useEffect, React 19 Actions, RSC, Suspense, TanStack Query v5 |
- | **Vue 3** | [Vue Guide](reference/vue.md) | Composition API, 响应性系统, Props/Emits, Watchers, Composables |
- | **Angular 17+** | [Angular Guide](reference/angular.md) | Signals, Standalone, RxJS, Zoneless, 模板优化, 测试, 路由守卫, HttpInterceptor |
- | **Rust** | [Rust Guide](reference/rust.md) | 所有权/借用, Unsafe 审查, 异步代码, 取消安全性, 错误处理 |
- | **TypeScript** | [TypeScript Guide](reference/typescript.md) | 类型安全, async/await, 不可变性, 测试, 模块解析, TS 5.x |
- | **Python** | [Python Guide](reference/python.md) | 可变默认参数, 异常处理, 类属性 |
- | **Django / DRF** | [Django Guide](reference/django.md) | 安全审查, N+1 查询, Serializer 反模式, ViewSet, 异步视图 |
- | **FastAPI** | [FastAPI Guide](reference/fastapi.md) | Depends, Pydantic v2 validation, async correctness, sessions/N+1, auth vs authorization, test-driven verification |
- | **Java** | [Java Guide](reference/java.md) | Java 17/21 新特性, Spring Boot 3, 虚拟线程, Stream/Optional |
- | **Java 8 / Legacy** | [Java 8 Guide](reference/java8.md) | Java 8, Spring Boot 2, javax.*, Stream/Optional, java.time, CompletableFuture |
- | **PHP** | [PHP Guide](reference/php.md) | PHP 8.x type system, PDO, security review, Composer, PHPUnit/PHPStan |
- | **Ruby / Rails** | [Ruby Guide](reference/ruby.md) | Ruby semantics, Rails 8, Active Record, Active Job, security, testing |
- | **C# / .NET** | [C# Guide](reference/csharp.md) | C# 12 特性, 异步编程, EF Core 性能, ASP.NET Core, LINQ |
- | **Go** | [Go Guide](reference/go.md) | 错误处理, goroutine/channel, context, 接口设计 |
- | **Kotlin / Android** | [Kotlin Guide](reference/kotlin.md) | 协程, Flow, Jetpack Compose, 空安全, 内存泄漏, 架构模式 |
- | **Swift / SwiftUI** | [Swift Guide](reference/swift.md) | Optionals, Swift Concurrency, Sendable/actors, SwiftUI property wrappers, value vs reference types, API design |
- | **Dart / Flutter** | [Dart Guide](reference/dart.md) | Widget rebuilds, const constructors, null safety, isolates, async in build, Riverpod/Bloc, platform channels, keys, disposal |
- | **NestJS** | [NestJS Guide](reference/nestjs.md) | 依赖注入, 分层架构, DTO 验证, Guard/Interceptor, 循环依赖 |
- | **Svelte / SvelteKit** | [Svelte Guide](reference/svelte.md) | Runes, Load 函数, Form Actions, Store 迁移, SSR/CSR 边界 |
- | **C** | [C Guide](reference/c.md) | 指针/缓冲区, 内存安全, UB, 安全编码, 可移植性, 测试 |
- | **C++** | [C++ Guide](reference/cpp.md) | RAII, 智能指针, C++20/23, constexpr, 测试 |
- | **Zig** | [Zig Guide](reference/zig.md) | Allocators, error unions, defer/errdefer, comptime, C interop |
- | **CSS/Less/Sass** | [CSS Guide](reference/css-less-sass.md) | 变量规范, !important, 性能优化, 响应式, 兼容性 |
- | **Qt** | [Qt Guide](reference/qt.md) | 对象模型, 信号/槽, Model/View, QML, Qt6 迁移, 测试 |
- ## Cross-Cutting Guides
- Language-agnostic patterns applicable to all code reviews:
- | Topic | Reference File | Key Topics |
- |-------|----------------|------------|
- | **Architecture Review** | [Architecture Review Guide](reference/architecture-review-guide.md) | SOLID, anti-patterns, coupling/cohesion, dependency direction |
- | **Performance Review** | [Performance Review Guide](reference/performance-review-guide.md) | Web Vitals, N+1, algorithm complexity, memory leaks, caching |
- | **Security Review** | [Security Review Guide](reference/security-review-guide.md) | SQLi, XSS, CSRF, SSRF, IDOR, 命令注入, 跨语言示例 |
- | **Universal Quality** | [Universal Quality Guide](reference/code-quality-universal.md) | Reuse audit, parameter sprawl, leaky abstractions, nested conditionals, stringly-typed code, TOCTOU, no-op updates, redundant state |
- | **Common Bugs** | [Common Bugs Checklist](reference/common-bugs-checklist.md) | Language-specific bug patterns, common pitfalls |
- | **SQL Injection Prevention** | [SQL Injection Guide](reference/cross-cutting/sql-injection-prevention.md) | Parameterized queries, ORM safety, 6 languages, dynamic identifiers, detection |
- | **XSS Prevention** | [XSS Prevention Guide](reference/cross-cutting/xss-prevention.md) | Output encoding, CSP, 5 frameworks, input validation vs encoding, detection |
- | **N+1 Queries** | [N+1 Queries Guide](reference/cross-cutting/n-plus-one-queries.md) | Eager loading, batch fetching, DataLoader, 5 languages, detection |
- | **Error Handling** | [Error Handling Guide](reference/cross-cutting/error-handling-principles.md) | Fail fast, error hierarchy, 7 languages, anti-patterns, logging |
- | **Async & Concurrency** | [Concurrency Guide](reference/cross-cutting/async-concurrency-patterns.md) | Goroutines, async/await, actors, structured concurrency, 7 languages |
- | **Review Best Practices** | [Code Review Best Practices](reference/code-review-best-practices.md) | Communication, reviewer mindset, giving feedback, severity labels |
- ## Additional Resources
- - [PR Review Template](assets/pr-review-template.md) - PR 审查评论模板
- - [Review Checklist](assets/review-checklist.md) - 快速参考清单
README.md · README · 780 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <div align="center">
- <h1>🔍 Code Review Skill</h1>
- <p>
- <strong>A comprehensive, modular code review skill for Claude Code</strong><br/>
- <strong>面向 Claude Code 的全面模块化代码审查技能</strong>
- </p>
- <p>
- <a href="https://github.com/awesome-skills/code-review-skill/blob/main/LICENSE">
- <img src="https://img.shields.io/badge/License-MIT-22c55e?style=flat-square" alt="License: MIT"/>
- </a>
- <img src="https://img.shields.io/badge/Claude_Code-Skill-7c3aed?style=flat-square&logo=anthropic&logoColor=white" alt="Claude Code Skill"/>
- <img src="https://img.shields.io/badge/Total_Lines-21%2C000%2B-3b82f6?style=flat-square" alt="21000+ lines"/>
- <img src="https://img.shields.io/badge/Languages-20%2B-f59e0b?style=flat-square" alt="20+ languages"/>
- <img src="https://img.shields.io/badge/PRs-Welcome-ec4899?style=flat-square" alt="PRs Welcome"/>
- </p>
- <p>
- <a href="#english">English</a>
- ·
- <a href="#chinese">中文</a>
- ·
- <a href="./CONTRIBUTING.md">Contributing</a>
- </p>
- </div>
- ---
- <a name="english"></a>
- ## English
- ### What is this?
- **Code Review Skill** is a production-ready skill for [Claude Code](https://claude.ai/code) that transforms AI-assisted code review from vague suggestions into a **structured, consistent, and expert-level** process.
- It covers **20+ languages and frameworks** with over **21,000 lines** of carefully curated review guidelines — loaded progressively to minimize context window usage.
- ---
- ### ✨ Key Features
- - **Progressive Disclosure** — Core skill is ~220 lines; language guides (~200–1,100 lines each) load only when needed.
- - **Four-Phase Review Process** — Structured workflow from understanding scope to delivering clear feedback.
- - **Severity Labeling** — Every finding is categorized: `blocking` · `important` · `nit` · `suggestion` · `learning` · `praise`
- - **Security-First** — Dedicated security checklists per language ecosystem.
- - **Collaborative Tone** — Questions over commands, suggestions over mandates.
- - **Automation Awareness** — Clearly separates what human review should catch vs. what linters handle.
- ---
- ### 🌐 Supported Languages & Frameworks
- <table>
- <thead>
- <tr>
- <th>Category</th>
- <th>Technology</th>
- <th>Guide</th>
- <th>Lines</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td rowspan="6"><strong>Frontend</strong></td>
- <td>⚛️ React 19 / Next.js / TanStack Query v5</td>
- <td><code>reference/react.md</code></td>
- <td>~870</td>
- </tr>
- <tr>
- <td>💚 Vue 3.5 + Composition API</td>
- <td><code>reference/vue.md</code></td>
- <td>~920</td>
- </tr>
- <tr>
- <td>🔮 Angular 17+ / Signals / Zoneless</td>
- <td><code>reference/angular.md</code></td>
- <td>~790</td>
- </tr>
- <tr>
- <td>🔥 Svelte 5 / SvelteKit</td>
- <td><code>reference/svelte.md</code></td>
- <td>~1,060</td>
- </tr>
- <tr>
- <td>🎨 CSS / Less / Sass</td>
- <td><code>reference/css-less-sass.md</code></td>
- <td>~660</td>
- </tr>
- <tr>
- <td>🔷 TypeScript</td>
- <td><code>reference/typescript.md</code></td>
- <td>~1,020</td>
- </tr>
- <tr>
- <td rowspan="11"><strong>Backend</strong></td>
- <td>☕ Java 17/21 + Spring Boot 3</td>
- <td><code>reference/java.md</code></td>
- <td>~410</td>
- </tr>
- <tr>
- <td>☕ Java 8 + Spring Boot 2</td>
- <td><code>reference/java8.md</code></td>
- <td>~580</td>
- </tr>
- <tr>
- <td>⚡ FastAPI</td>
- <td><code>reference/fastapi.md</code></td>
- <td>~590</td>
- </tr>
- <tr>
- <td>PHP 8.x</td>
- <td><code>reference/php.md</code></td>
- <td>~700</td>
- </tr>
- <tr>
- <td>💎 Ruby 3.4+/4.0 + Rails 8.x</td>
- <td><code>reference/ruby.md</code></td>
- <td>~960</td>
- </tr>
- <tr>
- <td>📦 NestJS</td>
- <td><code>reference/nestjs.md</code></td>
- <td>~590</td>
- </tr>
- <tr>
- <td>🐍 Django / DRF</td>
- <td><code>reference/django.md</code></td>
- <td>~1,030</td>
- </tr>
- <tr>
- <td>🐹 Go</td>
- <td><code>reference/go.md</code></td>
- <td>~990</td>
- </tr>
- <tr>
- <td>🦀 Rust</td>
- <td><code>reference/rust.md</code></td>
- <td>~840</td>
- </tr>
- <tr>
- <td>💻 C# / .NET 8</td>
- <td><code>reference/csharp.md</code></td>
- <td>~520</td>
- </tr>
- <tr>
- <td>🐍 Python</td>
- <td><code>reference/python.md</code></td>
- <td>~1,070</td>
- </tr>
- <tr>
- <td rowspan="7"><strong>Mobile / Systems</strong></td>
- <td>📱 Kotlin / Android</td>
- <td><code>reference/kotlin.md</code></td>
- <td>~1,020</td>
- </tr>
- <tr>
- <td>🍎 Swift / SwiftUI</td>
- <td><code>reference/swift.md</code></td>
- <td>~930</td>
- </tr>
- <tr>
- <td>🎯 Dart / Flutter</td>
- <td><code>reference/dart.md</code></td>
- <td>~650</td>
- </tr>
- <tr>
- <td>⚙️ C</td>
- <td><code>reference/c.md</code></td>
- <td>~890</td>
- </tr>
- <tr>
- <td>🔩 C++</td>
- <td><code>reference/cpp.md</code></td>
- <td>~890</td>
- </tr>
- <tr>
- <td>⚡ Zig</td>
- <td><code>reference/zig.md</code></td>
- <td>~440</td>
- </tr>
- <tr>
- <td>🖥️ Qt Framework</td>
- <td><code>reference/qt.md</code></td>
- <td>~760</td>
- </tr>
- <tr>
- <td rowspan="9"><strong>Cross-Cutting</strong></td>
- <td>🏛️ Architecture Design Review</td>
- <td><code>reference/architecture-review-guide.md</code></td>
- <td>~470</td>
- </tr>
- <tr>
- <td>⚡ Performance Review</td>
- <td><code>reference/performance-review-guide.md</code></td>
- <td>~820</td>
- </tr>
- <tr>
- <td>🔍 Universal Quality Anti-Patterns</td>
- <td><code>reference/code-quality-universal.md</code></td>
- <td>~490</td>
- </tr>
- <tr>
- <td>🛡️ Security Review</td>
- <td><code>reference/security-review-guide.md</code></td>
- <td>~640</td>
- </tr>
- <tr>
- <td>📈 N+1 Queries</td>
- <td><code>reference/cross-cutting/n-plus-one-queries.md</code></td>
- <td>~310</td>
- </tr>
- <tr>
- <td>⚠️ Error Handling Principles</td>
- <td><code>reference/cross-cutting/error-handling-principles.md</code></td>
- <td>~490</td>
- </tr>
- <tr>
- <td>⚡ Async & Concurrency Patterns</td>
- <td><code>reference/cross-cutting/async-concurrency-patterns.md</code></td>
- <td>~540</td>
- </tr>
- <tr>
- <td>🛡️ SQL Injection Prevention</td>
- <td><code>reference/cross-cutting/sql-injection-prevention.md</code></td>
- <td>~310</td>
- </tr>
- <tr>
- <td>🛡️ XSS Prevention</td>
- <td><code>reference/cross-cutting/xss-prevention.md</code></td>
- <td>~260</td>
- </tr>
- </tbody>
- </table>
- ---
- ### 🔄 The Four-Phase Review Process
- ```
- Phase 1 - Context Gathering
- Understand PR scope, linked issues, and intent
- |
- v
- Phase 2 - High-Level Review
- Architecture - Performance impact - Test strategy
- |
- v
- Phase 3 - Line-by-Line Analysis
- Logic - Security - Maintainability - Edge cases
- |
- v
- Phase 4 - Summary & Decision
- Structured feedback - Approval status - Action items
- ```
- ---
- ### 🏷️ Severity Labels
- | Label | Meaning |
- |-------|---------|
- | 🔴 `blocking` | Must be fixed before merge |
- | 🟠 `important` | Should be fixed; may block depending on context |
- | 🟡 `nit` | Minor style or preference issue |
- | 🔵 `suggestion` | Optional improvement worth considering |
- | 📚 `learning` | Educational note for the author |
- | 🌟 `praise` | Explicitly highlight great work |
- ---
- ### 📁 Repository Structure
- ```
- code-review-skill/
- |
- +-- SKILL.md # Core skill - loaded on activation (~220 lines)
- +-- README.md
- +-- LICENSE
- +-- CONTRIBUTING.md
- |
- +-- reference/ # On-demand language guides
- | +-- react.md # React 19 / Next.js / TanStack Query v5
- | +-- vue.md # Vue 3.5 Composition API
- | +-- angular.md # Angular 17+ / Signals / Zoneless
- | +-- svelte.md # Svelte 5 / SvelteKit
- | +-- rust.md # Rust ownership, async/await, unsafe
- | +-- typescript.md # TypeScript strict mode, generics, ESLint
- | +-- nestjs.md # NestJS DI, Guards, Interceptors, DTOs
- | +-- java.md # Java 17/21 & Spring Boot 3
- | +-- java8.md # Java 8 & Spring Boot 2 (legacy)
- | +-- php.md # PHP 8.x types, PDO, security, Composer
- | +-- ruby.md # Ruby 3.4+/4.0, Rails 8.x, Active Record/Job
- | +-- python.md # Python async, typing, pytest
- | +-- django.md # Django / DRF security, serializers, async
- | +-- fastapi.md # FastAPI Depends, Pydantic v2, async, test-driven verification
- | +-- go.md # Go goroutines, channels, context, interfaces
- | +-- kotlin.md # Kotlin / Android coroutines, Compose, Flow
- | +-- swift.md # Swift 5.9+/6, SwiftUI, concurrency, optionals
- | +-- dart.md # Dart / Flutter rebuilds, null safety, isolates, state
- | +-- csharp.md # C# 12 / .NET 8, EF Core, ASP.NET Core
- | +-- c.md # C memory safety, UB, error handling
- | +-- cpp.md # C++ RAII, move semantics, exception safety
- | +-- zig.md # Zig allocators, errors, comptime, C interop
- | +-- qt.md # Qt object model, signals/slots, GUI perf
- | +-- css-less-sass.md # CSS/Less/Sass variables, responsive design
- | +-- architecture-review-guide.md # SOLID, anti-patterns, coupling/cohesion
- | +-- code-quality-universal.md # Reuse audit, parameter sprawl, TOCTOU, no-op updates
- | +-- performance-review-guide.md # Core Web Vitals, N+1, memory leaks
- | +-- security-review-guide.md # Security checklist (all languages)
- | +-- common-bugs-checklist.md # Language-specific bug patterns
- | +-- code-review-best-practices.md # Communication & process guidelines
- |
- +-- reference/cross-cutting/ # Language-agnostic cross-cutting patterns
- | +-- sql-injection-prevention.md # Parameterized queries, 6 languages
- | +-- xss-prevention.md # Output encoding, CSP, 5 frameworks
- | +-- n-plus-one-queries.md # N+1 queries, eager loading, 5 languages
- | +-- error-handling-principles.md # Error handling principles, 7 languages
- | +-- async-concurrency-patterns.md # Concurrency patterns, 7 languages
- |
- +-- assets/
- | +-- review-checklist.md # Quick reference checklist
- | +-- pr-review-template.md # PR review comment template
- |
- +-- scripts/
- +-- pr-analyzer.py # PR complexity analyzer
- ```
- ---
- ### 🚀 Installation
- **Install with `npx skills` (Cursor, Claude Code, Codex, OpenCode, and other agents):**
- ```bash
- npx skills add awesome-skills/code-review-skill
- ```
- The skills CLI finds `SKILL.md` at the repo root. Do not nest this skill under `skills/`.
- **Or clone into the Claude Code skills directory:**
- ```bash
- # macOS / Linux
- git clone https://github.com/awesome-skills/code-review-skill.git \
- ~/.claude/skills/code-review-skill
- # Windows (PowerShell)
- git clone https://github.com/awesome-skills/code-review-skill.git `
- "$env:USERPROFILE\.claude\skills\code-review-skill"
- ```
- **Or add to an existing plugin:**
- ```bash
- cp -r code-review-skill ~/.claude/plugins/your-plugin/skills/code-review/
- ```
- ---
- ### 💡 Usage
- Once installed, activate the skill in your Claude Code session:
- ```
- Use code-review-skill to review this PR
- ```
- Or create a custom slash command in `.claude/commands/`:
- ```markdown
- <!-- .claude/commands/review.md -->
- Use code-review-skill to perform a thorough review of the changes in this PR.
- Focus on: security, performance, and maintainability.
- ```
- **Example prompts:**
- | Prompt | What happens |
- |--------|-------------|
- | `Review this React component` | Loads `react.md` - checks hooks, Server Components, Suspense patterns |
- | `Review this Java PR` | Loads `java.md` - checks virtual threads, JPA, Spring Boot 3 patterns |
- | `Review this Java 8 / Spring Boot 2 PR` | Loads `java8.md` - Stream/Optional, java.time, RestTemplate timeouts, javax.* |
- | `Review this Flutter widget` | Loads `dart.md` - rebuilds, const, null safety, isolates, Riverpod/Bloc, keys, disposal |
- | `Security review of this Go service` | Loads `go.md` + `security-review-guide.md` |
- | `Architecture review` | Loads `architecture-review-guide.md` - SOLID, anti-patterns, coupling |
- | `Performance review` | Loads `performance-review-guide.md` - Web Vitals, N+1, complexity |
- ---
- ### 🔬 Highlights by Language
- <details>
- <summary><strong>⚛️ React 19</strong></summary>
- - `useActionState` - Unified form state management
- - `useFormStatus` - Access parent form status without prop drilling
- - `useOptimistic` - Optimistic UI updates with automatic rollback
- - Server Components & Server Actions patterns (Next.js 15+)
- - Suspense boundary design, Error Boundary integration, streaming SSR
- - `use()` Hook for consuming Promises
- </details>
- <details>
- <summary><strong>☕ Java & Spring Boot 3</strong></summary>
- - **Java 17/21**: Records, Pattern Matching for Switch, Text Blocks, Sealed Classes
- - **Virtual Threads** (Project Loom): High-throughput I/O patterns
- - **Spring Boot 3**: Constructor injection, `@ConfigurationProperties`, `ProblemDetail`
- - **JPA Performance**: Solving N+1, correct `equals`/`hashCode` on Entities
- </details>
- <details>
- <summary><strong>☕ Java 8 & Spring Boot 2 (Legacy)</strong></summary>
- - **Java 8**: Lambda, Stream/`Collectors`, Optional, `java.time` (no Records / virtual threads)
- - **Concurrency**: bounded thread pools, `CompletableFuture` + explicit executors
- - **Spring Boot 2**: `javax.*`, constructor injection, `RestTemplate` timeouts
- - **JPA / Hibernate 5**: N+1, Entity `equals`/`hashCode`, UTC time mapping pitfalls
- </details>
- <details>
- <summary><strong>🦀 Rust</strong></summary>
- - Ownership patterns and common pitfalls
- - `unsafe` code review requirements (mandatory `SAFETY` comments)
- - Async/await - avoiding blocking in async context, cancellation safety
- - Error handling: `thiserror` for libraries, `anyhow` for applications
- </details>
- <details>
- <summary><strong>🐹 Go</strong></summary>
- - Goroutine lifecycle management and leak prevention
- - Channel patterns, select usage
- - `context.Context` propagation
- - Interface design (accept interfaces, return structs)
- - Error wrapping with `%w`
- </details>
- <details>
- <summary><strong>⚙️ C / C++</strong></summary>
- - **C**: Pointer/buffer safety, undefined behavior, resource cleanup, integer overflow
- - **C++**: RAII ownership, Rule of 0/3/5, move semantics, exception safety, `noexcept`
- - **Qt**: Object parent/child memory model, thread-safe signal/slot connections, GUI performance
- </details>
- ---
- ### 🤝 Contributing
- Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
- **Ideas:**
- - New language guides (Elixir, Scala, Lua...)
- - Framework-specific guides (Laravel, Spring WebFlux...)
- - Additional checklists and templates
- - Translations of core documentation
- ---
- ### 📄 License
- MIT © [awesome-skills](https://github.com/awesome-skills)
- ---
- <a name="chinese"></a>
- ## 中文
- ### 这是什么?
- **Code Review Skill** 是专为 [Claude Code](https://claude.ai/code) 打造的生产级代码审查技能,将 AI 辅助的代码审查从模糊建议转变为**结构化、一致且专业级**的流程。
- 覆盖 **20+ 种语言和框架**,拥有超过 **21,000 行**精心整理的代码审查指南——按需加载,最大程度减少上下文占用。
- ---
- ### ✨ 核心特性
- - **渐进式加载** — 核心技能仅 ~220 行,各语言指南(每份 200–1,100 行)仅在需要时才加载。
- - **四阶段审查流程** — 从理解 PR 范围到输出清晰反馈,每一步都有规可循。
- - **严重性标记** — 每条发现均分级:`blocking` · `important` · `nit` · `suggestion` · `learning` · `praise`
- - **安全优先** — 每个语言生态均配备专属安全检查清单。
- - **协作式语气** — 以提问替代命令,以建议替代指令。
- - **自动化感知** — 明确区分人工审查应关注的内容与 linter 自动处理的内容。
- ---
- ### 🌐 支持的语言与框架
- | 分类 | 技术栈 | 指南文件 | 行数 |
- |------|--------|----------|------|
- | **前端** | ⚛️ React 19 / Next.js / TanStack Query v5 | `reference/react.md` | ~870 |
- | | 💚 Vue 3.5 Composition API | `reference/vue.md` | ~920 |
- | | 🔮 Angular 17+ / Signals / Zoneless | `reference/angular.md` | ~790 |
- | | 🔥 Svelte 5 / SvelteKit | `reference/svelte.md` | ~1,060 |
- | | 🎨 CSS / Less / Sass | `reference/css-less-sass.md` | ~660 |
- | | 🔷 TypeScript | `reference/typescript.md` | ~1,020 |
- | **后端** | ☕ Java 17/21 + Spring Boot 3 | `reference/java.md` | ~410 |
- | | ☕ Java 8 + Spring Boot 2 | `reference/java8.md` | ~580 |
- | | ⚡ FastAPI | `reference/fastapi.md` | ~590 |
- | | PHP 8.x | `reference/php.md` | ~700 |
- | | 💎 Ruby 3.4+/4.0 + Rails 8.x | `reference/ruby.md` | ~960 |
- | | 📦 NestJS | `reference/nestjs.md` | ~590 |
- | | 🐍 Django / DRF | `reference/django.md` | ~1,030 |
- | | 🐍 Python | `reference/python.md` | ~1,070 |
- | | 🐹 Go | `reference/go.md` | ~990 |
- | | 🦀 Rust | `reference/rust.md` | ~840 |
- | | 💻 C# / .NET 8 | `reference/csharp.md` | ~520 |
- | **移动 / 系统** | 📱 Kotlin / Android | `reference/kotlin.md` | ~1,020 |
- | | 🍎 Swift / SwiftUI | `reference/swift.md` | ~930 |
- | | 🎯 Dart / Flutter | `reference/dart.md` | ~650 |
- | | ⚙️ C | `reference/c.md` | ~890 |
- | | 🔩 C++ | `reference/cpp.md` | ~890 |
- | | ⚡ Zig | `reference/zig.md` | ~440 |
- | | 🖥️ Qt 框架 | `reference/qt.md` | ~760 |
- | **架构** | 🏛️ 架构设计审查 | `reference/architecture-review-guide.md` | ~470 |
- | | ⚡ 性能审查 | `reference/performance-review-guide.md` | ~820 |
- | | 🔍 通用质量反模式 | `reference/code-quality-universal.md` | ~490 |
- | | 🛡️ 安全审查 | `reference/security-review-guide.md` | ~640 |
- | | 📈 N+1 查询 | `reference/cross-cutting/n-plus-one-queries.md` | ~310 |
- | | ⚠️ 错误处理原则 | `reference/cross-cutting/error-handling-principles.md` | ~490 |
- | | ⚡ 异步与并发模式 | `reference/cross-cutting/async-concurrency-patterns.md` | ~540 |
- | | 🛡️ SQL 注入防护 | `reference/cross-cutting/sql-injection-prevention.md` | ~310 |
- | | 🛡️ XSS 防护 | `reference/cross-cutting/xss-prevention.md` | ~260 |
- ---
- ### 🔄 四阶段审查流程
- ```
- 阶段一 - 上下文收集
- 理解 PR 范围、关联 Issue 和实现意图
- |
- v
- 阶段二 - 高层级审查
- 架构设计 - 性能影响 - 测试策略
- |
- v
- 阶段三 - 逐行深度分析
- 逻辑正确性 - 安全漏洞 - 可维护性 - 边界情况
- |
- v
- 阶段四 - 总结与决策
- 结构化反馈 - 审批状态 - 后续行动项
- ```
- ---
- ### 🏷️ 严重性标记说明
- | 标记 | 含义 |
- |------|------|
- | 🔴 `blocking` | 合并前必须修复 |
- | 🟠 `important` | 应当修复,视情况可能阻塞合并 |
- | 🟡 `nit` | 风格或偏好上的小问题 |
- | 🔵 `suggestion` | 值得考虑的可选优化 |
- | 📚 `learning` | 给作者的教育性说明 |
- | 🌟 `praise` | 明确表扬优秀代码 |
- ---
- ### 📁 仓库结构
- ```
- code-review-skill/
- |
- +-- SKILL.md # 核心技能,激活时加载(~220 行)
- +-- README.md
- +-- LICENSE
- +-- CONTRIBUTING.md
- |
- +-- reference/ # 按需加载的语言指南
- | +-- react.md # React 19 / Next.js / TanStack Query v5
- | +-- vue.md # Vue 3.5 组合式 API
- | +-- angular.md # Angular 17+ / Signals / Zoneless
- | +-- svelte.md # Svelte 5 / SvelteKit
- | +-- rust.md # Rust 所有权、async/await、unsafe
- | +-- typescript.md # TypeScript strict 模式、泛型、ESLint
- | +-- nestjs.md # NestJS 依赖注入、Guard、Interceptor、DTO
- | +-- java.md # Java 17/21 & Spring Boot 3
- | +-- java8.md # Java 8 & Spring Boot 2(遗留栈)
- | +-- php.md # PHP 8.x 类型、PDO、安全、Composer
- | +-- ruby.md # Ruby 3.4+/4.0、Rails 8.x、Active Record/Job
- | +-- python.md # Python async、类型注解、pytest
- | +-- django.md # Django / DRF 安全、Serializer、异步视图
- | +-- fastapi.md # FastAPI Depends、Pydantic v2、异步、测试驱动验证
- | +-- go.md # Go goroutine、channel、context、接口
- | +-- kotlin.md # Kotlin / Android 协程、Compose、Flow
- | +-- swift.md # Swift 5.9+/6、SwiftUI、并发、可选值
- | +-- dart.md # Dart / Flutter 重建、空安全、isolate、状态
- | +-- csharp.md # C# 12 / .NET 8、EF Core、ASP.NET Core
- | +-- c.md # C 内存安全、UB、错误处理
- | +-- cpp.md # C++ RAII、移动语义、异常安全
- | +-- zig.md # Zig allocator、错误处理、comptime、C 互操作
- | +-- qt.md # Qt 对象模型、信号/槽、GUI 性能
- | +-- css-less-sass.md # CSS/Less/Sass 变量、响应式设计
- | +-- architecture-review-guide.md # SOLID、反模式、耦合度分析
- | +-- code-quality-universal.md # 复用审查、参数膨胀、抽象泄漏、TOCTOU
- | +-- performance-review-guide.md # Core Web Vitals、N+1、内存泄漏
- | +-- security-review-guide.md # 安全审查清单(全语言通用)
- | +-- common-bugs-checklist.md # 各语言常见 Bug 模式
- | +-- code-review-best-practices.md # 沟通与流程最佳实践
- |
- +-- reference/cross-cutting/ # 语言无关跨领域模式
- | +-- sql-injection-prevention.md # 参数化查询, 6 语言
- | +-- xss-prevention.md # 输出编码, CSP, 5 框架
- | +-- n-plus-one-queries.md # N+1 查询, 预加载, 5 语言
- | +-- error-handling-principles.md # 错误处理原则, 7 语言
- | +-- async-concurrency-patterns.md # 并发模式, 7 语言
- |
- +-- assets/
- | +-- review-checklist.md # 快速参考清单
- | +-- pr-review-template.md # PR 审查评论模板
- |
- +-- scripts/
- +-- pr-analyzer.py # PR 复杂度分析工具
- ```
- ---
- ### 🚀 安装方法
- **使用 `npx skills` 安装(Cursor、Claude Code、Codex、OpenCode 及其他 Agent):**
- ```bash
- npx skills add awesome-skills/code-review-skill
- ```
- skills CLI 会发现仓库根目录的 `SKILL.md`。不要把本技能嵌套到 `skills/` 目录下。
- **或克隆到 Claude Code skills 目录:**
- ```bash
- # macOS / Linux
- git clone https://github.com/awesome-skills/code-review-skill.git \
- ~/.claude/skills/code-review-skill
- # Windows(PowerShell)
- git clone https://github.com/awesome-skills/code-review-skill.git `
- "$env:USERPROFILE\.claude\skills\code-review-skill"
- ```
- **或添加到现有插件:**
- ```bash
- cp -r code-review-skill ~/.claude/plugins/your-plugin/skills/code-review/
- ```
- ---
- ### 💡 使用方式
- 安装后,在 Claude Code 会话中激活技能:
- ```
- Use code-review-skill to review this PR
- ```
- 或在 `.claude/commands/` 中创建自定义斜杠命令:
- ```markdown
- <!-- .claude/commands/review.md -->
- 使用 code-review-skill 对这次 PR 的变更进行全面审查。
- 重点关注:安全性、性能和可维护性。
- ```
- **示例提示词:**
- | 提示词 | 效果 |
- |--------|------|
- | `审查这个 React 组件` | 加载 `react.md`,检查 Hooks、Server Components、Suspense |
- | `审查这个 Java PR` | 加载 `java.md`,检查虚拟线程、JPA、Spring Boot 3 |
- | `审查这个 Java 8 / Spring Boot 2 PR` | 加载 `java8.md`,检查 Stream/Optional、java.time、RestTemplate 超时、javax.* |
- | `审查这个 Flutter 组件` | 加载 `dart.md`,检查重建、const、空安全、isolate、Riverpod/Bloc、Key、释放 |
- | `对这个 Go 服务进行安全审查` | 加载 `go.md` + `security-review-guide.md` |
- | `架构审查` | 加载 `architecture-review-guide.md`,检查 SOLID 与反模式 |
- | `性能审查` | 加载 `performance-review-guide.md`,分析 Web Vitals、N+1 等 |
- ---
- ### 🔬 各语言核心内容
- <details>
- <summary><strong>⚛️ React 19</strong></summary>
- - `useActionState` — 统一的表单状态管理
- - `useFormStatus` — 无需 props 透传即可访问父表单状态
- - `useOptimistic` — 带自动回滚的乐观 UI 更新
- - Server Components & Server Actions(Next.js 15+)
- - Suspense 边界设计、Error Boundary 集成、流式 SSR
- - `use()` Hook 消费 Promise
- </details>
- <details>
- <summary><strong>☕ Java & Spring Boot 3</strong></summary>
- - **Java 17/21**:Records、Switch 模式匹配、文本块、Sealed Classes
- - **虚拟线程**(Project Loom):高吞吐量 I/O 模式
- - **Spring Boot 3**:构造器注入、`@ConfigurationProperties`、`ProblemDetail`
- - **JPA 性能**:解决 N+1、Entity 正确的 `equals`/`hashCode` 实现
- </details>
- <details>
- <summary><strong>☕ Java 8 & Spring Boot 2(遗留栈)</strong></summary>
- - **Java 8**:Lambda、Stream/`Collectors`、Optional、`java.time`(无 Records / 虚拟线程)
- - **并发**:有界线程池、`CompletableFuture` + 显式 Executor
- - **Spring Boot 2**:`javax.*`、构造器注入、`RestTemplate` 超时
- - **JPA / Hibernate 5**:N+1、Entity `equals`/`hashCode`、UTC 时间映射陷阱
- </details>
- <details>
- <summary><strong>🦀 Rust</strong></summary>
- - 所有权模式与常见陷阱
- - `unsafe` 代码审查要求(必须有 `SAFETY` 注释)
- - Async/await — 避免在异步上下文中阻塞,取消安全性
- - 错误处理:库用 `thiserror`,应用用 `anyhow`
- </details>
- <details>
- <summary><strong>🐹 Go</strong></summary>
- - Goroutine 生命周期管理与泄漏预防
- - Channel 模式、select 用法
- - `context.Context` 传播规范
- - 接口设计原则(接受接口,返回结构体)
- - 错误包装:使用 `%w`
- </details>
- <details>
- <summary><strong>⚙️ C / C++</strong></summary>
- - **C**:指针/缓冲区安全、未定义行为、资源清理、整数溢出
- - **C++**:RAII 所有权、Rule of 0/3/5、移动语义、异常安全、`noexcept`
- - **Qt**:父子内存模型、线程安全的信号/槽连接、GUI 性能优化
- </details>
- ---
- ### 🤝 参与贡献
- 欢迎贡献!请查阅 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解规范。
- **可贡献方向:**
- - 新增语言指南(Elixir、Scala、Lua...)
- - 框架专属指南(Laravel、Spring WebFlux...)
- - 补充检查清单和审查模板
- - 核心文档的多语言翻译
- ---
- ### 📄 开源协议
- MIT © [awesome-skills](https://github.com/awesome-skills)
- ---
- <div align="center">
- Made with ❤️ for developers who care about code quality
- </div>
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.