Skip to content
Back to skills

Babysit Pr

ASecurity

Monitor a GitHub PR and handle CI or review blockers until ready or blocked. Use when asked to watch, babysit, or manage PR feedback.

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
ai-agentspythonrustbashgitapi

Works with

  • cursor
  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add shekohex/dotai --skill babysit-pr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Babysit Pr?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Babysit Pr
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shekohex-babysit-pr/badge)](https://www.skillsdirectory.com/skills/shekohex-babysit-pr)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: babysit-pr
description: Monitor a GitHub PR and handle CI or review blockers until ready or blocked. Use when asked to watch, babysit, or manage PR feedback.
---

# PR Babysitter

## Objective
Monitor one PR until exactly one terminal outcome happens:

- PR is merged or closed.
- PR is ready to merge: CI green, review feedback handled, required approval not blocking, no merge conflict risk.
- User help is required: permissions/auth failure, exhausted flaky retries, ambiguous review request, unsafe local state.

## Quick Start

```bash
python3 <skill-dir>/scripts/gh_pr_watch.py --pr auto --watch
```

`--watch` is agent-first: it blocks silently, emits one compact JSON event, then exits. Reuse the returned `cursor` on the next invocation; no state file is needed.

```bash
python3 <skill-dir>/scripts/gh_pr_watch.py --pr auto --watch --cursor '<cursor>'
```

## Agent Loop

1. Run `--watch` with the latest cursor, if any.
2. Read the single JSON event.
3. Act on `actions` and `event`.
4. After any fix, commit, push, or retry, run `--watch` again with returned cursor.
5. Stop only on terminal event or user-help blocker.

## Event Handling

| Event | Action |
| --- | --- |
| `review_feedback` | Inspect `review_items`; patch only correct/actionable feedback. |
| `ci_failed` | Inspect `failed_runs`/`failed_checks`; diagnose logs before retry/fix. |
| `sha_changed` | Note new SHA; continue watching with cursor. |
| `mergeability_changed` | Re-check merge conflict/review state; continue or stop if blocked. |
| `ci_green` | Report concise progress; keep watching for review/mergeability changes. |
| `heartbeat` | No useful change before max wait; continue watching with cursor. |
| `ready` | Final success summary; stop. |
| `closed` | Final closed/merged summary; stop. |
| `blocked` | Explain blocker; stop and ask user. |

Retry flaky failures only when `actions` includes `retry_failed_checks`:

```bash
python3 <skill-dir>/scripts/gh_pr_watch.py --pr auto --retry-failed-now --cursor '<cursor>'
```

## CI Failure Rules

- Treat compile/typecheck/lint/test failures in touched areas as branch-related; fix, commit, push.
- Treat runner/network/registry/GitHub infra failures as likely flaky; retry only when watcher allows it.
- If ambiguous, inspect logs once before deciding.

Commands:

```bash
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headSha
gh run view <run-id> --log-failed
```

## Review Rules

- Watcher surfaces trusted human/bot review activity once per cursor.
- Address only technically correct, actionable feedback that fits user intent.
- If feedback is ambiguous, product-level, or conflicts with instructions, stop and ask.

## Git Safety

- Work only on the PR head branch.
- Before edits, stop if unrelated uncommitted changes exist.
- Avoid destructive git commands and unnecessary branch switches.
- After each fix: commit, push, then resume `--watch` with cursor.

## Final Summary

Include PR SHA, CI summary, mergeability/review state, fixes pushed, retry cycles used, and remaining blockers.

## References

- Event schema: `./references/watcher-events.md`
- CI/review heuristics: `./references/heuristics.md`
- GitHub CLI/API notes: `./references/github-api-notes.md`

Files in this skill

  • SKILL.md3.2 KB
  • references/github-api-notes.md2.2 KB
  • references/heuristics.md2.3 KB
  • references/watcher-events.md2.4 KB
  • scripts/gh_pr_watch.py35.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.