ops-ci-fixlisted
Install: claude install-skill christopherlouet/claude-base
# CI Fixer — CI/CD Diagnosis and Repair
## Goal
Diagnose failing CI/CD pipelines, identify the root cause,
and apply automatic fixes when safe.
## Phase 1: Discovery and workflow state
### Scan the workflows
```bash
# List recent runs
gh run list --limit 20 --json databaseId,status,conclusion,name,createdAt,headBranch
# Identify workflow files
ls -la .github/workflows/
```
### Classify the state
| State | Criterion | Urgency |
|------|---------|---------|
| **Failed** | conclusion = failure | High |
| **Stuck** | status = in_progress for > 30 min | High |
| **Cancelled** | conclusion = cancelled (recurring) | Medium |
| **Stale** | No successful run for 7+ days | Low |
### Check the runners (if self-hosted)
```bash
# Runner status
gh api repos/{owner}/{repo}/actions/runners --jq '.runners[] | {name, status, busy}'
```
## Phase 2: Failure diagnosis
For each failing workflow:
### 2.1 Extract the logs
```bash
# Logs of the failed run
gh run view <run-id> --log-failed
```
### 2.2 Classify the cause
| Category | Patterns in logs | Typical fix |
|-----------|----------------------|-------------|
| **Test failure** | `FAIL`, `AssertionError`, `expect(` | Fix the test or the code |
| **Build error** | `error TS`, `SyntaxError`, `cannot find` | Fix the compilation error |
| **Dep install** | `npm ERR!`, `ERESOLVE`, `peer dep` | Fix package.json / lockfile |
| **Auth/secrets** | `401`, `403`, `secret not found` | Check the configured secrets |
| **Timeout** | `timed out