自动化代码审查助手,支持 PR 审查、代码质量分析、潜在 bug 检测、安全漏洞扫描。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install code-review-assistant或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install code-review-assistant⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/code-review-assistant/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: code-review-assistant description: 自动化代码审查助手,支持 PR 审查、代码质量分析、潜在 bug 检测、安全漏洞扫描。 metadata: {"clawdbot":{"emoji":"🔍","requires":{},"primaryEnv":""}} ---
自动化代码审查助手,帮助开发者快速审查代码,提高代码质量。
| 语言 | 支持 | |------|------| | JavaScript/TypeScript | ✅ | | Python | ✅ | | Go | ✅ | | Rust | ✅ | | Java | ✅ | | C/C++ | ✅ |
code-review-assistant review path/to/file.js
# 指定语言
code-review-assistant review path/to/file.py --language python
# 审查当前的 git diff
code-review-assistant diff
# 审查特定分支
code-review-assistant diff main..feature-branch
code-review-assistant pr --owner username --repo reponame --pr-number 123
# Code Review Report
## File: src/utils.js
### Issues Found: 3
#### 🔴 High Priority (1)
1. **Line 45: Potential SQL Injection**
```javascript
const query = `SELECT * FROM users WHERE id = ${userId}`;
```
→ Use parameterized queries instead
#### 🟡 Medium Priority (2)
2. **Line 23: Missing Error Handling**
```javascript
const data = JSON.parse(response);
```
→ Add try-catch block
3. **Line 67: Hardcoded API Key**
```javascript
const API_KEY = "sk-1234567890";
```
→ Use environment variables
#### 🟢 Suggestions (5)
- Consider using const instead of let
- Add JSDoc comments
- Extract function at line 100
- ...
---
### Summary
| Category | Count |
|----------|-------|
| Security | 1 |
| Performance | 0 |
| Best Practices | 3 |
| Code Style | 2 |
**Recommendation**: Fix high priority issues before merging
# 启用/禁用特定规则
code-review-assistant config --enable security,performance --disable style
# 设置严重级别
code-review-assistant config --severity high
创建 .codereviewignore 文件:
# Ignore node_modules
node_modules/
# Ignore build output
dist/
build/
# 无需额外依赖
# 使用内置代码分析
name: Code Review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Code Review
run: |
code-review-assistant review . --output report.md
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: code-review-report
path: report.md
安装 Code Review Assistant 后,可以对 AI 说这些话来触发它
Help me get started with Code Review Assistant
Explains what Code Review Assistant does, walks through the setup, and runs a quick demo based on your current project
Use Code Review Assistant to automated code review assistant that supports PR review, code quali...
Invokes Code Review Assistant with the right parameters and returns the result directly in the conversation
What can I do with Code Review Assistant in my developer & devops workflow?
Lists the top use cases for Code Review Assistant, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/code-review-assistant/ 目录(个人级,所有项目可用),或 .claude/skills/code-review-assistant/(项目级)。重启 AI 客户端后,用 /code-review-assistant 主动调用,或让 AI 根据上下文自动发现并使用。
Code Review Assistant 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Code Review Assistant 可免费安装使用。请查阅仓库了解许可证信息。
自动化代码审查助手,支持 PR 审查、代码质量分析、潜在 bug 检测、安全漏洞扫描。
Code Review Assistant 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Code Review Assistant
Identifies repetitive steps in your workflow and sets up Code Review Assistant to handle them automatically