babysit-pr
Create, monitor, and shepherd a GitHub pull request end-to-end: respect repo PR templates, watch CI and reviews, fix branch-related failures, address valid…
от ckorhonen★ 35 звёзд на GitHub
Установить babysit-pr в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
PR Lifecycle Operator
Objective
Own the pull request from creation through post-merge validation with as little manual babysitting as possible.
Terminal outcomes:
- The PR is merged and the deployment looks healthy.
- The PR is merge-safe and waiting on humans.
- A blocker requires user help: ambiguous product intent, permissions, unrelated dirty worktree, external-only outage, or missing deployment visibility.
Do not stop at "PR created" or "CI is green once." Keep following the PR until one of the terminal outcomes is true.
Common Failure Modes
These gotchas appear during real PR automation and require proactive handling:
Watcher Script Exits Silently (Template Resolution)
The watcher can exit unexpectedly if PR template resolution fails during preflight. Root cause: resolve_pr_template.py may fail to parse custom template syntax, or template file is unreadable. Mitigation: always run the resolver in --json mode first to validate template before starting the watcher. If resolution fails, fall back to the bundled default template at assets/default_pr_template.md.
Multiple Watchers on Same PR (Duplicate Comments)
Running multiple gh_pr_watch.py instances for the same PR causes duplicate comment processing and can result in duplicate bot comments or conflicting retry actions. This typically happens when the watcher is restarted without properly stopping the previous session. Mitigation: use one watcher session per PR. Verify no orphaned watcher processes exist before starting: ps aux | grep gh_pr_watch. Kill any stale sessions before resuming.
CI Retry Logic Triggers on Non-Flaky Failures (Quota Waste)
The retry logic may consume the CI retry budget on failures that are not actually transient (e.g., legitimate test failures from branch-specific issues). This wastes quota and can block progress on legitimate issues. Mitigation: always inspect CI logs with gh run view <run-id> --log-failed before retrying. Confirm the failure is truly flaky or unrelated to branch changes. Apply the heuristics in references/heuristics.md strictly before calling --retry-failed-now.
Review Score Extraction Fails with Markdown Formatting
When reviewers use markdown formatting in their score phrases (e.g., **4/5** stars or `4 out of 5`), the review score extraction regex may fail to match. This results in the watcher missing explicit scores and potentially merging PRs prematurely despite unfinished reviewer feedback. Mitigation: the score extractor looks for patterns like 5/5 and 5 out of 5. If a reviewer uses markdown around the score, manually extract the numeric rating and document it in the PR thread before proceeding.
See references in each workflow section below for prevention strategies.
Defaults
- Poll open PR state every 60 seconds.
- Use one watcher session per PR.
- Prefer fixing valid review feedback before retrying flaky CI.
- Treat reviewer scores as real requirements when explicitly stated.
- Use repo-native templates and signals before falling back to bundled defaults.
Preflight
- Confirm you are on the PR branch, not the default branch.
- Confirm
gh auth statusworks. - Check for unrelated uncommitted changes before editing.
- Resolve the PR template before opening or rewriting the PR body.
PR Template Handling
Use the resolver script first:
python3 skills/babysit-pr/scripts/resolve_pr_template.py --json
⚠️ Related gotcha: See "Watcher Script Exits Silently (Template Resolution)" under Common Failure Modes. Always validate template resolution before starting the watcher.
Rules:
- If the repo has a pull request template, preserve its section structure and fill it thoughtfully.
- If no repo template exists, use the bundled fallback at
assets/default_pr_template.md. - Prefer
gh pr create --body-fileorgh pr edit --body-filewith a prepared body that mirrors the resolved template. - Do not discard checklist items unless they are clearly irrelevant and leaving them blank would be misleading.
Creation Workflow
- Resolve the template.
- Write a tight PR title.
- Build a PR body that includes summary, testing, and rollout notes.
- Push the branch.
- Create or update the PR.
- Start the watcher immediately after the push succeeds.
Helpful commands:
gh pr create --base <default-branch> --title "<title>" --body-file <body-file>
gh pr edit <pr-number> --title "<title>" --body-file <body-file>
python3 skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --watch
Watcher Workflow
The watcher emits snapshots and recommended actions. Start with:
python3 skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --watch
⚠️ Related gotchas: See Common Failure Modes for "Multiple Watchers on Same PR" and "Watcher Script Exits Silently." Ensure no stale watcher processes are running before starting, and verify template resolution completes
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- agents/openai.yaml
- assets/default_pr_template.md
- references/deployment-monitoring.md
- references/github-api-notes.md
- references/heuristics.md
- scripts/gh_deploy_watch.py
- scripts/gh_pr_watch.py
- scripts/resolve_pr_template.py
FAQ
Что делает скилл babysit-pr?
Create, monitor, and shepherd a GitHub pull request end-to-end: respect repo PR templates, watch CI and reviews, fix branch-related failures, address valid comments, and validate post-merge deployment when possible.
Как установить скилл babysit-pr?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл babysit-pr запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…