ciloop
Skill0 starsChanged 5 months agoMITView on GitHub
Use when CI is failing on a branch/PR and the user wants it driven back to green — "fix the failing CI", "CI is red, sort it out", "make the checks pass", "loop until CI is green". Pulls the real error from the failing GitHub Actions logs, reproduces it locally, fixes the confident failures, pushes once, and re-watches until green. The red-CI twin of reviewloop.
- Commits and pushes
In this repository2 other files it gives its agents.
- reviewloopSkill
- standupSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 71
Read the actual error from --log-failed — not just "job X failed".
- Very specific: line 86
Run that exact command locally (e.g.
- Distinctive: line 93
Only after every fixable job is green locally:
- Distinctive: line 116
Only hand-back failures remain → stop and report (don't burn iterations on what you won't fix).
- Distinctive: line 140
If stopped at max iterations or on hand-back failures, list each remaining failure with its real error and a suggested next step.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Ciloop
Drive a failing CI run to green. Pull the real error from the logs, reproduce it locally, fix the failures you're confident about, push once, and confirm — looping until green.
Core principle: CI is slow and costs minutes, so don't use it as your edit-test loop. Reproduce the failure locally, fix until local is green, then push once. And don't flail: fix what you can diagnose with confidence; for failures you can't (flaky, infra, secrets, ambiguous logic), stop and hand back rather than guess. Loop the fixable; hand back the judgment calls.
When to use
- A push/PR has red checks and you want them green without babysitting each run.
- "Fix the failing CI", "make the checks pass", "CI is red, loop until it's clean".
When NOT to use: You only want to read why CI failed without fixing → just gh run view --log-failed.
The failures are all infra/deploy/flaky (nothing to fix in code) → ciloop will just hand those back.
Classify every failure first
| Category | Examples | Action |
| Confident-fix | lint, format/prettier, type errors (tsc), clear test/assertion failures, missing import, obvious compile error | reproduce locally → fix → loop |
| Hand-back | flaky/non-deterministic tests, infra/network timeouts, missing secrets/credentials, deploy/release steps, ambiguous logic failures you can't pin down | don't touch — record the real error + why, report at the end |
A step that can't run locally (needs live services, secrets, a built artifact) is hand-back, not a guess. Never push a speculative fix for something you couldn't reproduce.
Inputs
- branch / PR (optional): default = current branch.
--max-iterations N(optional, default 5): cap on the fix→push→watch loop.
The loop
0. Find the red run
BRANCH=$(git rev-parse --abbrev-ref HEAD)
HEAD_SHA=$(git rev-parse HEAD)
gh run list --branch "$BRANCH" --limit 5 \
--json databaseId,headSha,status,conclusion,workflowNamePick the most recent run for HEAD_SHA. If it's success → report "already green" and stop. If
still in_progress → wait (gh run watch). See references/gh-ci.md.
1. Pull the real failures
gh run view <run-id> --json jobs \
--jq '.jobs[] | select(.conclusion=="failure") | {name, steps: [.steps[] | select(.conclusion=="failure") | .name]}'
gh run view <run-id> --log-failedRead the actual error from --log-failed — not just "job X failed". Find the line that caused it.
2. Classify each failing job (table above)
Split into fix and hand-back. If there are zero fixable failures, skip to the report.
3. Reproduce + fix locally
For each fixable job, map it to its local command by reading the workflow that ran it:
# find the failed step's exact command
cat .github/workflows/*.y*ml # locate the failing job → its `run:` stepRun that exact command locally (e.g. pnpm lint, pnpm typecheck, pnpm test <file>), read the
error in context, fix the root cause, and re-run the command until it passes locally. Repeat per
fixable job. (If the YAML is a composite/opaque action, fall back to the obvious local command for the
job's purpose — but if you can't reproduce it, treat it as hand-back.)
4. Push once
Only after every fixable job is green locally:
git add -A
git commit -m "fix CI: <what failed> (ciloop iteration N)"
git pushOne push per iteration — not one per fix.
5. Confirm the re-run
git rev-parse HEAD # new sha — watch THIS run, not the stale one
gh run watch <new-run-id> --exit-statusGuard against acting on a stale run: only evaluate the run whose headSha matches the new local HEAD.
6. Exit conditions
- New run is green → done.
- Still red with fixable failures → back to step 1, until --max-iterations.
- Only hand-back failures remain → stop and report (don't burn iterations on what you won't fix).
Common mistakes
| Mistake | Fix |
| Using CI as the edit-test loop (push every fix) | Reproduce locally, fix to local-green, push once. |
| Pushing a fix you couldn't reproduce locally | If it won't run locally, it's hand-back — don't guess. |
| Reading "job failed" but not the actual error | Always --log-failed and find the causing line. |
| Watching the old run after pushing | Re-resolve the run id for the new HEAD sha before watching. |
| Looping forever on a flaky/infra failure | Classify it hand-back; stop and report instead. |
| "Fixing" a flaky test by rerunning until it passes | That's hand-back — report it; don't mask flakiness. |
Report
Ciloop complete.
Branch: eng-522-migrate-the-voice_service
Iterations: 2
Fixed: lint (3 files), typecheck (1 error), unit test auth.spec.ts
Handed back: e2e job — flaky (timeout on external service), not a code issue
Final CI: green ✅If stopped at max iterations or on hand-back failures, list each remaining failure with its real error and a suggested next step.
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.

