{"manifest":{"name":"CI Fix Agent","version":"1.0.0","description":"Diagnoses failing CI/CD pipelines from build logs. Classifies failures, performs root cause analysis, applies targeted fixes. Inspired by Codex gh-fix-ci.","tags":["ci-cd","debugging","devops","workflow"],"standard":"agentskills.io","standard_version":"1.0","content_checksum":"3018d49aebd820be27760d5b2f3fa4c7adc4a1572d245c6daf7fb8254df9d90d","bundle_checksum":null,"metadata":{},"files":[]},"files":{"SKILL.md":"# CI Fix Agent\n\n> **Purpose:** Diagnose and fix failing CI/CD pipelines. Reads build logs, identifies root causes, and applies targeted fixes.\n\n---\n\n## Invocation\n\n```\n/fix-ci [--run-id <id>]\n```\n\nWithout a run ID, fetches the latest failed run for the current branch.\n\n---\n\n## Diagnosis Process\n\n### Step 1: Fetch CI Logs\n\n```bash\ngh run list --branch $(git branch --show-current) --status failure --limit 1\ngh run view <run_id> --log-failed\n```\n\n### Step 2: Classify the Failure\n\n| Pattern | Category | Priority |\n|---------|----------|----------|\n| `npm ERR! peer dep` | Dependency conflict | High |\n| `ENOSPC` / `out of memory` | Resource limit | Medium |\n| `FAIL src/tests/` | Test failure | High |\n| `error TS` / `type error` | Type error | High |\n| `ESLint:` / `Lint error` | Lint violation | Low |\n| `ETIMEOUT` / `connect ECONNREFUSED` | Network/service | Medium |\n| `permission denied` | Permissions | Medium |\n| `Module not found` | Missing dependency | High |\n| `exit code 137` | OOM killed | High |\n\n### Step 3: Root Cause Analysis\n\nFor each failure category:\n\n**Test failures:**\n1. Read the failing test file\n2. Read the source file it tests\n3. Check recent changes to both: `git log --oneline -5 <file>`\n4. Identify if the test or the source is wrong\n\n**Type errors:**\n1. Read the error location\n2. Check if types changed upstream\n3. Verify import paths are correct\n\n**Dependency issues:**\n1. Check `package-lock.json` for conflicts\n2. Compare with the last passing CI run\n3. Try `npm ci` vs `npm install`\n\n### Step 4: Apply Fix\n\n- Edit the minimum files needed\n- Run the same CI step locally to verify\n- Commit with: `fix(ci): <description of what was wrong>`\n\n---\n\n## Common Fixes\n\n| Issue | Fix |\n|-------|-----|\n| Snapshot mismatch | `npx vitest run --update` if change is intentional |\n| Missing env var | Add to CI config secrets, not to code |\n| Lock file conflict | `npm ci` (clean install from lock) |\n| Flaky test (timing) | Add `vi.useFakeTimers()` or increase timeout |\n| OOM on build | Split the build step or increase runner memory |\n\n---\n\n## Rules\n\n- Never skip or delete failing tests — fix the root cause\n- Never add `--no-verify` or `continue-on-error` to hide failures\n- If a test is genuinely flaky, fix the flakiness don't skip it\n- Always verify the fix locally before pushing\n\n## Playground\n\n<!DOCTYPE html><html><head><meta charset='utf-8'><style>*{box-sizing:border-box;margin:0;padding:0}body{background:#0d1117;color:#e6edf3;font-family:monospace;font-size:12px;height:100vh;display:flex;flex-direction:column;overflow:hidden}.header{background:#161b22;border-bottom:1px solid #30363d;padding:8px 14px;font-size:11px;color:#8b949e;display:flex;justify-content:space-between;align-items:center;flex-shrink:0}.title{color:#58a6ff;font-weight:bold;font-size:13px}.panels{display:flex;flex:1;overflow:hidden}.panel{flex:1;overflow:auto;padding:12px;border-right:1px solid #30363d}.panel:last-child{border-right:none}.label{font-size:10px;color:#8b949e;text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px}pre{white-space:pre-wrap;word-break:break-word;line-height:1.5}</style></head><body><div class='header'><span class='title'>CI Fix Agent</span><span>Example · SkillSlap</span></div><div class='panels'><div class='panel'><div class='label'>Input: Failing CI step</div><pre><span style='color:#8b949e'>Step: Build (npm run build)</span>\n<span style='color:#8b949e'>Exit: 1</span>\n\n<span style='color:#8b949e'>Error:</span>\n<span style='color:#8b949e'>./app/dashboard/page.tsx</span>\n<span style='color:#8b949e'>Type error: Property 'slug' does</span>\n<span style='color:#8b949e'>not exist on type 'Skill'.</span>\n\n<span style='color:#8b949e'>  45 |   return skill.slug</span></pre></div><div class='panel'><div class='label'>Output: Fix steps</div><pre><span style='color:#f85149'>Root cause</span>\n<span style='color:#8b949e'>`slug` was removed from the Skill</span>\n<span style='color:#8b949e'>type in a recent schema update but</span>\n<span style='color:#8b949e'>dashboard/page.tsx still references it.</span>\n\n<span style='color:#58a6ff'>Fix</span>\n<span style='color:#3fb950'>1. Check lib/types/skill.ts for the</span>\n<span style='color:#3fb950'>   new field name (likely `handle`</span>\n<span style='color:#3fb950'>   or read from SKILLS_COLUMNS).</span>\n<span style='color:#3fb950'>2. Replace `skill.slug` with correct</span>\n<span style='color:#3fb950'>   field name.</span>\n<span style='color:#3fb950'>3. Search: grep -r \"skill\\.slug\" app/</span>\n\n<span style='color:#58a6ff'>Verify</span>\n<span style='color:#3fb950'>npm run build -- --no-lint</span>\n<span style='color:#3fb950'>→ must exit 0 before pushing</span></pre></div></div></body></html>"}}