code-reviewer
它能做什么
这项技能让智能体审查代码变更的质量、安全和性能问题。适合希望在拉取请求或某段代码上获得第二双眼睛的开发者。
适用场景
- ✓当你有一个拉取请求、想在合并前进行检查的时候。
- ✓当你粘贴一个函数或文件、想知道可能出什么问题的时候。
- ✓当你想检查某次提交或差异是否存在安全问题的时候。
技能链接
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/code-reviewer/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我合并之前,审查这个拉取请求是否存在安全问题和错误。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会加载通用规则以及所用语言的规则。它会扫描注入风险、缺失检查和薄弱的错误处理等问题,并可对变更的风险和复杂度评分。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Code Reviewer
Automated code review tools for analyzing pull requests, detecting code quality issues, and generating review reports.
How This Skill Is Organized
code-reviewer/
SKILL.md ← you are here (tools + dispatch table)
rules/
universal.md ← security, async, resources, exceptions, performance — all languages
languages/
python.md ← Python-specific rules + idioms
typescript.md ← TypeScript / JavaScript-specific rules + idioms
go.md ← Go-specific rules + idioms
swift.md ← Swift-specific rules + idioms
kotlin.md ← Kotlin-specific rules + idioms
csharp.md ← C# / .NET-specific rules + idioms
java.md ← Java-specific rules + idioms
c.md ← C -specific rules + idioms
cpp.md ← C++ -specific rules + idioms
rust.md ← Rust -specific rules + idioms
ruby.md ← Ruby -specific rules + idioms
php.md ← PHP-specific rules + idioms
dart.md ← Dart / Flutter-specific rules + idioms
Loading order for every review
- This file (
SKILL.md) — tools and thresholds rules/universal.md— always, for every language- The matching
languages/*.md— one file based on the extension table below
That is always exactly 2 additional files, regardless of scope.
| Extension(s) | Load |
|---|---|
.py |
languages/python.md |
.ts, .tsx, .js, .jsx, .mjs |
languages/typescript.md |
.go |
languages/go.md |
.swift |
languages/swift.md |
.kt, .kts |
languages/kotlin.md |
.cs, .csx, .razor, .cshtml |
languages/csharp.md |
.java |
languages/java.md |
.c, .h |
languages/c.md |
.cpp, .cc, .cxx, .hpp, .hh, .hxx |
languages/cpp.md |
.rs |
languages/rust.md |
.rb, .rake, .gemspec, .ru |
languages/ruby.md |
.php, .phtml |
languages/php.md |
.dart |
languages/dart.md |
Tools
PR Analyzer
Analyzes git diff between branches to assess review complexity and identify risks.
# Analyze current branch against main
python scripts/pr_analyzer.py /path/to/repo
# Compare specific branches
python scripts/pr_analyzer.py . --base main --head feature-branch
# JSON output for integration
python scripts/pr_analyzer.py /path/to/repo --json
What it detects (universal — see also language file for language-specific signals):
- Hardcoded secrets (passwords, API keys, tokens, connection strings)
- SQL / query injection patterns
- Debug statements left in production code
- Lint / analyzer suppression annotations
- TODO/FIXME comments
Language-specific detections are defined in each languages/*.md file.
Output includes:
- Complexity score (1-10)
- Risk categorization (critical, high, medium, low)
- File prioritization for review order
- Commit message validation
Code Quality Checker
Analyzes source code for structural issues, code smells, and SOLID violations.
# Analyze a directory
python scripts/code_quality_checker.py /path/to/code
# Analyze specific language
# Valid values: python, typescript, javascript, go, swift, kotlin, csharp, java, c, cpp, rust, ruby, php, dart
python scripts/code_quality_checker.py . --language java
# JSON output
python scripts/code_quality_checker.py /path/to/code --json
Universal thresholds:
| Issue | Threshold |
|---|---|
| Long function | >50 lines |
| Large file | >500 lines |
| God class | >20 methods |
| Too many params | >5 |
| Deep nesting | >4 levels |
| High complexity | >10 branches |
Language-specific checks are defined in each languages/*.md file.
Review Report Generator
Combines PR analysis and code quality findings into structured review reports.
# Generate report for current repo
python scripts/review_report_generator.py /path/to/repo
# Markdown output
python scripts/review_report_generator.py . --format markdown --output review.md
# Use pre-computed analyses
python scripts/review_report_generator.py . \
--pr-analysis pr_results.json \
--quality-analysis quality_results.json
Verdicts:
| Score | Verdict |
|---|---|
| 90+ with no high issues | Approve |
| 75+ with ≤2 high issues | Approve wit |
常见问题
它支持哪些语言?
许多常见语言,包括 Python、TypeScript、JavaScript、Go、Java、C#、Rust、Ruby、PHP、Swift、Kotlin、Dart 和 C++。
它也检查安全问题吗?
会。它会查找 SQL 注入和缺失的授权检查等问题。
它能审查我没有编写的代码吗?
能。它适用于任何差异、提交、拉取请求或粘贴的代码。
详情
作者的原始描述
Use for any code review: a pull request, a diff, a commit, or a pasted function, handler or file in TypeScript, JavaScript, Python, Go, Swift, Kotlin, C#/.NET, Java, C, C++, Rust, Ruby, PHP or Dart/Flutter. Applies per-language rule packs (security such as SQL injection and missing auth, async and resource handling, error handling, performance) and scripts that score a PR's risk and complexity, then gives a merge verdict with blocking and non-blocking findings. Use whenever the user asks to review, check or look over code, says 'code review', 'review this PR', 'review this diff' or 'is this sa
热度
- GitHub 星标
- 29k
- 排名
- #9493
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-launcher-orchestrator
29k帮你的智能体从一个清晰的目标出发,逐步规划、构建、测试并定时运行你自己账户中的 Claude 托管智能体。
grade-iterate
29k让你的智能体按评分标准为托管 AI 智能体的工作打分,并在固定的轮次内改进,因此它永远不会无限循环。
interview
29k让你的智能体就一个 AI 智能体的想法对你进行访谈,并在任何上线之前,把你的回答整理成一份简单的构建计划。
run-without-you
29k帮你的智能体设置托管 AI 智能体,使其按计划或在某个事件发生时运行,并在启动前检查定时设置。