
Code Review Skill
- 890 installs
- 1.6k repo stars
- Updated July 16, 2026
- awesome-skills/code-review-skill
Code Review Skill is an agent skill that guides constructive, multi-stack pull request and architecture reviews.
About
Code Review Skill is an agent skill that turns ad-hoc PR comments into a systematic, constructive review workflow for solo builders and small teams who wear the senior reviewer hat. It covers a wide surface of frameworks and languages—from React and Vue through Rust, Django, NestJS, and mobile stacks—so one install can support polyglot repos typical of indie SaaS. Invoke it when reviewing pull requests, drafting team standards, mentoring through feedback, or running architecture and security-flavored reviews before merge. The skill stresses catching bugs and edge cases, maintainability, and design improvement while explicitly avoiding format nitpicks that belong in linters. For Prism, canonical placement is Ship → Review with natural spill into Ship → Security when audits are requested. It complements stack-specific perf skills but does not replace automated CI; Bash access is intended to run lint, test, and build verification when the agent environment allows.
- Review guidance spanning React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Python, Go, .NET, and more
- Emphasizes knowledge sharing over gatekeeping with explicit review goals and anti-goals
- Supports architecture reviews, mentoring juniors, and team review standards
- Allowed tools include Read, Grep, Glob, Bash, and WebFetch for lint/test/doc verification
- Use cases include security-oriented review passes and reducing review cycle time
Code Review Skill by the numbers
- 890 all-time installs (skills.sh)
- +192 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #165 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/awesome-skills/code-review-skill --skill code-review-skillAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 890 |
|---|---|
| repo stars | ★ 1.6k |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 16, 2026 |
| Repository | awesome-skills/code-review-skill ↗ |
What it does
Run structured, constructive PR and architecture reviews across many stacks when you are the only senior reviewer on the team.
Who is it for?
Best when you review every change yourself across multiple languages and want a repeatable review mindset plus checklist depth.
Skip if: Replacing automated formatters/linters or deep exclusive audits that need a dedicated security-only skill with no breadth tradeoff.
When should I use this skill?
Reviewing pull requests, conducting PR reviews, reviewing code changes, establishing review standards, mentoring developers, architecture reviews, security audits, checking code quality, finding bugs, or giving feedback
What you get
You deliver structured review comments, validated quality checks when tools are available, and shared standards that improve code before it ships.
- Structured review comments with bugs, design, and maintainability notes
- Suggested follow-ups and standards aligned to review goals
By the numbers
- Covers 15+ language and framework stacks including React 19, Vue 3, Angular 17+, and Svelte 5
Files
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)
❌ 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` (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
- Check: SOLID principles, coupling/cohesion, anti-patterns
2. Performance Assessment - Are there performance concerns?
- For performance-critical code, consult Performance Review Guide
- 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 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 for comprehensive security checklist.
Technique 2: The Question Approach
Instead of stating problems, ask questions:
❌ "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:
❌ "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 | Hooks, useEffect, React 19 Actions, RSC, Suspense, TanStack Query v5 |
| Vue 3 | Vue Guide | Composition API, 响应性系统, Props/Emits, Watchers, Composables |
| Angular 17+ | Angular Guide | Signals, Standalone 组件, RxJS, Zoneless 变更检测, 模板优化 |
| Rust | Rust Guide | 所有权/借用, Unsafe 审查, 异步代码, 取消安全性, 错误处理 |
| TypeScript | TypeScript Guide | 类型安全, async/await, 不可变性 |
| Python | Python Guide | 可变默认参数, 异常处理, 类属性 |
| Django / DRF | Django Guide | 安全审查, N+1 查询, Serializer 反模式, ViewSet, 异步视图 |
| FastAPI | FastAPI Guide | Depends, Pydantic v2 validation, async correctness, sessions/N+1, auth vs authorization, test-driven verification |
| Java | Java Guide | Java 17/21 新特性, Spring Boot 3, 虚拟线程, Stream/Optional |
| PHP | PHP Guide | PHP 8.x type system, PDO, security review, Composer, PHPUnit/PHPStan |
| C# / .NET | C# Guide | C# 12 特性, 异步编程, EF Core 性能, ASP.NET Core, LINQ |
| Go | Go Guide | 错误处理, goroutine/channel, context, 接口设计 |
| Kotlin / Android | Kotlin Guide | 协程, Flow, Jetpack Compose, 空安全, 内存泄漏, 架构模式 |
| Swift / SwiftUI | Swift Guide | Optionals, Swift Concurrency, Sendable/actors, SwiftUI property wrappers, value vs reference types, API design |
| NestJS | NestJS Guide | 依赖注入, 分层架构, DTO 验证, Guard/Interceptor, 循环依赖 |
| Svelte / SvelteKit | Svelte Guide | Runes, Load 函数, Form Actions, Store 迁移, SSR/CSR 边界 |
| C | C Guide | 指针/缓冲区, 内存安全, UB, 错误处理 |
| C++ | C++ Guide | RAII, 生命周期, Rule of 0/3/5, 异常安全 |
| CSS/Less/Sass | CSS Guide | 变量规范, !important, 性能优化, 响应式, 兼容性 |
| Qt | Qt Guide | 对象模型, 信号/槽, 内存管理, 线程安全, 性能 |
Cross-Cutting Guides
Language-agnostic patterns applicable to all code reviews:
| Topic | Reference File | Key Topics |
|---|---|---|
| Universal Quality | Universal Quality Guide | Reuse audit, parameter sprawl, leaky abstractions, nested conditionals, stringly-typed code, TOCTOU, no-op updates, redundant state |
Additional Resources
- Architecture Review Guide - 架构设计审查指南(SOLID、反模式、耦合度)
- Performance Review Guide - 性能审查指南(Web Vitals、N+1、复杂度)
- Common Bugs Checklist - 按语言分类的常见错误清单
- Security Review Guide - 安全审查指南
- Code Review Best Practices - 代码审查最佳实践
- PR Review Template - PR 审查评论模板
- Review Checklist - 快速参考清单
# OS files
.DS_Store
Thumbs.db
# Editor files
*.swp
*.swo
*~
.idea/
.vscode/
# Python
__pycache__/
*.py[cod]
*.egg-info/
.eggs/
dist/
build/
# Logs
*.log
# Local config
.env
.env.local
PR Review Template
Copy and use this template for your code reviews.
---
Summary
[Brief overview of what was reviewed - 1-2 sentences]
PR Size: [Small/Medium/Large] (~X lines) Review Time: [X minutes]
Strengths
- [What was done well]
- [Good patterns or approaches used]
- [Improvements from previous code]
Required Changes
🔴 [blocking] [Issue description]
[Code location or example]
[Suggested fix or explanation]
🔴 [blocking] [Issue description]
[Details]
Important Suggestions
🟡 [important] [Issue description]
[Why this matters]
[Suggested approach]
Minor Suggestions
🟢 [nit] [Minor improvement suggestion]
💡 [suggestion] [Alternative approach to consider]
Learning Notes
📚 [Educational context worth sharing about X]
📚 [Background behind design decision Y]
Security Considerations
- [ ] No hardcoded secrets
- [ ] Input validation present
- [ ] Authorization checks in place
- [ ] No SQL/XSS injection risks
Test Coverage
- [ ] Unit tests added/updated
- [ ] Edge cases covered
- [ ] Error cases tested
Verdict
[ ] ✅ Approve - Ready to merge [ ] 💬 Comment - Minor suggestions, can merge [ ] 🔄 Request Changes - Must address blocking issues
---
Quick Copy Templates
Blocking Issue
🔴 **[blocking]** [Title]
[Description of the issue]
**Location:** `file.ts:123`
**Suggested fix:**
\`\`\`typescript
// Your suggested code
\`\`\`Important Suggestion
🟡 **[important]** [Title]
[Why this is important]
**Consider:**
- Option A: [description]
- Option B: [description]Minor Suggestion
🟢 **[nit]** [Suggestion]
Not blocking, but consider [improvement].Praise
🎉 **[praise]** Great work on [specific thing]!
[Why this is good]Learning
📚 **[learning]** [Educational note]
For context, [X] works this way because [Y]. No action needed — just sharing.Code Review Quick Checklist
Quick reference checklist for code reviews.
Pre-Review (2 min)
- [ ] Read PR description and linked issue
- [ ] Check PR size (<400 lines ideal)
- [ ] Verify CI/CD status (tests passing?)
- [ ] Understand the business requirement
Architecture & Design (5 min)
- [ ] Solution fits the problem
- [ ] Consistent with existing patterns
- [ ] No simpler approach exists
- [ ] Will it scale?
- [ ] Changes in right location
Logic & Correctness (10 min)
- [ ] Edge cases handled
- [ ] Null/undefined checks present
- [ ] Off-by-one errors checked
- [ ] Race conditions considered
- [ ] Error handling complete
- [ ] Correct data types used
Security (5 min)
- [ ] No hardcoded secrets
- [ ] Input validated/sanitized
- [ ] SQL injection prevented
- [ ] XSS prevented
- [ ] Authorization checks present
- [ ] Sensitive data protected
Performance (3 min)
- [ ] No N+1 queries
- [ ] Expensive operations optimized
- [ ] Large lists paginated
- [ ] No memory leaks
- [ ] Caching considered where appropriate
Testing (5 min)
- [ ] Tests exist for new code
- [ ] Edge cases tested
- [ ] Error cases tested
- [ ] Tests are readable
- [ ] Tests are deterministic
Code Quality (3 min)
- [ ] Clear variable/function names
- [ ] No code duplication
- [ ] Functions do one thing
- [ ] Complex code commented
- [ ] No magic numbers
Documentation (2 min)
- [ ] Public APIs documented
- [ ] README updated if needed
- [ ] Breaking changes noted
- [ ] Complex logic explained
---
Severity Labels
| Label | Meaning | Action |
|---|---|---|
🔴 [blocking] | Must fix | Block merge |
🟡 [important] | Should fix | Discuss if disagree |
🟢 [nit] | Nice to have | Non-blocking |
💡 [suggestion] | Alternative | Consider |
📚 [learning] | Educational comment | No action needed |
🎉 [praise] | Good work | Celebrate! |
---
Decision Matrix
| Situation | Decision |
|---|---|
| Critical security issue | 🔴 Block, fix immediately |
| Breaking change without migration | 🔴 Block |
| Missing error handling | 🟡 Should fix |
| No tests for new code | 🟡 Should fix |
| Style preference | 🟢 Non-blocking |
| Minor naming improvement | 🟢 Non-blocking |
| Clever but working code | 💡 Suggest simpler |
---
Time Budget
| PR Size | Target Time |
|---|---|
| < 100 lines | 10-15 min |
| 100-400 lines | 20-40 min |
| > 400 lines | Ask to split |
---
Red Flags
Watch for these patterns:
// TODOin production codeconsole.logleft in code- Commented out code
anytype in TypeScript- Empty catch blocks
unwrap()in Rust production code- Magic numbers/strings
- Copy-pasted code blocks
- Missing null checks
- Hardcoded URLs/credentials
Contributing to AI Code Review Guide
Thank you for your interest in contributing! This document provides guidelines for contributing to this Claude Code Skill project.
Claude Code Skill 开发规范
本项目是一个 Claude Code Skill,贡献者需要遵循以下规范。
目录结构
code-review-skill/
├── SKILL.md # Required: main file (always loaded)
├── README.md
├── CONTRIBUTING.md
├── LICENSE
├── reference/ # On-demand language/framework guides
│ ├── react.md # React 19 / Next.js / TanStack Query v5
│ ├── vue.md # Vue 3.5 Composition API
│ ├── angular.md # Angular 17+, Signals, Standalone, RxJS
│ ├── svelte.md # Svelte 5 / SvelteKit, runes, SSR boundary
│ ├── rust.md # Ownership, async, unsafe, cancellation
│ ├── typescript.md # Type safety, generics, strict mode
│ ├── nestjs.md # NestJS DI, modules, Guards/Pipes, DTOs
│ ├── python.md # Type hints, async, testing
│ ├── django.md # Django / DRF, N+1, serializers, async views
│ ├── fastapi.md # FastAPI, Depends, Pydantic v2, async
│ ├── java.md # Java 17/21, Spring Boot 3, virtual threads
│ ├── kotlin.md # Kotlin / Android, coroutines, Flow, Compose
│ ├── go.md # Error handling, goroutines, context
│ ├── csharp.md # C# / .NET 8, async, EF Core, ASP.NET Core
│ ├── php.md # PHP 8.x, types, PDO, security, Composer
│ ├── c.md # Memory safety, UB, error handling
│ ├── cpp.md # RAII, move semantics, exception safety
│ ├── qt.md # Object model, signals/slots, GUI perf
│ ├── css-less-sass.md # Variables, responsive, performance
│ ├── architecture-review-guide.md # SOLID, anti-patterns, coupling
│ ├── performance-review-guide.md # Web Vitals, N+1, complexity
│ ├── security-review-guide.md # OWASP Top 10, JWT, validation
│ ├── common-bugs-checklist.md # Quick-reference bug patterns
│ ├── code-quality-universal.md # Language-agnostic quality anti-patterns
│ └── code-review-best-practices.md # Communication & process
├── assets/ # Templates and quick reference
│ ├── review-checklist.md
│ └── pr-review-template.md
└── scripts/
└── pr-analyzer.py # PR complexity analyzerFrontmatter 规范
SKILL.md 必须包含 YAML frontmatter:
---
name: skill-name
description: |
功能描述。触发条件说明。
Use when [具体使用场景]。
allowed-tools: ["Read", "Grep", "Glob"] # 可选:限制工具访问
---必需字段
| 字段 | 说明 | 约束 |
|---|---|---|
name | Skill 标识符 | 小写字母、数字、连字符;最多 64 字符 |
description | 功能和激活条件 | 最多 1024 字符;必须包含 "Use when" |
可选字段
| 字段 | 说明 | 示例 |
|---|---|---|
allowed-tools | 限制工具访问 | ["Read", "Grep", "Glob"] |
命名约定
Skill 名称规则:
- 仅使用小写字母、数字和连字符(kebab-case)
- 最多 64 个字符
- 避免下划线或大写字母
✅ 正确:code-review-skill, typescript-advanced-types
❌ 错误:CodeReview, code_review, TYPESCRIPT文件命名规则:
- reference 文件使用小写:
react.md,vue.md - 多词文件使用连字符:
common-bugs-checklist.md
Description 写法规范
Description 必须包含两部分:
1. 功能陈述:具体说明 Skill 能做什么 2. 触发条件:以 "Use when" 开头,说明何时激活
# ✅ 正确示例
description: |
Provides comprehensive code review guidance for React 19, Vue 3, Rust,
TypeScript, Java, Python, and C/C++.
Helps catch bugs, improve code quality, and give constructive feedback.
Use when reviewing pull requests, conducting PR reviews, establishing
review standards, or mentoring developers through code reviews.
# ❌ 错误示例(太模糊,缺少触发条件)
description: |
Helps with code review.Progressive Disclosure(渐进式披露)
Claude 只在需要时加载支持文件,不会一次性加载所有内容。
文件职责划分
| 文件 | 加载时机 | 内容 |
|---|---|---|
SKILL.md | 始终加载 | 核心原则、快速索引、何时使用 |
reference/*.md | 按需加载 | 语言/框架的详细指南 |
assets/*.md | 明确需要时 | 模板、清单 |
scripts/*.py | 明确指引时 | 工具脚本 |
内容组织原则
SKILL.md(~200 行以内):
- 简述:2-3 句话说明用途
- 核心原则和方法论
- 语言/框架索引表(链接到 reference/)
- 何时使用此 Skill
*reference/.md**(详细内容):
- 完整的代码示例
- 所有最佳实践
- Review Checklist
- 边界情况和陷阱
文件引用规范
在 SKILL.md 中引用其他文件时:
# ✅ 正确:使用 Markdown 链接格式
| **React** | [React Guide](reference/react.md) | Hooks, React 19, RSC |
| **Vue 3** | [Vue Guide](reference/vue.md) | Composition API |
详见 [React Guide](reference/react.md) 获取完整指南。
# ❌ 错误:使用代码块格式
参考 `reference/react.md` 文件。路径规则:
- 使用相对路径(相对于 Skill 目录)
- 使用正斜杠
/,不使用反斜杠 - 不需要
./前缀
约定(Conventions)
严重级别(severity):审查意见统一使用 SKILL.md「Technique 4」的标记方案,三档由红到绿表示优先级:
- 🔴
[blocking]- 合并前必须修复 - 🟡
[important]- 应当修复,有异议可讨论 - 🟢
[nit]- 可选优化,不阻塞合并
新增 reference 指南时请沿用这套标记,不要自创等价的名称(如 critical/warning/suggestion)。
语言策略:现有指南是中英混合的——部分通篇中文,部分(如 fastapi.md、php.md)以英文为主。新增内容时跟随同一领域既有指南的语言:改某个指南就用它的语言;新建指南可自行选择中文或英文,但单个文件内部保持一致。
---
贡献类型
添加新语言支持
1. 在 reference/ 目录创建新文件(如 go.md) 2. 遵循以下结构:
# [Language] Code Review Guide
> 简短描述,一句话说明覆盖内容。
## 目录
- [主题1](#主题1)
- [主题2](#主题2)
- [Review Checklist](#review-checklist)
---
## 主题1
### 子主题
// ❌ Bad pattern - 说明为什么不好 bad_code_example()
// ✅ Good pattern - 说明为什么好 good_code_example()
---
## Review Checklist
### 类别1
- [ ] 检查项 1
- [ ] 检查项 23. 在 SKILL.md 的索引表中添加链接 4. 更新 README.md 的统计信息
添加框架模式
1. 确保引用官方文档 2. 包含版本号(如 "React 19", "Vue 3.5+") 3. 提供可运行的代码示例 4. 添加对应的 checklist 项
改进现有内容
- 修复拼写或语法错误
- 更新过时的模式(注明版本变化)
- 添加边界情况示例
- 改进代码示例的清晰度
---
代码示例规范
格式要求
// ❌ 问题描述 - 解释为什么这样做不好
problematic_code()
// ✅ 推荐做法 - 解释为什么这样做更好
recommended_code()质量标准
- 示例应基于真实场景,避免人为构造
- 同时展示问题和解决方案
- 保持示例简洁聚焦
- 包含必要的上下文(import 语句等)
---
提交流程
Issue 报告
- 使用 GitHub Issues 报告问题或建议
- 提供清晰的描述和示例
- 标注相关的语言/框架
Pull Request 流程
1. Fork 仓库 2. 创建功能分支:git checkout -b feature/add-go-support 3. 进行修改 4. 提交(见下文 commit 格式) 5. 推送到 fork:git push origin feature/add-go-support 6. 创建 Pull Request
Commit 消息格式
类型: 简短描述
详细说明(如需要)
- 具体变更 1
- 具体变更 2类型:
feat: 新功能或新内容fix: 修复错误docs: 仅文档变更refactor: 重构(不改变功能)chore: 维护性工作
示例:
feat: 添加 Go 语言代码审查指南
- 新增 reference/go.md
- 覆盖错误处理、并发、接口设计
- 更新 SKILL.md 索引表---
Skill 设计原则
单一职责
每个 Skill 专注一个核心能力。本 Skill 专注于代码审查,不应扩展到:
- 代码生成
- 项目初始化
- 部署配置
版本管理
- 在 reference 文件中标注框架/语言版本
- 更新时在 commit 中说明版本变化
- 过时内容应更新而非删除(除非完全废弃)
内容质量
- 所有建议应有依据(官方文档、最佳实践)
- 避免主观偏好(如代码风格),专注于客观问题
- 优先覆盖常见陷阱和安全问题
---
常见问题
Q: 如何测试我的更改?
将修改后的 Skill 复制到 ~/.claude/skills/ 目录,然后在 Claude Code 中测试:
cp -r code-review-skill ~/.claude/skills/code-review-skillQ: 我应该更新 SKILL.md 还是 reference 文件?
- SKILL.md:只修改索引表或核心原则
- *reference/.md**:添加/更新具体的语言或框架内容
Q: 如何处理过时的内容?
1. 标注版本变化(如 "React 18 → React 19") 2. 保留旧版本内容(如果仍有用户使用) 3. 在 checklist 中更新相关项
---
问题咨询
如有任何问题,欢迎在 GitHub Issues 中提问。
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>code-review-skill(1) — User Commands (en_US)</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #14110d;
--bg-alt: #1a1611;
--fg: #c4b596;
--fg-bright:#e8d5a8;
--fg-dim: #7a6f56;
--fg-faint: #4a4334;
--amber: #d8964a;
--amber-2: #e8a455;
--red: #d56350;
--green: #8fae5a;
--blue: #6b94c4;
--rule: #2a2520;
}
html { background: var(--bg); }
body {
font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
font-size: 14px;
line-height: 1.65;
color: var(--fg);
background: var(--bg);
min-height: 100vh;
padding: 0 0 4rem;
-webkit-font-smoothing: antialiased;
}
/* faint scanline-free phosphor texture — very subtle */
body::before {
content: '';
position: fixed;
inset: 0;
pointer-events: none;
z-index: 0;
background:
radial-gradient(ellipse at 50% 0%, rgba(216,150,74,0.04) 0%, transparent 60%);
}
/* ─── HEADER / FOOTER BAND ─── */
.band {
position: sticky;
top: 0;
background: var(--bg);
border-bottom: 1px solid var(--rule);
z-index: 10;
font-size: 12px;
}
.band-inner {
max-width: 820px;
margin: 0 auto;
padding: 0.625rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
color: var(--fg-dim);
}
.band-l, .band-r {
color: var(--fg-bright);
letter-spacing: 0.04em;
white-space: nowrap;
}
.band-c { color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band a {
color: inherit;
text-decoration: none;
border-bottom: 1px dotted var(--fg-faint);
}
.band a:hover { color: var(--amber); border-bottom-color: var(--amber); }
/* ─── PAGE ─── */
main {
max-width: 820px;
margin: 0 auto;
padding: 3rem 2rem 0;
position: relative;
z-index: 1;
}
pre, .pre {
font-family: inherit;
white-space: pre;
color: inherit;
background: none;
margin: 0;
}
/* ─── SECTIONS ─── */
h2.sec {
color: var(--fg-bright);
font-weight: 600;
font-size: 14px;
letter-spacing: 0.04em;
margin: 2.75rem 0 0.875rem;
padding: 0;
}
h2.sec::before { content: ''; }
section.body {
padding-left: 7ch;
position: relative;
}
section.body p {
margin-bottom: 0.875rem;
max-width: 70ch;
}
section.body p:last-child { margin-bottom: 0; }
.em { color: var(--fg-bright); }
.dim { color: var(--fg-dim); }
.faint { color: var(--fg-faint); }
.amber { color: var(--amber); }
.red { color: var(--red); }
.green { color: var(--green); }
.blue { color: var(--blue); }
a.link {
color: var(--amber);
text-decoration: none;
border-bottom: 1px dotted var(--amber);
}
a.link:hover {
color: var(--bg);
background: var(--amber);
border-bottom-color: transparent;
}
/* ─── TITLE BLOCK ─── */
.title-block {
margin-bottom: 3rem;
}
.ascii-title {
color: var(--amber);
font-size: 12px;
line-height: 1;
margin: 1.5rem 0 2.25rem;
white-space: pre;
overflow-x: auto;
font-weight: 500;
letter-spacing: 0;
text-shadow: 0 0 12px rgba(216,150,74,0.25);
}
.one-liner {
color: var(--fg-bright);
margin-bottom: 0.5rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
.lang-toggle {
font-size: 12px;
color: var(--fg-dim);
letter-spacing: 0.04em;
}
.lang-toggle a {
color: var(--fg-dim);
text-decoration: none;
border-bottom: 1px dotted var(--fg-faint);
padding-bottom: 1px;
margin: 0 0.25em;
}
.lang-toggle a.on {
color: var(--amber);
border-bottom-color: var(--amber);
}
.lang-toggle a:hover { color: var(--amber); border-bottom-color: var(--amber); }
.lang-toggle .sep { color: var(--fg-faint); }
.one-liner-sub {
color: var(--fg-dim);
}
/* ─── TABLES ─── */
.lang-row {
display: grid;
grid-template-columns: 26ch 1fr 7ch;
gap: 1ch;
padding: 0.125rem 0;
align-items: baseline;
transition: background 0.1s;
border-bottom: 1px dotted var(--rule);
}
.lang-row:hover { background: var(--bg-alt); }
.lang-row .file { color: var(--amber); }
.lang-row .desc { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-row .desc .topics { color: var(--fg-dim); }
.lang-row .lines { text-align: right; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.dotleader {
color: var(--fg-faint);
display: none;
}
.cat-head {
color: var(--fg-bright);
margin: 1.25rem 0 0.5rem;
padding-bottom: 0.25rem;
border-bottom: 1px solid var(--rule);
}
.cat-head:first-child { margin-top: 0; }
/* ─── PHASE DIAGRAM ─── */
.phase-flow {
margin: 1rem 0 1.5rem;
color: var(--fg-dim);
line-height: 1.4;
font-size: 13px;
overflow-x: auto;
}
.phase-flow .box { color: var(--amber); }
.phase-flow .arrow { color: var(--fg-bright); }
.phase-list dt {
color: var(--fg-bright);
margin-top: 0.875rem;
}
.phase-list dt:first-child { margin-top: 0; }
.phase-list dd {
color: var(--fg);
max-width: 70ch;
margin-bottom: 0.125rem;
}
.phase-list dd.t {
color: var(--fg-dim);
font-size: 13px;
}
/* ─── SEVERITY LIST ─── */
.sev-list {
list-style: none;
}
.sev-list li {
display: grid;
grid-template-columns: 16ch 1fr;
gap: 1ch;
padding: 0.25rem 0;
border-bottom: 1px dotted var(--rule);
align-items: baseline;
}
.sev-list li:last-child { border-bottom: none; }
.sev-list li .label { color: var(--fg-bright); }
.sev-list li .desc { color: var(--fg); }
.sev-list li .desc .aside { color: var(--fg-dim); }
/* ─── CODE BLOCKS ─── */
.codeblock {
background: var(--bg-alt);
border-left: 2px solid var(--amber);
padding: 0.875rem 1.25rem;
margin: 0.875rem 0;
color: var(--fg);
overflow-x: auto;
max-width: 70ch;
}
.codeblock .prompt { color: var(--green); }
.codeblock .cmt { color: var(--fg-dim); }
.codeblock .cmd { color: var(--amber); }
.codeblock .arg { color: var(--fg-bright); }
.examples {
list-style: none;
max-width: 70ch;
}
.examples li {
padding: 0.375rem 0;
color: var(--fg);
}
.examples li::before {
content: '$ ';
color: var(--green);
}
.examples li .q { color: var(--fg-bright); }
.examples li .note {
display: block;
margin-top: 0.125rem;
padding-left: 2ch;
color: var(--fg-dim);
font-size: 13px;
}
.examples li .note::before { content: '↳ '; color: var(--fg-faint); }
/* ─── FILES TREE ─── */
.tree {
color: var(--fg);
line-height: 1.55;
}
.tree .dir { color: var(--amber); }
.tree .file { color: var(--fg); }
.tree .cmt { color: var(--fg-dim); }
.tree .branch { color: var(--fg-faint); }
/* ─── STATUS BAR / VIM-LIKE ─── */
.statusbar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: var(--amber);
color: var(--bg);
font-size: 12px;
letter-spacing: 0.02em;
z-index: 20;
}
.statusbar-inner {
max-width: 820px;
margin: 0 auto;
padding: 0.25rem 2rem;
display: flex;
justify-content: space-between;
gap: 1rem;
white-space: nowrap;
overflow: hidden;
}
.statusbar-l, .statusbar-r { display: flex; gap: 1.25rem; align-items: center; }
.statusbar-l > span:last-child {
overflow: hidden;
text-overflow: ellipsis;
max-width: 22ch;
}
.statusbar kbd {
background: var(--bg);
color: var(--amber);
padding: 1px 5px;
border-radius: 2px;
font-family: inherit;
font-size: 11px;
font-weight: 500;
}
/* ─── CURSOR ─── */
.cursor {
display: inline-block;
width: 0.55em;
height: 1em;
background: var(--amber);
vertical-align: -2px;
animation: blink 1.1s steps(1) infinite;
margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }
/* ─── SEPARATOR ─── */
.hr {
color: var(--rule);
margin: 2rem 0 0;
max-width: 70ch;
padding-left: 7ch;
user-select: none;
}
/* ─── BIB ─── */
.bib {
max-width: 70ch;
}
.bib dt {
color: var(--fg-bright);
margin-top: 0.5rem;
}
.bib dt:first-child { margin-top: 0; }
.bib dd { color: var(--fg-dim); }
/* ─── RESPONSIVE ─── */
@media (max-width: 720px) {
body { font-size: 13px; }
main { padding: 2rem 1rem 0; }
.band-inner, .statusbar-inner { padding: 0.5rem 1rem; font-size: 11px; }
section.body { padding-left: 4ch; }
.lang-row { grid-template-columns: 1fr 6ch; gap: 0.5ch; }
.lang-row .desc { display: none; }
.ascii-title { font-size: 9px; }
.sev-list li { grid-template-columns: 14ch 1fr; }
.phase-flow { font-size: 10px; }
.band-c { display: none; }
}
</style>
</head>
<body>
<!-- ═══ TOP BAND (man page header line) ═══ -->
<div class="band">
<div class="band-inner">
<span class="band-l">CODE-REVIEW-SKILL(1)</span>
<span class="band-c">User Commands · Edition 2026.01</span>
<span class="band-r">CODE-REVIEW-SKILL(1)</span>
</div>
</div>
<main>
<!-- ═══ TITLE BLOCK ═══ -->
<div class="title-block">
<pre class="ascii-title"> ___ ___ ___ ___ ___ _____ _____ _____ __ ___ _ _____ _ _
/ __/ _ \| \| __| ___ | _ \ __\ \ / /_ _| __\ \ /\ / / __/ __| |/ /_ _| | | |
| (_| (_) | |) | _| |___|| / _| \ V / | || _| \ V V /__\__ \ ' < | || |__| |__
\___\___/|___/|___| |_|_\___| \_/ |___|___| \_/\_/ |___/_|\_\___|____|____|</pre>
<div class="one-liner">
<span>
<span class="dim">$ </span><span class="em">man code-review-skill</span><span class="cursor"></span>
</span>
<span class="lang-toggle">
<span class="dim">LANG=</span><a href="index.html">zh_CN</a><span class="sep"> | </span><a href="index.en.html" class="on">en_US</a>
</span>
</div>
<div class="one-liner-sub">
v1.0 · awesome-skills · MIT · 20 languages · 16,000+ lines
</div>
</div>
<!-- ═══ NAME ═══ -->
<h2 class="sec">NAME</h2>
<section class="body">
<p>
<span class="em">code-review-skill</span> — A comprehensive, modular code review skill for Claude Code
</p>
</section>
<!-- ═══ SYNOPSIS ═══ -->
<h2 class="sec">SYNOPSIS</h2>
<section class="body">
<pre class="pre">
<span class="amber">Use code-review-skill to</span> review this PR
<span class="amber">Use code-review-skill to</span> review this <<span class="dim">component</span>>
<span class="amber">Use code-review-skill for</span> <span class="dim">[</span>security <span class="dim">|</span> performance <span class="dim">|</span> architecture<span class="dim">]</span> review</pre>
</section>
<!-- ═══ DESCRIPTION ═══ -->
<h2 class="sec">DESCRIPTION</h2>
<section class="body">
<p>A production-grade code review skill. It transforms AI-assisted code review from vague suggestions into a structured, consistent, expert-level collaborative process.</p>
<p>Core is only <span class="em">~190 lines</span>; the full <span class="em">16,000+ lines</span> of language guides load on demand. Covers <span class="em">20+</span> mainstream languages and frameworks — progressive loading, zero overhead.</p>
<p>Every finding carries an explicit severity label. Every review proceeds through four phases: PR context · high-level assessment · line-by-line analysis · summary & decision.</p>
</section>
<!-- ═══ LANGUAGES ═══ -->
<h2 class="sec">LANGUAGES</h2>
<section class="body">
<div class="cat-head">┌── frontend ──┘</div>
<div class="lang-row"><span class="file">react.md</span><span class="desc">React 19, Hooks, Server Components, TanStack v5 <span class="dotleader">.................</span></span><span class="lines">870</span></div>
<div class="lang-row"><span class="file">vue.md</span><span class="desc">Vue 3.5, Composition API, Composables, Watchers <span class="dotleader">.................</span></span><span class="lines">920</span></div>
<div class="lang-row"><span class="file">angular.md</span><span class="desc">Angular 17+, Signals, Standalone, Zoneless <span class="dotleader">..........................</span></span><span class="lines">420</span></div>
<div class="lang-row"><span class="file">svelte.md</span><span class="desc">Svelte 5, Runes, SvelteKit, SSR/CSR boundaries <span class="dotleader">..................</span></span><span class="lines">1,060</span></div>
<div class="lang-row"><span class="file">typescript.md</span><span class="desc">TypeScript strict mode, generics, immutability <span class="dotleader">..................</span></span><span class="lines">540</span></div>
<div class="lang-row"><span class="file">css-less-sass.md</span><span class="desc">CSS/Less/Sass variables, responsive, compatibility <span class="dotleader">..............</span></span><span class="lines">660</span></div>
<div class="cat-head">┌── backend ──┘</div>
<div class="lang-row"><span class="file">python.md</span><span class="desc">Python async, typing, pytest, mutable defaults <span class="dotleader">.................</span></span><span class="lines">1,070</span></div>
<div class="lang-row"><span class="file">django.md</span><span class="desc">Django/DRF security, N+1, serializers, async views <span class="dotleader">..............</span></span><span class="lines">1,030</span></div>
<div class="lang-row"><span class="file">java.md</span><span class="desc">Java 17/21, Spring Boot 3, virtual threads, JPA <span class="dotleader">................</span></span><span class="lines">800</span></div>
<div class="lang-row"><span class="file">php.md</span><span class="desc">PHP 8.x, types, PDO, security, Composer <span class="dotleader">...........................</span></span><span class="lines">700</span></div>
<div class="lang-row"><span class="file">go.md</span><span class="desc">Goroutines, channels, context, interface design <span class="dotleader">.................</span></span><span class="lines">990</span></div>
<div class="lang-row"><span class="file">rust.md</span><span class="desc">Ownership, async/await, unsafe, cancellation safety <span class="dotleader">.............</span></span><span class="lines">840</span></div>
<div class="lang-row"><span class="file">csharp.md</span><span class="desc">C# 12 / .NET 8, EF Core, ASP.NET Core, LINQ <span class="dotleader">.....................</span></span><span class="lines">520</span></div>
<div class="lang-row"><span class="file">nestjs.md</span><span class="desc">NestJS DI, guards, interceptors, DTO validation <span class="dotleader">.................</span></span><span class="lines">590</span></div>
<div class="cat-head">┌── mobile / systems ──┘</div>
<div class="lang-row"><span class="file">kotlin.md</span><span class="desc">Kotlin/Android coroutines, Compose, Flow, null safety <span class="dotleader">...........</span></span><span class="lines">1,020</span></div>
<div class="lang-row"><span class="file">swift.md</span><span class="desc">Swift 5.9+/6, SwiftUI, concurrency, Sendable, optionals <span class="dotleader">..........</span></span><span class="lines">930</span></div>
<div class="lang-row"><span class="file">c.md</span><span class="desc">C pointer safety, undefined behavior, resources <span class="dotleader">.................</span></span><span class="lines">210</span></div>
<div class="lang-row"><span class="file">cpp.md</span><span class="desc">C++ RAII, Rule of 0/3/5, move semantics, noexcept <span class="dotleader">...............</span></span><span class="lines">300</span></div>
<div class="lang-row"><span class="file">qt.md</span><span class="desc">Qt object model, signals/slots, GUI performance <span class="dotleader">.................</span></span><span class="lines">190</span></div>
<div class="cat-head">┌── cross-cutting ──┘</div>
<div class="lang-row"><span class="file">architecture-review-guide.md</span><span class="desc">SOLID, anti-patterns, coupling <span class="dotleader">...</span></span><span class="lines">470</span></div>
<div class="lang-row"><span class="file">performance-review-guide.md</span><span class="desc">Web Vitals, N+1, complexity <span class="dotleader">.......</span></span><span class="lines">850</span></div>
<div class="lang-row"><span class="file">code-quality-universal.md</span><span class="desc">TOCTOU, leaky abstractions, sprawl <span class="dotleader">....</span></span><span class="lines">320</span></div>
<div class="lang-row"><span class="file">security-review-guide.md</span><span class="desc">Injection, XSS, secrets, all langs <span class="dotleader">.....</span></span><span class="lines">—</span></div>
</section>
<!-- ═══ PHASES ═══ -->
<h2 class="sec">PHASES</h2>
<section class="body">
<pre class="phase-flow"> <span class="box">┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐</span>
<span class="box">│ context │</span> <span class="arrow">─▶</span> <span class="box">│ high level │</span> <span class="arrow">─▶</span> <span class="box">│ line by line│</span> <span class="arrow">─▶</span> <span class="box">│ decide │</span>
<span class="box">│ 2-3m │</span> <span class="box">│ 5-10m │</span> <span class="box">│ 10-20m │</span> <span class="box">│ 2-3m │</span>
<span class="box">└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘</span></pre>
<dl class="phase-list" style="margin-top:1.5rem;">
<dt>1. context gathering <span class="dim">— 2-3 min</span></dt>
<dd>Read the PR description and linked issues, assess scope, check CI status, understand the business intent.</dd>
<dt>2. high-level review <span class="dim">— 5-10 min</span></dt>
<dd>Evaluate architectural fit, performance impact, file organization, test strategy. See the whole first.</dd>
<dt>3. line-by-line analysis <span class="dim">— 10-20 min</span></dt>
<dd>Logic correctness · security · performance · maintainability · edge cases. One by one.</dd>
<dt>4. summary & decision <span class="dim">— 2-3 min</span></dt>
<dd>Summarize findings, name what was done well, deliver approve / comment / request-changes.</dd>
</dl>
</section>
<!-- ═══ SEVERITY ═══ -->
<h2 class="sec">SEVERITY</h2>
<section class="body">
<ul class="sev-list">
<li>
<span class="label"><span class="red">●</span> [blocking]</span>
<span class="desc">must fix <span class="aside">— resolve before merge; security / correctness / serious logic</span></span>
</li>
<li>
<span class="label"><span style="color:#d68a3d;">●</span> [important]</span>
<span class="desc">should fix <span class="aside">— strongly recommended; discuss if you disagree</span></span>
</li>
<li>
<span class="label"><span style="color:#c7a648;">●</span> [nit]</span>
<span class="desc">nice to have <span class="aside">— style or preference; non-blocking</span></span>
</li>
<li>
<span class="label"><span class="blue">●</span> [suggestion]</span>
<span class="desc">alternative <span class="aside">— worth considering; author decides</span></span>
</li>
<li>
<span class="label"><span style="color:#9078b8;">●</span> [learning]</span>
<span class="desc">educational <span class="aside">— no action needed; share knowledge</span></span>
</li>
<li>
<span class="label"><span class="green">●</span> [praise]</span>
<span class="desc">good work <span class="aside">— say it out loud when you see it</span></span>
</li>
</ul>
</section>
<!-- ═══ INSTALLATION ═══ -->
<h2 class="sec">INSTALLATION</h2>
<section class="body">
<p>Clone into the Claude Code skills directory. Two commands.</p>
<pre class="codeblock"><span class="cmt"># macOS / Linux</span>
<span class="prompt">$</span> <span class="cmd">git clone</span> <span class="arg">https://github.com/awesome-skills/code-review-skill.git</span> \
~/.claude/skills/code-review-skill
<span class="cmt"># Windows PowerShell</span>
<span class="prompt">PS></span> <span class="cmd">git clone</span> <span class="arg">https://github.com/awesome-skills/code-review-skill.git</span> `
"$env:USERPROFILE\.claude\skills\code-review-skill"</pre>
</section>
<!-- ═══ EXAMPLES ═══ -->
<h2 class="sec">EXAMPLES</h2>
<section class="body">
<ul class="examples">
<li>
<span class="q">Use code-review-skill to review this PR</span>
<span class="note">runs the full four-phase review</span>
</li>
<li>
<span class="q">Review this React component</span>
<span class="note">loads react.md · checks Hooks · Server Components</span>
</li>
<li>
<span class="q">Security review of this Go service</span>
<span class="note">loads go.md + security-review-guide.md together</span>
</li>
<li>
<span class="q">Architecture review</span>
<span class="note">loads the architecture guide · SOLID · anti-patterns · coupling</span>
</li>
</ul>
</section>
<!-- ═══ FILES ═══ -->
<h2 class="sec">FILES</h2>
<section class="body">
<pre class="tree">
<span class="dir">~/.claude/skills/code-review-skill/</span>
<span class="branch">├──</span> <span class="file">SKILL.md</span> <span class="cmt"># core, loaded on activation (~190 lines)</span>
<span class="branch">├──</span> <span class="file">README.md</span>
<span class="branch">├──</span> <span class="file">LICENSE</span> <span class="cmt"># MIT</span>
<span class="branch">├──</span> <span class="dir">reference/</span> <span class="cmt"># on-demand language guides</span>
<span class="branch">│ ├──</span> <span class="file">react.md</span> <span class="file">vue.md</span> <span class="file">angular.md</span> ...
<span class="branch">│ └──</span> <span class="file">architecture-review-guide.md</span> ...
<span class="branch">├──</span> <span class="dir">assets/</span>
<span class="branch">│ ├──</span> <span class="file">review-checklist.md</span> <span class="cmt"># quick reference</span>
<span class="branch">│ └──</span> <span class="file">pr-review-template.md</span> <span class="cmt"># PR comment template</span>
<span class="branch">└──</span> <span class="dir">scripts/</span>
<span class="branch">└──</span> <span class="file">pr-analyzer.py</span> <span class="cmt"># PR complexity analyzer</span></pre>
</section>
<!-- ═══ SEE ALSO ═══ -->
<h2 class="sec">SEE ALSO</h2>
<section class="body">
<p>
<a class="link" href="https://claude.ai/code" target="_blank">claude-code(1)</a>,
<a class="link" href="https://github.com/awesome-skills/code-review-skill" target="_blank">github / awesome-skills</a>,
<a class="link" href="https://github.com/awesome-skills/code-review-skill/blob/main/CONTRIBUTING.md" target="_blank">CONTRIBUTING(7)</a>,
<a class="link" href="https://github.com/awesome-skills/code-review-skill/blob/main/assets/review-checklist.md" target="_blank">review-checklist(7)</a>
</p>
</section>
<!-- ═══ AUTHORS ═══ -->
<h2 class="sec">AUTHORS</h2>
<section class="body">
<dl class="bib">
<dt>awesome-skills</dt>
<dd>maintainer, primary author</dd>
<dt>contributors</dt>
<dd>see <a class="link" href="https://github.com/awesome-skills/code-review-skill/graphs/contributors" target="_blank">graphs/contributors</a></dd>
</dl>
</section>
<!-- ═══ COPYRIGHT ═══ -->
<h2 class="sec">COPYRIGHT</h2>
<section class="body">
<p>
<span class="dim">Copyright (c) 2025 awesome-skills.</span><br>
Released under the MIT License.<br>
<span class="dim">This is free software: you are free to change and redistribute it.</span><br>
<span class="dim">There is NO WARRANTY, to the extent permitted by law.</span>
</p>
</section>
<div style="height: 4rem;"></div>
<!-- ═══ END-OF-PAGE BAND ═══ -->
<div style="border-top:1px solid var(--rule); margin-top:2rem; padding:0.625rem 0;">
<div style="display:flex; justify-content:space-between; color:var(--fg-dim); font-size:12px; white-space:nowrap; gap:1rem;">
<span class="band-l" style="color:var(--fg-bright);">CODE-REVIEW-SKILL(1)</span>
<span style="color:var(--fg-dim);">awesome-skills</span>
<span class="band-r" style="color:var(--fg-bright);">CODE-REVIEW-SKILL(1)</span>
</div>
</div>
</main>
<!-- ═══ VIM-LIKE STATUS BAR ═══ -->
<div class="statusbar">
<div class="statusbar-inner">
<div class="statusbar-l">
<span>-- NORMAL --</span>
<span>code-review-skill.1</span>
</div>
<div class="statusbar-r">
<span><kbd>g</kbd> top</span>
<span><kbd>G</kbd> end</span>
<span><kbd>q</kbd> quit</span>
<span id="pos">1,1</span>
</div>
</div>
</div>
<script>
// Vim-like keyboard nav for the man-page vibe
document.addEventListener('keydown', (e) => {
if (e.metaKey || e.ctrlKey || e.altKey) return;
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
if (e.key === 'g') {
window.scrollTo({ top: 0, behavior: 'smooth' });
} else if (e.key === 'G') {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
} else if (e.key === 'j') {
window.scrollBy({ top: 60, behavior: 'smooth' });
} else if (e.key === 'k') {
window.scrollBy({ top: -60, behavior: 'smooth' });
} else if (e.key === 'q') {
const ok = confirm('Quit man page?');
if (ok) window.close();
}
});
// Update line/col-like indicator from scroll position
const posEl = document.getElementById('pos');
function updatePos() {
const pct = Math.round((window.scrollY / (document.body.scrollHeight - window.innerHeight)) * 100) || 0;
const line = Math.max(1, Math.round((window.scrollY / 20)));
posEl.textContent = line + ',1 ' + (pct >= 99 ? 'Bot' : pct <= 1 ? 'Top' : pct + '%');
}
updatePos();
window.addEventListener('scroll', updatePos, { passive: true });
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>code-review-skill(1) — User Commands</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #14110d;
--bg-alt: #1a1611;
--fg: #c4b596;
--fg-bright:#e8d5a8;
--fg-dim: #7a6f56;
--fg-faint: #4a4334;
--amber: #d8964a;
--amber-2: #e8a455;
--red: #d56350;
--green: #8fae5a;
--blue: #6b94c4;
--rule: #2a2520;
}
html { background: var(--bg); }
body {
font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
font-size: 14px;
line-height: 1.65;
color: var(--fg);
background: var(--bg);
min-height: 100vh;
padding: 0 0 4rem;
-webkit-font-smoothing: antialiased;
}
/* faint scanline-free phosphor texture — very subtle */
body::before {
content: '';
position: fixed;
inset: 0;
pointer-events: none;
z-index: 0;
background:
radial-gradient(ellipse at 50% 0%, rgba(216,150,74,0.04) 0%, transparent 60%);
}
/* ─── HEADER / FOOTER BAND ─── */
.band {
position: sticky;
top: 0;
background: var(--bg);
border-bottom: 1px solid var(--rule);
z-index: 10;
font-size: 12px;
}
.band-inner {
max-width: 820px;
margin: 0 auto;
padding: 0.625rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
color: var(--fg-dim);
}
.band-l, .band-r {
color: var(--fg-bright);
letter-spacing: 0.04em;
white-space: nowrap;
}
.band-c { color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band a {
color: inherit;
text-decoration: none;
border-bottom: 1px dotted var(--fg-faint);
}
.band a:hover { color: var(--amber); border-bottom-color: var(--amber); }
/* ─── PAGE ─── */
main {
max-width: 820px;
margin: 0 auto;
padding: 3rem 2rem 0;
position: relative;
z-index: 1;
}
pre, .pre {
font-family: inherit;
white-space: pre;
color: inherit;
background: none;
margin: 0;
}
/* ─── SECTIONS ─── */
h2.sec {
color: var(--fg-bright);
font-weight: 600;
font-size: 14px;
letter-spacing: 0.04em;
margin: 2.75rem 0 0.875rem;
padding: 0;
}
h2.sec::before { content: ''; }
section.body {
padding-left: 7ch;
position: relative;
}
section.body p {
margin-bottom: 0.875rem;
max-width: 70ch;
}
section.body p:last-child { margin-bottom: 0; }
.em { color: var(--fg-bright); }
.dim { color: var(--fg-dim); }
.faint { color: var(--fg-faint); }
.amber { color: var(--amber); }
.red { color: var(--red); }
.green { color: var(--green); }
.blue { color: var(--blue); }
a.link {
color: var(--amber);
text-decoration: none;
border-bottom: 1px dotted var(--amber);
}
a.link:hover {
color: var(--bg);
background: var(--amber);
border-bottom-color: transparent;
}
/* ─── TITLE BLOCK ─── */
.title-block {
margin-bottom: 3rem;
}
.ascii-title {
color: var(--amber);
font-size: 12px;
line-height: 1;
margin: 1.5rem 0 2.25rem;
white-space: pre;
overflow-x: auto;
font-weight: 500;
letter-spacing: 0;
text-shadow: 0 0 12px rgba(216,150,74,0.25);
}
.one-liner {
color: var(--fg-bright);
margin-bottom: 0.5rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
.lang-toggle {
font-size: 12px;
color: var(--fg-dim);
letter-spacing: 0.04em;
}
.lang-toggle a {
color: var(--fg-dim);
text-decoration: none;
border-bottom: 1px dotted var(--fg-faint);
padding-bottom: 1px;
margin: 0 0.25em;
}
.lang-toggle a.on {
color: var(--amber);
border-bottom-color: var(--amber);
}
.lang-toggle a:hover { color: var(--amber); border-bottom-color: var(--amber); }
.lang-toggle .sep { color: var(--fg-faint); }
.one-liner-sub {
color: var(--fg-dim);
}
/* ─── TABLES ─── */
.lang-row {
display: grid;
grid-template-columns: 26ch 1fr 7ch;
gap: 1ch;
padding: 0.125rem 0;
align-items: baseline;
transition: background 0.1s;
border-bottom: 1px dotted var(--rule);
}
.lang-row:hover { background: var(--bg-alt); }
.lang-row .file { color: var(--amber); }
.lang-row .desc { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-row .desc .topics { color: var(--fg-dim); }
.lang-row .lines { text-align: right; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.dotleader {
color: var(--fg-faint);
display: none;
}
.cat-head {
color: var(--fg-bright);
margin: 1.25rem 0 0.5rem;
padding-bottom: 0.25rem;
border-bottom: 1px solid var(--rule);
}
.cat-head:first-child { margin-top: 0; }
/* ─── PHASE DIAGRAM ─── */
.phase-flow {
margin: 1rem 0 1.5rem;
color: var(--fg-dim);
line-height: 1.4;
font-size: 13px;
overflow-x: auto;
}
.phase-flow .box { color: var(--amber); }
.phase-flow .arrow { color: var(--fg-bright); }
.phase-list dt {
color: var(--fg-bright);
margin-top: 0.875rem;
}
.phase-list dt:first-child { margin-top: 0; }
.phase-list dd {
color: var(--fg);
max-width: 70ch;
margin-bottom: 0.125rem;
}
.phase-list dd.t {
color: var(--fg-dim);
font-size: 13px;
}
/* ─── SEVERITY LIST ─── */
.sev-list {
list-style: none;
}
.sev-list li {
display: grid;
grid-template-columns: 16ch 1fr;
gap: 1ch;
padding: 0.25rem 0;
border-bottom: 1px dotted var(--rule);
align-items: baseline;
}
.sev-list li:last-child { border-bottom: none; }
.sev-list li .label { color: var(--fg-bright); }
.sev-list li .desc { color: var(--fg); }
.sev-list li .desc .aside { color: var(--fg-dim); }
/* ─── CODE BLOCKS ─── */
.codeblock {
background: var(--bg-alt);
border-left: 2px solid var(--amber);
padding: 0.875rem 1.25rem;
margin: 0.875rem 0;
color: var(--fg);
overflow-x: auto;
max-width: 70ch;
}
.codeblock .prompt { color: var(--green); }
.codeblock .cmt { color: var(--fg-dim); }
.codeblock .cmd { color: var(--amber); }
.codeblock .arg { color: var(--fg-bright); }
.examples {
list-style: none;
max-width: 70ch;
}
.examples li {
padding: 0.375rem 0;
color: var(--fg);
}
.examples li::before {
content: '$ ';
color: var(--green);
}
.examples li .q { color: var(--fg-bright); }
.examples li .note {
display: block;
margin-top: 0.125rem;
padding-left: 2ch;
color: var(--fg-dim);
font-size: 13px;
}
.examples li .note::before { content: '↳ '; color: var(--fg-faint); }
/* ─── FILES TREE ─── */
.tree {
color: var(--fg);
line-height: 1.55;
}
.tree .dir { color: var(--amber); }
.tree .file { color: var(--fg); }
.tree .cmt { color: var(--fg-dim); }
.tree .branch { color: var(--fg-faint); }
/* ─── STATUS BAR / VIM-LIKE ─── */
.statusbar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: var(--amber);
color: var(--bg);
font-size: 12px;
letter-spacing: 0.02em;
z-index: 20;
}
.statusbar-inner {
max-width: 820px;
margin: 0 auto;
padding: 0.25rem 2rem;
display: flex;
justify-content: space-between;
gap: 1rem;
white-space: nowrap;
overflow: hidden;
}
.statusbar-l, .statusbar-r { display: flex; gap: 1.25rem; align-items: center; }
.statusbar-l > span:last-child {
overflow: hidden;
text-overflow: ellipsis;
max-width: 22ch;
}
.statusbar kbd {
background: var(--bg);
color: var(--amber);
padding: 1px 5px;
border-radius: 2px;
font-family: inherit;
font-size: 11px;
font-weight: 500;
}
/* ─── CURSOR ─── */
.cursor {
display: inline-block;
width: 0.55em;
height: 1em;
background: var(--amber);
vertical-align: -2px;
animation: blink 1.1s steps(1) infinite;
margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }
/* ─── SEPARATOR ─── */
.hr {
color: var(--rule);
margin: 2rem 0 0;
max-width: 70ch;
padding-left: 7ch;
user-select: none;
}
/* ─── BIB ─── */
.bib {
max-width: 70ch;
}
.bib dt {
color: var(--fg-bright);
margin-top: 0.5rem;
}
.bib dt:first-child { margin-top: 0; }
.bib dd { color: var(--fg-dim); }
/* ─── RESPONSIVE ─── */
@media (max-width: 720px) {
body { font-size: 13px; }
main { padding: 2rem 1rem 0; }
.band-inner, .statusbar-inner { padding: 0.5rem 1rem; font-size: 11px; }
section.body { padding-left: 4ch; }
.lang-row { grid-template-columns: 1fr 6ch; gap: 0.5ch; }
.lang-row .desc { display: none; }
.ascii-title { font-size: 9px; }
.sev-list li { grid-template-columns: 14ch 1fr; }
.phase-flow { font-size: 10px; }
.band-c { display: none; }
}
</style>
</head>
<body>
<!-- ═══ TOP BAND (man page header line) ═══ -->
<div class="band">
<div class="band-inner">
<span class="band-l">CODE-REVIEW-SKILL(1)</span>
<span class="band-c">User Commands · Edition 2026.01</span>
<span class="band-r">CODE-REVIEW-SKILL(1)</span>
</div>
</div>
<main>
<!-- ═══ TITLE BLOCK ═══ -->
<div class="title-block">
<pre class="ascii-title"> ___ ___ ___ ___ ___ _____ _____ _____ __ ___ _ _____ _ _
/ __/ _ \| \| __| ___ | _ \ __\ \ / /_ _| __\ \ /\ / / __/ __| |/ /_ _| | | |
| (_| (_) | |) | _| |___|| / _| \ V / | || _| \ V V /__\__ \ ' < | || |__| |__
\___\___/|___/|___| |_|_\___| \_/ |___|___| \_/\_/ |___/_|\_\___|____|____|</pre>
<div class="one-liner">
<span>
<span class="dim">$ </span><span class="em">man code-review-skill</span><span class="cursor"></span>
</span>
<span class="lang-toggle">
<span class="dim">LANG=</span><a href="index.html" class="on">zh_CN</a><span class="sep"> | </span><a href="index.en.html">en_US</a>
</span>
</div>
<div class="one-liner-sub">
v1.0 · awesome-skills · MIT · 20 languages · 16,000+ lines
</div>
</div>
<!-- ═══ NAME ═══ -->
<h2 class="sec">NAME</h2>
<section class="body">
<p>
<span class="em">code-review-skill</span> — 面向 Claude Code 的全面、模块化代码审查技能
</p>
</section>
<!-- ═══ SYNOPSIS ═══ -->
<h2 class="sec">SYNOPSIS</h2>
<section class="body">
<pre class="pre">
<span class="amber">Use code-review-skill to</span> review this PR
<span class="amber">Use code-review-skill to</span> review this <<span class="dim">component</span>>
<span class="amber">Use code-review-skill for</span> <span class="dim">[</span>security <span class="dim">|</span> performance <span class="dim">|</span> architecture<span class="dim">]</span> review</pre>
</section>
<!-- ═══ DESCRIPTION ═══ -->
<h2 class="sec">DESCRIPTION</h2>
<section class="body">
<p>一份生产级的代码审查技能。它把 AI 辅助的代码审查从模糊建议提升为结构化、一致、专业级的协作流程。</p>
<p>核心仅约 <span class="em">190 行</span>,按需调阅共计 <span class="em">16,000+ 行</span> 的语言指南。覆盖 <span class="em">20+ 种</span> 主流语言与框架——按需加载,零冗余。</p>
<p>每一条审查意见都带有明确的严重性标记。每一次审查都按四个阶段推进:从 PR 上下文 · 高层级评估 · 逐行分析 · 总结决策。</p>
</section>
<!-- ═══ LANGUAGES ═══ -->
<h2 class="sec">LANGUAGES</h2>
<section class="body">
<div class="cat-head">┌── frontend ──┘</div>
<div class="lang-row"><span class="file">react.md</span><span class="desc">React 19, Hooks, Server Components, TanStack v5 <span class="dotleader">.................</span></span><span class="lines">870</span></div>
<div class="lang-row"><span class="file">vue.md</span><span class="desc">Vue 3.5, Composition API, Composables, Watchers <span class="dotleader">.................</span></span><span class="lines">920</span></div>
<div class="lang-row"><span class="file">angular.md</span><span class="desc">Angular 17+, Signals, Standalone, Zoneless <span class="dotleader">..........................</span></span><span class="lines">420</span></div>
<div class="lang-row"><span class="file">svelte.md</span><span class="desc">Svelte 5, Runes, SvelteKit, SSR/CSR boundaries <span class="dotleader">..................</span></span><span class="lines">1,060</span></div>
<div class="lang-row"><span class="file">typescript.md</span><span class="desc">TypeScript strict mode, generics, immutability <span class="dotleader">..................</span></span><span class="lines">540</span></div>
<div class="lang-row"><span class="file">css-less-sass.md</span><span class="desc">CSS/Less/Sass variables, responsive, compatibility <span class="dotleader">..............</span></span><span class="lines">660</span></div>
<div class="cat-head">┌── backend ──┘</div>
<div class="lang-row"><span class="file">python.md</span><span class="desc">Python async, typing, pytest, mutable defaults <span class="dotleader">.................</span></span><span class="lines">1,070</span></div>
<div class="lang-row"><span class="file">django.md</span><span class="desc">Django/DRF security, N+1, serializers, async views <span class="dotleader">..............</span></span><span class="lines">1,030</span></div>
<div class="lang-row"><span class="file">java.md</span><span class="desc">Java 17/21, Spring Boot 3, virtual threads, JPA <span class="dotleader">................</span></span><span class="lines">800</span></div>
<div class="lang-row"><span class="file">php.md</span><span class="desc">PHP 8.x, types, PDO, security, Composer <span class="dotleader">...........................</span></span><span class="lines">700</span></div>
<div class="lang-row"><span class="file">go.md</span><span class="desc">Goroutines, channels, context, interface design <span class="dotleader">.................</span></span><span class="lines">990</span></div>
<div class="lang-row"><span class="file">rust.md</span><span class="desc">Ownership, async/await, unsafe, cancellation safety <span class="dotleader">.............</span></span><span class="lines">840</span></div>
<div class="lang-row"><span class="file">csharp.md</span><span class="desc">C# 12 / .NET 8, EF Core, ASP.NET Core, LINQ <span class="dotleader">.....................</span></span><span class="lines">520</span></div>
<div class="lang-row"><span class="file">nestjs.md</span><span class="desc">NestJS DI, guards, interceptors, DTO validation <span class="dotleader">.................</span></span><span class="lines">590</span></div>
<div class="cat-head">┌── mobile / systems ──┘</div>
<div class="lang-row"><span class="file">kotlin.md</span><span class="desc">Kotlin/Android coroutines, Compose, Flow, null safety <span class="dotleader">...........</span></span><span class="lines">1,020</span></div>
<div class="lang-row"><span class="file">swift.md</span><span class="desc">Swift 5.9+/6, SwiftUI, concurrency, Sendable, optionals <span class="dotleader">..........</span></span><span class="lines">930</span></div>
<div class="lang-row"><span class="file">c.md</span><span class="desc">C pointer safety, undefined behavior, resources <span class="dotleader">.................</span></span><span class="lines">210</span></div>
<div class="lang-row"><span class="file">cpp.md</span><span class="desc">C++ RAII, Rule of 0/3/5, move semantics, noexcept <span class="dotleader">...............</span></span><span class="lines">300</span></div>
<div class="lang-row"><span class="file">qt.md</span><span class="desc">Qt object model, signals/slots, GUI performance <span class="dotleader">.................</span></span><span class="lines">190</span></div>
<div class="cat-head">┌── cross-cutting ──┘</div>
<div class="lang-row"><span class="file">architecture-review-guide.md</span><span class="desc">SOLID, anti-patterns, coupling <span class="dotleader">...</span></span><span class="lines">470</span></div>
<div class="lang-row"><span class="file">performance-review-guide.md</span><span class="desc">Web Vitals, N+1, complexity <span class="dotleader">.......</span></span><span class="lines">850</span></div>
<div class="lang-row"><span class="file">code-quality-universal.md</span><span class="desc">TOCTOU, leaky abstractions, sprawl <span class="dotleader">....</span></span><span class="lines">320</span></div>
<div class="lang-row"><span class="file">security-review-guide.md</span><span class="desc">Injection, XSS, secrets, all langs <span class="dotleader">.....</span></span><span class="lines">—</span></div>
</section>
<!-- ═══ PHASES ═══ -->
<h2 class="sec">PHASES</h2>
<section class="body">
<pre class="phase-flow"> <span class="box">┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐</span>
<span class="box">│ context │</span> <span class="arrow">─▶</span> <span class="box">│ high level │</span> <span class="arrow">─▶</span> <span class="box">│ line by line│</span> <span class="arrow">─▶</span> <span class="box">│ decide │</span>
<span class="box">│ 2-3m │</span> <span class="box">│ 5-10m │</span> <span class="box">│ 10-20m │</span> <span class="box">│ 2-3m │</span>
<span class="box">└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘</span></pre>
<dl class="phase-list" style="margin-top:1.5rem;">
<dt>1. context gathering <span class="dim">— 2-3 min</span></dt>
<dd>读 PR 描述与关联 issue,评估规模,检查 CI 状态,理解业务需求。</dd>
<dt>2. high-level review <span class="dim">— 5-10 min</span></dt>
<dd>评估架构合理性、性能影响面、文件组织、测试策略。先看全局。</dd>
<dt>3. line-by-line analysis <span class="dim">— 10-20 min</span></dt>
<dd>逻辑正确性 · 安全 · 性能 · 可维护性 · 边界情况。一一过目。</dd>
<dt>4. summary & decision <span class="dim">— 2-3 min</span></dt>
<dd>汇总问题,表扬亮点,给出 approve / comment / request-changes。</dd>
</dl>
</section>
<!-- ═══ SEVERITY ═══ -->
<h2 class="sec">SEVERITY</h2>
<section class="body">
<ul class="sev-list">
<li>
<span class="label"><span class="red">●</span> [blocking]</span>
<span class="desc">必须修复 <span class="aside">— 合并前解决;安全漏洞 / 数据正确性 / 严重逻辑</span></span>
</li>
<li>
<span class="label"><span style="color:#d68a3d;">●</span> [important]</span>
<span class="desc">应当修复 <span class="aside">— 强烈建议;有分歧应讨论</span></span>
</li>
<li>
<span class="label"><span style="color:#c7a648;">●</span> [nit]</span>
<span class="desc">细节建议 <span class="aside">— 风格或偏好,不阻塞合并</span></span>
</li>
<li>
<span class="label"><span class="blue">●</span> [suggestion]</span>
<span class="desc">可选优化 <span class="aside">— 替代方案,由作者决定</span></span>
</li>
<li>
<span class="label"><span style="color:#9078b8;">●</span> [learning]</span>
<span class="desc">知识分享 <span class="aside">— 教育性说明,无需采取行动</span></span>
</li>
<li>
<span class="label"><span class="green">●</span> [praise]</span>
<span class="desc">表扬肯定 <span class="aside">— 看到好代码就说出来</span></span>
</li>
</ul>
</section>
<!-- ═══ INSTALLATION ═══ -->
<h2 class="sec">INSTALLATION</h2>
<section class="body">
<p>克隆到 Claude Code skills 目录。两条命令即可。</p>
<pre class="codeblock"><span class="cmt"># macOS / Linux</span>
<span class="prompt">$</span> <span class="cmd">git clone</span> <span class="arg">https://github.com/awesome-skills/code-review-skill.git</span> \
~/.claude/skills/code-review-skill
<span class="cmt"># Windows PowerShell</span>
<span class="prompt">PS></span> <span class="cmd">git clone</span> <span class="arg">https://github.com/awesome-skills/code-review-skill.git</span> `
"$env:USERPROFILE\.claude\skills\code-review-skill"</pre>
</section>
<!-- ═══ EXAMPLES ═══ -->
<h2 class="sec">EXAMPLES</h2>
<section class="body">
<ul class="examples">
<li>
<span class="q">Use code-review-skill to review this PR</span>
<span class="note">激活完整四阶段流程</span>
</li>
<li>
<span class="q">Review this React component</span>
<span class="note">加载 react.md · 检查 Hooks · Server Components</span>
</li>
<li>
<span class="q">Security review of this Go service</span>
<span class="note">同时加载 go.md + security-review-guide.md</span>
</li>
<li>
<span class="q">Architecture review</span>
<span class="note">加载架构指南 · SOLID · 反模式 · 耦合度</span>
</li>
</ul>
</section>
<!-- ═══ FILES ═══ -->
<h2 class="sec">FILES</h2>
<section class="body">
<pre class="tree">
<span class="dir">~/.claude/skills/code-review-skill/</span>
<span class="branch">├──</span> <span class="file">SKILL.md</span> <span class="cmt"># 核心,激活时加载 (~190 行)</span>
<span class="branch">├──</span> <span class="file">README.md</span>
<span class="branch">├──</span> <span class="file">LICENSE</span> <span class="cmt"># MIT</span>
<span class="branch">├──</span> <span class="dir">reference/</span> <span class="cmt"># 按需加载的语言指南</span>
<span class="branch">│ ├──</span> <span class="file">react.md</span> <span class="file">vue.md</span> <span class="file">angular.md</span> ...
<span class="branch">│ └──</span> <span class="file">architecture-review-guide.md</span> ...
<span class="branch">├──</span> <span class="dir">assets/</span>
<span class="branch">│ ├──</span> <span class="file">review-checklist.md</span> <span class="cmt"># 快速参考</span>
<span class="branch">│ └──</span> <span class="file">pr-review-template.md</span> <span class="cmt"># 评论模板</span>
<span class="branch">└──</span> <span class="dir">scripts/</span>
<span class="branch">└──</span> <span class="file">pr-analyzer.py</span> <span class="cmt"># PR 复杂度分析</span></pre>
</section>
<!-- ═══ SEE ALSO ═══ -->
<h2 class="sec">SEE ALSO</h2>
<section class="body">
<p>
<a class="link" href="https://claude.ai/code" target="_blank">claude-code(1)</a>,
<a class="link" href="https://github.com/awesome-skills/code-review-skill" target="_blank">github / awesome-skills</a>,
<a class="link" href="https://github.com/awesome-skills/code-review-skill/blob/main/CONTRIBUTING.md" target="_blank">CONTRIBUTING(7)</a>,
<a class="link" href="https://github.com/awesome-skills/code-review-skill/blob/main/assets/review-checklist.md" target="_blank">review-checklist(7)</a>
</p>
</section>
<!-- ═══ AUTHORS ═══ -->
<h2 class="sec">AUTHORS</h2>
<section class="body">
<dl class="bib">
<dt>awesome-skills</dt>
<dd>maintainer, primary author</dd>
<dt>contributors</dt>
<dd>see <a class="link" href="https://github.com/awesome-skills/code-review-skill/graphs/contributors" target="_blank">graphs/contributors</a></dd>
</dl>
</section>
<!-- ═══ COPYRIGHT ═══ -->
<h2 class="sec">COPYRIGHT</h2>
<section class="body">
<p>
<span class="dim">Copyright (c) 2025 awesome-skills.</span><br>
Released under the MIT License.<br>
<span class="dim">This is free software: you are free to change and redistribute it.</span><br>
<span class="dim">There is NO WARRANTY, to the extent permitted by law.</span>
</p>
</section>
<div style="height: 4rem;"></div>
<!-- ═══ END-OF-PAGE BAND ═══ -->
<div style="border-top:1px solid var(--rule); margin-top:2rem; padding:0.625rem 0;">
<div style="display:flex; justify-content:space-between; color:var(--fg-dim); font-size:12px; white-space:nowrap; gap:1rem;">
<span class="band-l" style="color:var(--fg-bright);">CODE-REVIEW-SKILL(1)</span>
<span style="color:var(--fg-dim);">awesome-skills</span>
<span class="band-r" style="color:var(--fg-bright);">CODE-REVIEW-SKILL(1)</span>
</div>
</div>
</main>
<!-- ═══ VIM-LIKE STATUS BAR ═══ -->
<div class="statusbar">
<div class="statusbar-inner">
<div class="statusbar-l">
<span>-- NORMAL --</span>
<span>code-review-skill.1</span>
</div>
<div class="statusbar-r">
<span><kbd>g</kbd> top</span>
<span><kbd>G</kbd> end</span>
<span><kbd>q</kbd> quit</span>
<span id="pos">1,1</span>
</div>
</div>
</div>
<script>
// Vim-like keyboard nav for the man-page vibe
document.addEventListener('keydown', (e) => {
if (e.metaKey || e.ctrlKey || e.altKey) return;
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
if (e.key === 'g') {
window.scrollTo({ top: 0, behavior: 'smooth' });
} else if (e.key === 'G') {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
} else if (e.key === 'j') {
window.scrollBy({ top: 60, behavior: 'smooth' });
} else if (e.key === 'k') {
window.scrollBy({ top: -60, behavior: 'smooth' });
} else if (e.key === 'q') {
const ok = confirm('Quit man page?');
if (ok) window.close();
}
});
// Update line/col-like indicator from scroll position
const posEl = document.getElementById('pos');
function updatePos() {
const pct = Math.round((window.scrollY / (document.body.scrollHeight - window.innerHeight)) * 100) || 0;
const line = Math.max(1, Math.round((window.scrollY / 20)));
posEl.textContent = line + ',1 ' + (pct >= 99 ? 'Bot' : pct <= 1 ? 'Top' : pct + '%');
}
updatePos();
window.addEventListener('scroll', updatePos, { passive: true });
</script>
</body>
</html>
MIT License
Copyright (c) 2025 tt-a1i
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
<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-16%2C000%2B-3b82f6?style=flat-square" alt="16000+ 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 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 16,000 lines of carefully curated review guidelines — loaded progressively to minimize context window usage.
---
✨ Key Features
- Progressive Disclosure — Core skill is ~190 lines; language guides (~200–1,000 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>~420</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>~540</td> </tr> <tr> <td rowspan="9"><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>⚡ 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>📦 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="5"><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>⚙️ C</td> <td><code>reference/c.md</code></td> <td>~290</td> </tr> <tr> <td>🔩 C++</td> <td><code>reference/cpp.md</code></td> <td>~390</td> </tr> <tr> <td>🖥️ Qt Framework</td> <td><code>reference/qt.md</code></td> <td>~190</td> </tr> <tr> <td rowspan="3"><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> </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 (~190 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
| +-- php.md # PHP 8.x types, PDO, security, Composer
| +-- 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
| +-- 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
| +-- 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
|
+-- assets/
| +-- review-checklist.md # Quick reference checklist
| +-- pr-review-template.md # PR review comment template
|
+-- scripts/
+-- pr-analyzer.py # PR complexity analyzer---
🚀 Installation
Clone to your Claude Code skills directory:
# 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:
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 PROr create a custom slash command in .claude/commands/:
<!-- .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 |
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 managementuseFormStatus- Access parent form status without prop drillinguseOptimistic- 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/hashCodeon Entities
</details>
<details> <summary><strong>🦀 Rust</strong></summary>
- Ownership patterns and common pitfalls
unsafecode review requirements (mandatorySAFETYcomments)- Async/await - avoiding blocking in async context, cancellation safety
- Error handling:
thiserrorfor libraries,anyhowfor applications
</details>
<details> <summary><strong>🐹 Go</strong></summary>
- Goroutine lifecycle management and leak prevention
- Channel patterns, select usage
context.Contextpropagation- 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 for guidelines.
Ideas:
- New language guides (Ruby, Elixir, Scala...)
- Framework-specific guides (Laravel, Spring WebFlux...)
- Additional checklists and templates
- Translations of core documentation
---
📄 License
MIT © awesome-skills
---
<a name="chinese"></a>
中文
这是什么?
Code Review Skill 是专为 Claude Code 打造的生产级代码审查技能,将 AI 辅助的代码审查从模糊建议转变为结构化、一致且专业级的流程。
覆盖 20+ 种语言和框架,拥有超过 16,000 行精心整理的代码审查指南——按需加载,最大程度减少上下文占用。
---
✨ 核心特性
- 渐进式加载 — 核心技能仅 ~190 行,各语言指南(每份 200–1,000 行)仅在需要时才加载。
- 四阶段审查流程 — 从理解 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 | ~420 | |
| 🔥 Svelte 5 / SvelteKit | reference/svelte.md | ~1,060 | |
| 🎨 CSS / Less / Sass | reference/css-less-sass.md | ~660 | |
| 🔷 TypeScript | reference/typescript.md | ~540 | |
| 后端 | ☕ Java 17/21 + Spring Boot 3 | reference/java.md | ~410 |
| ⚡ FastAPI | reference/fastapi.md | ~590 | |
| PHP 8.x | reference/php.md | ~700 | |
| 📦 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 | |
| ⚙️ C | reference/c.md | ~290 | |
| 🔩 C++ | reference/cpp.md | ~390 | |
| 🖥️ Qt 框架 | reference/qt.md | ~190 | |
| 架构 | 🏛️ 架构设计审查 | reference/architecture-review-guide.md | ~470 |
| ⚡ 性能审查 | reference/performance-review-guide.md | ~820 | |
| 🔍 通用质量反模式 | reference/code-quality-universal.md | ~490 |
---
🔄 四阶段审查流程
阶段一 - 上下文收集
理解 PR 范围、关联 Issue 和实现意图
|
v
阶段二 - 高层级审查
架构设计 - 性能影响 - 测试策略
|
v
阶段三 - 逐行深度分析
逻辑正确性 - 安全漏洞 - 可维护性 - 边界情况
|
v
阶段四 - 总结与决策
结构化反馈 - 审批状态 - 后续行动项---
🏷️ 严重性标记说明
| 标记 | 含义 |
|---|---|
🔴 blocking | 合并前必须修复 |
🟠 important | 应当修复,视情况可能阻塞合并 |
🟡 nit | 风格或偏好上的小问题 |
🔵 suggestion | 值得考虑的可选优化 |
📚 learning | 给作者的教育性说明 |
🌟 praise | 明确表扬优秀代码 |
---
📁 仓库结构
code-review-skill/
|
+-- SKILL.md # 核心技能,激活时加载(~190 行)
+-- 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
| +-- php.md # PHP 8.x 类型、PDO、安全、Composer
| +-- 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、并发、可选值
| +-- csharp.md # C# 12 / .NET 8、EF Core、ASP.NET Core
| +-- c.md # C 内存安全、UB、错误处理
| +-- cpp.md # C++ RAII、移动语义、异常安全
| +-- 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 # 沟通与流程最佳实践
|
+-- assets/
| +-- review-checklist.md # 快速参考清单
| +-- pr-review-template.md # PR 审查评论模板
|
+-- scripts/
+-- pr-analyzer.py # PR 复杂度分析工具---
🚀 安装方法
克隆到 Claude Code skills 目录:
# 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"或添加到现有插件:
cp -r code-review-skill ~/.claude/plugins/your-plugin/skills/code-review/---
💡 使用方式
安装后,在 Claude Code 会话中激活技能:
Use code-review-skill to review this PR或在 .claude/commands/ 中创建自定义斜杠命令:
<!-- .claude/commands/review.md -->
使用 code-review-skill 对这次 PR 的变更进行全面审查。
重点关注:安全性、性能和可维护性。示例提示词:
| 提示词 | 效果 |
|---|---|
审查这个 React 组件 | 加载 react.md,检查 Hooks、Server Components、Suspense |
审查这个 Java PR | 加载 java.md,检查虚拟线程、JPA、Spring Boot 3 |
对这个 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>🦀 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 了解规范。
可贡献方向:
- 新增语言指南(Ruby、Elixir、Scala...)
- 框架专属指南(Laravel、Spring WebFlux...)
- 补充检查清单和审查模板
- 核心文档的多语言翻译
---
📄 开源协议
MIT © awesome-skills
---
<div align="center"> Made with ❤️ for developers who care about code quality </div>
Angular Code Review Guide
Angular 17+ 代码审查指南,覆盖 Signals、Standalone 组件、RxJS 反模式、Zoneless 变更检测、模板最佳实践及性能优化等核心主题。
目录
---
Signals 与变更检测
Signal + OnPush 自动触发变更检测
// ❌ 可变状态 + OnPush = 界面不更新
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<p>{{ data.name }}</p>`,
})
export class UserProfile {
data = { name: 'Alice' };
changeName() { this.data.name = 'Bob'; } // UI 不会更新!
}
// ✅ Signal + OnPush = 自动变更检测
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<p>{{ name() }}</p>`,
})
export class UserProfile {
name = signal('Alice');
changeName() { this.name.set('Bob'); } // 自动触发 CD
}@Input() 对象变异不会被 OnPush 检测
// ❌ 变异 Input 对象——引用不变,OnPush 不检测
@Input() config!: Config;
updateConfig() { this.config.theme = 'dark'; }
// ✅ 创建新引用
updateConfig() { this.config = { ...this.config, theme: 'dark' }; }computed() 用于派生状态
// ❌ effect 用于同步状态——反模式,可能触发额外 CD 周期
export class CartComponent {
total = signal(0);
discounted = signal(0);
constructor() {
effect(() => this.discounted.set(this.total() * 0.9));
}
}
// ✅ computed 用于派生状态——惰性计算,无副作用
export class CartComponent {
total = signal(0);
discounted = computed(() => this.total() * 0.9);
}effect() 中 Signal 读取在 await 后不会被追踪
// ❌ await 之后读取 Signal——依赖未被追踪
effect(async () => {
const data = await fetchUserData();
console.log(`Theme: ${theme()}`); // theme() 未被追踪!
});
// ✅ 在 await 之前同步读取
effect(async () => {
const currentTheme = theme(); // 同步读取,被追踪
const data = await fetchUserData();
console.log(`Theme: ${currentTheme}`);
});effect 只在特定场景使用
// ❌ 用 effect 同步两个 Signal——永远用 computed
effect(() => { this.filtered.set(this.items().filter(i => i.active)); });
// ✅ effect 的合理场景:DOM 操作、分析日志、订阅外部源
effect(() => {
const canvas = this.canvasRef.nativeElement;
const ctx = canvas.getContext('2d');
ctx.fillStyle = this.color();
ctx.fillRect(0, 0, this.size(), this.size());
});
// 💡 "There are no situations where effect is good,
// only situations where it is appropriate."---
Standalone 组件迁移
Angular 19+ standalone 是默认值
// ❌ Legacy NgModule 组件
@Component({
selector: 'old-component',
standalone: false,
})
export class OldComponent {}
// ✅ 现代 Standalone 组件(Angular 19+ standalone 是默认值)
@Component({
selector: 'user-profile',
imports: [ProfilePhoto, RouterLink],
template: `<profile-photo /><a routerLink="/edit">Edit</a>`,
})
export class UserProfile {}审查标记
// ⚠️ 需要迁移的信号:
// 1. standalone: false
// 2. @NgModule declarations
// 3. 组件通过 NgModule 而非直接 import
// ✅ 迁移路径:
// 1. 删除 standalone: false
// 2. 将依赖添加到组件的 imports 数组
// 3. 如果不再有 declarations,删除 NgModule---
RxJS 反模式
subscribe() 必须配 takeUntilDestroyed
// ❌ 裸 subscribe——内存泄漏!组件销毁后仍继续接收数据
@Component({ /* ... */ })
export class UserProfile implements OnInit {
ngOnInit() {
this.data$.subscribe(data => this.processData(data));
}
}
// ✅ takeUntilDestroyed——自动在组件销毁时取消(需在构造函数或注入上下文中调用)
@Component({ /* ... */ })
export class UserProfile {
constructor() {
this.data$.pipe(takeUntilDestroyed()).subscribe(data => {
this.processData(data);
});
}
}
// ✅ 在构造函数外使用——传入 DestroyRef
@Component({ /* ... */ })
export class UserProfile {
private destroyRef = inject(DestroyRef);
startListening() {
this.data$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(/* ... */);
}
}toSignal 优于 AsyncPipe
// ❌ AsyncPipe——需要导入,模板中有 | async
@Component({
imports: [AsyncPipe],
template: `{{ data$ | async }}`,
})
// ✅ toSignal——自动取消订阅,可在任何地方使用
export class UserProfile {
data = toSignal(this.data$, { initialValue: null });
// 模板直接用 data()
}避免重复 toSignal 调用
// ❌ toSignal 每次调用都创建新订阅
getData() {
return toSignal(this.http.get('/api/data'));
}
// ✅ 存储结果
data = toSignal(this.http.get('/api/data'), { initialValue: null });---
Zoneless 变更检测
普通属性变异不会被检测(Angular 21+)
// ❌ Zoneless 下普通属性赋值不触发 CD
export class UserService {
user: User | null = null;
loadUser() { this.user = fetchResult; } // 不触发!
}
// ✅ Signal 自动触发 CD
export class UserService {
private _user = signal<User | null>(null);
readonly user = this._user.asReadonly();
loadUser() { this._user.set(fetchResult); }
}NgZone API 在 Zoneless 中失效
// ❌ NgZone.onStable 在 zoneless 中永远不会触发
ngZone.onStable.subscribe(() => { /* 永远不触发 */ });
// ✅ 使用 afterNextRender
afterNextRender({ write: () => { /* CD 之后执行 */ } });Reactive Forms 变异需要 markForCheck
// ❌ Reactive Forms 的 setValue/patchValue 在 zoneless 中不自动调度 CD
this.form.patchValue({ name: 'Alice' }); // UI 可能不更新
// ✅ 手动标记或通过 Signal 反映
this.form.patchValue({ name: 'Alice' });
this.cdr.markForCheck();Zoneless 下有效的 CD 触发器
| 触发器 | 说明 |
|---|---|
signal.set() / .update() | Signal 更新自动触发 |
ChangeDetectorRef.markForCheck() | 手动标记 |
ComponentRef.setInput() | 输入绑定 |
| 模板事件监听器回调 | 用户交互 |
---
模板最佳实践
复杂逻辑提取为 computed Signal
// ❌ 模板中复杂表达式
template: `<div *ngIf="items.filter(i => i.active).length > 0 && user.role === 'admin'">`
// ✅ 提取为 computed
filteredItems = computed(() => this.items().filter(i => i.active));
shouldShow = computed(() => this.filteredItems().length > 0 && this.user().role === 'admin');
template: `@if (shouldShow()) { <div>...</div> }`原生绑定优于 NgClass / NgStyle
// ❌ NgClass/NgStyle——额外指令开销
template: `<div [ngClass]="{active: isActive}" [ngStyle]="{'color': textColor}">`
// ✅ 原生 class/style 绑定——性能更好
template: `<div [class.active]="isActive" [style.color]="textColor">`模板专用成员标记 protected
// ❂ 模板专用方法暴露为 public
export class UserProfile {
formatName(name: string) { return name.trim(); }
}
// ✅ 模板专用成员用 protected
export class UserProfile {
protected formatName(name: string) { return name.trim(); }
}Angular 管理的属性标记 readonly
// ❌ input/output/model 可被意外覆盖
userId = input<string>();
userSaved = output<void>();
// ✅ readonly 防止意外赋值
readonly userId = input<string>();
readonly userSaved = output<void>();
readonly userName = model<string>();命名规范:操作名而非事件名
// ❌ 以事件命名
template: `<button (click)="handleClick()">Save</button>`
// ✅ 以操作命名
template: `<button (click)="saveUserData()">Save</button>`---
性能优化
effect 是最后手段——优先 computed
// ❌ effect 用于状态同步——触发额外 CD,可能无限循环
effect(() => {
this.filteredItems.set(this.items().filter(i => i.active));
});
// ✅ computed——惰性计算,无副作用,无额外 CD
filteredItems = computed(() => this.items().filter(i => i.active));afterRenderEffect 分离读写阶段
// ❌ 无阶段指定 = mixedReadWrite = 额外 DOM 回流
afterRenderEffect(() => {
const height = el.offsetHeight; // 读
el.style.height = height + 10 + 'px'; // 写
});
// ✅ 分离阶段减少回流
afterRenderEffect({
earlyRead: () => el.offsetHeight,
write: (height) => { el.style.height = height() + 10 + 'px'; },
read: () => verifyLayout(),
});inject() 优于构造函数注入
// ❌ 构造函数注入——多依赖时难以阅读
export class UserService {
constructor(
private http: HttpClient,
private router: Router,
private auth: AuthService,
) {}
}
// ✅ inject()——更好的类型推断和可读性
export class UserService {
private http = inject(HttpClient);
private router = inject(Router);
private auth = inject(AuthService);
}---
Review Checklist
Signals 与变更检测
- [ ] Signal + OnPush 用于模板状态(非可变对象)
- [ ]
@Input()对象通过新引用更新(非变异) - [ ] 派生状态用
computed(),不用effect() - [ ]
effect()中 Signal 读取在await之前 - [ ]
effect()只用于 DOM 操作、日志、外部源订阅
Standalone 组件
- [ ] 无
standalone: false(Angular 19+) - [ ] 组件通过
imports数组导入依赖 - [ ] 无不必要的
@NgModule
RxJS
- [ ]
.subscribe()配takeUntilDestroyed或asyncpipe - [ ] 优先
toSignal而非AsyncPipe - [ ] 无重复
toSignal调用
Zoneless
- [ ] 模板状态通过 Signal 管理(非普通属性)
- [ ] 无
NgZone.onStable/NgZone.onMicrotaskEmpty - [ ] Reactive Forms 变异后有
markForCheck()
模板
- [ ] 复杂逻辑提取为
computedSignal - [ ] 使用原生
[class]/[style]而非NgClass/NgStyle - [ ] 模板专用成员标记
protected - [ ]
input/output/model属性标记readonly - [ ] 事件处理器以操作命名(
saveData而非handleClick)
性能
- [ ]
effect()不用于状态同步 - [ ]
afterRenderEffect分离读写阶段 - [ ]
inject()用于依赖注入
C Code Review Guide
C code review guide focused on memory safety, undefined behavior, and portability. Examples assume C11.
Table of Contents
- Pointer and Buffer Safety
- Ownership and Resource Management
- Undefined Behavior Pitfalls
- Integer Types and Overflow
- Error Handling
- Concurrency
- Macros and Preprocessor
- API Design and Const
- Tooling and Build Checks
- Review Checklist
---
Pointer and Buffer Safety
Always carry size with buffers
// ❌ Bad: ignores destination size
bool copy_name(char *dst, size_t dst_size, const char *src) {
strcpy(dst, src);
return true;
}
// ✅ Good: validate size and terminate
bool copy_name(char *dst, size_t dst_size, const char *src) {
size_t len = strlen(src);
if (len + 1 > dst_size) {
return false;
}
memcpy(dst, src, len + 1);
return true;
}Avoid dangerous APIs
Prefer snprintf, fgets, and explicit bounds over gets, strcpy, or sprintf.
// ❌ Bad: unbounded write
sprintf(buf, "%s", input);
// ✅ Good: bounded write
snprintf(buf, buf_size, "%s", input);Use the right copy primitive
// ❌ Bad: memcpy with overlapping regions
memcpy(dst, src, len);
// ✅ Good: memmove handles overlap
memmove(dst, src, len);---
Ownership and Resource Management
One allocation, one free
Track ownership and clean up on every error path.
// ✅ Good: cleanup label avoids leaks
int load_file(const char *path) {
int rc = -1;
FILE *f = NULL;
char *buf = NULL;
f = fopen(path, "rb");
if (!f) {
goto cleanup;
}
buf = malloc(4096);
if (!buf) {
goto cleanup;
}
if (fread(buf, 1, 4096, f) == 0) {
goto cleanup;
}
rc = 0;
cleanup:
free(buf);
if (f) {
fclose(f);
}
return rc;
}---
Undefined Behavior Pitfalls
Common UB patterns
// ❌ Bad: use after free
char *p = malloc(10);
free(p);
p[0] = 'a';
// ❌ Bad: uninitialized read
int x;
if (x > 0) { /* UB */ }
// ❌ Bad: signed overflow
int sum = a + b;Avoid pointer arithmetic past the object
// ❌ Bad: pointer past the end then dereference
int arr[4];
int *p = arr + 4;
int v = *p; // UB---
Integer Types and Overflow
Avoid signed/unsigned surprises
// ❌ Bad: negative converted to large size_t
int len = -1;
size_t n = len;
// ✅ Good: validate before converting
if (len < 0) {
return -1;
}
size_t n = (size_t)len;Check for overflow in size calculations
// ❌ Bad: potential overflow in multiplication
size_t bytes = count * sizeof(Item);
// ✅ Good: check before multiplying
if (count > SIZE_MAX / sizeof(Item)) {
return NULL;
}
size_t bytes = count * sizeof(Item);---
Error Handling
Always check return values
// ❌ Bad: ignore errors
fread(buf, 1, size, f);
// ✅ Good: handle errors
size_t read = fread(buf, 1, size, f);
if (read != size && ferror(f)) {
return -1;
}Consistent error contracts
- Use a clear convention: 0 for success, negative for failure.
- Document ownership rules on success and failure.
- If using
errno, set it only for actual failures.
---
Concurrency
volatile is not synchronization
// ❌ Bad: data race
volatile int stop = 0;
void worker(void) {
while (!stop) { /* ... */ }
}
// ✅ Good: C11 atomics
_Atomic int stop = 0;
void worker(void) {
while (!atomic_load(&stop)) { /* ... */ }
}Use mutexes for shared state
Protect shared data with pthread_mutex_t or equivalent. Avoid holding locks while doing I/O.
---
Macros and Preprocessor
Parenthesize arguments
// ❌ Bad: macro with side effects
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int x = MIN(i++, j++);
// ✅ Good: static inline function
static inline int min_int(int a, int b) {
return a < b ? a : b;
}---
API Design and Const
Const-correctness and sizes
// ✅ Good: explicit size and const input
int hash_bytes(const uint8_t *data, size_t len, uint8_t *out);Document nullability
Clearly document whether pointers may be NULL. Prefer returning error codes instead of NULL when possible.
---
Tooling and Build Checks
# Warnings
clang -Wall -Wextra -Werror -Wconversion -Wshadow -std=c11 ...
# Sanitizers (debug builds)
clang -fsanitize=address,undefined -fno-omit-frame-pointer -g ...
clang -fsanitize=thread -fno-omit-frame-pointer -g ...
# Static analysis
clang-tidy src/*.c -- -std=c11
cppcheck --enable=warning,performance,portability src/
# Formatting
clang-format -i src/*.c include/*.h---
Review Checklist
Memory and UB
- [ ] All buffers have explicit size parameters
- [ ] No out-of-bounds access or pointer arithmetic past objects
- [ ] No use after free or uninitialized reads
- [ ] Signed overflow and shift rules are respected
API and Design
- [ ] Ownership rules are documented and consistent
- [ ] const-correctness is applied for inputs
- [ ] Error contracts are clear and consistent
Concurrency
- [ ] No data races on shared state
- [ ] volatile is not used for synchronization
- [ ] Locks are held for minimal time
Tooling and Tests
- [ ] Builds clean with warnings enabled
- [ ] Sanitizers run on critical code paths
- [ ] Static analysis results are addressed
Code Review Best Practices
Comprehensive guidelines for conducting effective code reviews.
Review Philosophy
Goals of Code Review
Primary Goals:
- Catch bugs and edge cases before production
- Ensure code maintainability and readability
- Share knowledge across the team
- Enforce coding standards consistently
- Improve design and architecture decisions
Secondary Goals:
- Mentor junior developers
- Build team culture and trust
- Document design decisions through discussions
What Code Review is NOT
- A gatekeeping mechanism to block progress
- An opportunity to show off knowledge
- A place to nitpick formatting (use linters)
- A way to rewrite code to personal preference
Review Timing
When to Review
| Trigger | Action |
|---|---|
| PR opened | Review within 24 hours, ideally same day |
| Changes requested | Re-review within 4 hours |
| Blocking issue found | Communicate immediately |
Time Allocation
- Small PR (<100 lines): 10-15 minutes
- Medium PR (100-400 lines): 20-40 minutes
- Large PR (>400 lines): Request to split, or 60+ minutes
Review Depth Levels
Level 1: Skim Review (5 minutes)
- Check PR description and linked issues
- Verify CI/CD status
- Look at file changes overview
- Identify if deeper review needed
Level 2: Standard Review (20-30 minutes)
- Full code walkthrough
- Logic verification
- Test coverage check
- Security scan
Level 3: Deep Review (60+ minutes)
- Architecture evaluation
- Performance analysis
- Security audit
- Edge case exploration
Communication Guidelines
Tone and Language
Use collaborative language:
- "What do you think about..." instead of "You should..."
- "Could we consider..." instead of "This is wrong"
- "I'm curious about..." instead of "Why didn't you..."
Be specific and actionable:
- Include code examples when suggesting changes
- Link to documentation or past discussions
- Explain the "why" behind suggestions
Handling Disagreements
1. Seek to understand: Ask clarifying questions 2. Acknowledge valid points: Show you've considered their perspective 3. Provide data: Use benchmarks, docs, or examples 4. Escalate if needed: Involve senior dev or architect 5. Know when to let go: Not every hill is worth dying on
Review Prioritization
Must Fix (Blocking)
- Security vulnerabilities
- Data corruption risks
- Breaking changes without migration
- Critical performance issues
- Missing error handling for user-facing features
Should Fix (Important)
- Test coverage gaps
- Moderate performance concerns
- Code duplication
- Unclear naming or structure
- Missing documentation for complex logic
Nice to Have (Non-blocking)
- Style preferences beyond linting
- Minor optimizations
- Additional test cases
- Documentation improvements
Anti-Patterns to Avoid
Reviewer Anti-Patterns
- Rubber stamping: Approving without actually reviewing
- Bike shedding: Debating trivial details extensively
- Scope creep: "While you're at it, can you also..."
- Ghosting: Requesting changes then disappearing
- Perfectionism: Blocking for minor style preferences
Author Anti-Patterns
- Mega PRs: Submitting 1000+ line changes
- No context: Missing PR description or linked issues
- Defensive responses: Arguing every suggestion
- Silent updates: Making changes without responding to comments
Metrics and Improvement
Track These Metrics
- Time to first review
- Review cycle time
- Number of review rounds
- Defect escape rate
- Review coverage percentage
Continuous Improvement
- Hold retrospectives on review process
- Share learnings from escaped bugs
- Update checklists based on common issues
- Celebrate good reviews and catches
#!/usr/bin/env python3
"""Tests for pr-analyzer.py diff parsing (stdlib unittest, no extra deps)."""
import importlib.util
import os
import unittest
# The script has a hyphen in its name, so load it by path.
_HERE = os.path.dirname(os.path.abspath(__file__))
_spec = importlib.util.spec_from_file_location(
'pr_analyzer', os.path.join(_HERE, 'pr-analyzer.py')
)
pr_analyzer = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(pr_analyzer)
class ParseDiffFilenameTest(unittest.TestCase):
def test_lib_prefixed_path(self):
# "lib/" embeds a literal "b/" that the old regex swallowed.
diff = (
"diff --git a/lib/foo.py b/lib/foo.py\n"
"index 1234567..89abcde 100644\n"
"--- a/lib/foo.py\n"
"+++ b/lib/foo.py\n"
"@@ -1,2 +1,3 @@\n"
" unchanged\n"
"+added line\n"
"-removed line\n"
)
files = pr_analyzer.parse_diff(diff)
self.assertEqual(len(files), 1)
self.assertEqual(files[0].filename, 'lib/foo.py')
self.assertEqual(files[0].additions, 1)
self.assertEqual(files[0].deletions, 1)
def test_normal_path(self):
diff = (
"diff --git a/src/main.py b/src/main.py\n"
"index 1111111..2222222 100644\n"
"--- a/src/main.py\n"
"+++ b/src/main.py\n"
"@@ -0,0 +1 @@\n"
"+print('hi')\n"
)
files = pr_analyzer.parse_diff(diff)
self.assertEqual(len(files), 1)
self.assertEqual(files[0].filename, 'src/main.py')
def test_other_embedded_b_slash_prefixes(self):
# web/ and db/ also contain a literal "b/".
diff = (
"diff --git a/web/x.js b/web/x.js\n"
"+++ b/web/x.js\n"
"+console.log(1)\n"
"diff --git a/db/y.sql b/db/y.sql\n"
"+++ b/db/y.sql\n"
"+SELECT 1;\n"
)
files = pr_analyzer.parse_diff(diff)
self.assertEqual([f.filename for f in files], ['web/x.js', 'db/y.sql'])
def test_rename_falls_back_to_b_side(self):
diff = (
"diff --git a/old/name.py b/new/name.py\n"
"similarity index 100%\n"
"rename from old/name.py\n"
"rename to new/name.py\n"
)
files = pr_analyzer.parse_diff(diff)
self.assertEqual(len(files), 1)
self.assertEqual(files[0].filename, 'new/name.py')
if __name__ == '__main__':
unittest.main()
Related skills
How it compares
Broad multi-framework review playbook—pair with stack-specific checkers like React perf rules instead of one-size-fits-all static analysis.
FAQ
Who is code-review-skill for?
Developers conducting PR reviews, mentoring others, or setting team review culture—especially solos who lack a dedicated review committee.
When should I use code-review-skill?
At Ship → review on every meaningful PR, during architecture discussions in Build, or for security-flavored passes in Ship → security before release.
Is code-review-skill safe to install?
It may invoke Bash and network fetches to verify quality; review the Security Audits panel on this Prism page and restrict tools in untrusted repos.