← 返回 Skills 市场
easy-code-review
作者
yanghao-smile
· GitHub ↗
· v1.0.0
· MIT-0
300
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install easy-code-review
功能描述
AI代码审核助手,自动审查AI修改的代码,检查是否符合原始需求、是否存在非必要修改
使用说明 (SKILL.md)
\r \r
AI代码审核助手 (Code Review Assistant)\r
\r
触发场景\r
\r 当用户请求以下任务时,自动激活此技能:\r
- 用户说"审核代码"、"检查代码修改"、"review代码"等关键词\r
- 用户要求验证AI修改是否符合需求\r
- 用户要求检查是否存在非必要文件修改\r
- 用户提供了需求描述和修改后的代码,要求对比验证\r \r
核心能力\r
\r 本技能赋予小龙虾以下代码审核能力:\r \r
1. 需求符合性检查\r
\r 执行逻辑:\r
- 解析用户的原始需求描述,提取关键要点:\r
- 功能性需求(要实现什么功能)\r
- 技术约束(使用的框架、库、版本等)\r
- 业务规则(业务逻辑要求)\r
- 性能要求(如有)\r \r
- 对比分析修改内容:\r
- 检查每个修改点是否直接服务于需求\r
- 标记与需求无关的代码修改\r
- 识别过度设计或不必要的复杂性\r \r
- 输出符合性报告:\r
- ✅ 符合需求:列出直接对应需求的修改\r
- ⚠️ 部分相关:列出可能相关但非必需的修改\r
- ❌ 无关修改:列出与需求无关的修改\r \r 检查清单模板:\r
## 需求符合性检查报告\r
\r
### 原始需求\r
{用户描述的需求}\r
\r
### 关键要点提取\r
- 功能点1: {描述}\r
- 功能点2: {描述}\r
- 技术约束: {描述}\r
\r
### 修改分析\r
| 修改文件 | 修改内容 | 符合性 | 说明 |\r
|---------|---------|-------|------|\r
| {文件} | {简述} | ✅/⚠️/❌ | {原因} |\r
\r
### 总体评估\r
- 符合度评分: X/10\r
- 建议: {改进建议}\r
```\r
\r
### 2. 非必要文件修改检查\r
\r
**执行逻辑:**\r
1. 获取本次修改涉及的文件列表(通过git diff或用户提供)\r
2. 对每个文件进行必要性评估:\r
- 是否为需求直接涉及的模块\r
- 是否为配置文件(检查是否有必要改动)\r
- 是否为测试文件(检查是否合理)\r
- 是否为文档文件(检查是否相关)\r
\r
3. 识别风险修改:\r
- 修改了不相关的核心文件\r
- 大规模重构但需求很小\r
- 修改了依赖版本配置\r
- 修改了构建配置文件\r
\r
**警告级别:**\r
- 🔴 高风险:修改了与需求无关的核心业务文件\r
- 🟡 中风险:修改了配置文件或依赖\r
- 🟢 低风险:仅修改相关文件\r
\r
**检查报告模板:**\r
```markdown\r
## 非必要修改检查报告\r
\r
### 修改文件统计\r
- 总修改文件数: X\r
- 必要修改: X 个文件\r
- 可疑修改: X 个文件\r
- 不必要修改: X 个文件\r
\r
### 详细分析\r
\r
#### ✅ 必要修改\r
{文件列表及原因}\r
\r
#### ⚠️ 可疑修改\r
{文件列表及风险说明}\r
\r
#### ❌ 不必要修改\r
{文件列表及建议处理方式}\r
\r
### 风险评估\r
- 风险等级: 🔴/🟡/🟢\r
- 建议: {具体建议}\r
```\r
\r
### 3. 代码质量检查\r
\r
**检查项:**\r
- 代码风格一致性\r
- 是否存在硬编码\r
- 是否有足够的注释\r
- 变量命名规范性\r
- 潜在的性能问题\r
- 安全漏洞风险\r
\r
### 4. 变更影响分析\r
\r
**分析内容:**\r
- 修改的影响范围\r
- 是否会影响现有功能\r
- 是否需要数据库迁移\r
- 是否需要配置更新\r
\r
## 执行流程\r
\r
```\r
用户请求审核\r
↓\r
解析需求描述\r
↓\r
获取代码变更信息\r
↓\r
┌─────────────┬─────────────┬─────────────┐\r
│ 需求符合性 │ 非必要修改 │ 代码质量 │\r
│ 检查 │ 检查 │ 检查 │\r
└─────────────┴─────────────┴─────────────┘\r
↓\r
生成综合审核报告\r
↓\r
提供改进建议\r
```\r
\r
## 使用示例\r
\r
### 示例1:基本使用\r
\r
**用户输入:**\r
```\r
审核一下这段代码修改是否符合需求。\r
\r
需求:添加用户登录功能,要求:\r
1. 支持用户名密码登录\r
2. 登录成功后返回token\r
3. 记录登录日志\r
\r
修改的文件:\r
- src/auth/login.ts\r
- src/models/user.ts\r
- package.json\r
- tsconfig.json\r
```\r
\r
**小龙虾响应:**\r
将按照检查流程,分析每个文件修改的必要性,输出详细的审核报告。\r
\r
### 示例2:Git变更审核\r
\r
**用户输入:**\r
```\r
帮我review一下最近的git commit,检查是否有不必要的修改\r
```\r
\r
**小龙虾响应:**\r
将执行 `git diff` 或 `git show` 获取变更,然后进行审核分析。\r
\r
## 异常处理\r
\r
1. **无法获取变更信息**\r
- 提示用户提供变更文件列表或diff内容\r
- 指导用户使用git命令获取变更\r
\r
2. **需求描述不清晰**\r
- 引导用户补充需求细节\r
- 基于代码变更反推可能的意图并确认\r
\r
3. **文件无法访问**\r
- 提示用户确认文件路径\r
- 建议用户提供文件内容\r
\r
## 配置选项\r
\r
用户可通过以下方式自定义审核行为:\r
\r
```yaml\r
# .claw/review-config.yaml\r
review:\r
strictness: normal # strict | normal | loose\r
focus_areas:\r
- requirement_alignment\r
- unnecessary_changes\r
- code_quality\r
ignore_patterns:\r
- "*.test.ts"\r
- "*.spec.js"\r
custom_rules:\r
- "不允许修改.env文件"\r
- "配置文件修改需要确认"\r
```\r
\r
## 输出格式\r
\r
审核报告支持多种格式:\r
- **Markdown**(默认):适合在聊天中展示\r
- **JSON**:适合程序处理\r
- **HTML**:适合生成报告页面\r
\r
## 技能依赖\r
\r
- OpenClaw核心能力(文件读写、命令执行)\r
- Git工具(用于获取代码变更)\r
- 代码分析能力(AST解析等)\r
\r
## 更新日志\r
\r
### v1.0.0 (2026-03-11)\r
- 初始版本发布\r
- 支持需求符合性检查\r
- 支持非必要修改检测\r
- 支持代码质量基础检查\r
\r
## 反馈与贡献\r
\r
如有问题或建议,请访问:https://github.com/openclaw/easy-code-review/issues\r
安全使用建议
This skill appears to do what it says: analyze git diffs and produce review reports. Before installing: (1) review the included scripts (scripts/analyze_changes.py) yourself to confirm behavior; (2) be aware that granting file.read and git.read gives the skill access to your repository files — avoid running it against repos with secrets unless you trust the environment; (3) if you don't want automatic runs, avoid adding the suggested pre-commit hook or CI integration, or limit those integrations to non-sensitive branches; (4) run the analyzer locally first (python scripts/analyze_changes.py) to see sample outputs; (5) if you are in a shared/CI environment with injected secrets, ensure the skill's outputs/reports won't expose them. Overall the package is coherent and proportionate to its stated purpose.
功能分析
Type: OpenClaw Skill
Name: easy-code-review
Version: 1.0.0
The 'easy-code-review' skill is a legitimate tool designed to assist in code reviews by analyzing Git changes against user requirements. The core logic in 'scripts/analyze_changes.py' safely uses subprocess calls to execute standard git commands (diff, show) without shell interpolation, and the requested permissions (file.read, file.write, git.read) are consistent with its stated purpose of analyzing code and potentially saving reports or applying fixes. No evidence of data exfiltration, malicious prompt injection, or unauthorized execution was found.
能力评估
Purpose & Capability
Name/description match the behavior: SKILL.md and analyze_changes.py focus on parsing git diffs, classifying file types, and producing review reports. Declared permissions (file.read, file.write, git.read) and the optional Python helper script are appropriate for a code-review skill.
Instruction Scope
Runtime instructions explicitly describe using git diff/git show and analyzing provided diffs or staged changes. The skill does not instruct reading unrelated system paths or environment variables; it only references project files and git state. The SKILL.md includes examples (pre-commit hook, CI) that would invoke the skill automatically if the user installs those integrations, but those are user-provided integration steps, not hidden behavior.
Install Mechanism
There is no install spec (instruction-only skill) and the included Python script is local. No external downloads, URL shorteners, or extraction steps are present. README/CI examples mention installing OpenClaw (curl) but that is an example for the environment, not a skill-provided installer.
Credentials
The skill requests no environment variables or external credentials. The only runtime requirements are access to the repository (git) and file read/write, which are proportional to reviewing code. The script uses subprocess to run git commands — expected for its purpose.
Persistence & Privilege
always:false and no self-modifying behavior are present. However, documentation includes pre-commit hook and CI examples that, if installed by the user, will cause the skill to run automatically in those contexts; consider that enabling such integrations increases its runtime frequency and access to repo contents.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install easy-code-review - 安装完成后,直接呼叫该 Skill 的名称或使用
/easy-code-review触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
easy-code-review v1.0.0
- Initial release of the AI code review assistant skill.
- Supports requirement alignment checks for AI-modified code.
- Detects unnecessary file changes and flags risk levels.
- Provides basic code quality checks (style, naming, comments, risks).
- Generates detailed review reports in Markdown, JSON, or HTML.
- Offers configurable review rules and behaviors.
元数据
常见问题
easy-code-review 是什么?
AI代码审核助手,自动审查AI修改的代码,检查是否符合原始需求、是否存在非必要修改. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 300 次。
如何安装 easy-code-review?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install easy-code-review」即可一键安装,无需额外配置。
easy-code-review 是免费的吗?
是的,easy-code-review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
easy-code-review 支持哪些平台?
easy-code-review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 easy-code-review?
由 yanghao-smile(@yanghao-smile)开发并维护,当前版本 v1.0.0。
推荐 Skills