/repomatic:babysit-cifrom Repomatic
Monitors CI workflows (tests, lint, autofix, docs, Nuitka binary builds), diagnoses failures, fixes code, commits, and loops until all stable jobs pass.
Ships in Repomatic. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Monitor the tests.yaml, lint.yaml, autofix.yaml, docs.yaml, and release.yaml (Nuitka binary matrix, on projects that enable it) workflows in a fix-verify loop until all stable matrix variations pass and type-checking is clean.
![ -f repomatic/__init__.py ] && echo "CANONICAL_REPO" || echo "DOWNSTREAM"
!grep -rhoE 'kdeldycke/repomatic/[^@ ]+@[0-9a-f]{40} # v[0-9.]+' .github/workflows 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+$' | sort -u | sed 's/^/WORKFLOW_PIN=/'
This skill involves repeated gh, git, uv run pytest, git commit, and git push calls. Run with --dangerously-skip-permissions to avoid manual approval on each step. Sonnet is recommended: the task is mechanical (fetch logs, match patterns, edit code, commit) and doesn't need deep reasoning:
$ claude --dangerously-skip-permissions --model sonnet /babysit-ci
[!WARNING]
--dangerously-skip-permissionsremoves the permission prompts and the auto-mode classifier for the whole session. Some checks stay on in Claude Code2.1.326: a deny rule blocks the call it matches, and an ask rule prompts. A few safety checks also prompt. The flag also lets Claude Code run a command outside its own sandbox without asking. To keep every command inside the sandbox, setsandbox.allowUnsandboxedCommandstofalse. Only use the flag in an environment you trust, ideally a sandbox or disposable checkout, never against an unfamiliar repository or untrusted input.
Because this loop runs autonomously without human review, every commit carries a Co-Authored-By: Claude <[email protected]> trailer by default so unattended changes stay traceable, including where a project AGENTS.md or a global ~/.claude/CLAUDE.md says nothing about commit attribution. The default yields to one thing: an explicit standing rule from the repository's maintainer against AI attribution, which outranks it because the trailer lands in their permanent history. A parent skill (like /repomatic-ship) spawning this loop does not by itself relax the requirement, but an exemption that skill passes down does, and it binds every commit made from that point on.
Keep the message itself short: an imperative subject naming the fix, under 72 characters, and no body at all unless the commit meets one of three cases. It bundles orthogonal work, a public record holds the context, or it resolves a tracked item (Closes #N). A CI fix rarely does: Fix Windows path assertion in `test_cache_paths` is a complete commit message. The case that recurs here is the link: when the red traces to an upstream bug, a dependency release or a linked discussion, put that URL in the body, since it is the only place the next reader will find why the fix looks the way it does. That body is the URL plus at most one clause naming what it holds, and it is capped hard at two lines and 25 words. Never summarize the linked page, and never record what you measured while diagnosing: a failing assertion, a version a probe reported, the flag that turned out to be the cause. Those belong in a code comment beside the fix.
CANONICAL_REPO, use uv run --frozen repomatic: without --frozen, an edit to pyproject.toml makes the local uv relock uv.lock.uvx --exclude-newer '{window}' --exclude-newer-package repomatic=P0D --from 'repomatic==X.Y.Z' -- repomatic, with X.Y.Z the WORKFLOW_PIN the context shows. Read {window} from the workflow-level UV_EXCLUDE_NEWER of .github/workflows/tests.yaml or release.yaml, which repomatic init renders from [tool.repomatic] minimum-release-age. --exclude-newer-package exempts repomatic itself, so a fresh release stays installable while its dependency tree stays gated. The pin keeps the tool registry (ruff, mypy versions) identical to what CI runs. Drop the --from clause only when the context shows no WORKFLOW_PIN.References to <cmd> below resolve to one or the other.
When /repomatic-ship or another orchestrator spawns this loop as a sub-agent, it may reach in to claim a specific fix, usually one touching a deliberately-kept structure that needs its own judgment. Honor that at once: a message telling you to hold, stop, or stand down on a fix (or on the whole loop) means stop editing the working tree immediately, reply to acknowledge, and neither commit nor push that fix. Mailbox messages are delivered between tool calls, so read yours before every edit and before every commit: a HOLD that landed while you were mid-edit still binds the moment you see it, and you must not race the orchestrator by finishing the edit first. Unless told to stand down entirely, keep polling and reporting the jobs it did not claim, and let it tell you which HEAD to resume on once its fix lands.
Detect the repo and branch from the current working directory:
$ gh repo view --json nameWithOwner --jq '.nameWithOwner'
$ git branch --show-current
Use the detected branch for all --branch= flags below.
Watch five workflows. docs.yaml may have no run: its paths: filter skips pushes touching nothing docs-relevant. The tests.yaml run exercises the full test matrix; lint.yaml runs ruff and mypy over every tracked Python file and lints YAML; autofix.yaml runs the mechanical fix jobs (format-*, sync-*, update-*, fix-typos, fix-vulnerable-deps) and turns red when one crashes instead of committing a fix; docs.yaml builds and deploys the Sphinx site and runs the broken-links check (an externally cancelled or link-flaky run re-runs cleanly via gh workflow run docs.yaml --ref <BRANCH>, no commit needed); release.yaml runs the Nuitka binary matrix (dev binaries: an ordinary push rebuilds only the [tool.repomatic] nuitka.dev-targets canary subset, while release commits, the weekly schedule and workflow_dispatch build the full target fleet) — but only on projects with [tool.repomatic] nuitka.enabled and a CLI entry point; with Nuitka disabled the per-platform jobs skip on every push, release commits included, and a green release.yaml means package build plus dev pre-release sync only. Even with Nuitka enabled, a single push can still skip the matrix: Metadata.skip_binary_build (repomatic/metadata/git.py) is the authoritative signal, true when the head commit is on a non-code branch, is a user-initiated version-bump commit, or (the common case) its changed files fall entirely outside Metadata.binary_affecting_paths — a docs-only commit, say, or a workflow-only one that leaves release.yaml and _release-engine.yaml alone. nuitka_matrix is empty whenever skip_binary_build is true. An empty matrix in the logged metadata= output of build / 🧬 Project metadata does not say which condition fired. Check skip_binary_build's three conditions before asserting why a matrix skipped, since any one of them is enough on its own. All five workflows must pass — see § Autofix job failures and § Nuitka binary build failures in references/failure-patterns.md for how to triage them without stalling the loop.
When a later command needs a run ID that ci-status did not print, list the runs of the commit with gh api 'repos/<OWNER>/<REPO>/actions/runs?head_sha=<FULL_SHA>'. Give head_sha the full 40-character SHA, and quote the whole path. Never use gh run list: it can put weeks-old runs first.
Run local tests while waiting for CI. Don't idle while polling. Start the full test suite and linters locally in the background immediately, each through the Bash tool's background mode (run_in_background: true):
$ uv run --frozen --all-extras --group test pytest --no-header -q
$ UV_PROJECT_ENVIRONMENT={scratch}/mypy-venv <cmd> run mypy
$ <cmd> run ruff -- check
Run mypy in an environment synced like CI's lint job, which installs every dependency group. Sync it with UV_PROJECT_ENVIRONMENT={scratch}/mypy-venv uv sync --frozen --all-extras --all-groups, with {scratch} a directory outside the repository, and sync it again after any change to uv.lock. A venv synced with the test groups alone reports each missing type stub as an import-untyped error.
Never append & to one of them instead: a non-interactive shell starts a & job with SIGINT ignored, which fails every test that expects Python's KeyboardInterrupt handler.
Give run mypy and run ruff no paths: the tool runner then checks the same files CI's lint.yaml does, so the two cannot diverge.
Gate 1 (local, ~30s): if any local check fails, you already have the diagnosis: skip straight to step 5 without waiting for CI.
If local passes, watch CI:
$ <cmd> ci-status --branch=<BRANCH> --wait --no-fatal
It reads every workflow a push can start (derived from .github/workflows/, so its list is wider than the five above), polls in-process at --interval (60 seconds by default, which keeps the REST quota intact), and prints each run whose verdict changed. It returns on the first run that blocks a merge, like one with a failed or cancelled required job, or once every run settled and the tip has a run of its own. A run that GitHub keeps failing to serve drops out of the wait, and prints as a cannot read its run warning: that workflow has no result yet, so read it again before you call it green.
A cancelled or skipped verdict is not a pass: see § When supersession never lets a run conclude. For a workflow with no run on the newest commits, ci-status falls back to that workflow's own run listing, filtered by creation date. Re-read a surprising red or green once before acting on it.
A queue is not a hang, and elapsed time alone cannot tell them apart. Two readings settle it, and neither is the elapsed clock. Get a baseline from that workflow's recent successful runs (gh api 'repos/<OWNER>/<REPO>/actions/workflows/<wf>/runs?status=success&created=>=<DATE>' --jq '.workflow_runs[] | [.created_at, .updated_at] | @tsv'): a suite whose normal duration is two hours is not hung at ninety minutes. Then read per-job completedAt timestamps (gh run view <id> --json jobs) rather than an aggregate: a flat count of in_progress jobs is not evidence of a stall, since jobs finish and others start into the freed slots, holding the count steady while real progress continues. Two smaller traps live here too: gh reports a pending job's conclusion as "", not null, so a select(.conclusion == null) filter silently matches nothing and reads as "no pending jobs"; and jobs queue against the runner pool their runs-on names, so a stall confined to macOS cells says nothing about Linux capacity. Never cancel another repository's run to free slots without the maintainer's explicit go-ahead, and never ask for that go-ahead on a diagnosis you have not backed with a baseline and timestamps.
Gate 2 (lint.yaml, ~4 min): lint.yaml finishes before tests.yaml. If "Lint Python" (ruff) or "Lint types" (mypy) fails, proceed to step 4 immediately.
Gate 3 (tests.yaml, ~5-8 min): once the first stable job fails, or all fast platforms (Linux, Windows) pass, proceed.
Poll in-process; never detach a monitor. --wait blocks inside your turn. A detached background monitor (a standalone process, a run_in_background: true Bash poller that re-invokes you when it exits, or a Monitor-tool stream that returns control on each tick) makes a parent-resumed run spawn another monitor per tick instead of driving to a terminal state; worse, a spawned sub-agent that detaches this way orphans the poll from its caller the moment it returns. Hold the turn until --wait returns: starting a poller and handing back "to be notified" is the early return this loop must never make.
Never hand-roll a poll loop around gh. A loop with no delay fires thousands of requests per minute and exhausts the REST quota (5,000/hour) within minutes.
On any CI failure, fetch the logs of all failed required jobs across the workflows:
$ <cmd> ci-status --branch=<BRANCH> --no-fatal --failed-logs <DIR>
One file per failed required job, control sequences stripped, readable the moment the job settled: a failed cell is diagnosed twenty minutes into its slowest sibling's build, since the job-scoped log endpoint answers at once where gh run view --log-failed waits for the whole run. Fix them as one batch: different sources surface different issues. Batch only what has already failed, never what might still fail. Once every harvested failure is root-caused and fixed, push immediately rather than waiting for undrained cells to surface more: the fresh run supersedes the stale one, and serially waiting out each full matrix is the slow path. Analyze following the error triage discipline: stable-job FAILED/AssertionError lines only. Then match each failure against references/failure-patterns.md before fixing anything.
Fix the root cause using the combined picture from CI logs and local results. Fix the codebase, not the tests, unless the tests are genuinely wrong. Address mypy and ruff failures together.
If the root cause is in a third-party dependency, check whether a change this cycle exposed it before treating it as upstream: git log <last-release-tag>..HEAD for a runner/image swap, a dependency bump, or a config change that put the dependency in a context it cannot satisfy (a Rust-built package forced to compile from an sdist on an architecture with no published wheel, say). Such a build fails with Failed to build <pkg>, or with a maturin, cargo or native-compiler error during install. When a cycle change is the trigger, revert or adjust that change; only a failure independent of everything the cycle touched warrants /file-bug-report for an upstream report.
After applying fixes, re-run the full local validation:
$ uv run --frozen --all-extras --group test pytest --no-header -q
$ UV_PROJECT_ENVIRONMENT={scratch}/mypy-venv <cmd> run mypy
$ <cmd> run ruff -- check
$ <cmd> run ruff -- format
Hard gate: all four must come back clean before step 6. If a fix introduces new failures not in the original set, the fix is wrong: revert it and try a different approach rather than layering another fix on top.
Both ruff commands write in place: read git diff after they run and fold any reformat into the fix. Skipping the format pass does not fail CI — instead the format-python autofix job opens a pull request with the reformat, and its merge lands a new HEAD that cancels every in-flight run through the shared concurrency group and restarts the whole CI cycle (a wasted Tests + Nuitka round). A parent /repomatic-ship run's format gate only covered the pre-fix tree: this loop's commits are exactly the ones that would skip it.
Check autofix status before pushing:
$ <cmd> ci-status --branch=<BRANCH> --no-fatal --automation-prs
If any open autofix PR already contains your fix — a format-python branch (ruff's own autofixes, and the comment and docstring lines fix-long-lines wraps), a sync-repomatic/sync-workflow-pins branch (a bumped workflow pin, or a spliced-in --exclude-newer-package repomatic=P0D cooldown exemption carrying no version bump at all — that one is the whole fix when the metadata job cannot resolve its own pin), or another sync-*/fix-* branch — prefer merging it over authoring your own commit: GitHub signs the merge commit server-side, so this sidesteps a local hardware-key signing prompt entirely. If it resolves the failure, merge it (gh pr merge <n> --squash --delete-branch), pull, and rebase your fix before pushing — or skip your own commit if the merge is the whole fix. If gh pr merge is denied, see § PR-merge permission wall.
Commit the fix with a clear message describing what changed and why. Before a push that goes out at once, cancel the branch's remaining runs to free runners, then git push:
$ <cmd> cancel-runs --branch=<BRANCH>
The command spares any run whose head commit opens on [changelog] Release or [changelog] Post-release, the two commits of a release push. The concurrency groups of autofix.yaml, lint.yaml, release.yaml and tests.yaml apply the same test. Cancelling a release run costs that version its binaries permanently, so never hand-roll the sweep with gh run cancel.
After the cancel, ci-status reports each required job it stopped on the tip as required job cancelled, with a gh run rerun command. Do not run that command: your cancel stopped the job, and your fix push moves the tip past that run.
When the fix corrects a user-facing bug, add a changelog.md entry only when the bug reached a released version. Blame the changed line against the last release tag (git blame, or git log -S): a bug introduced and fixed within the current unreleased cycle never shipped, so it gets no entry; a bug that predates the last tag is a real regression and does. Making this call here keeps a parent /repomatic-ship run from having to add or drop entries afterward.
Time each push by what its diff rebuilds. A source-affecting fix (repomatic/**, tests/**, pyproject.toml, uv.lock: whatever the repo's test and binary paths: filters name) pushes the moment it clears step 5: the runs it supersedes were verifying an obsolete tree, and its own run rebuilds everything it cancels. A commit those filters skip (changelog-only, docs-only, cosmetic prose) is the opposite case on a binaries-enabled project: release.yaml runs on every push in a per-branch cancel-in-progress group, so pushed mid-drain such a commit cancels the in-flight binary matrix while its own run skips the rebuild (Metadata.skip_binary_build), and the lost verification costs a full re-dispatch. That cost scales with what is actually in flight: an ordinary push builds only the [tool.repomatic] nuitka.dev-targets canary subset, and no push cancels a full fleet at all, since release commits, schedule and workflow_dispatch runs each sit in their own concurrency group. Hold it until the heavy matrices on the current HEAD are terminal, or bundle it into the next source-affecting push; with binaries disabled, only a canary build in flight, or nothing heavy in flight, push freely.
If commit signing fails, do not loop on it. The sandbox can block the SSH key or socket under ~/.ssh/* (Operation not permitted): fix with dangerouslyDisableSandbox: true for the git commit and git push calls only. A hardware-backed key (Secretive, YubiKey, TPM) then prompts the maintainer per signature, and a refused or missed prompt surfaces as agent refused operation?, indistinguishable from a real failure. Retry once at most after disabling the sandbox; if it still refuses, hand off cleanly: stage the specific files you fixed (never git add -A), return the exact commit message and git push command verbatim, and exit the loop. The fix is done — only the signature is missing. For a denied gh pr merge, see § PR-merge permission wall.
Repeat from step 2 until the five monitored workflows are green: every required job of each one passes. That covers every stable (✅) job of tests.yaml, and the ruff and mypy jobs of lint.yaml (test and docs files included). Stop after 5 iterations without progress (the set of distinct failing stable jobs did not shrink): report what was fixed and what remains, and ask for guidance rather than churning. Productive iterations never trip the cap: a release paying down a long test-debt tail legitimately takes more than five pushes.
This shortcut applies only when a human invoked the loop directly. Once all fast platforms (Linux, Windows) have completed with zero stable failures and only slow runners (macOS) remain queued or in progress, declare success and stop — macOS runners are resource-constrained, and platform-independent fixes gain no diagnostic value from waiting. Announce this exit; never end on a silent idle. Report that the fast channels are green and name what stays unverified (the release.yaml binary-matrix run ID, any still-queued macOS or congestion-delayed cells) so the human takes over that check instead of assuming the whole matrix passed.
When an orchestrator spawned this loop (like /repomatic-ship), do not early-exit — drive every monitored workflow to terminal green before returning. The orchestrator spawned you precisely to own the slow tail it would otherwise poll itself; returning at "fast platforms green" just hands the macOS cells and the release.yaml binary matrix back to a caller that must then detect your stall and re-drive them, and an idle sub-agent is indistinguishable from a dead one. Keep polling with step 3's ci-status --wait, never a hand-rolled loop, until macOS and the full release.yaml matrix have finished and every stable (✅) job is green, fixing and re-pushing on any stable failure (steps 4-7). Then send the orchestrator a final SendMessage naming each monitored workflow's conclusion. A harness idle/available signal is not that report: end the turn only with that explicit message, or on a blocker you cannot resolve (say which).
A busy default branch can cancel the same workflow indefinitely. Every push shares the ${{ github.workflow }}-${{ github.ref }} concurrency group, so an unrelated commit landing mid-matrix cancels yours, and the next one cancels its replacement. A release push escapes it in autofix.yaml, lint.yaml, release.yaml and tests.yaml, and a version bump in autofix.yaml and lint.yaml. Three consecutive heads leaving tests.yaml cancelled is an ordinary afternoon, not a fault. Of the five monitored workflows, only release.yaml lets a dispatch escape it too. It gives each schedule and workflow_dispatch run a group of its own. In the other four, a workflow_dispatch run joins the same group, and the next push cancels it. A gh run rerun of an older run joins it too, and cancels the in-flight run of the current head: re-run only once that run is terminal.
A dispatch does settle one case: a version-bump commit, whose subject starts with [changelog] Bump, merged right after your push. It cancels your tests.yaml run, and tests.yaml skips the bump commit itself, so ci-status reads cancelled on your commit. Dispatch it once, with gh workflow run tests.yaml --ref <BRANCH>: the dispatched run checks the head, which holds your change.
A cancelled run is neither a failure nor a pass, and the run-level conclusion hides which. Read the jobs:
$ gh run view {run-id} --json jobs \
--jq '[.jobs[] | (.conclusion | select(. != "")) // "running"] | group_by(.) | map({(.[0]): length}) | add'
{"cancelled":2,"success":25}
Twenty-five green and zero failures is a strong signal that the tree is fine; it is not a green run, and must never be reported as one.
Establish coverage by union, then close the residue locally. List the cells that never reached success on any head containing your change, across every cancelled run:
$ gh run view {run-id} --json jobs --jq '.jobs[] | select(.conclusion != "success") | "\(.conclusion): \(.name)"'
The residue is almost always macOS, which is the slowest tier and therefore last standing whenever a run is cut short. Discount any ⁉️ cell (it gates nothing) and run whatever stable cells remain on the matching interpreter locally:
$ uv --no-progress run --python 3.11 --all-extras --group test --frozen -- pytest -m "not once"
--group test is required: without it uv resolves an environment with no pytest in it and fails with Failed to spawn: pytest, which reads as a broken command rather than a missing dependency group. A cell whose OS differs from the machine you are on cannot be closed this way — name it as unverified instead of implying otherwise.
Report the union explicitly: which cells passed in CI, which you closed locally, and which remain open and why. "CI was cancelled" on its own tells the caller nothing they can act on.
🛡️ Lint types, 1️⃣ Run-once tests, 📦 Package install): the test is the absence of ⁉️ anywhere in the name, never the presence of a ✅ prefix.The workflow uses continue-on-error for unstable jobs, so the run can succeed even when they fail.
Read the exact error messages before forming a hypothesis. The most common diagnostic mistake is latching onto a warning or unstable-job failure instead of the actual stable-job error.
/repomatic-ship spawned this loop for a release, ⁉️ reds are still work owed under its genuinely-green goal: once no stable red is outstanding, read their logs and fix what is repo-fixable (a crash converted to a clean availability-gated skip, a flaky live install folded into a tolerated-exit set), leaving only genuine dev-interpreter breakage unfixed and named in the final report. Human-invoked runs keep the strict filter: discard ⁉️ logs entirely unless asked.AssertionError and a mypy error: have different fixes, but always analyze mypy and ruff failures together before fixing either.When a job fails, read references/failure-patterns.md before fixing anything. It names the failures that are not code bugs, and what each one needs:
After the loop converges (or hits the iteration cap), review whether any finding is worth feeding back: a failure pattern that recurred across iterations, or a diagnosis needing non-obvious knowledge, belongs in references/failure-patterns.md. Propose the addition; do not push it unreviewed.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kdeldycke/repomatic --plugin repomatic18 skills in this plugin
/av-false-positiveScan a release on VirusTotal. Write submission instructions for each AV vendor that flags a false positive./awesome-triageTriage new issues and PRs on awesome-list repos. Apply the curation criteria drawn from past decisions./benchmark-updateCreate or update the competitive benchmark page (docs/benchmark.md) that compares this project against its alternatives. Check maintenance status, feature accuracy, new candidates and badge health./brand-assetsCreate project logo and banner SVGs, then export them to light and dark PNG variants. Use when you design a logo or banner, or regenerate the PNGs from their SVG source files./file-bug-reportWrite a bug report for an upstream project, or a reply on an existing issue. Read its contribution guidelines, issue templates and community norms first, then produce a markdown file ready to paste./github-housekeepingBackfill and curate labels and milestones across a repository's whole issue and PR history. Design the taxonomy, classify in bulk, detect AI slop, and reconstruct past releases.Other plugins' skills for the same job