#What it does
The /ci-fix skill diagnoses failing CI/CD pipelines by reading build logs, identifying the root cause, and applying targeted fixes. It handles GitHub Actions, GitLab CI, and other common CI systems.
#How to use
bash
/ci-fix
/ci-fix https://github.com/owner/repo/actions/runs/12345#Workflow
- Identify -- Detects the CI system and locates the failing workflow
- Fetch -- Pulls the latest run logs and error output
- Diagnose -- Classifies the failure type (dependency, test, build, config, flaky)
- Fix -- Applies the appropriate fix and explains the root cause
- Prevent -- Suggests pipeline improvements to avoid future failures
#Common failures it resolves
- Dependency issues -- Lock file conflicts, missing native dependencies, version mismatches
- Environment mismatches -- Node/Python version differences, missing env vars, OS-specific paths
- Flaky tests -- Race conditions, time-dependent assertions, external service calls
- Resource limits -- Out of memory during build, disk space exhaustion, timeout errors
- Config errors -- YAML syntax issues, incorrect step ordering, missing permissions
#Example
bash
> /ci-fix
# Fetching latest CI run...
Run #847 FAILED at step "Build" (2m 14s)
# Error:
TypeError: Cannot read properties of undefined (reading 'map')
at generateSitemap (src/lib/sitemap.ts:23:18)
# Diagnosis:
Build-time data fetch returns undefined in CI (no API key set).
NEXT_PUBLIC_API_URL is configured locally but not in GitHub Secrets.
# Fix:
1. Added NEXT_PUBLIC_API_URL to .github/workflows/deploy.yml
2. Added fallback for missing env var in sitemap.ts
3. Re-triggered workflow
# Result: Build passing