← 返回 Skills 市场
xonet1

code-review-assistant

作者 xonet1 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
163
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cody
功能描述
代码 Review 助手。分析 Git diff 或代码片段,输出结构化中文 Review 报告,覆盖 Bug、安全漏洞、性能问题、可读性、最佳实践、类型安全、错误处理、测试覆盖。支持严格程度配置(信息/优化/标准/严重)和多种主流语言(Python/JS/TS/Java/Go/Rust)。支持 GitHub/G...
使用说明 (SKILL.md)

代码 Review 助手

工作流程

第一步:获取代码

按优先级尝试以下方式:

  1. PR diff(最高优先级):运行 scripts/get_pr_diff.py,支持 GitHub/GitLab
  2. Git diff:运行 scripts/get_diff.py 获取本地变更
  3. 用户粘贴:直接分析用户提供的代码片段或 diff 文本
  4. 指定文件:读取用户指定的文件内容

第二步:确认严格程度

若用户未指定,默认使用标准模式

模式 触发词 检查范围
🔵 信息 快速 review、简单看看 命名规范、注释完整性
🟢 优化 -(默认最低) 可读性问题、最佳实践
🟡 建议 标准 review + 性能问题、明显 Bug
🔴 严重 严格模式、PR review + 安全漏洞、严重 Bug

详见 references/severity-guide.md

第三步:执行分析

按以下维度检查,详细规则见 references/review-dimensions.md

  • 🐛 潜在 Bug — 空指针、越界、异常处理、类型错误
  • 🔒 安全问题 — SQL 注入、XSS、硬编码密钥、权限校验
  • 性能问题 — N+1 查询、不必要循环、低效数据结构
  • 📖 可读性 — 过长函数、魔法数字、晦涩命名
  • 最佳实践 — DRY 原则、错误处理一致性
  • 🧪 类型安全 — 类型注解、隐式转换
  • 🛡️ 错误处理 — 异常捕获、返回值校验
  • 🧪 测试覆盖 — 关键逻辑缺少测试提示

第四步:语言特定规则

根据代码语言加载对应规则:references/languages/ 目录下包含:

  • python.md — Python 特定检查
  • javascript.md — JavaScript/TypeScript 检查
  • go.md — Go 语言检查
  • java.md — Java 检查
  • rust.md — Rust 检查

第五步:输出报告

支持三种格式,默认 Markdown:

  • Markdown(默认):适合直接阅读和分享
  • JSON:适合 CI 集成和二次处理,使用 --format json
  • HTML:适合生成可分享的报告,使用 --format html

输出模板见 references/report-template.md

快速参考

用户说 对应操作
"review 最近的提交" get_diff.py --commits HEAD~1
"review 和 main 的差异" get_diff.py --branch main
"review GitHub PR #123" get_pr_diff.py --provider github --pr 123
"严格模式 review" 启用 🔴 严重模式
"快速看看" 启用 🔵 信息模式
"输出 JSON" 使用 JSON 模板
"生成 HTML 报告" 使用 HTML 模板

注意事项

  • 优先给出可操作的改进建议,不只是指出问题
  • 每条意见附带具体行号(如能定位)
  • 中文输出,技术术语保留英文原词
  • 若 diff 超过 500 行,按文件分批处理,每批处理完询问是否继续
  • 使用语言特定规则时,先识别代码语言再加载对应检查项
安全使用建议
This skill appears to do what it says: fetch diffs and produce structured code-review reports. Before using it, consider: (1) Only provide GITHUB_TOKEN/GITLAB_TOKEN when necessary and prefer least-privilege / read-only tokens. (2) Avoid asking the skill to read or send files that contain secrets (keys, credentials) unless you intend to expose them. (3) The helper scripts use your local git repo and network calls to GitHub/GitLab — run them in a safe working directory and review output before sharing externally. (4) There is no installer or hidden network endpoint in the package; the main remaining risk is accidental exposure of repository contents if you request broad diffs or files.
功能分析
Type: OpenClaw Skill Name: cody Version: 1.0.0 The bundle is a legitimate code review assistant designed to analyze Git diffs and pull requests. It includes functional Python scripts (scripts/get_diff.py and scripts/get_pr_diff.py) that use standard Git commands and GitHub/GitLab APIs to retrieve code changes for analysis. The scripts handle authentication tokens via environment variables securely and do not exhibit signs of data exfiltration, shell injection, or malicious intent. The documentation and instructions in SKILL.md are well-structured and strictly aligned with the tool's stated purpose of providing multi-language code quality and security reviews.
能力评估
Purpose & Capability
Name/description match the included files: SKILL.md describes code-review behavior and the repository provides get_diff.py and get_pr_diff.py plus language/rule references. The optional use of GITHUB_TOKEN / GITLAB_TOKEN in get_pr_diff.py is appropriate for fetching PR/MR diffs.
Instruction Scope
Runtime instructions are scoped to obtaining diffs (local git, PRs via API, or user-pasted snippets) and running language-specific checks. One attention point: the skill will read repository files or any file the user explicitly asks it to (via '--file' or '指定文件'), so sensitive files in the repo could be exposed if you request them — this is expected behavior for a review tool but worth being cautious about.
Install Mechanism
No install spec; this is an instruction-only skill with included Python helper scripts. Nothing downloads or extracts remote code or installs packages, so installation risk is low.
Credentials
The skill does not declare required env vars. get_pr_diff.py optionally reads GITHUB_TOKEN and GITLAB_TOKEN to access private PRs/MRs — these are directly relevant and proportionate to the described capability. No unrelated secrets or configuration paths are requested.
Persistence & Privilege
always is false and the skill has no install-time hooks or requests for permanent agent-wide privileges. It does not modify other skills or system-wide config.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cody
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cody 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release with comprehensive code review capabilities: - 分析 Git diff 或代码片段,输出结构化中文 Review 报告,覆盖 Bug、安全、性能、可读性、最佳实践、类型安全、错误处理、测试覆盖等多维度 - 支持严格程度配置(信息/优化/标准/严重),涵盖多种主流编程语言(Python/JavaScript/TypeScript/Java/Go/Rust) - Source 支持 GitHub/GitLab PR diff、本地 Git diff、直接粘贴或文件读取 - 报告支持 Markdown、JSON、HTML 输出格式,方便阅读、分享及集成 - 专为提效代码审查场景设计,快速识别并给出可操作建议
元数据
Slug cody
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

code-review-assistant 是什么?

代码 Review 助手。分析 Git diff 或代码片段,输出结构化中文 Review 报告,覆盖 Bug、安全漏洞、性能问题、可读性、最佳实践、类型安全、错误处理、测试覆盖。支持严格程度配置(信息/优化/标准/严重)和多种主流语言(Python/JS/TS/Java/Go/Rust)。支持 GitHub/G... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 163 次。

如何安装 code-review-assistant?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cody」即可一键安装,无需额外配置。

code-review-assistant 是免费的吗?

是的,code-review-assistant 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

code-review-assistant 支持哪些平台?

code-review-assistant 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 code-review-assistant?

由 xonet1(@xonet1)开发并维护,当前版本 v1.0.0。

💬 留言讨论