跳到正文
Skillpedia
通用编程29k · #9493

code-reviewer

它能做什么

这项技能让智能体审查代码变更的质量、安全和性能问题。适合希望在拉取请求或某段代码上获得第二双眼睛的开发者。

适用场景

  • ✓当你有一个拉取请求、想在合并前进行检查的时候。
  • ✓当你粘贴一个函数或文件、想知道可能出什么问题的时候。
  • ✓当你想检查某次提交或差异是否存在安全问题的时候。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/code-reviewer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/code-reviewer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  1. This file (SKILL.md) — tools and thresholds
  2. rules/universal.md — always, for every language
  3. 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

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9493
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能