ci-fix-loop
Skill22 starsChanged 2 months agoMITView on GitHub
Diagnose GitHub Actions CI failures in a loop: fetch the failing check logs, identify the root cause, apply a targeted fix, push, and wait for the next run: repeating until all checks are green or a real blocker needs a human. Use when CI is red after a push, when the user says "fix CI", "make tests pass", "diagnose CI failures", or "drive this to green". Direct analog of qodoloop / coderabbitloop for automated test and lint failures.
- Installs packages
- Commits and pushes
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 69
Stop if the working set is empty: all required checks are green.
- Distinctive: line 73
Before touching any code, verify the failure is not already present on main:
- Very specific: line 80
If the same check is failing on the base branch, stop and report: this is not your PR's fault.
- Very specific: line 82
Wait for a Base branch recovered notice before re-trying.
- Distinctive: line 119
Wait for the rerun result.
- Very specific: line 175
Wait until all previously-failing checks show a new result (pass or fail) on the current SHA.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
🤖 Auto-generated by weekly-pattern-learner · qodoloop and coderabbitloop share the push→poll→diagnose→fix→repeat loop; CI failures have the same shape but no dedicated skill existed
CI Fix Loop
Drive a GitHub Actions CI run from red to green: fetch failure logs, diagnose, apply a targeted fix, push, and repeat until all required checks pass or a blocker is hit.
Inputs
- PR number (optional): detect from current branch if not given.
- Check names (optional): limit to specific failing checks instead of all.
- Max iterations (default: 5)
Workflow
1. Identify the PR and current CI state
# Detect PR from current branch
gh pr view --json number,headRefName,headRefOid \
-q '{number, branch: .headRefName, sha: .headRefOid}'
# Current check status
gh pr checks --json name,state,conclusion 2>/dev/null \
|| gh run list --branch <branch> --limit 5Classify each check as: pass, fail, pending, or skipped.
Exit immediately if all required checks already pass: nothing to do.
2. Loop (max 5 iterations)
A. Identify failing checks
gh pr checks --json name,state,conclusion \
--jq '.[] | select(.conclusion == "failure" or .state == "FAILURE")'For each failing check, record: check name, workflow file, job name.
Stop if the working set is empty: all required checks are green.
B. Check for base-branch regression first
Before touching any code, verify the failure is not already present on main:
gh run list --branch <base-branch> --workflow <workflow-name> --limit 3 \
--json conclusion --jq '.[].conclusion'If the same check is failing on the base branch, stop and report:
this is not your PR's fault. Do not attempt a fix that masks a base-branch problem.
Wait for a Base branch recovered notice before re-trying.
C. Fetch failure logs
For each failing check:
# Latest run ID for this branch/workflow
gh run list --branch <branch> --workflow <workflow-name> --limit 1 \
--json databaseId --jq '.[0].databaseId'
# Fetch only failing steps (not the full log)
gh run view <run-id> --log-failedCap log reading at ~200 lines per job: the error is almost always in the last 50 lines of a failed step.
D. Diagnose
Classify the failure before writing any code:
| Category | Examples | Fix target |
| Test failure | FAIL TestFoo, AssertionError, expected X got Y | Source or test |
| Lint / format | gofmt, eslint, ruff, prettier | Run auto-formatter |
| Build error | compile error, missing import, type mismatch | Source |
| Dependency | npm ERR!, missing module, lockfile mismatch | Update lockfile |
| CI config | YAML parse error, bad action ref, missing secret | Workflow YAML |
| Flaky test | same test passes on manual re-run | Re-run first; mark if it keeps failing |
For flaky-looking failures, re-run the check before touching code:
gh run rerun <run-id> --failedWait for the rerun result. If it passes on rerun, skip this iteration and go to step F to poll for the new result.
E. Apply a targeted fix
Fix only what the log names as the failure. Do not refactor surrounding code, add unrelated tests, or touch files the failing step never mentioned.
Common one-liners:
# Go format
gofmt -w .
goimports -w .
# Node format / lint
npx prettier --write .
npx eslint --fix .
# Python
ruff check --fix .
black .
# Lockfile
npm install # Node
poetry lock --no-update # Python
go mod tidy # GoFor test failures: read the failing test and the code it exercises. Fix the code or the assertion, but not both in one commit unless the test was clearly wrong and the fix is trivial.
F. Commit and push
Stage only the files touched in step E: never git add -A, which can sweep
in unrelated local changes:
git add <files touched>
git commit -m "fix(ci): <what was broken> (ci-fix-loop iteration N)"
git pushConfirm the push succeeded before polling. A resolved check whose fix never reached the branch is worse than an unresolved one.
G. Wait for CI on the new SHA
Poll every ~15s (timeout ~8min) for all previously-failing checks to complete on the new push:
gh pr checks --json name,state,conclusion,startedAtWait until all previously-failing checks show a new result (pass or fail)
on the current SHA. Do not act on a result that still shows the old SHA.
Go back to step A.
3. Report
| Field | Value |
| Iterations | N |
| Checks fixed | names + root cause |
| Checks blocked | names + reason (flaky / needs human / base-branch red) |
| Final status | all green / partial / blocked |
CI fix loop complete.
Iterations: 2
Fixed: lint (gofmt: 3 files), test (TestUserCreate: nil pointer in fixture)
Blocked: none
Status: all required checks greenChaining
| Before this skill | After this skill |
olko:pr-description-writer | olko:qodoloop |
Any git push with failing CI | olko:coderabbitloop |
In this repository194 other files it gives its agents.
- 0-templateSkill
- ab-test-analyzerSkill
- academy-guideSkill
- add-to-my-skillsSkill
- adr-authorSkill
- ai-tools-setupSkill
- algorithmic-artSkill
- api-and-interface-designSkill
- api-designerSkill
- api-docs-writerSkill
- apple-store-submitSkill
- aws-cost-optimizerSkill
- bash-script-hardeningSkill
- blog-post-writerSkill
- book-summarizerSkill
- branch-cleanupSkill
- brand-copy-landingSkill
- brand-copySkill
- brand-designSkill
- brand-guidelinesSkill
- browser-testing-with-devtoolsSkill
- canvas-designSkill
- changelog-generatorSkill
- changelog-keeperSkill
- chart-chooserSkill
- ci-cd-and-automationSkill
- claude-apiSkill
- cloudflare-block-countriesSkill
- coderabbitloopSkill
- code-review-and-qualitySkill
- code-reviewerSkill
- code-simplificationSkill
- codexloopSkill
- comms-notionSkill
- comms-slackSkill
- comms-whatsappSkill
- competitive-analysisSkill
- concept-explainerSkill
- constraint-driven-developmentSkill
- context-engineeringSkill
- context-repoSkill
- cover-letter-writerSkill
- crash-courseSkill
- cron-schedulerSkill
- data-digestSkill
- data-pipeline-architectSkill
- debug-detectiveSkill
- debugging-and-error-recoverySkill
- decision-matrixSkill
- dependabot-triageSkill
- dependency-upgraderSkill
- deprecation-and-migrationSkill
- dev-instantdbSkill
- discernment-nudgeSkill
- doc-coauthoringSkill
- dockerfile-proSkill
- docs-index-keeperSkill
- documentation-and-adrsSkill
- docxSkill
- doubt-driven-developmentSkill
- The first 60 shown.
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.

