agentleFS
mastro993mastro993/fstack/skills/pr-babysit/SKILL.md

pr-babysit

Skill3 starsChanged 13 days agoMITView on GitHub

Use when the user asks to monitor, watch, babysit, or keep an eye on a pull request through CI, review, and merge, or to get a PR green or mergeable.

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    The user's checkout: If it has uncommitted changes or another branch checked out, leave it untouched (no switch, stash, or commit).

    line 24
  2. Distinctive:

    Bots: Check a bot's claim against the code before acting.

    line 28
  3. Distinctive:

    Leave threads unresolved: resolving is how the reviewer says they're satisfied.

    line 36
  4. Distinctive:

    After each push, tell the user in a line what changed, then go back to waiting.

    line 40
  5. Distinctive:

    When the PR becomes ready, tell the user in a line, with the link, and keep waiting.

    line 44
  6. Very specific:

    If you're blocked on the user, ask, say you'll resume once they answer, and leave a background wait running so other events still reach you.

    line 46

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR babysit

Stay with the PR until it is merged or closed, or the user says stop. Green CI and ready (open and not a draft, checks green, approved or no review required, no review request or requested changes outstanding, mergeable and up to date, no thread awaiting a reply) are milestones, not the end: a late review or another PR landing on the base can break a ready PR without anyone touching it. A request that names a milestone ("babysit it until it's green", "till it's mergeable") still means the whole watch: say when the PR gets there and keep going. If the user only asked to be told ("let me know when CI finishes"), report and change nothing.

Watching

scripts/pr_watch.py (in this skill's directory) reads everything in one command:

  • python3 <skill-dir>/scripts/pr_watch.py snapshot [PR]: state, failing checks, threads awaiting reply, and a READY: line with the blockers. Start with it; anything already failing or unanswered is your first work.
  • python3 <skill-dir>/scripts/pr_watch.py wait [PR]: polls every 15 s and exits on the next new event (check failed or passed, review or comment, conflict, branch behind base, draft marked ready for review or converted back, merged or closed) with a fresh snapshot, or after 25 min with NO CHANGE. It skips your own comments. Starting a wait takes over from an older one on the same PR, which exits with SUPERSEDED: ignore that one.

Wait with a host PR-watch tool if you have one (e.g. watch_pull_request). Otherwise run wait as a background command with a timeout of at least 30 minutes (it can run for 25) and end your turn; handle its notification, then start it again. Without background commands, run it in the foreground. On NO CHANGE, re-arm silently: a ready PR can sit for hours before someone merges it.

Acting

Fix failures and review comments as you normally would, minding these:

  • The user's checkout. If it has uncommitted changes or another branch checked out, leave it untouched (no switch, stash, or commit). Work in git worktree add --detach ../<repo>-pr-<n> origin/<head branch> (after git fetch) and push with git push origin HEAD:<head branch>.
  • Base moved. On BEHIND with no conflict, gh pr update-branch <n> merges the base in on GitHub. On MERGE CONFLICT, load the resolve-merge-conflicts skill and run it to the end, merging the base into the PR branch (never rebase: the shared branch keeps its history); it works out why each side changed, resolves, runs the checks, commits, and pushes. If the push dismissed approvals, re-request those reviewers.
  • CI. A failure that also happens on the base branch isn't this PR's to fix: report it. Infra failures (runner lost, network timeouts) get one gh run rerun <id> --failed. Stop and ask after two failed attempts at the same check.
  • The user's calls. Design changes, scope growth, and disagreeing with a human reviewer go to the user, and the reply stays theirs to post.
  • Bots. Check a bot's claim against the code before acting; if it's wrong, reply briefly with why.
  • Commits. Stage only the files you changed (git add <paths>): tests and builds leave artifacts like __pycache__/ that a broad add pushes into the PR for good. Never force-push a shared branch.
  • Replies. Reply on each thread you addressed with what changed and the short SHA:
    gh api graphql -f query='mutation($id: ID!, $body: String!) {
      addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: $id, body: $body}) { comment { url } }
    }' -f id=<thread id from the snapshot> -f body='<reply>'
    Leave threads unresolved: resolving is how the reviewer says they're satisfied.
  • Re-review. Once every thread from a human reviewer has a reply, gh pr edit <n> --add-reviewer <login>; hold off while one of their questions waits on the user.
  • Merging. Only if the user asked. Leave a draft a draft, and read whether it is one from the latest snapshot's state line, not from memory: its author can mark it ready on GitHub at any moment, even a PR you opened as a draft yourself.

After each push, tell the user in a line what changed, then go back to waiting.

Finishing

When the PR becomes ready, tell the user in a line, with the link, and keep waiting. Say it again only if it became ready again after something changed.

If you're blocked on the user, ask, say you'll resume once they answer, and leave a background wait running so other events still reach you.

Once the PR is merged or closed, or the user says stop, report the outcome with the PR link and a short recap of what you did along the way (pushes with their short SHAs, reruns, replies, anything left for the user), since the user may not have read every line in between. Stop any background wait (or unwatch with the host tool), and remove any worktree you created.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.