code-reviewcommit 7739eaeSKILL.md · 代码评审
双轴代码审查
从指定基点起审查代码改动,分别检查是否符合仓库编码规范、是否实现了原始需求。
npx skills add mattpocock/skills --skill code-review已选中命令,请手动复制。
- 权限
- read-repo
- write-files
- shell
- network
- 兼容工具
- Claude Code, Codex, Copilot, Gemini CLI
- GitHub
- 308.7k
- 来源
- 社区 · Matt Pocock
- 状态
- 扫描通过
- 许可证
- MIT
- 分类
- 代码评审
核心规则
规范和需求两条审查结果分开呈现,不合并、不跨轴重新排序。
执行阶段
阶段 01确定基点
确认用户给出的提交、分支或标签可以解析且 diff 非空,然后记下 git diff 和 git log 命令。
阶段 02找到需求来源
依次查找提交信息中引用的 issue、用户给出的路径、docs/ 或 specs/ 下的文件,都没有则询问用户。
阶段 03收集编码规范
找出仓库中所有编码规范文件,并附上一组 Fowler 代码坏味道作为基线;仓库规范优先于基线。
阶段 04并行派发子代理
同时启动规范和需求两个子代理,各自使用全新上下文,报告控制在 400 词以内。
阶段 05汇总报告
在 Standards 和 Spec 两个标题下分别呈现结果,最后用一行总结各轴的问题数和最严重问题。
权限说明(据 SKILL.md 整理)
| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 不需要 | 只输出审查报告,不修改代码。 |
| 命令执行 | 部分需要 | 运行 git rev-parse、git diff、git log 获取改动和提交列表。 |
| 网络外发 | 部分需要 | 仅按 issue 跟踪器文档中的流程获取提交里引用的 issue。 |
SKILL.md 头部信息(YAML)
---
name: code-review
description: "Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\"."
---相关技能
规则扫描无法覆盖所有风险,安装前请阅读此技能的 SKILL.md,确认权限后再使用。