Babysit

From bendrucker/claude · View interactive version

Babysit is an AI agent skill from the GitHub repository bendrucker/claude. Monitor a PR's CI, fix trivial failures, and self-cancel when green; --merge drives to merged, --reviews hands off to AI-review triage.

How to use this skill

Skill file

Babysit PR

Drive a PR to green CI, or to merged with --merge, by reacting to a provider watcher's events with fix-and-push. Babysit is done when it calls TaskStop after reporting one terminal: green (no flags), merged (--merge), or a block it cannot fix unattended.

Context

Workflow

Start the watcher with github:actions-monitor for a github.com remote, or gitlab:ci-monitor for a gitlab.com remote. It runs under Monitor and emits JSON events, already deduped by (sha, state). Read event fields from that JSON directly, without piping CLI output to an inline interpreter.

Arguments ($ARGUMENTS), both flags off by default:

On GitHub, a PR with auto-merge already enabled (gh pr view <pr> --json autoMergeRequest is non-null) runs as --merge, since whoever enabled it approved the merge.

Bounds

Every wait runs through a watcher, including the post-submit merge wait. The watcher enforces the poll interval and wall clock (--max-minutes, default 60). Pass through a user-supplied --max-minutes. After max-time-reached, report and stop without starting a new watcher. When babysit runs in /loop, the loop handles repetition.

The watcher ends with the session. Resume by invoking babysit from a new session.

Event Handlers

status: running

Wait for the next event.

status: failing

CI may run on a synthetic merge commit, so each event reports the source branch SHA. When git rev-parse HEAD is newer than the event's sha, a fix is already pushed: wait for the new run.

The monitor skill has already run the provider's logs agent (github:logs or gitlab:logs), which gives a summary and a log-file path. Use the summary to judge triviality.

status: success

When a conflicts or unresolved mergeable-unknown event arrived for the current SHA, handle it per CODE2 first, since green on a conflicting PR is stale.

Summarize the commits pushed this session with git log <start-sha>..HEAD --oneline. Then continue to --reviews or --merge when set. With neither, report the summary and TaskStop.

other events

For conflicts, mergeable-unknown, queued-timeout, api-error, rate-limited, pr-closed, merged, and max-time-reached, load CODE8.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.