babysit-pr

openai/codex

Сопровождение пул-реквеста после создания: опрос комментариев ревью, CI-проверок и статуса слияния до мержа или закрытия.

Звёзды135 700
Форки21 520
Авторopenai
Обновлённоя 18 2026

Установка

SKILL.md

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

  1. 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.
  2. Run the watcher script to snapshot PR/review/CI state (or consume each streamed snapshot from --watch).
  3. Inspect the actions list in the JSON response.
  4. If diagnose_ci_failure is present, inspect failed run logs and classify the failure.
  5. 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.
  6. If process_review_comment is present, inspect surfaced published review items and decide whether to address them.
  7. 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.
  8. 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.
  9. If the failure is likely flaky/unrelated and retry_failed_checks is present, rerun failed jobs with --retry-failed-now.
  10. If both actionable review feedback and 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.
  11. 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.
  12. After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
  13. If you had been using --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).
  14. Repeat polling until stop_pr_closed appears 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.
  15. Maintain terminal/session ownership: while babysitting is active, keep consuming watcher output in the same turn; do not leave a detached --watch process 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,headSha
  • gh api repos/<owner>/<repo>/actions/runs/<run-id>/jobs -X GET -f per_page=100
  • gh api repos/<owner>/<repo>/actions/jobs/<job-id>/logs > /tmp/codex-gh-job-<job-id>-logs.zip
  • gh run view <run-id> --log-failed as 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 jobs first and, as soon as a specific job has failed, fetch that job's logs directly from the Actions job logs endpoint. The watcher includes a failed_jobs list with each failed job's job_id and logs_endpoint when GitHub exposes one.

Prefer treating failures as branch-related when failed-job 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).

Do not attempt to fix flaky/unrelated failures by changing tests, build scripts, CI configuration, dependency pins, or infrastructure-adjacent code unless the logs clearly connect the failure to the PR branch. For flaky/unrelated failures, rerun only when the watcher recommends retry_failed_checks; otherwise wait or stop for user help.

If classification is ambiguous, perform one manual diagnosis attempt before choosing rerun.

Read .codex/skills/babysit-pr/references/heuristics.md for a concise checklist.

Review Comment Handling

The watcher surfaces review items from:

  • PR issue comments
  • Inline review comments
  • Review submissions (COMMENT / APPROVED / CHANGES_REQUESTED)

Only act on published feedback. Ignore review submissions in GitHub's PENDING state and inline comments attached to those pending reviews. Do not mark pending review feedback as seen; it should be eligible to surface after the reviewer submits the review.

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 unaddressed published 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:

  1. Patch code locally.
  2. Commit with codex: address PR review feedback (#<n>).
  3. Push to the PR head branch.
  4. After the push succeeds, resolve the associated GitHub review thread only when allowed by the GitHub state mutation policy below.
  5. Resume watching on the new SHA immediately (do not stop after reporting the push).
  6. If monitoring was running in --watch mode, restart --watch immediately after the push in the same turn; do not wait for the user to ask again.

Do not post replies to human-authored GitHub review comments/threads automatically. If you disagree with a human comment, believe it is non-actionable/already addressed, or need to answer a question, report the item to the user with a suggested response and wait for explicit confirmation before posting anything on GitHub. If the user approves a response, prefix it with [codex] so it is clear the response is automated and not from the human user. If the watcher later surfaces your own approved reply because the authenticated operator is treated as a trusted review author, treat that self-authored item as already handled and do not reply again. 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.

GitHub State Mutation Policy

You can read any PR state you need for monitoring. Writes must comply with this policy.

You can push PRs to update the code under review or to force CI re-runs as described above.

You can resolve review comment threads from the human who requested babysitting or from the Codex review bot. When resolving, leave a comment prefixed with [from Codex]: and explain what changes you made and which commit includes them. Don't touch review threads if other humans other than the user who requested babysitting have participated.

Before making any changes, fetch the PR state yourself instead of relying on the PR watcher script's output.

Unless explicitly asked, do not:

  • comment on other humans' review threads, communicate with the user in chat instead
  • resolve review threads from humans other than the user
  • interact with humans other than the user
  • mark PRs as drafts or ready for review
  • close or reopen PRs

In general, never act on GitHub in ways that would make it hard to tell whether you or the user did something visible to other humans. When in doubt, ask the user for clarification in chat.

Git Safety Rules

  • Work only on the PR head branch.
  • Avoid destructive git commands.
  • Do not switch branches unless necessary to recover context.
  • Before editing, check for unrelated uncommitted changes. If present, stop and ask the user.
  • After each successful fix, commit and git push, then re-run the watcher.
  • If you interrupted a live --watch session to make the fix, restart --watch immediately after the push in the same turn.
  • Do not run multiple concurrent --watch processes for the same PR/state file; keep one watcher session active and reuse it until it stops or you intentionally restart it.
  • A push is not a terminal outcome; continue the monitoring loop unless a strict stop condition is met.

Commit message defaults:

  • codex: fix CI failure on PR #<n>
  • codex: address PR review feedback (#<n>)

Monitoring Loop Pattern

Use this loop in a live Codex session:

  1. Run --once.
  2. Read actions.
  3. First check whether the PR is now merged or otherwise closed; if so, report that terminal state and stop polling immediately.
  4. Check CI summary, new review items, and mergeability/conflict status.
  5. Diagnose CI failures and classify branch-related vs flaky/unrelated. If the overall run is still pending but failed_jobs already includes a failed job, fetch that job's logs and diagnose immediately instead of waiting for the whole workflow run to finish. Patch only when the failure is branch-related.
  6. For each surfaced review item from another author, patch/commit/push if it is actionable, then resolve it only when allowed by the GitHub state mutation policy above. If it is non-actionable, already addressed, or requires a written answer, surface it to the user with a suggested response instead of posting automatically. If a later snapshot surfaces your own approved reply, treat it as informational and continue without responding again.
  7. Process actionable review comments before flaky reruns when both are present; if a review fix requires a commit, push it and skip rerunning failed checks on the old SHA.
  8. Retry failed checks only when retry_failed_checks is present and you are not about to replace the current SHA with a review/CI fix commit. Do not make code changes for unrelated flakes or infrastructure failures just to get CI green.
  9. If you pushed a commit, resolved an eligible review thread, or triggered a rerun, report the action briefly and continue polling (do not stop). If a human review comment needs a written GitHub response, stop and ask for confirmation before posting.
  10. After a review-fix push, proactively restart continuous monitoring (--watch) in the same turn unless a strict stop condition has already been reached.
  11. If everything is passing, mergeable, not blocked on required review approval, and there are no unaddressed review items, report that the PR is currently ready to merge but keep the watcher running so new review comments are surfaced quickly while the PR remains open.
  12. If blocked on a user-help-required issue (infra outage, exhausted flaky retries, unclear reviewer request, permissions), report the blocker and stop.
  13. Otherwise sleep according to the polling cadence below and repeat.

When the user explicitly asks to monitor/watch/babysit a PR, prefer --watch so polling continues autonomously in one command. Use repeated --once снимки только для отладки, локального тестирования или когда пользователь явно запрашивает разовую проверку. Не останавливайтесь, чтобы спросить пользователя, продолжать ли опрос; продолжайте автономно, пока не будет выполнено строгое условие остановки или пользователь явно не прервёт. Не возвращайте управление пользователю после push с исправлениями по ревью только потому, что был создан новый SHA; перезапуск watcher и повторный вход в цикл опроса — часть той же задачи сопровождения. Если --watch процесс всё ещё выполняется и строгое условие остановки не достигнуто, задача сопровождения всё ещё выполняется; продолжайте передавать/потреблять вывод watcher вместо завершения хода.

Частота опроса

Поддерживайте агрессивный опрос ревью и продолжайте мониторинг даже после того, как CI станет зелёным:

  • Пока CI не зелёный (pending/running/queued или failing): опрашивайте каждую 1 минуту.
  • После того как CI станет зелёным: продолжайте опрос с базовой частотой, пока PR остаётся открытым, чтобы новые комментарии ревью появлялись оперативно, вместо ожидания длительного backoff в зелёном состоянии.
  • Сбрасывайте частоту немедленно при любом изменении (новый коммит/SHA, изменения статуса проверок, новые комментарии ревью, изменения возможности слияния, изменения решения по ревью).
  • Если CI снова перестаёт быть зелёным (новый коммит, повторный запуск или регрессия): оставайтесь на базовой частоте опроса.
  • Если любой опрос показывает, что PR слит или иным образом закрыт: немедленно прекратите опрос и сообщите терминальное состояние.

Условия остановки (строгие)

Останавливайтесь только когда верно одно из следующего:

  • PR слит или закрыт (остановитесь, как только опрос/снимок подтвердит это).
  • Требуется вмешательство пользователя, и Codex не может безопасно продолжить самостоятельно.

Продолжайте опрос, когда:

  • actions содержит только idle но проверки всё ещё в ожидании.
  • CI всё ещё выполняется/в очереди.
  • Состояние ревью спокойное, но CI не терминален.
  • CI зелёный, но возможность слияния неизвестна/в ожидании.
  • CI зелёный и возможно слияние, но PR всё ещё открыт, и вы ждёте возможных новых комментариев ревью или изменений из-за конфликтов слияния.
  • PR зелёный, но заблокирован ожиданием одобрения ревью (REVIEW_REQUIRED / аналогичное); продолжайте опрос с базовой частотой и показывайте любые новые комментарии ревью, не спрашивая подтверждения на продолжение наблюдения.

Ожидания по выводу

Предоставляйте краткие обновления о прогрессе во время мониторинга и итоговую сводку, включающую:

  • В течение длительных периодов мониторинга без изменений избегайте полного обновления при каждом опросе; суммируйте только изменения статуса плюс occasional heartbeat-обновления.

  • Рассматривайте подтверждения push, промежуточные снимки CI, снимки готовности к слиянию и обновления действий по ревью только как обновления о прогрессе; не выдавайте итоговую сводку и не завершайте сессию сопровождения, если не выполнено строгое условие остановки.

  • Запрос пользователя на "мониторинг" не удовлетворяется парой выборочных опросов; оставайтесь в цикле до строгого условия остановки или явного прерывания пользователем.

  • Коммит с исправлениями по ревью + push не является событием завершения; немедленно возобновите живой мониторинг (--watch) в том же ходе и продолжайте сообщать обновления о прогрессе.

  • Когда CI впервые переходит в полностью зелёное состояние для текущего SHA, выдайте однократное праздничное обновление о прогрессе (не повторяйте его при каждом зелёном опросе). Предпочтительный стиль: 🚀 CI is all green! 33/33 passed. Still on watch for review approval.

  • Не отправляйте итоговую сводку, пока терминал watcher всё ещё выполняется, если только watcher не выдал/подтвердил строгое условие остановки; иначе продолжайте с обновлениями о прогрессе.

  • Финальный SHA PR

  • Сводка статуса CI

  • Возможность слияния / статус конфликтов

  • Отправленные исправления

  • Использованные циклы повторных попыток для flaky-тестов

  • Оставшиеся нерешённые сбои или комментарии ревью

Ссылки

  • Эвристики и дерево решений: .codex/skills/babysit-pr/references/heuristics.md
  • Детали GitHub CLI/API, используемые watcher: .codex/skills/babysit-pr/references/github-api-notes.md

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: babysit-pr](https://darkplay.ru/ai/skills/codex-babysit-pr)

Описание

Сопровождение GitHub pull request после создания: непрерывный опрос комментариев ревью, проверок/запусков CI и состояния слияния, пока PR не будет слит/закрыт или не потребуется помощь пользователя. Диагностирует сбои, повторяет вероятно нестабильные сбои до 3 раз, при необходимости автоматически исправляет и пушит связанные с веткой проблемы и продолжает следить за открытыми PR, чтобы свежие отзывы ревью появлялись своевременно. Используй, когда пользователь просит Codex мониторить PR, следить за CI, обрабатывать комментарии ревью или держать под наблюдением сбои и отзывы по открытому PR.

Похожие скиллы и другие разделы каталога

Похожие скиллы в категории «Рабочие процессы»

Та же категория — сравните, что ещё подойдёт под вашу задачу.

beadsgastownhall · Для репозиториев с bd или Beads: учёт задач, зависимости, блокеры, передача между…
28 812 ★
planning-with-filesOthmanAdi · Постоянное файловое планирование для ИИ-агентов: task_plan.md, findings.md и progress.md…
28 119 ★
ce-brainstormeveryinc · Проработка расплывчатых или амбициозных идей в соразмерный план только с требованиями…
26 142 ★
harness-creatorwalkinglabs · Создание, аудит и улучшение обвязок для надёжной работы ИИ-агентов: файлы инструкций…
25 333 ★
paseogetpaseo · Справочник Paseo по управлению рабочими пространствами, агентами, расписаниями и…
24 294 ★
butgitbutlerapp · Коммиты, пуш, ветки и управление версиями через GitButler: выборочные коммиты файлов и…
21 974 ★
using-superpowersjnmetacode · Китайская версия superpowers (116k+ ⭐): полный перевод + 6 оригинальных китайских skills…
8 559 ★
tlc-spec-driventech-leads-club · Планирование и реализация фич в 4 адаптивных фазы — Specify, Design, Tasks, Execute…
7 177 ★
n8n-workflow-patternsczlonkowski · Проверенные архитектурные паттерны из реальных workflow n8n. Полезно при создании новых…
6 668 ★
grill-mevinvcn · Серия уточняющих вопросов для доработки плана или дизайна.
5 904 ★
Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8