fix-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFix PR
修复PR
Flags
参数
| Flag | Effect |
|---|---|
| Target PR. Default: |
| Commit locally; skip push. Off by default. |
| Fix code; skip GitHub thread replies. Off by default. |
| 参数 | 作用 |
|---|---|
| 指定目标PR。默认值: 在当前分支执行 |
| 仅在本地提交代码;跳过推送步骤。默认关闭。 |
| 仅修复代码;跳过GitHub讨论线程回复。默认关闭。 |
Step 1: Resolve PR
步骤1:确定目标PR
--prgh pr view --json number,headRefName,url,headRepositoryRecord owner, repo, number, head branch, URL. If errors or no PR exists,
stop and ask.
ghDone when: owner, repo, number, head branch, and URL are known.
若传入了参数则使用该参数;否则执行。
--prgh pr view --json number,headRefName,url,headRepository记录仓库所有者、仓库名、PR编号、头部分支、链接。如果命令报错或不存在对应PR,则停止并询问用户。
gh完成标志: 已获取仓库所有者、仓库名、PR编号、头部分支和链接信息。
Step 2: Fetch open feedback
步骤2:获取未处理的评审反馈
Paginate all unresolved review threads using the GraphQL contract in
. Substitute owner, repo, and number from Step 1.
./REFERENCE.mdIf a changes-requested review has a body with actionable feedback not already
covered by inline threads, add those items using the REST pattern in
.
./REFERENCE.mdDone when: Every unresolved thread and orphan review-body item is listed with
path, line, author, and body.
使用中的GraphQL协议分页获取所有未解决的评审线程。代入步骤1中获取的仓库所有者、仓库名和PR编号。
./REFERENCE.md若标记为“请求修改”的评审包含未被内联线程覆盖的可操作反馈,则使用中的REST格式添加这些反馈项。
./REFERENCE.md完成标志: 已列出所有未解决的线程和独立评审反馈项,包含文件路径、行号、作者和反馈内容。
Step 3: Checkout PR branch
步骤3:切换到PR分支
gh pr checkout <number>headRefNameDone when: Working tree is on the PR head branch.
执行或确认工作区已处于分支。
gh pr checkout <number>headRefName完成标志: 工作区已切换至PR的头部分支。
Step 4: Triage skeptically
步骤4:审慎筛选评审意见
For every item from Step 2. No file edits until this step completes.
- Read the cited file with surrounding context.
- Trace the code path the reviewer claims is wrong.
- Reproduce if possible (targeted test, call trace, type check).
- Assign verdict: |
fix|reject.clarify - Record one-line evidence.
Done when: Every item has verdict and evidence; no edits before this holds.
针对步骤2中的每一项反馈执行以下操作。在完成此步骤前禁止修改任何文件。
- 阅读标注文件及其上下文内容。
- 追踪评审者指出的问题代码路径。
- 尽可能复现问题(针对性测试、调用追踪、类型检查)。
- 给出判定结果:(修复)|
fix(驳回)|reject(澄清)。clarify - 记录一行简短的判定依据。
完成标志: 每一项反馈均已给出判定结果和依据;在此之前未进行任何文件修改。
Step 5: Implement
步骤5:实施修复
Apply only verdicts. Focused diffs; no drive-by refactors.
fixDone when: Every item has a local change, or there were zero
verdicts.
fixfix仅对判定为的反馈进行修复。仅生成针对问题的差异代码;禁止顺带重构。
fix完成标志: 所有判定为的反馈均已完成本地修改,或无需要修复的反馈项。
fixStep 6: Commit
步骤6:提交代码
Read in full. Commit per that skill (diff-only message).
../commit/SKILL.mdDone when: Changes are committed, or there is nothing to commit.
完整阅读文档。按照该技能要求提交代码(仅包含差异内容的提交信息)。
../commit/SKILL.md完成标志: 已提交修改内容,或无内容可提交。
Step 7: Push and reply
步骤7:推送代码并回复评审
Unless : .
--no-pushgit pushUnless , reply to every triaged item:
--no-reply- Draft per verdict shape in .
./REFERENCE.md - Apply the unslop process in to each draft. Replies must be concise (fact or fix first, no preamble) and humane (teammate tone, not a bot closing a ticket).
~/.agents/skills/unslop/SKILL.md - Post using reply commands in . For
./REFERENCE.mdverdicts, push before replying; reference the commit SHA. Never post platitudes ("acknowledged", "will fix", "good point", "hope this helps").fix - When author is , use dismissal patterns in
semgrep-code-scan../REFERENCE.md
Done when: Push succeeded (or ); every item has a posted reply
(or ); every reply is concise, humane, and unslopped.
--no-push--no-reply除非启用参数:执行。
--no-pushgit push除非启用参数,否则需回复每一项经过筛选的反馈:
--no-reply- 按照中的判定结果格式撰写回复草稿。
./REFERENCE.md - 应用中的unslop流程处理每一条草稿回复。回复必须简洁(先陈述事实或修复内容,无开场白)且人性化(采用团队协作语气,而非机器人处理工单的语气)。
~/.agents/skills/unslop/SKILL.md - 使用中的回复命令发布回复。对于判定为
./REFERENCE.md的反馈,需先推送代码再回复;引用提交的SHA值。禁止发布空泛内容(如“已确认”、“将修复”、“好建议”、“希望有所帮助”)。fix - 若反馈作者为,则使用
semgrep-code-scan中的驳回模板。./REFERENCE.md
完成标志: 推送成功(或启用了参数);每一项反馈均已发布回复(或启用了参数);所有回复均简洁、人性化且经过unslop流程处理。
--no-push--no-replyStep 8: Report
步骤8:生成报告
Table: . Include PR URL and commit SHA if any.
item | verdict | actionDone when: What was fixed, rejected, or discussed is visible at a glance.
Does not handle CI, merge conflicts, or stack restacking (); never invoke .
pr-babysitmake-pr生成表格:。若有提交,需包含PR链接和提交SHA值。
反馈项 | 判定结果 | 操作完成标志: 可一目了然看到哪些问题已修复、哪些已驳回或已讨论。
本工具不处理CI、合并冲突或栈式PR重排(该功能由负责);请勿调用。
pr-babysitmake-pr