review
- 信任分
- 88/100
- 兼容 Agent
- 1
- 领域
- 工程开发
- 兼容 Agent
- Claude Code
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @mattpocock · 未声明 license
- 安装命令数
- 1 条
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
想读作者英文原文? ↓ 滚到正文区切换 · 在 GitHub 查看 ↗
review-mattpocock 是 Matt Pocock 团队的双轴 review——同一份 diff 里同时跑两个独立子 agent:Standards 看是否符合本仓库文档化的编码规范,Spec 看是否忠实实现了发起 issue / PRD / spec。两者在不同 context 中并行,避免互相污染,最后由本 skill 汇总。
设计思路
作者认为 review 失败最常见的原因是「reviewer 一脑子装了 standards 和 spec,结果两边都没看仔细」。把它拆成两个 sub-agent,各自只看自己那一面:standards agent 只读规范文档与 diff、spec agent 只读 spec 与 diff,互不干扰,最终汇报时就能清楚区分「不符合 style」与「没满足需求」。
工作流
① Pin the fixed point — 接收用户给的 SHA / branch / tag / main / HEAD~5,捕获 git diff <fixed-point>...HEAD(三点 diff = merge-base 比较)+ git log;② Identify spec source — 按提交消息里的 #123 / Closes #45 / GitLab !67(用 docs/agents/issue-tracker.md 抓),其次用户给的路径,再次 docs/ / specs/ / .scratch/ 下匹配分支名的文件,都没有就问;③ Identify standards sources — 收 CLAUDE.md / AGENTS.md / CONTRIBUTING.md / CONTEXT.md / docs/adr/ / STYLE.md 等;机器可执行的(eslint.config / biome.json / tsconfig.json)记下但不重复检查;④ 单条消息里一次性发 2 个 Agent 调用并行跑两个 sub-agent。
适合谁
- 用 Matt Pocock 团队 ai-hero / TS 课程类 monorepo 的开发者
- 已经把 standards 文档与 issue tracker 接好的项目
- 想把「规范偏移」与「需求偏移」分别归责的 PR review 流
何时不要用
- 仓库没有任何 standards 文档或 spec:spec sub-agent 会回 "no spec available"——不如用更轻量的
review - 想让 review 与实现在同一 context 里来回讨论:两轴并行不适合
配套
setup-matt-pocock-skills(先把 docs/agents/issue-tracker.md 准备好)、requesting-code-review(gstack 体系的 review 入口)、scaffold-exercises(同体系的练习骨架技能)。
Review
Two-axis review of the diff between HEAD and a fixed point the user supplies:
- Standards — does the code conform to this repo's documented coding standards?
- Spec — does the code faithfully implement the originating issue / PRD / spec?
Both axes run as parallel sub-agents so they don't pollute each other's context, then this skill aggregates their findings.
The issue tracker should have been provided to you — run /setup-matt-pocock-skills if docs/agents/issue-tracker.md is missing.
Process
1. Pin the fixed point
Whatever the user said is the fixed point — a commit SHA, branch name, tag, main, HEAD~5, etc. Don't be opinionated; pass it through. If they didn't specify one, ask: "Review against what — a branch, a commit, or main?" Don't proceed until you have it.
Capture the diff command once: git diff <fixed-point>...HEAD (three-dot, so the comparison is against the merge-base). Also note the list of commits via git log <fixed-point>..HEAD --oneline.
2. Identify the spec source
Look for the originating spec, in this order:
- Issue references in the commit messages (
#123,Closes #45, GitLab!67, etc.) — fetch via the workflow indocs/agents/issue-tracker.md. - A path the user passed as an argument.
- A PRD/spec file under
docs/,specs/, or.scratch/matching the branch name or feature. - If nothing is found, ask the user where the spec is. If they say there isn't one, the Spec sub-agent will skip and report "no spec available".
3. Identify the standards sources
Anything in the repo that documents how code should be written. Common locations:
CLAUDE.md,AGENTS.mdCONTRIBUTING.mdCONTEXT.md,CONTEXT-MAP.md, per-contextCONTEXT.mdfilesdocs/adr/(architectural decisions are standards).editorconfig,eslint.config.*,biome.json,prettier.config.*,tsconfig.json(machine-enforced standards — note them but don't re-check what tooling already checks)- Any
STYLE.md,STANDARDS.md,STYLEGUIDE.md, or similar at the repo root or underdocs/
Collect the list of files. The Standards sub-agent will read them.
4. Spawn both sub-agents in parallel
Send a single message with two Agent tool calls. Use the general-purpose subagent for both.
Standards sub-agent prompt — include:
- The full diff command and commit list.
- The list of standards-source files you found in step 3.
- The brief: "Read the standards docs. Then read the diff. Report — per file/hunk where relevant — every place the diff violates a documented standard. Cite the standard (file + the rule). Distinguish hard violations from judgement calls. Skip anything tooling enforces. Under 400 words."
Spec sub-agent prompt — include:
- The diff command and commit list.
- The path or fetched contents of the spec.
- The brief: "Read the spec. Then read the diff. Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
If the spec is missing, skip the Spec sub-agent and note this in the final report.
5. Aggregate
Present the two reports under ## Standards and ## Spec headings, verbatim or lightly cleaned. Do not merge or rerank findings — the two axes are deliberately separate so the user can see them independently.
End with a one-line summary: total findings per axis, and the worst single issue (if any) flagged.
Why two axes
A change can pass one axis and fail the other:
- Code that follows every standard but implements the wrong thing → Standards pass, Spec fail.
- Code that does exactly what the issue asked but breaks the project's conventions → Spec pass, Standards fail.
Reporting them separately stops one axis from masking the other.