babysit-pr
它能做什么
这项技能监控拉取请求,修复其 CI 失败和审查反馈,并分批推送修改。适合希望以更少的人工跟进,让拉取请求达到干净状态的开发者。
适用场景
- ✓当拉取请求有失败的检查,并希望自动修复的时候。
- ✓当审阅者留下了评论,并希望在评论出现时就处理的时候。
- ✓当你希望对拉取请求进行监看,直到可以合并的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/babysit-pr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能盯着我的拉取请求,修复任何失败的检查或审查评论,直到它变得干净吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体每一轮都检查拉取请求,阅读所有审查评论,修复能修复的内容,并将修改合并为一批推送。如果没有合并请求,在检查全部通过且没有新反馈 30 分钟后停止。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Babysit PR
Monitor PR $ARGUMENTS: fix CI failures and review feedback, one batched push
at a time, until the PR is clean. With no number, find it from the branch:
gh pr list --head "$(git branch --show-current)" --state open --json number --limit 1
Ownership, who may push or comment, the merge gate, cadence, and the Codex
goal and heartbeat all live in ship. Under /ship this is a step inside it:
keep going through the merge. Standalone, stop after 30 minutes of green
GitHub Actions and no new feedback, and merge only if the user asks.
Each tick
Refresh and read the live PR:
git fetch origin --quiet gh api user --jq .login gh pr view $ARGUMENTS --json state,mergedAt,author,headRepository,headRefName,headRefOid,baseRefName,mergeable,mergeCommitIf
author.loginisn't your login, don't push, comment, or merge unless the user named this PR and that action. Closed without a merge ends the work; report it as unsuccessful. Merged under/shipcontinues with its post-merge step. If the query fails, retry on the next tick instead of acting on old data.Read all review comments, every tick, until the moment you merge. Review bots re-review on every push and post a new round each time. Never filter by a "since <timestamp>" window: it hides rounds posted before your last reply, and "0 new" reads as "all addressed" (this left two rounds unanswered on PR #1097). Use reply state instead. Run both queries below with
set -o pipefail. If either fails, the PR is not clean: retry next tick, and never read empty output from a failed call as "no feedback". This lists every top-level comment with no reply:gh api --paginate repos/{owner}/{repo}/pulls/$ARGUMENTS/comments --jq '.[]' \ | jq -s ' ([ .[] | .in_reply_to_id // empty ]) as $replied | .[] | select((.in_reply_to_id // null) == null) | select(.id as $id | ($replied | index($id)) | not) | {id, user: .user.login, path, line: (.line // .original_line), snippet: (.body[0:200])}'Bind
.id as $idfirst.index(.id)would read.idfrom the$repliedarray and fail. Review bodies carry findings too:gh api --paginate repos/{owner}/{repo}/pulls/$ARGUMENTS/reviews \ --jq '.[] | select(.body != null and .body != "") | {user: .user.login, state, submitted_at, body: .body[0:1000]}'Check CI with
gh pr checks $ARGUMENTSand read the logs of failing jobs. Fix repo-owned causes. Provider outages, cancelled runs, and missing secrets are not code bugs. Failures from external checks only (Cloudflare, Netlify) while GitHub Actions is green don't block, and they don't reset any timer.Fix, validate, push once. Collect everything actionable from steps 2 and 3 first, run the focused checks for what you changed, then push a single update. Each push restarts CI, so don't push piecemeal.
Reply on your own PR. Answer every thread you fixed or declined with the fix or your reasoning, and post one short top-level recap for feedback that only appeared in a review body. On anyone else's PR, comment only if the user named that PR and the comment. Feedback that needs a reply you aren't allowed to post stays unresolved and blocks the merge.
Judging feedback
- Follow a human reviewer over a bot. Treat a bot comment as a hypothesis and verify it before acting.
- Fix real bugs, security issues, data-loss risks, and repo-rule violations, even when this PR didn't introduce them.
- Skip, with a reply saying why: pre-existing issues the PR doesn't touch, false positives, nitpicks, and anything the linter or typechecker already covers.
- Never leave a comment without a disposition.
- A high or critical finding closes only with a commit that fixes it, or a reply that points at the code showing it can't happen. Replying "addressed" without either doesn't close it, and it blocks the merge.
- When a third round of findings lands on code this PR added, stop patching its edges: each patch is new code for the next round. Replace it with something simpler, often by fixing the boundary that made it necessary, or, in a sweep, revert that report's commit and leave it for a person. #8288 patched one resolver about 25 times in a day and never merged.
Pushing to an existing PR
pnpm ship:push -m "<specific subject>" stages every publishable dirty path,
so check `
常见问题
它会合并拉取请求吗?
不会自行合并。只有在你要求时才会合并。
如果拉取请求不是我的呢?
技能说明,除非你指定,否则不得在他人的拉取请求上推送、评论或合并。
它会阅读每一条评论吗?
会。每一轮它都会阅读所有审查评论,因为审查机器人在每次推送后都会再次发表评论。
详情
作者的原始描述
Watch an open PR and fix its CI failures and review feedback until it's clean. Use standalone for a PR you want monitored, or as the babysit step of /ship, which continues through the merge.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13139
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …