pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePull request
Pull Request
Make one change understandable to a human reviewer: the problem, delivered
behavior, consequential decisions, and evidence needed to assess it.
This skill owns publication and PR presentation. owns atomic commits;
owns stack topology, submit and cascading rebases;
owns requested feedback and CI repair. Use those owners only for work included
in the active request or standing instructions. Returning to an authorized caller
continues its workflow; completing this phase does not cancel the enclosing task.
commitstacked-prpr-followup让单项变更易于人类评审者理解:包括问题、交付后的行为、关键决策,以及评估变更所需的证据。
本 skill 负责发布和 PR 呈现。 负责原子 commit; 负责 stack 拓扑、提交和级联 rebase; 负责所请求的反馈处理和 CI 修复。仅针对当前请求或长期指令所包含的工作使用这些负责方。返回已授权的调用方时,继续其工作流;完成本阶段不会取消外层任务。
commitstacked-prpr-followupResolve the operation
确定操作
- Create: publish the intended commits and open a PR when requested and no exact PR exists. Default to draft unless the user's preference says ready.
- Update: refresh an existing open PR under existing authorization. Rewrite the whole body from the final published diff; preserve still-valid evidence and required template content. A request to update does not need a second approval.
- Draft-only: provide requested copy or inspection without a commit, push, or GitHub mutation. Use only the reads needed for that deliverable.
An exact closed or merged PR is historical state. Show its URL and state; do not
edit, reopen or replace it unless the user has chosen that operation. Ask only for
unresolved material decisions, never for an action already authorized. A blocker
pauses its dependent work; finish independent preparation when useful.
- 创建: 在收到请求且不存在完全匹配的 PR 时,发布预期提交并创建 PR。除非用户偏好为 ready,否则默认设为 draft。
- 更新: 在既有授权范围内刷新已打开的 PR。根据最终发布的 diff 完整重写正文;保留仍然有效的证据和必需的模板内容。更新请求无需再次批准。
- 仅起草: 提供所请求的文案或检查结果,不进行 commit、push 或 GitHub mutation。只执行交付该结果所需的读取操作。
完全匹配但已关闭或已合并的 PR 属于历史状态。显示其 URL 和状态;除非用户选择相应操作,否则不得编辑、重新打开或替换它。只询问尚未解决且会影响实质内容的决策,绝不重复请求已经授权的操作。阻塞项会暂停其依赖工作;如有帮助,可完成独立的准备工作。
Establish identity and scope
确定身份和范围
Read current branch, status, remotes, upstream and HEAD. Resolve:
- Push repository, remote and ref: use the branch's verified upstream or the requested destination; map remote URLs to actual GitHub repositories. Remote names are hints. A branch's upstream is a push destination, never the PR base.
- Target repository: prefer the supplied PR URL or explicit target. For an upstream contribution from a fork, use the verified parent, not the fork by accident. Ask if fork versus parent remains materially ambiguous.
- Exact PR: query all relevant results with
.
gh pr list --repo <target> --state all --head <branch> --json number,url,state,headRefName,headRepository,headRepositoryOwner,baseRefName,isDrafttakes the branch here, not--head; filter by both branch and head repository identity. A failed or incomplete query is not an empty result. Inspect a supplied URL directly. Multiple exact matches need disambiguation.owner:branch - Base: retain an existing PR's actual base. For a new PR, use an explicit
verified base or the target repository's default. Detect dependent branches
and pass topology decisions to . Use the target's SSH remote to fetch the chosen base; verify its identity rather than trusting local
stacked-pr.main - Revision: identify the head actually being described: selected local commits for creation/publication, published head for metadata-only work. Record base and head SHAs. Preserve unrelated working and staged changes; they do not block a metadata-only update and do not belong in its claims.
Honor the host's checkout ownership and PR-linking requirements. When switching
checkouts is necessary, use the host handoff and owner. Register the
actual PR with the host when it provides that capability.
worktrunk读取当前 branch、status、remotes、upstream 和 HEAD。确定:
- 推送 repository、remote 和 ref: 使用该 branch 经核验的 upstream 或请求指定的目标;将 remote URL 映射到实际的 GitHub repository。remote 名称仅供提示。branch 的 upstream 是 push 目标,绝不是 PR base。
- 目标 repository: 优先使用提供的 PR URL 或明确指定的目标。对于来自 fork 的 upstream contribution,应使用经过验证的 parent,而不是误用 fork。如果 fork 与 parent 之间仍存在实质性的歧义,则询问用户。
- 完全匹配的 PR: 使用以下命令查询所有相关结果:
。 此处
gh pr list --repo <target> --state all --head <branch> --json number,url,state,headRefName,headRepository,headRepositoryOwner,baseRefName,isDraft接收 branch,而不是--head;按 branch 和 head repository identity 双重过滤。查询失败或结果不完整并不等同于没有结果。直接检查提供的 URL。出现多个完全匹配项时需要消除歧义。owner:branch - Base: 保留现有 PR 的实际 base。新建 PR 时,使用明确且经过验证的 base,或目标 repository 的默认 base。检测依赖 branch,并将拓扑决策交给 。使用目标的 SSH remote 获取所选 base;验证其身份,而不是信任本地
stacked-pr。main - Revision: 确认实际被描述的 head:创建或发布时使用选定的本地 commits;仅处理元数据时使用已发布的 head。记录 base 和 head SHA。保留无关的 working 和 staged changes;它们不会阻塞仅更新元数据的操作,也不属于该操作所声明的内容。
遵守 host 对 checkout ownership 和 PR-linking 的要求。必须切换 checkout 时,使用 host handoff 和 owner。如果 host 提供相应能力,则将实际 PR 注册到 host。
worktrunkUnderstand the change and repository
理解变更和 repository
Read references/claims.md before making substantive
claims. Inspect every commit in and the full
diff, then trace the important behavior through current code,
gates and failure paths. Account for generated, binary, dependency and migration
changes. Do not equate tests present with tests passed or issue intent with delivery.
<base-ref>..<head><base-ref>...<head>Check whether independent concerns can be reviewed and reverted separately.
Recommend a split when it materially helps; do not rewrite published history,
reorder a stack or separate a behavior from its regression test just to shorten
the diff. Necessary generated output is not automatically noise.
Before composing a body, read:
- Written PR rules in repository instructions and .
CONTRIBUTING.md - Templates on the resolved base in root, ,
docs/and their.github/directories. A template changed by this branch does not establish existing convention. Choose the applicable template from the change and repository rules; ask only if a remaining choice matters.PULL_REQUEST_TEMPLATE/ - Up to ten recent merged PRs; read three bodies, or all when fewer exist. Use relevant recent examples for style, not as authority over written rules.
Record inaccessible required evidence as unknown with the exact failed lookup.
Continue what the available evidence supports; do not invent missing conventions.
作出实质性陈述前,读取 references/claims.md。检查 中的每个 commit 以及完整的 diff,然后通过当前代码、gates 和 failure paths 追踪重要行为。考虑生成、二进制、依赖和迁移变更。不要把“存在测试”视为“测试已通过”,也不要把 issue intent 视为已交付内容。
<base-ref>..<head><base-ref>...<head>检查独立关注点能否分别评审和回滚。当拆分能实质帮助时,建议进行拆分;不要仅为缩短 diff 而重写已发布历史、重新排列 stack,或将某项行为与其回归测试分离。必要的生成产物并不自动属于噪声。
编写正文前,读取:
- repository instructions 和 中书面规定的 PR 规则。
CONTRIBUTING.md - 已确定的 base 上,根目录、、
docs/及其.github/目录中的模板。此 branch 修改过的模板不能作为既有约定的依据。根据变更和 repository 规则选择适用模板;仅当剩余选择确实重要时才询问。PULL_REQUEST_TEMPLATE/ - 最多十个最近合并的 PR;阅读三个正文,若不足三个则全部阅读。将相关近期示例用于风格参考,但不能凌驾于书面规则。
将无法访问的必需证据记录为 unknown,并附上失败的确切查询。继续完成现有证据支持的工作;不要臆造缺失的约定。
Compose for review
面向评审编写内容
Read references/review-packet.md for every title
or body. Read references/visual-evidence.md when
a changed interface, flow or structure would be easier to assess visually.
Use the smallest useful diagram, genuine screenshots or measured comparison.
Ordinary small changes can be explained in a sentence.
For visible UI changes, capture and attach the relevant app states when the app,
capture tool and upload route are available. Use existing verified captures when
they match the revision. Follow references/attachments.md
to upload them into the PR body; a local screenshot path is not an attachment.
If a prerequisite is inaccessible, report which one and the evidence retained.
Follow repository requirements and preserve meaningful template fields. When a
style convention leaves useful context out, a small addition is appropriate;
explain a material departure. An exact enforced format still applies unless the
user explicitly overrides it. Keep the body proportional to the review decision.
For Update, draft from the complete published change and replace obsolete claims,
rather than appending a history of successive fixes. Revalidate useful links,
screenshots and completed checklist claims before carrying them forward. Use
when available for clear prose without weakening technical meaning.
communicate-clearly每次编写 title 或 body 前,读取 references/review-packet.md。当变更的 interface、flow 或 structure 通过视觉方式更易评估时,读取 references/visual-evidence.md。使用最小但有帮助的 diagram、真实 screenshots 或实测对比。普通的小变更可以用一句话说明。
对于可见的 UI 变更,如果 app、capture tool 和 upload route 均可用,则捕获并附加相关 app states。若已有 verified captures 与 revision 匹配,应复用。按照 references/attachments.md 将其上传到 PR 正文;本地 screenshot 路径不算 attachment。如果某项 prerequisite 无法访问,报告具体项及已保留的证据。
遵循 repository 要求并保留有意义的模板字段。如果某种风格约定导致有用上下文缺失,可以适当补充;若存在实质性偏离,则应说明。强制要求的精确格式仍然适用,除非用户明确覆盖。正文篇幅应与评审决策相称。
对于 Update,根据完整的已发布变更起草正文,并替换过时声明,而不是附加 successive fixes 的历史。沿用之前的内容前,重新验证有用的 links、screenshots 和已完成的 checklist 声明。 可用时,使用它编写清晰的文字,同时不削弱技术含义。
communicate-clearlyPublish and verify
发布并验证
For any Git or GitHub mutation, read
references/publication.md. It owns identity checks,
SSH publication, non-interactive commands, draft state and post-write verification.
Complete the reviewable title/body and necessary validation before asking for a
remaining authorization. Existing request and standing authorization take precedence
over source workflows that require blanket confirmation.
A successful phase has the exact PR URL, expected head and base, verified title
and body, intended state, and only requested metadata changes. Included captures
have verified uploaded references and a recorded rendering/access result. A failed
write is unknown until inspected; avoid duplicate creation or claims of success on timeout.
Do not start monitoring, respond to reviews, change ready state on an existing PR,
or merge solely because this phase succeeded.
进行任何 Git 或 GitHub mutation 前,读取 references/publication.md。该文件负责身份核验、SSH 发布、non-interactive commands、draft state 和写入后验证。
请求剩余授权前,完成可供评审的 title/body 和必要的 validation。现有请求和长期授权优先于源工作流中要求一律确认的规定。
成功的阶段应包含准确的 PR URL、预期的 head 和 base、经过验证的 title 和 body、预期状态,以及仅限所请求的元数据变更。包含的 captures 应具有经过验证的 uploaded references,并记录 rendering/access 结果。写入失败在被检查前应视为状态未知;避免重复创建或在超时后声称成功。
不要仅仅因为本阶段成功,就启动监控、回应 reviews、更改现有 PR 的 ready state 或执行 merge。
Return
返回
Report , , or , with the PR URL when known,
head/base, draft state, relevant validation and remaining work. Include actual
commands and outcomes, distinguishing current execution from historical evidence.
For draft-only, provide the requested copy and state that no mutation occurred.
For a blocker, name its failed prerequisite or decision and retain completed work.
Hand verified identity, revision and publication state back to an authorized caller.
createdupdateddraft-onlyblockedFor requested source maintenance, use with and
references/upstream-updates.md.
agent-instructionsorigin.txt报告 、、 或 ;已知时提供 PR URL、head/base、draft state、相关 validation 和剩余工作。列出实际执行的命令及其结果,区分当前执行与历史证据。
createdupdateddraft-onlyblocked对于 draft-only,提供所请求的文案,并说明未发生任何 mutation。
对于 blocked,指出失败的 prerequisite 或待定决策,并保留已完成的工作。
将经过验证的 identity、revision 和 publication state 交回给已授权的调用方。
如需执行请求的源代码维护,使用 ,并结合 和 references/upstream-updates.md。
agent-instructionsorigin.txt