ci-rerun
Skill2 starsChanged 24 days agoMITView on GitHub
Re-run failed CircleCI jobs or Read the Docs builds, or read why they failed, from a GitHub check's job number or build URL, when a PR check failed for an infrastructure reason (lost clone, dropped SSH handshake, runner timeout, failed checkout).
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- arduinoSkill
- code-sizeSkill
- coworkSkill
- debug-probeSkill
- download-docSkill
- followup-issueSkill
- headless-chiefSkill
- hil-farm-setupSkill
- hilSkill
- pr-babysitSkill
- pr-replySkill
- pr-reviewSkill
- read-docSkill
- read-pcbSkill
- repo-auditSkill
- rttSkill
- simplify-gateSkill
- target-debugSkill
- usb-kernel-debugSkill
- usb-kernel-recoverSkill
- usb-snifferSkill
- worktree-removeSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
Classify first: Read the log; re-run only a failure that is the infrastructure's, not the code's.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CircleCI from a GitHub check
A CircleCI check on a PR links to https://circleci.com/gh/<owner>/<repo>/<job-number>,
and that number is all gh pr checks gives. scripts/circleci.py turns it
into the job's workflow and acts on that.
C="${AGENTRC_DIR:-$HOME/.claude}/skills/ci-rerun/scripts/circleci.py"
python3 "$C" log 391824 # the failed steps' last 150 lines (--lines 0: all), to classify the failure
python3 "$C" rerun 391824 391728 ... # each job's workflow, once, from its failed jobsrerun prints one JSON line, {"reruns": [{"workflow", "jobs", "newWorkflow"}], "running": [{"workflow", "jobs", "status"}], "errors": [...]},
and exits 1 when any workflow could not be re-run. Several failed jobs of one
workflow are one re-run; the new workflow id is what a watcher records. A
workflow still running, failing, on_hold or queued cannot be re-run yet: the
script reads its status first, lists it under running without re-running
it, and exits 3 when that is all that stopped it; re-run it later, there is no
need to check its status yourself. A status it cannot read is an error. The
re-run goes through the installed circleci CLI and its token in
~/.circleci/cli.yml; the job, workflow status and log lookups are public.
Read the Docs from a GitHub check
A failed docs/readthedocs.org:<project> status links to its build,
https://app.readthedocs.org/projects/<project>/builds/<id>/, whose web log is
often behind a rate limit. scripts/rtd.py works from that URL through the
API.
R="${AGENTRC_DIR:-$HOME/.claude}/skills/ci-rerun/scripts/rtd.py"
python3 "$R" log <build-url> # state, the failure reason RTD recorded, failed commands' tails
python3 "$R" rerun <build-url>... # a new build of each build's versionrerun prints {"reruns": [{"build", "version", "newBuild"}], "errors": [...]}
and exits 1 when any build could not be re-run; builds of one version share one
new build. The token is RTD_TOKEN, from the environment or a login shell; without it
the script exits 2.
scripts/collect.py is pr-babysit's CI collector, not a tool for this skill's
users: its docstring is the contract.
Judgment
- Classify first. Read the log; re-run only a failure that is the infrastructure's, not the code's. A re-run that fails the same way is a real failure.
- Once. One re-run per workflow or version per failure; a second attempt is a human's call.
- Re-running is not publishing. It changes nothing on the branch or the PR and needs no grant.
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
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.

