Method to make a failing CI pass again for real - read the failed logs, reproduce locally, fix the cause, verify, commit. Use when the user says the CI, the build, the checks or a GitHub Actions run is red or failing and asks to fix it.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Fix Ci?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mpoulhazan-fix-ci)
---
name: fix-ci
description: Method to make a failing CI pass again for real - read the failed logs, reproduce locally, fix the cause, verify, commit. Use when the user says the CI, the build, the checks or a GitHub Actions run is red or failing and asks to fix it.
---
# Fix a failing CI
The control script is `scripts/fix-ci.mjs` at the plugin root, two folders up from this skill's base directory. Below, `FIXCI` stands for `node "<plugin root>/scripts/fix-ci.mjs"`.
While a run is open, the plugin's hooks refuse shortcuts (skipping or deleting tests, `continue-on-error`, `|| true`, force push, `--no-verify`) and, when you try to finish, run your check command themselves. You cannot end the turn while it fails, up to 3 attempts.
## 1. Start the run
Skip this step if the user typed `/fix-ci`. Otherwise run `FIXCI start`.
## 2. Find what fails
- GitHub: `gh run list --branch "$(git branch --show-current)" --limit 5`, then `gh run view <id> --log-failed`. Read the first error, not the last: later failures are often consequences.
- No `gh` or another CI: ask the user for the failed log, or for the link.
- Note the exact job, step and command that failed, and the versions CI uses (runtime, OS, lockfile).
## 3. Reproduce it here, then record the check
Run the same command CI runs (from the workflow file), on this machine. When you see the same failure, record it:
`FIXCI check "<that command>"`
The check must fail now and pass once fixed. One command, the narrowest that covers the failure (`npm test`, `npm run build`, `pytest tests/test_api.py`). If CI runs several steps that failed, chain them with `&&`.
If the failure does not reproduce locally (secrets, OS, versions, a flaky test), say so to the user, explain what you found, and end the run: `FIXCI stop "<why>"`. Do not guess-fix in CI.
## 4. Fix the cause
- Fix the code, or the test when the test is wrong. Say which, and why.
- Changing an expected value in a test is allowed only when the new behavior is the intended one. Say why it is.
- Never: skip, isolate or delete a test, loosen a CI step, raise a timeout to hide slowness, lower a coverage threshold, catch and swallow an error, pin a dependency to an older version with a known vulnerability. When that is the only way out, stop and ask the user.
- Keep the diff to what the fix needs. No refactoring on the way.
## 5. Get the diff reviewed
Before committing, hand the diff to the `ci-fix-reviewer` agent (Agent tool) with the failing job and the check command. If it answers FAIL, fix what it found, or tell the user why you disagree.
## 6. Commit, push, watch
- Run the check yourself, then commit only the files the fix needs. Message in English: `fix(ci): <what was broken>`.
- Push only if the project's instructions (CLAUDE.md) allow pushing to this branch. Then `gh run watch --exit-status` on the new run.
- When you finish, the hook runs the check one last time and, if the commit is pushed, reads the CI result of that commit.
## 7. Report
In a few lines, for the user: what failed, the cause, the fix, the check and its result, and the CI result if pushed.