babysit-pr
它能做什么
这项技能让你的智能体在你提交 GitHub 拉取请求后持续检查它。适用于希望自动处理新的评审意见和失败检查、而不必不断手动查看的开发者。
适用场景
- ✓当你刚刚提交了 GitHub 拉取请求,并希望对其评审意见进行监控的时候。
- ✓当你的拉取请求测试或检查失败,并希望对其进行诊断的时候。
- ✓当你只希望在打开的拉取请求需要你帮助时收到提醒的时候。
技能链接
https://github.com/openinterpreter/openinterpreter/blob/main/.codex/skills/babysit-pr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请监控我的拉取请求,当评审人留下意见或检查失败时告诉我。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能会反复检查拉取请求的评审、测试运行和合并状态。它会分析失败原因,对可能是临时性的失败有限次数地重试,并在安全时推送分支修复。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
PR Babysitter
Objective
Babysit a PR persistently until one of these terminal outcomes occurs:
- The PR is merged or closed.
- A situation requires user help (for example CI infrastructure issues, repeated flaky failures after retry budget is exhausted, permission problems, or ambiguity that cannot be resolved safely).
- Optional handoff milestone: the PR is currently green + mergeable + review-clean. Treat this as a progress state, not a watcher stop, so late-arriving review comments are still surfaced promptly while the PR remains open.
Do not stop merely because a single snapshot returns idle while checks are still pending.
Inputs
Accept any of the following:
- No PR argument: infer the PR from the current branch (
--pr auto) - PR number
- PR URL
Core Workflow
- When the user asks to "monitor"/"watch"/"babysit" a PR, start with the watcher's continuous mode (
--watch) unless you are intentionally doing a one-shot diagnostic snapshot. - Run the watcher script to snapshot PR/review/CI state (or consume each streamed snapshot from
--watch). - Inspect the
actionslist in the JSON response. - If
diagnose_ci_failureis present, inspect failed run logs and classify the failure. - If the failure is likely caused by the current branch, patch code locally, commit, and push. Do not patch random flaky tests, CI infrastructure, dependency outages, runner issues, or other failures that are unrelated to the branch.
- If
process_review_commentis present, inspect surfaced published review items and decide whether to address them. - If a review item is actionable and correct, patch code locally, commit, push, and then resolve the associated review thread only when allowed by the GitHub state mutation policy below.
- Do not post replies to human-authored review comments/threads unless the user explicitly confirms the exact response. If a human review item is non-actionable, already addressed, or not valid, surface the item and recommended response to the user instead of replying on GitHub.
- If the failure is likely flaky/unrelated and
retry_failed_checksis present, rerun failed jobs with--retry-failed-now. - If both actionable review feedback and
retry_failed_checksare present, prioritize review feedback first; a new commit will retrigger CI, so avoid rerunning flaky checks on the old SHA unless you intentionally defer the review change. - On every loop, look for newly surfaced review feedback before acting on CI failures or mergeability state, then verify mergeability / merge-conflict status (for example via
gh pr view) alongside CI. - After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
- If you had been using
--watchbefore pausing to patch/commit/push, relaunch--watchyourself in the same turn immediately after the push (do not wait for the user to re-invoke the skill). - Repeat polling until
stop_pr_closedappears or a user-help-required blocker is reached. A green + review-clean + mergeable PR is a progress milestone, not a reason to stop the watcher while the PR is still open. - Maintain terminal/session ownership: while babysitting is active, keep consuming watcher output in the same turn; do not leave a detached
--watchprocess running and then end the turn as if monitoring were complete.
Commands
One-shot snapshot
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --once
Continuous watch (JSONL)
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --watch
Trigger flaky retry cycle (only when watcher indicates)
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --retry-failed-now
Explicit PR target
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr <number-or-url> --once
CI Failure Classification
Use gh commands to inspect failed runs before deciding to rerun.
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headShagh api repos/<owner>/<repo>/actions/runs/<run-id>/jobs -X GET -f per_page=100gh api repos/<owner>/<repo>/actions/jobs/<job-id>/logs > /tmp/codex-gh-job-<job-id>-logs.zipgh run view <run-id> --log-failedas a fallback after the overall workflow run is complete
gh run view --log-failed is workflow-run scoped and may not expose failed-job logs until the overall run finishes. For faster diagnosis, poll the run's
常见问题
它会合并拉取请求吗?
它会一直监控,直到拉取请求被合并或关闭,并在需要做决定时请你帮忙。
它会在不经询问的情况下修改我的代码吗?
在适当的情况下,它可以为你分支中的问题打补丁并推送修复;如果修复方案不明确,它会询问你。
什么算是不稳定的失败?
看起来与你的分支无关的失败,例如临时性的测试或基础设施问题,可能会被重试。
详情
作者的原始描述
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.
热度
- GitHub 星标
- 69k
- 排名
- #3161
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …