shipping-a-pr
它能做什么
这个技能指导 AI 把完成的代码改动提交为拉取请求以供审查。它还涵盖更新请求、检查状态和回复审查意见。适合使用 GitHub 的开发者和团队。
适用场景
- ✓当你的代码改动已经完成,需要以拉取请求的形式提交时。
- ✓当你希望 AI 检查拉取请求的检查项是否通过时。
- ✓当审查者对拉取请求留下评论,并且你希望处理这些评论时。
技能链接
https://github.com/JetBrains/thinkrail/blob/main/packages/pi-thinkrail-workflow/skills/shipping-a-pr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的功能已经完成,请在 GitHub 上提交拉取请求,并告诉我检查是否通过。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会检查代码和远程仓库的当前状态,然后创建或更新拉取请求,并报告此刻的检查状态。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Shipping a PR
The PR lifecycle: ship the workspace's finished work, maintain PR metadata, and keep the PR healthy when requested. One workflow, six phases as sibling docs — enter at the phase the ask names.
Completion modes
- Snapshot mode is the default for creating, syncing, or updating a PR and for one-time status requests. Take one fresh checks and merge-state snapshot, report pending/failing/indeterminate state as observed, and stop without polling or fixing unrelated state. A push never upgrades the mode by itself.
- Wait mode requires an explicit remote-completion ask: monitor or watch checks, investigate CI, wait until green, or make the PR merge-ready. Done means every configured check is green, the head is current with its base, and GitHub reports an affirmative merge state; a requested draft is reported as draft, never merge-ready. A repo with no CI is reported as exactly that, never silently green.
Observed, never assumed (applies to every phase)
Git and GitHub state is concurrent and mutable: the base moves, CI lags, mergeability is computed lazily, and this workflow's own steps dirty the tree they just checked. Four rules hold at every step of every phase:
- Verify at the point of action. An irreversible step — push,
gh pr create,gh pr edit, replying to a thread, declaring done — re-checks the exact state it consumes immediately before running. A gate passed earlier does not survive the mutations made since it passed. - Keep verification tied to the final tree. Reuse exact prior results while the inputs they cover remain unchanged. Before every code-affecting push, run project-required checks that are missing or invalidated by later code, configuration, dependency, base, or conflict-resolution changes. If a check, cleanup, or self-review causes another relevant edit, reassess and repeat before pushing.
- Fetch, don't remember. Remote state is read fresh and completely at the moment it's needed:
the current body before editing it,
--paginateon every listing,git fetchbefore reasoning about the base. - Indeterminate is not affirmative. In wait mode, a pending or still-computing answer (an
UNKNOWNmerge state, queued checks) is polled until it resolves; done is declared only from observed affirmative state. In snapshot mode, report it as indeterminate without turning the phase into a watch.
Classify the ask
| The ask | Phase doc | Default mode |
|---|---|---|
| Create a PR — the work is finished | creating.md |
snapshot |
| Bring the PR up to date / resolve conflicts with its base | syncing.md |
snapshot |
| Update the PR title or body | body.md |
snapshot |
| Add or refresh screenshots on a PR | screenshots.md |
snapshot |
| Report the current checks / merge state once | checks.md |
snapshot |
| Monitor CI / investigate or fix failing checks | checks.md |
wait |
| Address review comments | review-comments.md |
snapshot |
Read and follow the selected phase doc — the gates and mechanics live only there; never run a phase from this spine's summary. Carry the completion mode selected above into that doc; a later push does not change it. A compound ask ("rebase, verify, and create a PR") is one flow: start at the earliest phase named; the docs chain forward on their own. If the work itself isn't finished — the ask bundles new design or implementation before the ship — that part is not this workflow's; route it per choosing-a-workflow first and come back here when it lands.
Working files
Ephemeral files this workflow uses, all under the workspace's gitignored .thinkrail/context/:
pr-body.md— the PR body draft; always passed via--body-file, never inline.pr-shots/— staged before/after screenshots awaiting attachment.
Both are deleted when the phase that made them completes (screenshots stay while the user is
uploading by hand — see screenshots.md).
Ending
Every phase ends through checks.md in the completion mode selected above.
常见问题
它会等待检查完成吗?
只有在你要求它监控或等待时才会。否则它只获取一次快照并报告。
什么才算就绪?
所有已配置的检查都通过,分支与基础分支保持最新,并且 GitHub 确认可以合并。没有配置检查的项目会被报告为没有检查。
它可以审查别人的拉取请求吗?
不可以。它用于提交你自己完成的工作,而不是审查你没有创建的拉取请求。
详情
作者的原始描述
Use when finished work needs to ship as a pull request, or when creating, syncing, updating metadata, checking status, monitoring CI, or addressing review comments on a PR. Not for reviewing a PR you are not shipping.
repo: JetBrains/thinkrail
热度
- GitHub 星标
- 7.1k
- 排名
- #13493
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
asking-user-questions
7.1k教你的智能体分轮次向你提出清晰的问题,并给出合适的回答选项,直到悬而未决的问题都得到确定。
brainstorming
7.1k帮你的智能体在构建之前,和你一起讨论功能、行为变更或缺陷修复,并记录商定的设计。
choosing-a-workflow
7.1k帮你的智能体为新项目、拉取请求或任何产品功能的变更,选择合适的 ThinkRail 工作流。
importing-a-codebase
7.1k教你的智能体阅读现有代码库,并起草第一套项目规格,只在代码不清楚的地方询问你。