code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFive-axis code review
五维代码审查
Review against one fixed point. Keep the axes independent so strength in one
cannot hide failure in another:
HEAD- Standards: repository rules plus the heuristic smell baseline below.
- Spec: fidelity to the originating requirement.
- Performance: concrete regression risks, measured regressions, and consciously accepted performance trade-offs.
- Observability: fidelity to the repository's operational baseline.
- Accessibility: fidelity to the repository's accessibility baseline.
Each applicable axis gets an isolated reviewer. Aggregate their reports without
merging or globally reranking findings.
将 与一个固定基准点进行比较审查。保持各维度相互独立,避免某一维度的优势掩盖另一维度的失败:
HEAD- Standards:仓库规则以及下方的启发式坏味道基线。
- Spec:对原始需求的符合程度。
- Performance:具体的回归风险、实测的性能回归,以及有意识接受的性能权衡。
- Observability:对仓库运维基线的符合程度。
- Accessibility:对仓库无障碍基线的符合程度。
每个适用维度都交由一名使用独立上下文的审查者处理。汇总其报告时,不合并发现,也不对所有发现进行全局重新排序。
1. Pin the comparison
1. 锁定比较基准
Use the fixed point supplied by the user. Otherwise infer it from repository
evidence: prefer the pull request's base branch, then a documented target
branch, then the repository's default branch.
Use their merge-base with as the fixed point. If no target branch can be
identified, use ; for a root commit, use the empty tree. State the
inferred point and the evidence for choosing it in the review. Do not ask the
user to choose the comparison point.
HEADHEAD^Resolve it with , then capture these exact views once:
git rev-parse <fixed-point>text
git diff <fixed-point>...HEAD
git log <fixed-point>..HEAD --onelineThe three-dot diff compares with the merge-base. Stop on an invalid ref or an
empty diff.
HEAD使用用户提供的固定基准点。否则,根据仓库证据进行推断:优先使用 pull request 的基础分支,其次使用有文档记录的目标分支,最后使用仓库的默认分支。使用目标分支与 的 merge-base 作为固定基准点。如果无法识别目标分支,则使用 ;对于根提交,使用空树。在审查结果中说明推断出的基准点及其选择依据。不要要求用户选择比较点。
HEADHEAD^使用 解析该引用,然后一次性按原样捕获以下视图:
git rev-parse <fixed-point>text
git diff <fixed-point>...HEAD
git log <fixed-point>..HEAD --oneline三点 diff 将 与 merge-base 进行比较。遇到无效 ref 或空 diff 时停止。
HEAD2. Require repository configuration
2. 要求具备仓库配置
Read repository instructions first. Require all three sources:
docs/agents/issue-tracker.mdOBSERVABILITY.mdACCESSIBILITY.md
An explicit pointer in , , , or equivalent
repository documentation may replace any canonical path. The pointed-to document is
authoritative.
AGENTS.mdCLAUDE.mdCONTRIBUTING.mdIf any source is absent, stop before review dispatch, list the missing sources, and
suggest that the user explicitly invoke . Do not invoke the
setup skill autonomously and do not substitute an implicit baseline.
$setup-beto-frega-skillsRead when present, then follow its pointers to relevant context
and ADR files. Existing repository rules override generic review heuristics.
docs/agents/domain.mdPERFORMANCE.md首先阅读仓库说明。必须具备以下三个来源:
docs/agents/issue-tracker.mdOBSERVABILITY.mdACCESSIBILITY.md
AGENTS.mdCLAUDE.mdCONTRIBUTING.md如果缺少任何来源,应在派发审查前停止,列出缺失的来源,并建议用户显式调用 。不要自主调用 setup skill,也不要改用隐式基线代替。
$setup-beto-frega-skills如果存在 ,则阅读该文件,并按照其中的指向查找相关上下文和 ADR 文件。既有仓库规则优先于通用审查启发式规则。
docs/agents/domain.mdPERFORMANCE.md3. Resolve the spec
3. 解析 Spec
Follow . Look in this order:
docs/agents/issue-tracker.md- Issue or merge-request references in .
git log <fixed-point>..HEAD --oneline - A spec path or issue supplied by the user.
- A matching file under ,
docs/, orspecs/..scratch/ - Pull-request metadata when the current branch identifies a pull request.
Ask for the source only after exhausting repository evidence. If the user confirms
there is no spec, mark the Spec axis .
N/A — no spec available按照 执行。按以下顺序查找:
docs/agents/issue-tracker.md- 中的 issue 或 merge request 引用。
git log <fixed-point>..HEAD --oneline - 用户提供的 spec 路径或 issue。
- 、
docs/或specs/下匹配的文件。.scratch/ - 当前分支标识出一个 pull request 时,读取其 pull request 元数据。
只有在穷尽仓库证据后,才能向用户询问来源。如果用户确认不存在 spec,则将 Spec 维度标记为 。
N/A — no spec available4. Resolve standards
4. 解析 Standards
Find repository documents that govern changed code, such as , ,
, and scoped coding standards. Also read
the smell baseline. Repository rules override the
baseline, and tooling-enforced rules do not need manual findings.
AGENTS.mdCLAUDE.mdCONTRIBUTING.md查找管理变更代码的仓库文档,例如 、、 和适用于特定范围的编码规范。同时阅读 坏味道基线。仓库规则优先于基线,由工具强制执行的规则无需作为人工发现项报告。
AGENTS.mdCLAUDE.mdCONTRIBUTING.md5. Dispatch isolated reviewers
5. 派发相互隔离的审查者
Use for each review assignment. Before or alongside dispatch, tell
the user the concrete model and reasoning effort for every reviewer, including any
substitution. Start as many reviewers concurrently as capacity permits and queue the
rest; never combine axes in one reviewer context.
model-selectionGive every reviewer:
- the fixed point, full diff command, and commit-list command;
- the changed-file list and applicable repository instructions;
- its authoritative source documents or contents;
- this finding format: classification, location, evidence, impact, and smallest credible correction;
- the classification must be exactly one of:
- PR Blocker: Causes a defect or regression if merged. Alters production behavior contrary to spec. Must be fixed before approval.
- Feature Blocker: Prevents the feature from working as specified, but is behind a feature flag (no prod regression). Can be fixed in the PR, or must generate a ticket blocking the feature and its flag activation. Infer feature flags from diff patterns (e.g., ) or PR/Spec metadata.
if (isFeatureEnabled(...)) - Tech Debt: No functional/non-functional regression, but significantly reduces maintainability.
- Improvement: Optional maintainability improvement.
- a limit of 400 words, findings ordered by classification severity;
- the constraint to report only actionable defects introduced or materially exposed by the diff, without praise, pass lists, or speculative hardening.
Each reviewer returns one of:
- findings;
- ;
No findings - when the axis does not apply.
N/A — <brief evidence-backed reason>
Use these axis briefs:
每个审查任务均使用 。在派发前或派发的同时,告诉用户每位审查者将使用的具体模型和推理力度,包括任何替换情况。在容量允许的范围内尽可能并行启动审查者,其余审查者排队;绝不在同一审查者上下文中合并多个维度。
model-selection向每位审查者提供:
- 固定基准点、完整 diff 命令和 commit 列表命令;
- 变更文件列表和适用的仓库说明;
- 其权威来源文档或文档内容;
- 以下发现项格式:分类、位置、证据、影响,以及最小且可信的修正方案;
- 分类必须严格为以下之一:
- PR Blocker:如果合并会引入缺陷或回归;会违反 spec 而改变生产环境行为。必须在批准前修复。
- Feature Blocker:阻止功能按 spec 工作,但该功能受 feature flag 控制(不会造成生产环境回归)。可以在 PR 中修复;否则,必须创建一个工单,阻塞该功能及其 flag 的启用。可以根据 diff 模式(例如 )或 PR/Spec 元数据推断 feature flag。
if (isFeatureEnabled(...)) - Tech Debt:不存在功能性或非功能性回归,但会显著降低可维护性。
- Improvement:可选的可维护性改进。
- 字数上限为 400 词,发现项按分类严重程度排序;
- 仅报告由 diff 引入或被 diff 实质性暴露的可操作缺陷,不得包含赞扬、已通过项清单或推测性加固建议。
每位审查者返回以下之一:
- 发现项;
- ;
No findings - (当该维度不适用时)。
N/A — <brief evidence-backed reason>
使用以下维度审查说明:
Standards reviewer
Standards 审查者
Provide every standards source and paste the smell baseline in full. Report documented
rule breaches with a file-and-rule citation. Label smell findings as judgement calls,
name the smell, and cite the changed hunk. Repository rules can be hard requirements;
smells never are.
提供所有规范来源,并完整粘贴坏味道基线。对于有文档依据的规则违规,引用具体文件和规则。将坏味道发现标记为判断项,注明坏味道名称,并引用变更 hunk。仓库规则可以是硬性要求;坏味道则绝不可以。
Spec reviewer
Spec 审查者
Provide the spec path and contents. Report missing or partial requirements, unrequested
scope, and implementation that appears to satisfy a requirement incorrectly. Quote or
precisely cite the controlling spec passage for each finding.
提供 spec 路径及内容。报告缺失或仅部分实现的需求、超出请求范围的内容,以及看似以错误方式满足需求的实现。每项发现都应引用或精确引用相应的控制性 spec 段落。
Performance reviewer
Performance 审查者
Provide the spec, the universal performance baseline
in full, any repository performance source, and every available author-authored
acknowledgement from the current chat, pull request, issue, or spec. First determine
whether the diff changes runtime, build, tests, distribution, or a development
feedback loop. Return when it changes none of them; return only
after reviewing an applicable change.
N/ANo findingsApply every relevant baseline and repository rule. Cite the changed hunk and controlling
rule, preserve the baseline's evidence and acknowledgement labels, and give the user
the complete causal explanation rather than leaving the mechanism for them to infer.
Use only after checking the supplied evidence and
other acknowledgement sources accessible in the reviewer context.
Author acknowledgement: Not found提供 spec、通用性能基线全文、任何仓库性能来源,以及当前对话、pull request、issue 或 spec 中所有可获取的、由作者本人作出的确认。首先判断 diff 是否改变运行时、构建、测试、分发或开发反馈回路。如果均未改变,则返回 ;只有审查完适用变更后,才能返回 。
N/ANo findings应用所有相关基线和仓库规则。引用变更 hunk 和控制性规则,保留基线中的证据标签和确认标签,并向用户提供完整的因果解释,而不是让用户自行推断其机制。只有在检查所提供的证据以及审查者上下文中可访问的其他确认来源后,才能使用 。
Author acknowledgement: Not foundObservability reviewer
Observability 审查者
Provide the complete authoritative observability document. First determine whether the
diff changes runtime behavior, failure modes, operational dependencies, or diagnostic
paths. Apply every relevant repository requirement. Look especially for lost failure
visibility, unusable signal context or correlation, unsafe data exposure, unbounded
cardinality or volume, and operational behavior that cannot be verified. Cite the
specific baseline rule for every finding; do not invent requirements absent from it.
提供完整的权威可观测性文档。首先判断 diff 是否改变运行时行为、故障模式、运维依赖关系或诊断路径。应用所有相关仓库要求。重点查找故障可见性丢失、信号上下文或关联关系不可用、不安全的数据暴露、无界的基数或数据量,以及无法验证的运维行为。每项发现都要引用具体的基线规则;不得发明基线中不存在的要求。
Accessibility reviewer
Accessibility 审查者
Provide the complete authoritative accessibility document. First determine whether the
diff changes a user-facing surface, content, interaction, accessibility API, or
assistive-technology behavior. Apply every relevant repository requirement across the
whole affected journey, including states and errors. Cite the specific baseline rule
for every finding; do not treat automated checks as proof of requirements that need
human or assistive-technology verification.
提供完整的权威无障碍文档。首先判断 diff 是否改变面向用户的界面、内容、交互、无障碍 API 或辅助技术行为。在整个受影响用户流程中应用所有相关仓库要求,包括各种状态和错误。每项发现都要引用具体的基线规则;不得将自动化检查视为需要人工或辅助技术验证的要求已经得到满足的证明。
6. Aggregate by classification
6. 按分类聚合
Present reports grouped by classification severity rather than by axis. Use the following headers in order:
## PR Blockers## Feature Blockers## Tech Debt## Improvements
Under each header, list the findings from all reviewers that match that classification. For each finding, preserve the reviewer's meaning and note which axis (Standards, Spec, Performance, Observability, Accessibility) it originated from. Do not deduplicate findings if they cover different aspects of the same issue. Lightly clean wording only.
End with a brief summary of the finding counts per classification.
按分类严重程度而非维度组织报告。必须按以下顺序使用这些标题:
## PR Blockers## Feature Blockers## Tech Debt## Improvements
在每个标题下,列出所有审查者中与该分类匹配的全部发现。对于每项发现,保留审查者的原意,并注明其来源维度(Standards、Spec、Performance、Observability、Accessibility)。如果发现项针对的是同一问题的不同方面,不得去重。仅可轻微润色措辞。
最后按分类简要汇总发现项数量。