babysit-pr by openai/codex
npx skills add https://github.com/openai/codex --skill babysit-pr持续照看一个 PR,直到出现以下任一终止结果:
不要仅仅因为某个快照返回 idle 状态而停止,只要检查仍在进行中。
接受以下任一输入:
--pr auto)--watch)开始。--watch 的每个流式快照)。actions 列表。diagnose_ci_failure,则检查失败的运行日志并对故障进行分类。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
process_review_comment,则检查发现的评审项并决定是否处理它们。retry_failed_checks,则使用 --retry-failed-now 重新运行失败的作业。retry_failed_checks,则优先处理评审反馈;新的提交将重新触发 CI,因此除非你特意推迟评审更改,否则应避免在旧的 SHA 上重新运行偶发性检查。gh pr view)。--watch,请在推送后立即在同一轮对话中自行重新启动 --watch(不要等待用户重新调用该技能)。stop_pr_closed,或遇到需要用户帮助的阻碍。--watch 进程在运行,然后结束本轮对话,就好像监控已完成一样。python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --once
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --watch
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --retry-failed-now
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr <number-or-url> --once
在决定重新运行之前,使用 gh 命令检查失败的运行。
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headShagh run view <run-id> --log-failed当日志指向更改的代码(在触及区域内的编译/测试/lint/类型检查/快照/静态分析)时,倾向于将故障视为与分支相关。
当日志显示短暂的基础设施/外部问题时(超时、运行器配置失败、注册表/网络中断、GitHub Actions 基础设施错误),倾向于将故障视为偶发性/无关。
如果分类不明确,在选择重新运行之前进行一次手动诊断尝试。
阅读 .codex/skills/babysit-pr/references/heuristics.md 以获取简明的检查清单。
监视器从以下来源发现评审项:
除了人工评审反馈外,它特意发现 Codex 评审机器人反馈(例如来自 chatgpt-codex-connector[bot] 的评论/评审)。大多数无关的机器人噪音仍应被忽略。为安全起见,监视器仅自动发现受信任的人工评审作者(例如仓库 OWNER/MEMBER/COLLABORATOR,加上经过身份验证的操作者)和已批准的评审机器人(如 Codex)。在新的监视器状态文件上,现有的待处理评审反馈可能会立即被发现(不仅仅是监控开始后到达的评论)。这是有意为之,以免遗漏已打开的评审评论。
当你同意某个评论并且它是可操作时:
codex: address PR review feedback (#<n>) 提交。--watch 模式运行的,则在推送后立即在同一轮对话中重新启动 --watch;不要等待用户再次询问。如果你不同意,或者评论不可操作/已处理,则通过继续监视器循环将其记录为已处理(脚本在发现项目后通过状态进行去重)。如果某个代码评审评论/线程在 GitHub 中已标记为已解决,则将其视为不可操作并安全忽略,除非出现新的未解决的后续反馈。
git push,然后重新运行监视器。--watch 会话来进行修复,请在推送后立即在同一轮对话中重新启动 --watch。--watch 进程;保持一个监视器会话处于活动状态并重复使用它,直到它停止或你故意重新启动它。提交消息默认值:
codex: fix CI failure on PR #<n>codex: address PR review feedback (#<n>)在实时 Codex 会话中使用此循环:
--once。actions。retry_failed_checks 并且你不打算用评审/CI 修复提交替换当前 SHA 时,才重试失败的检查。--watch)。当用户明确要求监控/监视/照看一个 PR 时,优先使用 --watch,以便轮询在一个命令中自主继续。仅在调试、本地测试或用户明确要求一次性检查时,才使用重复的 --once 快照。不要停下来询问用户是否继续轮询;自主继续,直到满足严格的停止条件或用户明确中断。不要在评审修复推送后仅仅因为创建了新的 SHA 就将控制权交还给用户;重新启动监视器并重新进入轮询循环是同一照看任务的一部分。如果一个 --watch 进程仍在运行且未达到严格的停止条件,则照看任务仍在进行中;继续流式传输/消费监视器输出,而不是结束本轮对话。
使用自适应轮询,即使在 CI 变绿后也继续监控:
仅当以下任一条件为真时才停止:
在以下情况下继续轮询:
actions 仅包含 idle 但检查仍在待处理。REVIEW_REQUIRED / 类似情况);继续按绿色状态节奏轮询,并发现任何新的评审评论,无需请求确认以继续监视。在监控期间提供简洁的进度更新,并提供包含以下内容的最终摘要:
--watch)并继续报告进度更新。🚀 CI 全部通过!33/33 成功。仍在监视等待评审批准。.codex/skills/babysit-pr/references/heuristics.md.codex/skills/babysit-pr/references/github-api-notes.md每周安装次数
298
仓库
GitHub 星标数
67.1K
首次出现
2026年2月23日
安全审计
安装于
opencode295
codex163
kimi-cli162
gemini-cli162
amp162
github-copilot162
Babysit a PR persistently until one of these terminal outcomes occurs:
Do not stop merely because a single snapshot returns idle while checks are still pending.
Accept any of the following:
--pr auto)--watch) unless you are intentionally doing a one-shot diagnostic snapshot.--watch).actions list in the JSON response.diagnose_ci_failure is present, inspect failed run logs and classify the failure.process_review_comment is present, inspect surfaced review items and decide whether to address them.retry_failed_checks is present, rerun failed jobs with --retry-failed-now.retry_failed_checks are 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.gh pr view) in addition to CI and review state.--watch before pausing to patch/commit/push, relaunch --watch yourself in the same turn immediately after the push (do not wait for the user to re-invoke the skill).stop_pr_closed appears, or a user-help-required blocker is reached.--watch process running and then end the turn as if monitoring were complete.python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --once
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --watch
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --retry-failed-now
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr <number-or-url> --once
Use gh commands to inspect failed runs before deciding to rerun.
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headShagh run view <run-id> --log-failedPrefer treating failures as branch-related when logs point to changed code (compile/test/lint/typecheck/snapshots/static analysis in touched areas).
Prefer treating failures as flaky/unrelated when logs show transient infra/external issues (timeouts, runner provisioning failures, registry/network outages, GitHub Actions infra errors).
If classification is ambiguous, perform one manual diagnosis attempt before choosing rerun.
Read .codex/skills/babysit-pr/references/heuristics.md for a concise checklist.
The watcher surfaces review items from:
It intentionally surfaces Codex reviewer bot feedback (for example comments/reviews from chatgpt-codex-connector[bot]) in addition to human reviewer feedback. Most unrelated bot noise should still be ignored. For safety, the watcher only auto-surfaces trusted human review authors (for example repo OWNER/MEMBER/COLLABORATOR, plus the authenticated operator) and approved review bots such as Codex. On a fresh watcher state file, existing pending review feedback may be surfaced immediately (not only comments that arrive after monitoring starts). This is intentional so already-open review comments are not missed.
When you agree with a comment and it is actionable:
codex: address PR review feedback (#<n>).--watch mode, restart --watch immediately after the push in the same turn; do not wait for the user to ask again.If you disagree or the comment is non-actionable/already addressed, record it as handled by continuing the watcher loop (the script de-duplicates surfaced items via state after surfacing them). If a code review comment/thread is already marked as resolved in GitHub, treat it as non-actionable and safely ignore it unless new unresolved follow-up feedback appears.
git push, then re-run the watcher.--watch session to make the fix, restart --watch immediately after the push in the same turn.--watch processes for the same PR/state file; keep one watcher session active and reuse it until it stops or you intentionally restart it.Commit message defaults:
codex: fix CI failure on PR #<n>codex: address PR review feedback (#<n>)Use this loop in a live Codex session:
--once.actions.retry_failed_checks is present and you are not about to replace the current SHA with a review/CI fix commit.--watch) in the same turn unless a strict stop condition has already been reached.When the user explicitly asks to monitor/watch/babysit a PR, prefer --watch so polling continues autonomously in one command. Use repeated --once snapshots only for debugging, local testing, or when the user explicitly asks for a one-shot check. Do not stop to ask the user whether to continue polling; continue autonomously until a strict stop condition is met or the user explicitly interrupts. Do not hand control back to the user after a review-fix push just because a new SHA was created; restarting the watcher and re-entering the poll loop is part of the same babysitting task. If a --watch process is still running and no strict stop condition has been reached, the babysitting task is still in progress; keep streaming/consuming watcher output instead of ending the turn.
Use adaptive polling and continue monitoring even after CI turns green:
Stop only when one of the following is true:
Keep polling when:
actions contains only idle but checks are still pending.REVIEW_REQUIRED / similar); continue polling on the green-state cadence and surface any new review comments without asking for confirmation to keep watching.Provide concise progress updates while monitoring and a final summary that includes:
During long unchanged monitoring periods, avoid emitting a full update on every poll; summarize only status changes plus occasional heartbeat updates.
Treat push confirmations, intermediate CI snapshots, and review-action updates as progress updates only; do not emit the final summary or end the babysitting session unless a strict stop condition is met.
A user request to "monitor" is not satisfied by a couple of sample polls; remain in the loop until a strict stop condition or an explicit user interruption.
A review-fix commit + push is not a completion event; immediately resume live monitoring (--watch) in the same turn and continue reporting progress updates.
When CI first transitions to all green for the current SHA, emit a one-time celebratory progress update (do not repeat it on every green poll). Preferred style: 🚀 CI is all green! 33/33 passed. Still on watch for review approval.
Do not send the final summary while a watcher terminal is still running unless the watcher has emitted/confirmed a strict stop condition; otherwise continue with progress updates.
Final PR SHA
CI status summary
Mergeability / conflict status
Fixes pushed
Flaky retry cycles used
Remaining unresolved failures or review comments
.codex/skills/babysit-pr/references/heuristics.md.codex/skills/babysit-pr/references/github-api-notes.mdWeekly Installs
298
Repository
GitHub Stars
67.1K
First Seen
Feb 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode295
codex163
kimi-cli162
gemini-cli162
amp162
github-copilot162
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装
阿里云云防火墙管理技能:使用OpenAPI和SDK自动化安全配置
242 周安装
Salesforce AI 可视化技能:Nano Banana Pro 生成 ERD、架构图与 UI 线框图
242 周安装
发票图像OCR读取技能 - 自动提取结构化数据,支持PDF/图片双重验证
242 周安装
WPS文字智能助手使用指南 - 24个工具解决Word文档排版、格式、目录问题
242 周安装
sdd:brainstorm - 创意协作对话工具,将创意转化为完整设计与规范
242 周安装
阿里云Data Lake Formation管理工具 - 使用OpenAPI和SDK管理数据湖资源
242 周安装