/marekkirejczyk-skills:baby-sitting [manual | auto]from marekkirejczyk-skills
Watches an open GitHub pull request until merged, keeping it rebased, green, and answered. Supports manual mode (developer merges) or auto mode (GitHub auto-merge).
Ships in marekkirejczyk-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Watches the current branch's open pull request on GitHub and handles what happens to it, until it is merged. Arguments: $ARGUMENTS. If your agent does not fill that in, take them from the user's message.
The one argument is the mode: manual (the default) or auto. Anything else: say so and stop.
The scripts are in scripts/ next to this file; <skill-dir> below is this file's directory. They need gh (signed in), jq and perl. Run every command in the checkout that holds the branch.
gh pr view --json number,url,isDraft,baseRefName. With no open PR, say so and stop. A draft can't merge and review bots skip it: gh pr ready <n>, and say you did.export REVIEW_BOT=<a pattern its login matches> and REVIEW_BOT_CHECK=<its check's name on a PR> in every call of a script. A repository with no review bot: export REVIEW_BOT=none. To tell, look at its last few pull requests (gh pr list --state all --limit 5 --json number,reviews,statusCheckRollup): a bot that reviews here shows in their reviews or checks.gh repo view --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed; squash when it is allowed): gh pr merge <n> --auto --squash. If GitHub answers that the PR is already clean to merge, it is green and approved: merge it (gh pr merge <n> --squash), report, and stop. Any other refusal: tell the developer, and carry on as manual.Run <skill-dir>/scripts/watch.sh <n> <mode> as a background command, say in one line what the PR is waiting for, and end your message: your harness wakes you when the script exits. It polls GitHub every 20 seconds and exits on the first event. Line 1 of its output is the event, with how long it waited; line 2 is every check and its state. Handle the event as the table says, then watch again unless the row says stop.
| Event | What to do |
|---|---|
merged | Report, and stop. |
closed | Report, and stop. |
conflict | Rebase, then ship. |
red <checks> | Read the failure (gh pr checks <n>, then gh run view <run> --log-failed; a deploy check links its own build log), fix it, ship. The same check red twice running: ask the developer, and stop. |
threads <n> | Manual only. Run a review round. |
behind <n> | The base has moved on. Rebase, then ship. |
ready | Manual only. Read the bot's review bodies (review round, step 1): a comment there that needs an answer starts a round. With none, tick "Ready to merge" in the block, report, and watch with --ready as the third argument, which lasts 4 hours. |
unreviewed | Manual only: green, but the bot's check is skipped, failed or missing. If the bot takes a request by comment and this PR has none yet, post one (CodeRabbit: gh pr comment <n> --body "@coderabbitai review") and watch again. Otherwise the bot isn't coming: handle it as ready, and say so in the report. |
auto-merge-on | Manual only. Someone turned auto-merge on, and manual means the developer merges: gh pr merge <n> --disable-auto, and say so in the report. |
review-needed | Auto only. Tell the developer whose approval the PR waits for (its code owners, or any teammate), then watch with --ready. |
auto-merge-off | Auto only. Turn it on again (Start, step 3). A second time before anything else happened, something keeps withdrawing it: read why (gh pr view <n> --json autoMergeRequest,mergeStateStatus,reviewDecision), report, and stop. |
error <why> | GitHub could not be read. Report why, and stop. |
timeout | Report what the PR was still waiting for, and stop. |
In manual mode the branch is rebased each time the base has moved and the PR's checks are done, so what the developer merges was checked on today's base. In auto mode behind comes only when GitHub refuses to merge a branch that is behind its base.
Without a background mode, run the script in the foreground with the longest timeout your shell tool allows, and run it again when it is cut off.
git fetch origin <base> && git rebase origin/<base>.git log -p -3 origin/<base> -- <file>) before choosing. A lockfile: take the base's, then reinstall with the repository's package manager.git push --force-with-lease.Every push goes out this way:
AGENTS.md, CLAUDE.md or CONTRIBUTING.md says (formatting, lint, tests, a review step). Where nothing is written, run what the PR's required checks run.git push.<skill-dir>/scripts/threads.sh <n>: the open threads where the bot spoke last, one JSON object per line.gh api "repos/{owner}/{repo}/pulls/<n>/reviews" --jq '.[] | select(.user.login | test("<bot pattern>"; "i")) | .body'.file:line, the comment in one sentence, and your verdict with its reason: fix, push back, or already done. They answer "all", "all but 3", "1, 2, 5" or "recommended". Act on exactly that.comment id: gh api "repos/{owner}/{repo}/pulls/<n>/comments/<comment>/replies" -f body=....
<sha>: ", then resolve it: gh api graphql -f query='mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}' -F id=<thread>.<sha>", and resolve it.The round is done when every collected thread has a reply. The bot may review the new commits or answer a push-back; that arrives as a new threads event and gets its own round.
The PR's description carries one block, between <!-- baby-sitting --> and <!-- /baby-sitting -->, that records what was done, so a reviewer and another session can see it. Where the description has no block yet, write it the first time a line has something to say: pipe the block, without the two markers, to <skill-dir>/scripts/block.sh <n>, which appends it. Where an earlier session wrote one, keep its other lines: tick a line and reword it with <skill-dir>/scripts/block.sh <n> tick "<how the line starts>" "<its new text>". The rest of the description stays as it is.
### Baby-sitting
- [x] Review bot: fixed 1, 3 in `0a1b2c3`; pushed back on 2
- [ ] Ready to merge
On ready, and whenever the table says stop: the PR's URL, what each event you handled came to in one line, the checks as line 2 last gave them, and what waits on someone else (an approval, the bot's answer to a push-back). Then run <skill-dir>/scripts/board.sh and show its table as it is: where each of the developer's open PRs stands.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub marekkirejczyk/skills --plugin marekkirejczyk-skills11 skills in this plugin
/dont-repeat-yourselfFind every concept implemented more than once in a scope (a repository, a PR, a directory, a concept) and give it one well-tested implementation. Identical copies are extracted automatically; behaviour differences and high-stakes code are brought to you for a decision at the end./eval-reportRun a repository's evals and turn the results into one static HTML report for fast review, with pass/fail counts, collapsible files, filters for failed and for new or changed cases, and links to the code. Run it with nothing for the whole repository, with commit or pr to mark what changed, or with only commit|pr to run just what changed./eval-report-install-ciSet up eval-report on GitHub Actions, so every pull request gets an HTML eval report linked at the top of its description and in one comment, built by a script without model tokens. Adds it to the existing eval job, or proposes a lean eval job of its own. Needs the eval-report skill installed next to it./explain-with-slidesBuild a slide deck that walks through a repository, the current one or one at a URL, (architecture and features) or through one pull request (its changes, before/after screenshots, diagrams, key files, diffs, tests and review risks), with screenshots taken from the code actually running. Published as a Claude Slides artifact or as a standalone HTML deck. Use only when the user asks for a repo presentation, onboarding deck or PR walkthrough deck./explain-with-videoMake a narrated explainer video of a repository or a pull request, as an MP4 with captions on a shareable video page. Scenes reveal and highlight item by item while a synthetic voice explains them (macOS say by default; OpenAI or ElevenLabs when configured). Use only when the user asks for a narrated video, screencast or video explainer of a repository, a feature or a pull request./finish-prFinish the current branch's pull request. It reviews the change in sub-agents and fixes what is worth fixing, pushes it with a description, lists its links and the files its code owners must review, then baby-sits it. With nothing or manual it leaves the PR ready for you to merge; with auto it merges once green.Other plugins' skills for the same job