# 双轴代码审查 (code-review)

> 从指定基点起审查代码改动，分别检查是否符合仓库编码规范、是否实现了原始需求。

- 分类: [代码评审](https://www.myskills.tools/zh/categories/code-review/)
- 来源: 社区 · Matt Pocock
- 代码仓库: https://github.com/mattpocock/skills/tree/main/skills/engineering/code-review (commit 7739eae)
- SKILL.md: https://github.com/mattpocock/skills/blob/main/skills/engineering/code-review/SKILL.md
- 安装命令: `npx skills add mattpocock/skills --skill code-review`
- 许可证: MIT
- 兼容工具: Claude Code, Codex, Copilot, Gemini CLI
- 权限: read-repo ✓, write-files ✗, shell ✓, network ✓
- 状态: 扫描通过
- 规则扫描无法覆盖所有风险，安装前请阅读此技能的 SKILL.md，确认权限后再使用。

## 核心规则

规范和需求两条审查结果分开呈现，不合并、不跨轴重新排序。

## 执行阶段

1. **确定基点** — 确认用户给出的提交、分支或标签可以解析且 diff 非空，然后记下 git diff 和 git log 命令。
2. **找到需求来源** — 依次查找提交信息中引用的 issue、用户给出的路径、docs/ 或 specs/ 下的文件，都没有则询问用户。
3. **收集编码规范** — 找出仓库中所有编码规范文件，并附上一组 Fowler 代码坏味道作为基线；仓库规范优先于基线。
4. **并行派发子代理** — 同时启动规范和需求两个子代理，各自使用全新上下文，报告控制在 400 词以内。
5. **汇总报告** — 在 Standards 和 Spec 两个标题下分别呈现结果，最后用一行总结各轴的问题数和最严重问题。

## 权限说明（据 SKILL.md 整理）

| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 不需要 | 只输出审查报告，不修改代码。 |
| 命令执行 | 部分需要 | 运行 git rev-parse、git diff、git log 获取改动和提交列表。 |
| 网络外发 | 部分需要 | 仅按 issue 跟踪器文档中的流程获取提交里引用的 issue。 |

## SKILL.md 头部信息（YAML）

```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\"."
---
```

首页: https://www.myskills.tools/zh/ · URL: https://www.myskills.tools/zh/skills/code-review/
