review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReview
审查
Two-axis review of the diff between and a fixed point the user supplies:
HEAD- 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 if is missing.
/setup-matt-pocock-skillsdocs/agents/issue-tracker.md从用户指定的固定节点与之间的代码差异,进行双维度审查:
HEAD- 标准维度 —— 代码是否符合本仓库文档中规定的编码标准?
- 规格维度 —— 代码是否忠实地实现了源需求issue / PRD / 规格文档?
两个维度的审查由并行子Agent执行,避免互相干扰上下文,之后由本skill汇总审查结果。
系统应已提供问题追踪器——如果缺少,请执行。
docs/agents/issue-tracker.md/setup-matt-pocock-skillsProcess
流程
1. Pin the fixed point
1. 确定固定节点
Whatever the user said is the fixed point — a commit SHA, branch name, tag, , , etc. Don't be opinionated; pass it through. If they didn't specify one, ask: "Review against what — a branch, a commit, or ?" Don't proceed until you have it.
mainHEAD~5mainCapture the diff command once: (three-dot, so the comparison is against the merge-base). Also note the list of commits via .
git diff <fixed-point>...HEADgit log <fixed-point>..HEAD --oneline用户指定的任意内容均可作为固定节点——commit哈希值、分支名、tag、、等。无需主观判断,直接使用用户指定的内容。如果用户未指定,请询问:“请指定审查基准——分支、commit还是?”在获取到基准前不要继续执行。
mainHEAD~5main一次性记录差异命令:(使用三个点,基于合并基准进行对比)。同时通过记录提交列表。
git diff <fixed-point>...HEADgit log <fixed-point>..HEAD --oneline2. Identify the spec source
2. 确定规格来源
Look for the originating spec, in this order:
- Issue references in the commit messages (,
#123, GitLabCloses #45, etc.) — fetch via the workflow in!67.docs/agents/issue-tracker.md - A path the user passed as an argument.
- A PRD/spec file under ,
docs/, orspecs/matching the branch name or feature..scratch/ - 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".
按以下顺序查找源规格文档:
- 提交信息中的issue引用(如、
#123、GitLab的Closes #45等)——通过!67中的工作流获取内容。docs/agents/issue-tracker.md - 用户作为参数传入的路径。
- 位于、
docs/或specs/目录下,与分支名或功能匹配的PRD/规格文件。.scratch/ - 如果未找到任何内容,请询问用户规格文档的位置。如果用户表示不存在规格文档,则规格维度的子Agent将跳过审查,并报告“无可用规格文档”。
3. Identify the standards sources
3. 确定标准来源
Anything in the repo that documents how code should be written. Common locations:
- ,
CLAUDE.mdAGENTS.md CONTRIBUTING.md- ,
CONTEXT.md, per-contextCONTEXT-MAP.mdfilesCONTEXT.md - (architectural decisions are standards)
docs/adr/ - ,
.editorconfig,eslint.config.*,biome.json,prettier.config.*(machine-enforced standards — note them but don't re-check what tooling already checks)tsconfig.json - Any ,
STYLE.md,STANDARDS.md, or similar at the repo root or underSTYLEGUIDE.mddocs/
Collect the list of files. The Standards sub-agent will read them.
仓库中所有记录代码编写规范的文档。常见位置包括:
- 、
CLAUDE.mdAGENTS.md CONTRIBUTING.md- 、
CONTEXT.md、各上下文对应的CONTEXT-MAP.md文件CONTEXT.md - (架构决策属于标准范畴)
docs/adr/ - 、
.editorconfig、eslint.config.*、biome.json、prettier.config.*(机器强制执行的标准——只需记录,无需重复检查工具已覆盖的内容)tsconfig.json - 仓库根目录或目录下的任何
docs/、STYLE.md、STANDARDS.md或类似文件STYLEGUIDE.md
收集这些文件列表,标准维度的子Agent将读取这些文件。
4. Spawn both sub-agents in parallel
4. 并行启动两个子Agent
Send a single message with two tool calls. Use the subagent for both.
Agentgeneral-purposeStandards 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.
发送一条包含两个工具调用的消息。两者均使用子Agent。
Agentgeneral-purpose标准子Agent提示词——需包含:
- 完整的差异命令和提交列表。
- 步骤3中找到的标准源文件列表。
- 任务说明:“阅读标准文档,然后查看代码差异。针对相关的每个文件/代码块,报告所有差异违反文档标准的地方。引用对应的标准(文件+规则)。区分硬性违规和主观判断项。跳过工具已强制执行的内容。字数控制在400字以内。”
规格子Agent提示词——需包含:
- 差异命令和提交列表。
- 规格文档的路径或获取到的内容。
- 任务说明:“阅读规格文档,然后查看代码差异。报告:(a) 规格文档要求但未实现或部分实现的需求;(b) 代码差异中存在但规格未要求的内容(范围蔓延);(c) 看起来已实现但存在错误的需求。每项发现需引用规格文档的对应行。字数控制在400字以内。”
如果缺少规格文档,则跳过规格子Agent,并在最终报告中注明这一点。
5. Aggregate
5. 汇总结果
Present the two reports under and headings, verbatim or lightly cleaned. Do not merge or rerank findings — the two axes are deliberately separate so the user can see them independently.
## Standards## SpecEnd 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.
代码变更可能通过其中一个维度但未通过另一个:
- 完全符合标准但实现了错误功能的代码 → 标准维度通过,规格维度未通过。
- 完全符合issue要求但违反项目约定的代码 → 规格维度通过,标准维度未通过。
分开报告可避免一个维度的结果掩盖另一个维度的问题。