Babysit pr
Skill mshadmanrahman/pm-operating-system/_context/skills/babysit-pr
An opinionated workflow system that restructures how product managers work with Claude Code. 16 PM skills, 9 agents, 10 coding rules, 13 slash commands, 6 automation hooks, product brain system, and session lifecycle with memory/handoffs.
npx -y skills add mshadmanrahman/pm-operating-system --skill babysit-prAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Monitor open PRs, retry flaky CI, resolve merge conflicts, and auto-merge when ready. Use when managing multiple PRs, after creating PRs, or when CI is failing intermittently. Triggers on: "babysit my PRs", "check PR status", "why is CI failing", "merge my PRs", "monitor PRs", "PR status", "what's blocking my PRs", "/babysit-pr".
SKILL.md
6.0 KB, as published. Nobody here has run it
Babysit PR
Continuous PR lifecycle management: monitor CI, retry flaky checks, resolve merge conflicts, and enable auto-merge. Inspired by Thariq's CI/CD & Deployment pattern from Anthropic's internal playbook.
When to Activate
- User says "babysit my PRs", "check PR status", "monitor PRs"
- User says "why is CI failing", "what's blocking my PRs"
- User says "merge my PRs", "auto-merge when ready"
- After a batch PR creation session (e.g., 10+ PRs in a day)
- When CI is flaky and user wants automatic retries
Modes
Single PR Mode
Monitor one specific PR by number or URL.
babysit-pr #4105
babysit-pr https://github.com/your-org/your-repo/pull/4105
Steps:
- Parse PR number from input (strip URL if needed)
- Run
scripts/check-pr-status.sh <repo> <pr-number> - Analyze CI failures against
references/ci-patterns.md - Take action or report findings
Batch Mode
Scan all open PRs by the current user across a repo.
babysit-pr your-org/your-repo
babysit-pr --all
Steps:
- Run
scripts/batch-check.sh <repo>(defaults to current repo's origin) - Sort PRs by urgency: failing CI > merge conflicts > pending review > green
- Present summary table
- Offer to act on each issue
PR Health Checks
For each PR, check all of the following:
1. CI Status
gh pr checks <number> --repo <repo>
- Map each check to pass/fail/pending
- Cross-reference failures with
references/ci-patterns.md - Distinguish required checks from optional/informational
2. Review Status
gh pr view <number> --repo <repo> --json reviews,reviewRequests
- Approved: ready to merge
- Changes requested: needs author action
- Pending: waiting on reviewers
3. Merge Conflicts
gh pr view <number> --repo <repo> --json mergeable,mergeStateStatus
- MERGEABLE: no conflicts
- CONFLICTING: needs rebase/conflict resolution
- UNKNOWN: GitHub still computing (wait and retry)
4. Branch Staleness
gh pr view <number> --repo <repo> --json baseRefName,headRefName,updatedAt
- If behind base by 10+ commits, suggest updating branch
- If no activity for 7+ days, flag as stale
Auto-Actions
Retry Flaky CI
When a check fails and references/ci-patterns.md marks the pattern as retryable:
# Re-run failed GitHub Actions workflows
gh run rerun <run-id> --failed --repo <repo>
Rules:
- Max 2 retries per check
- Only retry if the failure pattern matches a known flaky pattern
- Log each retry attempt
- If still failing after 2 retries, report as real failure
Update Branch
When PR is behind base branch and has no merge conflicts:
# GitHub API branch update (no force push)
gh api repos/<owner>/<repo>/pulls/<number>/update-branch \
--method PUT \
--field expected_head_sha="<sha>"
Rules:
- Only update if mergeable state is clean
- Never force-push
- Report the update to the user
Enable Auto-Merge
When CI is green and reviews are approved:
gh pr merge <number> --repo <repo> --auto --squash
Rules:
- Always ask before enabling auto-merge
- Only enable if: CI passing + reviews approved + no conflicts
- Default to squash merge
- Never force-merge or bypass required checks
Safety Rules
- Never force-merge a PR under any circumstances
- Never dismiss reviews or bypass review requirements
- Always report before acting on merge conflicts; let the user decide
- Ask before enabling auto-merge; present the PR state first
- Never push code to resolve conflicts without explicit user approval
- Respect branch protection rules; do not circumvent them
- Log all actions taken so the user has a clear audit trail
Output Format
Single PR Report
PR #4105: Fix recommendation form validation
CI: 2/3 passing (vercel/preview-deploy pending - 1m ago)
Reviews: Approved (2/2)
Merge: Clean, no conflicts
Branch: 3 commits behind main
Action: Update branch? [y/n]
Batch Summary
your-org/your-repo - 14 open PRs by @your-github-handle
# | Title | CI | Reviews | Merge | Action
-----|--------------------------------|---------|----------|-----------|--------
4105 | Fix form validation | Passing | Approved | Clean | Auto-merge?
4103 | Update i18n strings | Failing | Approved | Clean | Retry CI (flaky playwright)
4101 | Refactor search component | Passing | Pending | Conflicts | Report conflicts
4099 | Add landscape mode support | Pending | Pending | Clean | Wait
Actions available:
1. Retry flaky CI on #4103
2. Enable auto-merge on #4105
3. Show conflict details for #4101
Gotchas
- Vercel preview deploys take 2-3 minutes; do not declare failure before 3 minutes have elapsed. Check the
updatedAttimestamp on pending checks. gh pr checksshows ALL checks including optional/informational ones. Cross-reference with branch protection rules to identify which are required.- Some repos have required reviewers; auto-merge will not work without the required number of approvals, even if CI is green.
- GitHub mergeable state can be UNKNOWN for up to 30 seconds after a push. If UNKNOWN, wait 10 seconds and retry once.
- Rate limits:
ghCLI shares GitHub API rate limits. Batch mode across many repos can hit limits. Space requests if checking 20+ PRs. - Forked PRs have different permissions; CI retry may not work on PRs from external contributors.
Scripts
scripts/check-pr-status.sh <repo> <pr-number>: Single PR status as JSONscripts/batch-check.sh [repo]: All open PRs by current user with status
References
references/ci-patterns.md: Known CI failure patterns and retry policy