agentleFS
b1rdmaniab1rdmania/ghostclaw/.claude/skills/pr-babysitter/SKILL.md

pr-babysitter

Skill91 starsChanged 7 months agoMITView on GitHub

Set up automated PR monitoring. Watches GitHub repos for PRs with failing CI or unanswered review comments, fixes high-confidence issues automatically, and messages you when human input is needed. Triggers on "pr babysitter", "watch PRs", "monitor PRs", "pr monitor".

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

7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If not authenticated, run gh auth login.

    line 18
  2. Very specific:

    Use AskUserQuestion for each:

    line 22
  3. Very specific:

    How often to check?: Default: every 30 minutes (*/30 * * * *)

    line 27
  4. Distinctive:

    What to watch for?: Default: all of the below.

    line 28
  5. Distinctive:

    Auto-fix?: Should the agent attempt high-confidence fixes (typos, linting, simple test fixes) or always ask first?

    line 32
  6. Very specific:

    Pause: Update task status to paused via IPC or ask the agent

    line 88
  7. Very specific:

    Resume: Update task status to active

    line 89

“Common” is measured: kept by at least 6 in 10 of the 4 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 Babysitter

Automated PR monitoring that only spawns an agent when there's actual work to do. Uses the scheduler's pre_check feature to run a lightweight gh CLI check first — zero API credits burned when all PRs are clean.

Setup

1. Verify GitHub CLI

gh auth status

If not authenticated, run gh auth login.

2. Ask the user

Use AskUserQuestion for each:

  1. Which repos to watch? Accept either:
    • Specific repos: owner/repo1 owner/repo2
    • All repos: gh repo list --json nameWithOwner -q '.[].nameWithOwner'
  2. How often to check? Default: every 30 minutes (*/30 * * * *)
  3. What to watch for? Default: all of the below. Let user pick:
    • Failing CI checks
    • Unanswered review comments (especially from AI reviewers)
    • Stale PRs (no activity for 48h+)
  4. Auto-fix? Should the agent attempt high-confidence fixes (typos, linting, simple test fixes) or always ask first?

3. Create the scheduled task

Build a pre_check script and prompt based on user choices. Example for watching specific repos:

cat > $GHOSTCLAW_IPC_DIR/tasks/pr-babysitter_$(date +%s).json << 'TASKEOF'
{
  "type": "schedule_task",
  "pre_check": "REPOS=\"owner/repo1 owner/repo2\"; for repo in $REPOS; do gh pr list --repo $repo --state open --json number,title,headRefName,statusCheckRollup,reviewDecision,updatedAt --jq '.[] | select(.statusCheckRollup == \"FAILURE\" or .reviewDecision == \"CHANGES_REQUESTED\" or (.reviewDecision == \"\" and (.statusCheckRollup == \"PENDING\" or .statusCheckRollup == \"\")))' 2>/dev/null; done",
  "prompt": "You are a PR babysitter. These PRs need attention:\n\n{{pre_check_output}}\n\nFor each PR:\n1. Check CI status: `gh pr checks <number> --repo <repo>`\n2. Read review comments: `gh api repos/<owner>/<repo>/pulls/<number>/comments`\n3. If CI fails with a clear fix (linting, type error, simple test fix):\n   - Clone the repo, checkout the branch, fix it, push\n   - Comment on the PR: \"Fixed [issue] automatically\"\n4. If review comments are from AI reviewers and the suggestion is high-confidence:\n   - Implement the change, push, reply to the comment\n5. If it needs human judgement:\n   - Message me with: repo, PR number, what's wrong, what you think the fix is\n\nBe conservative. Only auto-fix things you're confident about. When in doubt, ask.",
  "schedule_type": "cron",
  "schedule_value": "*/30 * * * *",
  "context_mode": "isolated",
  "targetJid": "TARGET_JID"
}
TASKEOF

Replace TARGET_JID with the user's chat JID (get from registered groups).

4. Confirm setup

Tell the user:

  • PR babysitter is active
  • Checking every [interval] for [repos]
  • Will auto-fix: [yes/no]
  • To pause: "pause the PR babysitter" or "stop watching PRs"
  • To check now: "check my PRs"

Pre-check script details

The pre_check runs as a bash script before spawning the agent:

  • Exit 0 + no output → nothing to do, agent not spawned (free)
  • Exit 0 + output → PRs found, output passed to agent as {{pre_check_output}}
  • Exit non-zero → something's wrong, agent spawned to investigate

The gh pr list with --jq filter only outputs PRs that actually need attention. If all PRs are green with no pending reviews, the output is empty and the agent is skipped entirely.

Customising the pre_check

For users who want to watch all their repos:

"pre_check": "gh repo list --json nameWithOwner -q '.[].nameWithOwner' | while read repo; do gh pr list --repo $repo --state open --json number,title,headRefName,statusCheckRollup,reviewDecision --jq '.[] | select(.statusCheckRollup == \"FAILURE\" or .reviewDecision == \"CHANGES_REQUESTED\")' 2>/dev/null; done"

For users who only care about failing CI (not review comments):

"pre_check": "gh pr list --repo owner/repo --state open --json number,title,statusCheckRollup --jq '.[] | select(.statusCheckRollup == \"FAILURE\")'"

Managing the babysitter

  • Pause: Update task status to paused via IPC or ask the agent
  • Resume: Update task status to active
  • Change repos: Cancel old task, create new one with updated pre_check
  • Run now: User can say "check my PRs now" — agent runs the same prompt manually

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.