pr-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePR Review
PR 审查
One question — what do I do about this pull request — answered differently depending on which side
of it you are on.
Their branch. You are the reviewer. Attack the diff, then publish a real review: one inline
comment per finding, a body, and a verdict.
Your branch. You are the author. Work the threads people and bots left: decide whether answering
is even your business, check whether the claim is true, then reply and close what is finished.
The skill verifies before it speaks and changes no code unless asked. Its default output is
an action report plus whatever it posted.
只有一个问题——我该如何处理这个Pull Request——答案取决于你所处的立场。
他人分支:你作为审查者。分析代码差异,然后发布正式审查意见:每个问题对应一条行内评论,附带审查正文和结论。
自己的分支:你作为作者。处理他人和机器人留下的讨论线程:判断是否需要自己回复,验证主张是否属实,然后回复并结束已处理完成的线程。
该技能发言前先验证,且除非被要求否则不修改代码。默认输出为操作报告以及发布的所有内容。
The premise
核心前提
Bots write most of the inline comments on a modern pull request, and they fail in a shape: the
premise is wrong far more often than the conclusion. The claim rests on how a framework behaves,
and your repository's own code says nothing about it — so "read the code" is not enough, and two
agents agreeing is not verification.
The ordering is therefore fixed and not negotiable:
verify → fix → build → speak.
Never post a verdict you have not executed. A needs evidence that can be pasted; a
needs the project's own checks passing on it. has the traps, the
version-pinning discipline, and the run where a fabricated claim reached two independent
confirmations and was caught only because the fix would not compile.
rejectfixreferences/verifying-a-claim.md在现代Pull Request中,大多数行内评论由机器人生成,但它们存在一个缺陷:前提错误的频率远高于结论错误。主张往往基于框架的行为逻辑,但仓库自身代码并未涉及相关内容——因此仅“阅读代码”远远不够,两个Agent达成一致也不能算作验证。
因此,执行顺序是固定且不可协商的:
验证 → 修复 → 构建 → 发言
绝不要发布未经过验证的结论。结论需要可粘贴的证据;结论需要项目自身检查通过。中记录了相关陷阱、版本固定规则,以及一个伪造主张获得两个独立确认、最终因修复无法编译才被识破的案例。
rejectfixreferences/verifying-a-claim.mdConfiguration
配置项
| Setting | Flag | Default |
|---|---|---|
| Apply code changes | | Off — verify, check, report |
| Verification breadth | | Bot claims, plus anything heading for |
| Unattended | | Off — previews and confirmations are shown |
Explicit instructions in the invocation override the default posture in both directions. "Just
triage this" stays read-only however the postures resolve; "answer Anna" acts on a human thread that
the table below would have left alone.
--fix| 设置项 | 标识 | 默认值 |
|---|---|---|
| 应用代码修改 | | 关闭——仅验证、检查、报告 |
| 验证范围 | | 机器人主张,以及所有标记为 |
| 无人值守模式 | | 关闭——会显示预览并要求确认 |
调用时的明确指令会覆盖默认配置。例如“仅分类处理”会保持只读模式,无论配置如何;“回复Anna”会处理人类发起的线程,即使下表中对应的规则是忽略该线程。
--fixAsking the User
向用户提问
Every question in this skill is written as options. Use that tool where
the host offers it, or the host's nearest structured-choice equivalent. Where the host has
neither, ask the same question in normal chat as a numbered list of 2–5 options —
recommended first, one short line of description each — and wait for the user to reply
with a number.
AskUserQuestion该技能中的所有问题均以选项形式呈现。如果宿主环境支持该工具则直接使用,或使用宿主环境中最接近的结构化选择工具。如果两者都不支持,则在普通聊天中以2-5个选项的编号列表形式提问——推荐选项放在首位,每个选项配简短描述——等待用户回复编号。
AskUserQuestionPhase 1: Resolve the target and your side
阶段1:确定目标和你的立场
Parse the invocation:
| Input | Meaning |
|---|---|
| empty | The current branch's open pull request |
| a number or a PR URL | That pull request |
a | That single thread, and nothing else |
a login ( | Only threads that author rooted |
| free text | Threads whose body fuzzy-matches it |
Then resolve which side you are on, because it selects the mode:
bash
gh pr view <N> --json author,headRefName,baseRefName --jq .author.login
gh api user --jq .loginEqual → author mode. Different → reviewer mode. Announce which: If no pull request resolves, say so and stop.
Reviewer mode on PR #534 by ashklianko.解析调用指令:
| 输入内容 | 含义 |
|---|---|
| 空值 | 当前分支的已打开Pull Request |
| 数字或PR URL | 指定的Pull Request |
| 指定的单个讨论线程,忽略其他内容 |
登录名(如 | 仅处理该用户发起的线程 |
| 自由文本 | 正文模糊匹配该文本的线程 |
然后确定你的立场,这会选择对应的工作模式:
bash
gh pr view <N> --json author,headRefName,baseRefName --jq .author.login
gh api user --jq .login两者相等 → 作者模式。两者不同 → 审查者模式。需告知当前模式:例如如果无法找到对应的Pull Request,需告知并终止流程。
审查者模式,处理ashklianko发起的PR #534。Phase 2: Fetch
阶段2:获取数据
One query, up front, per . It carries the thread and comment ids that
replying and resolving need, the that decides bot from human, and for
outdated threads. Read that file before writing the query — the previous version of this skill could
not reply or resolve at all, because it fetched neither id.
references/fetching.md__typenameoriginalLineDo not filter resolved threads out of the fetch. Filter in Phase 3.
根据中的要求,提前执行一次查询。查询需包含回复和解决线程所需的线程及评论ID、区分机器人与人类的,以及过时线程的。编写查询前请阅读该文档——之前版本的技能完全无法回复或解决线程,原因就是未获取这些ID。
references/fetching.md__typenameoriginalLine获取数据时不要过滤已解决的线程,在阶段3进行过滤。
Phase 3: Standing
阶段3:判断立场权限
Resolved before any verdict, because it decides whether a verdict is yours to state at all. A
single-bot thread on your own pull request and a two-human argument you were never part of are not
the same situation and must not be treated alike.
| Your side | Thread rooted by | Last comment by | Posture |
|---|---|---|---|
| Reviewer | — | — | Author the review. Phase 7 publishes it |
| Author | Bot | bot only | Act — verify, reply, resolve. Code only under |
| Author | Bot | you | Already answered. Hands off |
| Author | Bot | another human | May add a technical fact. Do not resolve |
| Author | Human | that human | Draft a reply, confirm before posting. Never resolve |
| Author | Human | you | The ball is in their court. Do nothing |
| Author | 2+ other humans, you unmentioned | — | Read-only. Report as context, never reply |
A bot's own follow-up does not count as a human reply. Only a moves the last-comment axis.
UserResolved threads are out of scope unless or an explicit instruction brings them back.
--full在得出任何结论前先判断权限,因为这决定了你是否有权发表结论。自己Pull Request上的单机器人线程,与你从未参与过的两人争论线程,是完全不同的情况,必须区别对待。
| 你的立场 | 线程发起者 | 最后评论者 | 处理方式 |
|---|---|---|---|
| 审查者 | — | — | 撰写审查意见,阶段7发布 |
| 作者 | 机器人 | 仅机器人 | 执行操作——验证、回复、解决线程。仅在 |
| 作者 | 机器人 | 你自己 | 已回复过,无需处理 |
| 作者 | 机器人 | 其他人类 | 可补充技术事实,但不要解决线程 |
| 作者 | 人类 | 该人类 | 撰写回复草稿,发布前确认。绝不解决线程 |
| 作者 | 人类 | 你自己 | 等待对方回复,无需操作 |
| 作者 | 2名及以上其他人类,未提及你 | — | 只读模式。仅作为上下文报告,绝不回复 |
机器人自身的后续评论不算人类回复。只有类型的用户才会改变最后评论者的判定。
User已解决的线程不在处理范围内,除非模式或明确指令要求重新处理。
--fullPhase 4: Verify
阶段4:验证
Per . Decompose each claim into its premise about the world and
its conclusion about this code, and verify them separately — recording which failed, because the
answer differs completely.
references/verifying-a-claim.mdPin the resolved dependency version before reading any artifact. Never a package located by in
a global cache, never memory. Never apply a block unread.
find```suggestionScope: every bot claim and anything heading for or . adds everything
unresolved, human claims included. Loose recommendations and other reviewers' summaries are reported
as context and never verified.
fixreject--full按照执行。将每个主张分解为关于外部环境的前提和关于当前代码的结论,分别验证——记录哪部分验证失败,因为对应的回复完全不同。
references/verifying-a-claim.md读取任何工件前,先固定依赖的版本。绝不要使用全局缓存中通过找到的包,也不要依赖记忆。绝不要直接应用未阅读过的代码块。
find```suggestion验证范围:所有机器人主张,以及所有标记为或的内容。模式会增加所有未解决的内容,包括人类主张。宽松的建议和其他审查者的总结仅作为上下文报告,不进行验证。
fixreject--fullPhase 5: Verdict
阶段5:结论
Six, replacing the old / pair:
fixskip| Verdict | When |
|---|---|
| Real, and the change is yours to make |
| The premise or the conclusion is false. The reply carries the evidence |
| Handled elsewhere. |
| Correct, but the call belongs to a person — scope, architecture, product |
| Real, and deliberately not now |
| Praise or an FYI. Nothing to answer |
discussfix共六种结论,替代旧的/组合:
fixskip| 结论 | 适用场景 |
|---|---|
| 主张属实,且该修改由你负责 |
| 前提或结论错误。回复需附带证据 |
| 问题已在别处处理。 |
| 主张正确,但决策需由人员做出——涉及范围、架构、产品等 |
| 主张属实,但暂不处理 |
| 表扬或告知信息。无需回复 |
discussfixPhase 6: Fix (--fix
only)
--fix阶段6:修复(仅--fix
模式)
--fixWithout nothing is edited; a verdict is reported and its thread left for a later run.
--fixfixWith it: one thread's finding at a time, then the project's own checks — whatever ,
or CI actually runs. A fix whose checks fail is reverted, not worked around, and its
verdict drops to with the failure quoted. Never claim a fix that has not gone green.
package.jsonMakefilediscuss未开启时不会编辑任何代码;结论仅作为报告,对应的线程留待后续处理。
--fixfix开启时:每次处理一个线程的问题,然后运行项目自身的检查——无论、或CI实际执行的是什么检查。如果修复未通过检查,则回滚修改,结论改为并引用失败信息。绝不要声称修复已完成,除非检查全部通过。
--fixpackage.jsonMakefilediscussPhase 7: Speak
阶段7:发言
Composition is in : the answer in the first clause, real symbols rather than
descriptions, a link where one exists, ready concessions, and the decision handed back. A fix reply is
shorter — what changed, why, and the check that passed.
references/answering.mdReviewer mode publishes instead of replying. Invoke to attack the diff and
verify what it finds, passing the pull request's own issue as the requirement and any system facts you
have, then let its publication phase post the review with . It owns the inline anchoring,
the grouping of minors, and the verdict mapping; do not rebuild them here. Where the host cannot
invoke another skill, run the same attack inline and publish by the rules documents
for it — one inline comment per finding, minors grouped, nothing published without a demonstration
and an attribution, and the verdict set by whether a blocker survived.
review:changes-review--reviewchanges-reviewConfirm before anything leaves. In author mode show the composed replies; in reviewer mode show
the whole review — every inline comment, the body, the verdict — laid out locally first. Ask per Asking the User — post as
written (recommended) / edit first / discard. skips this and posts directly.
--autoResolve only what permits: never a human-rooted thread, never a .
Check before attempting.
references/answering.mddiscussviewerCanUpdate回复内容需遵循的规则:开头直接给出答案,使用真实符号而非描述,存在链接则附上,主动做出合理让步,将决策交还给相关人员。修复的回复应更简短——说明修改内容、原因,以及通过的检查。
references/answering.md审查者模式下发布审查意见而非回复。调用分析代码差异并验证发现的问题,将Pull Request自身的需求作为要求传入,同时传入所有已知的系统事实,然后让其发布阶段通过发布审查意见。该工具负责行内锚定、次要问题分组以及结论映射;不要在此处重新实现这些功能。如果宿主环境无法调用其他技能,则按照文档中的规则,在本地执行相同的审查流程并发布——每个问题对应一条行内评论,次要问题分组,未经过演示和归因的内容绝不发布,根据是否存在未解决的阻塞问题确定最终结论。
review:changes-review--reviewchanges-review任何内容发布前需确认。作者模式下需展示撰写好的回复;审查者模式下需展示完整的审查意见——所有行内评论、正文、结论——先在本地展示。按照「向用户提问」的规则进行确认——按原文发布(推荐)/先编辑/放弃发布。模式会跳过此步骤直接发布。
--auto仅解决允许的线程:绝不解决人类发起的线程,绝不解决标记为的线程。执行解决操作前需检查权限。
references/answering.mddiscussviewerCanUpdateOutput
输出格式
undefinedundefinedPR #<N> <author|reviewer> mode: <N> threads · <F> fixed · <R> rejected · <D> discuss · <X> deferred
PR #<N> <作者|审查者>模式:<N>个线程 · <F>个已修复 · <R>个已驳回 · <D>个待讨论 · <X>个已推迟
<per thread: the claim in a clause, the verdict, and what was done>
Posted: <N replies, N resolves, or the review and its verdict>
Held: <what awaits your confirmation, or what --fix would have changed>
Context: <read-only threads, unverified chatter>
Deferrals are always listed even though their threads are closed. A deferral nobody can see is
backlog that does not exist yet.<每个线程:以短句呈现主张、结论,以及执行的操作>
已发布:<N>条回复,<N>个已解决线程,或审查意见及其结论>
待确认:<等待你确认的内容,或模式下会修改的内容>
上下文:<只读线程,未验证的讨论内容>
--fix
即使线程已关闭,推迟处理的内容也会始终列出。无人可见的推迟内容不属于待办事项。Rules
规则
- Verify, then speak. No verdict that was not executed. No fix claimed without a green check.
- Standing before verdict. Whether you may answer is decided before what the answer is.
- Never resolve a human's thread. Closing someone's thread is theirs to do.
- Premise and conclusion are separate claims. A bot's conclusion can be right for a wrong reason.
- The pull request belongs to its author. Suggest, do not instruct.
- No code without . Reporting a needed change is not the same as making it.
--fix
- 先验证,再发言:绝不发布未经过验证的结论。绝不声称修复已完成,除非检查全部通过。
- 先判断权限,再得出结论:先确定你是否有权回复,再确定回复内容。
- 绝不解决人类发起的线程:关闭他人的线程应由对方自己操作。
- 前提和结论是独立的主张:机器人的结论可能因错误的前提而偶然正确。
- Pull Request属于其作者:仅提出建议,不要下达指令。
- 未开启时绝不修改代码:报告需要修改的内容与直接修改代码是两回事。
--fix
Error handling
错误处理
| Situation | Action |
|---|---|
| No pull request resolves | Say so and stop. Do not review the working tree instead |
| Every thread is resolved | Say the pull request is clear. Do not manufacture findings |
| A claim cannot be verified either way | |
| The resolved dependency version cannot be established | Say so in the reply and make no version claim |
| Reply where possible, resolve nothing, say why |
| A reply posts but the resolve fails | Say which thread is half-answered. Do not repost the reply |
| Establish the baseline first; never blame a pre-existing failure on the fix |
| Host cannot invoke another skill | Run the review inline, per Phase 7 |
| Ignore it and say why |
| The project's check command is outside the pre-approved set | It will prompt for approval. Run it anyway — an unrun check is not a green check |
| 场景 | 操作 |
|---|---|
| 无法找到对应的Pull Request | 告知用户并终止流程。不要转而审查工作区代码 |
| 所有线程均已解决 | 告知用户Pull Request已无问题。不要编造问题 |
| 无法验证主张的真伪 | 标记为 |
| 无法确定依赖的版本 | 在回复中说明,不要做出任何版本相关的主张 |
| 尽可能回复,不解决任何线程,并说明原因 |
| 回复发布成功但解决线程失败 | 告知用户哪个线程仅完成了回复。不要重新发布回复 |
开启 | 先确定基线状态;绝不要将预先存在的失败归咎于本次修复 |
| 宿主环境无法调用其他技能 | 按照阶段7的规则在本地执行审查流程 |
审查者模式下使用 | 忽略该标识并说明原因 |
| 项目的检查命令不在预批准列表中 | 会提示用户批准。无论如何都要执行检查——未执行的检查不能算作通过 |