Token导航 LogoToken导航

Agent Skill · 研究检索

ai-code-reviewer(AI 代码审查员)

ai-code-reviewer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

ai-code-reviewer 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 62,819。

总安装 326周安装 14GitHub Stars 公开资料未说明下载 114核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ai-code-reviewer(AI 代码审查员)
来源仓库:https://github.com/yulong-me/skills
仓库路径:skills/ai-code-reviewer
安装命令:
npx skills add https://github.com/yulong-me/skills --skill ai-code-reviewer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/yulong-me/skills --skill ai-code-reviewer

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

基于 Git Hook 的自动化 AI 代码审查工具,支持项目级规则校验。可智能匹配规则、阻断违规提交,并提供渐进式披露设计提升效率。通过 npx 命令从指定 GitHub 仓库安装,集成于 Codex、Claude 等宿主环境。需配置 .ai-reviewer/rules/ 目录以定义项目专属审查规则。

ai-code-reviewer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/ai-code-reviewer

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/yulong-me/skills --skill ai-code-reviewer;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ai-code-reviewer 怎么安装?

在终端执行 npx skills add https://github.com/yulong-me/skills --skill ai-code-reviewer。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ai-code-reviewer 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ai-code-reviewer 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

ai-code-reviewer 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

ai-code-reviewer 用的人多吗?

公开数据是累计安装 326 次,近一周安装 14 次,下载 114 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ai-code-reviewer 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
ai-code-reviewer

AI 代码审查员 · 本页

326—接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

AI Code Reviewer

Automated AI-powered code review that runs on git hooks with progressive disclosure design. Reviews staged changes against project-specific rules using Claude AI, blocking or warning about violations before commits.

Key Features

  • Progressive Disclosure: Loads rule metadata first for fast matching, full details only for applicable rules
  • Git Hook Integration: Automatically runs on pre-commit or pre-push
  • Project-Level Rules: Each project maintains its own review rules in .ai-reviewer/rules/
  • Smart Matching: Matches rules by keywords and file patterns before full AI review
  • Flexible Configuration: Block/warn modes, Claude API or CLI backend
  • Token Efficient: Minimizes context usage by loading only relevant rules

Quick Start

  1. Initialize project structure (if not exists): mkdir -p.ai-reviewer/{rules,hooks} cp <skill-path>/assets/config.yaml.ai-reviewer/ cp <skill-path>/assets/rules/*.md.ai-reviewer/rules/ cp <skill-path>/assets/hooks/*.template.ai-reviewer/hooks/
  2. Install git hook: python3 <skill-path>/scripts/install_hook.py install --hook-type pre-commit
  3. Configure AI backend in .ai-reviewer/config.yaml:

- Set ai_backend: claude-api and provide claude_api_key, OR - Set ai_backend: claude-cli (requires Claude CLI installed)

  1. Test the review: # Stage some changes git add. # Run review manually to test python3 <skill-path>/scripts/run_review.py --project-root. # If review passes, commit will proceed normally git commit -m "test commit"
  2. Skip review when needed: git commit --no-verify -m "message"

Workflow Decision Tree

User wants to:
│
├─ "Set up AI code review"
│  └─ Go to Initial Setup
│
├─ "Add review rules"
│  └─ Go to Creating Rules
│
├─ "Configure review behavior"
│  └─ Go to Configuration
│
├─ "Install/uninstall hooks"
│  └─ Go to Managing Git Hooks
│
├─ "Debug review issues"
│  └─ Go to Troubleshooting
│
└─ "Review staged changes manually"
   └─ Run: python3 <skill-path>/scripts/run_review.py --project-root .

Initial Setup

Step 1: Create Project Structure

The reviewer requires this structure:

project-root/
└── .ai-reviewer/
    ├── config.yaml          # Configuration
    ├── rules/               # Review rules
    │   ├── rule1.md
    │   └── rule2.md
    └── hooks/               # Git hook templates
        ├── pre-commit.template
        └── pre-push.template

Copy from skill assets:

# Create directories
mkdir -p .ai-reviewer/{rules,hooks}

# Copy example config
cp <skill-path>/assets/config.yaml .ai-reviewer/

# Copy example rules
cp <skill-path>/assets/rules/*.md .ai-reviewer/rules/

# Copy hook templates
cp <skill-path>/assets/hooks/*.template .ai-reviewer/hooks/

Step 2: Configure Reviewer

Edit .ai-reviewer/config.yaml:

For Claude API (recommended):

review_mode: block
ai_backend: claude-api
claude_api_key: "sk-ant-api03-..."  # Or use ANTHROPIC_API_KEY env var
model: claude-sonnet-4-5-20250929

For Claude CLI:

review_mode: block
ai_backend: claude-cli

See Configuration Reference for all options.

Step 3: Install Git Hooks

python3 <skill-path>/scripts/install_hook.py install --hook-type pre-commit

Or for pre-push:

python3 <skill-path>/scripts/install_hook.py install --hook-type pre-push

Step 4: Verify Installation

# Run manual review
python3 <skill-path>/scripts/run_review.py --project-root .

# If successful, try a commit
git add .
git commit -m "test commit"

Creating Rules

Rule File Format

Rules are Markdown files with YAML frontmatter. See references/rule_format.md for complete specification.

Basic structure:

---
id: unique-rule-id
keywords: ["keyword1", "keyword2"]
file_patterns: ["*.py", "src/**/*.js"]
priority: high | medium | low
description: Brief one-line description
---
# Rule Title

## Specification

Detailed explanation...

## Checklist

- Check item 1
- Check item 2

## Positive Examples

Good code


## Negative Examples

Bad code

Rule Matching Logic

A rule triggers if either condition is met:

  1. File pattern match: Changed file matches a pattern in file_patterns
  2. Keyword match: Keyword appears in diff content

Both use OR logic - either triggers the rule.

Creating a New Rule

  1. Create .ai-reviewer/rules/your-rule.md
  2. Add frontmatter with id, keywords, file_patterns, priority, description
  3. Add sections: Specification, Checklist
  4. Optionally add: Positive Examples, Negative Examples
  5. Test by running review on sample code

Example:

---
id: no-todo-comments
keywords: ["TODO", "FIXME", "HACK"]
file_patterns: ["*.py", "*.js", "*.ts"]
priority: medium
description: No TODO comments in production code
---
# No TODO Comments

## Specification

TODO comments should not be committed. Fix the issue or create a ticket.

## Checklist

- No TODO comments present
- No FIXME comments present
- No HACK comments present

## Negative Examples

TODO: Refactor this later

def bad_example(): pass

Configuration

Review Modes

Block mode (strict):

review_mode: block

Blocks commit if violations found. Use --no-verify to bypass.

Warn mode (permissive):

review_mode: warn

Shows warnings but allows commit.

Advisory mode (informational):

review_mode: advisory

Runs review but never blocks.

AI Backend

Claude API (recommended, faster):

ai_backend: claude-api
claude_api_key: "sk-ant-api03-..."
model: claude-sonnet-4-5-20250929
max_tokens: 4096

Requires API key. Set via config or ANTHROPIC_API_KEY env var.

Claude CLI (slower, no API key needed):

ai_backend: claude-cli

Requires: npm install -g @anthropic-ai/claude-cli

Skip Patterns

Exclude generated/vendor files:

skip_patterns:
  - "*.min.js"
  - "vendor/**"
  - "node_modules/**"
  - "*.pb.go"

See references/config_format.md for complete configuration reference.

Managing Git Hooks

Install Hook

python3 <skill-path>/scripts/install_hook.py install --hook-type pre-commit

Uninstall Hook

python3 <skill-path>/scripts/install_hook.py uninstall --hook-type pre-commit

List Installed Hooks

ls -la .git/hooks/

Hook Location

Hooks are installed to .git/hooks/pre-commit or .git/hooks/pre-push.

The hooks automatically find the .ai-reviewer directory by searching upward from the current directory.

Running Reviews Manually

Review Staged Changes

python3 <skill-path>/scripts/run_review.py --project-root .

Test Rule Matching

python3 <skill-path>/scripts/load_rules.py .ai-reviewer/rules

Lists all rule metadata without running full review.

Troubleshooting

Review Not Running

Check hook installation:

ls -la .git/hooks/pre-commit

Check hook is executable:

chmod +x .git/hooks/pre-commit

Check.ai-reviewer directory exists:

ls -la .ai-reviewer/

API Errors

Missing API key:

export ANTHROPIC_API_KEY=sk-ant-api03-...

Or set in config.yaml.

Quota exceeded: Use ai_backend: claude-cli instead.

Rules Not Matching

Test metadata loading:

python3 <skill-path>/scripts/load_rules.py .ai-reviewer/rules

Check keywords and patterns:

  • Keywords are case-insensitive
  • File patterns use glob syntax (e.g., *.py, src/**/*.js)
  • Empty arrays skip that check

Large Diffs Skipped

If diff exceeds max_diff_size, review is skipped. Increase limit:

max_diff_size: 50000

Silent Failures

Enable debug logging:

log_level: debug
log_file: .ai-reviewer/review.log

Check the log file for detailed error messages.

Progressive Disclosure Design

This skill uses a two-stage loading pattern for token efficiency:

Stage 1: Metadata Loading

Loads only frontmatter from all rules:

  • id, keywords, file_patterns, priority, description
  • Fast operation, minimal token usage
  • Stored in load_rules.py as RuleMetadata

Stage 2: Rule Matching

Matches rules against diff using only metadata:

  • Keyword matching against diff content
  • File pattern matching against changed files
  • Returns only potentially applicable rules

Stage 3: Full Rule Loading

Loads complete rule details only for matched rules:

  • Specification, checklist, examples
  • Passed to AI for detailed review
  • Minimizes tokens sent to AI

Benefits:

  • Scales to hundreds of rules
  • Fast initial filtering
  • AI receives only relevant context
  • Efficient token usage

Resources

scripts/

  • install_hook.py: Install/uninstall git hooks python3 scripts/install_hook.py install --hook-type pre-commit
  • run_review.py: Main review workflow python3 scripts/run_review.py --project-root.
  • load_rules.py: Progressive rule loading and matching from load_rules import RuleLoader, RuleMetadata, FullRule

references/

  • rule_format.md: Complete rule file specification

- Frontmatter fields - Body sections - Matching logic - Best practices

  • config_format.md: Complete configuration reference

- All config fields - Review modes - AI backends - Environment variables

assets/

  • config.yaml: Configuration file template
  • rules/: Example rules

- error-handling.md: Proper exception handling - naming-convention.md: PEP 8 naming conventions

  • hooks/: Git hook templates

- pre-commit.template - pre-push.template

Best Practices

  1. Start Small: Begin with 2-3 core rules, expand gradually
  2. Specific Keywords: Choose unique keywords that indicate the rule's concern
  3. Real Examples: Use examples from your actual codebase
  4. Block Mode: Use review_mode: block for strict enforcement
  5. Team Adoption: Discuss rules with team, get consensus
  6. Rule Priority: Mark critical rules as priority: high
  7. Regular Updates: Review and update rules as codebase evolves
  8. Token Limits: Monitor AI usage, adjust max_tokens if needed

Advanced Usage

Custom Rule Categories

Organize rules by category using ID prefixes:

id: security-001
id: style-001
id: performance-001

Rule-Specific Prompts

Add custom AI instructions in specification:

## Specification

When reviewing this rule, pay special attention to edge cases involving...

Multi-Language Projects

Use file patterns to target specific languages:

file_patterns: ["*.py"]  # Python only
file_patterns: ["*.js", "*.ts"]  # JavaScript/TypeScript
file_patterns: ["*"]  # All files

CI/CD Integration

Add to CI pipeline:

- name: AI Code Review
  run: python3 scripts/run_review.py --project-root .

Limitations

  • Requires Python 3.7+
  • Git hooks run in project root context
  • Large diffs (>10k chars) are skipped by default
  • Claude API has rate limits (use CLI for unlimited reviews)
  • Rules use keyword/pattern matching (not AST-based)

平台分布

OpenCode

28.64%
按下载量换算33

Claude Code

25.08%
按下载量换算29

Cursor

17.86%
按下载量换算20

windsurf

13.52%
按下载量换算15

trae

7.37%
按下载量换算8

Codex

3.73%
按下载量换算4

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills