# 多维代码审查 (code-review-and-quality)

> 从正确性、可读性、架构、安全和性能五个维度审查代码改动，并为每条意见标注严重程度。

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

## 核心规则

只要改动确实提升了整体代码健康度，即使不完美也应批准。

## 执行阶段

1. **理解上下文** — 看代码前先弄清改动目的、对应的需求或任务，以及预期的行为变化。
2. **先看测试** — 检查测试是否覆盖行为和边界情况；反转一个条件运行测试再恢复文件，仍通过则说明缺测试。
3. **五维审查实现** — 逐个文件按五个维度检查，指出结构问题时给出具体的重构方案。
4. **标注严重程度** — 用 Critical、Nit、Optional、FYI 或无前缀标注意见，先写正确性和安全问题。
5. **核查验证情况** — 确认运行过哪些测试、构建是否通过、是否手动验证；列出无用代码并在删除前询问。

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

| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 部分需要 | 仅为变异实验临时修改条件并从副本恢复；删除无用代码前需征得同意。 |
| 命令执行 | 部分需要 | 运行测试套件和构建，用于验证改动和变异实验。 |
| 网络外发 | 不需要 | 审查流程本身不需要访问网络。 |

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

```yaml
---
name: code-review-and-quality
description: Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.
---
```

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