ci-monitorlisted
Install: claude install-skill mattbutlerengineering/mattbutlerengineering
# CI Monitor
Monitor GitHub Actions CI health and respond to failures. Fixes simple issues automatically, escalates complex ones to the issue queue.
## Workflow
### Step 1: Check Main Branch CI
```bash
gh run list --branch main --limit 5 --json status,conclusion,databaseId,headBranch,name,createdAt
```
Examine the results:
- If all 5 runs have `conclusion: "success"` → **main is healthy**, proceed to Step 3
- If any run has `conclusion: "failure"` → proceed to Step 2
### Step 2: Diagnose Failure
For each failed run:
```bash
gh run view <databaseId> --log-failed 2>&1 | head -200
```
#### 2a: Check for Existing Fix
```bash
gh issue list --label "ci-fix" --state open --search "<error keyword>" --json number,title
```
If an open `ci-fix` issue already exists for this failure, **skip it** — it is already being tracked.
#### 2b: Classify the Failure
**Simple failures** (auto-fixable):
- Lint errors (`eslint`, `prettier`)
- Type errors (`tsc`, missing imports, wrong types)
- Missing Prisma client generation (`prisma generate`)
- Test failures with obvious fixes (snapshot updates, assertion mismatches from recent changes)
**Complex failures** (escalate to issue):
- Flaky tests (passes on retry)
- Infrastructure failures (Docker, database connectivity)
- Multi-file refactoring needed
- Dependency conflicts
#### 2c: Auto-Fix Simple Failures
```bash
mbe agent run "Fix CI failure: <concise description of error from logs>" --max-budget 0.50 --adapter auto
```
The agent