code-review
从固定点(commit、branch、tag 或 merge-base)开始,按 Standards(代码是否符合本仓库记录的编码标准?)和 Spec(代码是否符合来源 issue/PRD 的要求?)两个轴线审查变更。两个审查会在并行子代理中运行,并并排报告。适用于用户想审查 branch、PR、进行中的变更,或要求 “review since X” 时。
Security Assessment
About code-review
This skill (a Chinese-language translation of Matt Pocock's skills) performs a two-axis code review of the diff between a user-supplied fixed point (commit, branch, tag, or merge-base) and HEAD. The two axes are Standards (does the code follow the repository's documented coding standards?) and Spec (does the code faithfully implement the source issue/PRD/spec?). It solves the problem of one concern masking another: a change can pass standards while implementing the wrong thing, or match the issue exactly while breaking project conventions, so the two reviews run in parallel sub-agents and are reported side by side without merging.
The workflow pins the fixed point (validating that the ref resolves and the diff is non-empty via a three-dot `git diff` and `git log`), identifies the spec source from commit issue references, a passed path, or PRD files, and identifies standards sources such as CODING_STANDARDS.md or CONTRIBUTING.md. Beyond documented standards, the Standards axis always applies a fixed baseline of Fowler code smells (mysterious name, duplicated code, feature envy, data clumps, primitive obsession, repeated switches, shotgun surgery, divergent change, speculative generality, message chains, middle man, refused bequest), with the rule that documented repo standards override the baseline and that smells are judgement calls rather than hard violations. Two general-purpose sub-agents run with focused briefs, and the skill aggregates their findings under separate headings.
Target users are developers and AI agents who want to review a branch, PR, or in-progress change, or run a "review since X." The skill only reads diffs and specs and spawns review sub-agents; it makes no changes to the code.
FAQ
What are the two review axes?
Standards (does the code follow the repo's documented coding standards, plus a baseline of Fowler code smells) and Spec (does the code faithfully implement the source issue/PRD/spec). They run in parallel sub-agents and are reported separately.
How do I invoke it?
Ask to review a branch, PR, or in-progress change, or say 'review since X'. Any fixed point works: a commit SHA, branch name, tag, `main`, or `HEAD~5`. If none is given, the skill asks.
What happens if there is no spec?
The Spec sub-agent is skipped and the final report notes 'no spec available'; the Standards axis still runs against documented standards and the smell baseline.
Does it modify code?
No. It captures a three-dot git diff and commit list, validates the ref resolves and the diff is non-empty, and spawns read-only review sub-agents; it does not change the code.
How does it handle repo standards versus the smell baseline?
The documented repo standard always overrides — if it endorses something the baseline would flag, that smell is suppressed. Baseline smells are always judgement calls, and anything already enforced by tooling is skipped.
Install code-review
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
vinvcn/mattpocock-skills-zh-cn