Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ci Triage?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/me-cedric-ci-triage)
---
name: ci-triage
description: Triage a red or slow CI job: classify a failure as flaky, environment or real, fix and rerun, or audit the job time. Use when CI is red or slow.
risk_level: low
writes_files: false
requires_tools: [gh, glab]
---
# ci-triage
A red pipeline is not always a code defect. Read the failed job, not the pipeline color.
## Steps
1. Get the failed job log:
- GitHub: `gh run list --limit 5`, then `gh run view <run-id> --log-failed`.
- GitLab: `glab ci status`, then `glab ci trace <job>`.
2. Read the log from the first error, not from the last line.
3. Note which jobs pass. If tests, lint and typecheck pass, suspect the environment or a gate that runs over the whole commit range.
4. A commit linter runs over every commit of the branch. One inherited commit with a bad subject reddens each build. Reword or squash that commit. Do not change code.
5. Classify the failure, using the table.
6. Reproduce it locally with the command that the CI file runs, the same tool versions and a lockfile install.
7. If you cannot reproduce it, say so. Name the likely difference: OS, env var, test order, time zone, network, cache.
8. Make the smallest fix for one cause. Do not skip, weaken or delete a test. Do not relax a gate.
9. Run the checks locally. Push only when the user asks.
10. Rerun the failed job: `gh run rerun <run-id> --failed`, or `glab ci retry <job>`. Confirm that it passes.
## Classes
| Class | Sign | Action |
|---|---|---|
| Flaky | Passes on a rerun. The cause is timing, order or shared state. | Find the cause. Rerun once to confirm. Do not hide it with a retry. |
| Environment | The runner, network, cache, secret, quota or tool version failed. Unrelated commits fail the same way. | Fix the CI config or tell the owner. Do not change code. |
| Real | It fails on the same commit locally, and a change in the diff explains it. | Fix the code. |
## Packaging builds
An exit code is not a build result for an installer, an image, an APK or a binary.
1. The artifact exists at the path that the build declares.
2. It comes from this run. Compare it with a marker file that you create when the run starts. Do not compare it with a source file time.
3. It opens: `unzip -t`, `tar -tf`, `docker image inspect`, `hdiutil verify`.
4. A zero exit can ship the previous build, because a bundler may reuse an existing output directory. Delete the output before the build.
5. A non-zero exit can still leave a good artifact, because packaging runs last. Look before you call the build failed.
6. Clean the leftover state at the start of each build, not after a failure.
## Slow CI audit
Use it when CI is green but slow, or when the same job is rerun often. The audit reads. It changes nothing.
1. Take the last 50 runs or more. GitHub: `gh run list --limit 50 --json databaseId,event,headBranch,headSha,conclusion`. GitLab: `glab ci list`.
2. Split each job into wait, setup and run time.
- GitHub: `gh api repos/<owner>/<repo>/actions/runs/<id>/jobs`. Wait is `started_at - created_at`. Setup is the steps before the first build, lint or test step.
- GitLab: `glab api projects/:id/pipelines/<id>/jobs`. Wait is `queued_duration`. Run is `duration`.
3. Find the largest share for the slowest job, and fix that first. A pull request waits for its slowest job, not for the sum.
4. Look for a cache that misses on most pull request runs. Look for the same commit run more than once: each rerun hides a flaky or environment cause.
5. Report a table: job, median wait, setup and run, cache hits, reruns. Then name the levers from [references/speed.md](references/speed.md), largest saving first.
## Report
Give the job, the class, the cause, the fix and the rerun result. Say what you did not verify.