{"manifest":{"name":"CI/CD Failure Diagnostician","version":"1.0.0","description":"Paste a failed CI log (GitHub Actions, CircleCI, etc.) and get: failure category, root cause in plain English, exact fix command or code change, and flaky test detection.","tags":["devops","ci","github-actions","debugging","workflow"],"standard":"agentskills.io","standard_version":"1.0","content_checksum":"304b6c9df8487f4a0443bc1ea78b3ea3522a325ebbfc63853c3d8dfe030c4bee","bundle_checksum":null,"metadata":{},"files":[]},"files":{"SKILL.md":"# CI/CD Failure Diagnostician\n\n> **Purpose:** Diagnose a failed CI/CD pipeline from raw logs. Takes a GitHub Actions, CircleCI, GitLab CI, or any other CI log output. Returns: failure category, root cause explanation in plain English, exact fix (command, code change, or env var), and whether it looks like a flaky test. Turns 20 minutes of log-reading into 20 seconds.\n\n---\n\n## Invocation\n\n```\n/ci-fix <paste-log-output>\n```\n\nOr: `/ci-fix` then paste the log when prompted.\n\n---\n\n## Failure Categories\n\nClassify the failure into exactly one category:\n\n| Category | Indicators |\n|----------|-----------|\n| **Test failure** | `FAIL`, `AssertionError`, `expect(x).toBe(y)`, test name in output |\n| **Build error** | TypeScript error, compilation failure, syntax error |\n| **Lint error** | ESLint, Prettier, Ruff, golangci-lint rule violation |\n| **Missing env var** | `undefined`, `Cannot read properties of undefined (reading 'env')`, `process.env.X is not defined` |\n| **Dependency install failure** | `npm ERR!`, `pip install failed`, `Cannot find module` |\n| **Permission error** | `EACCES`, `403 Forbidden`, `permission denied` |\n| **Timeout** | Job exceeded `N` minutes, `ETIMEDOUT`, hanging process |\n| **Out of memory** | `ENOMEM`, `JavaScript heap out of memory`, OOM killed |\n| **Network error** | DNS resolution failed, connection refused, rate limited |\n| **Flaky test** | Timing assertions, random/date-dependent values, race conditions |\n\n---\n\n## Diagnosis Process\n\n### Step 1: Find the Failure Point\n\nScan the log for the FIRST error line — most CI logs dump a long stack trace but the real error is near the top of the first `ERROR` block.\n\nCommon patterns to scan for:\n```\n✗ FAILED\nError: ...\n× ...\nFAILED: ...\nerror[...]: ...\nexit code: 1 (immediately after the relevant command)\n```\n\n### Step 2: Explain in Plain English\n\nOne paragraph: what failed, why it failed, and what the system was trying to do when it failed. No jargon that isn't in the original log.\n\n### Step 3: Provide the Fix\n\nThe fix must be one of:\n- **A command to run** (with the exact command, ready to copy-paste)\n- **A code change** (file:line, old code, new code)\n- **An env var to add** (variable name + where to add it)\n- **A CI config change** (which job/step to modify and how)\n\n### Step 4: Flaky Test Detection\n\nFlag as **possibly flaky** if the failure involves:\n- `setTimeout` / `sleep` / date-based assertions without mocking\n- Race conditions (async test with no proper await)\n- External service calls in unit tests\n- File system state left from a previous test\n- Random or time-dependent data generation\n\nIf flaky: suggest `--retry=3` as a short-term bandage + the proper fix (mock the external dependency).\n\n---\n\n## Output Format\n\n```\n## CI Failure Diagnosis\n\n**Job:** [job name from log]\n**Step:** [step that failed]\n**Category:** [one of the 10 categories above]\n\n---\n\n### Root Cause\n\n[Plain-English explanation, 2-4 sentences]\n\n---\n\n### Fix\n\n[Exact command OR code change OR env var to add]\n\n```bash\n# Run this locally to reproduce and verify the fix:\n[reproduction command]\n```\n\n---\n\n### Flaky Test?\n\n[Yes / No / Possibly — with brief reason]\n\n---\n\n### Prevention\n\n[One-line suggestion to prevent this class of failure in the future]\n```\n\n---\n\n## Rules\n\n- Always find the FIRST error line, not the last — stack traces cascade from the origin\n- Never say \"the issue is complex\" — give a specific diagnosis even if uncertain (flag uncertainty)\n- If `Missing env var`: specify the exact variable name found in the log, not a guess\n- If flaky: never just say \"add a retry\" — explain the actual race condition or timing issue\n- If you cannot determine the cause: output \"Inconclusive — please provide more log context\" with specific questions about what's missing\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/CD Failure Diagnostician</span><span>Example · SkillSlap</span></div><div class='panels'><div class='panel'><div class='label'>Input: CI log excerpt</div><pre><span style='color:#8b949e'>FAIL src/auth/session.test.ts</span>\n<span style='color:#8b949e'>  ● Session › persists after reload</span>\n\n<span style='color:#8b949e'>    Expected: \"active\"</span>\n<span style='color:#8b949e'>    Received: undefined</span>\n\n<span style='color:#8b949e'>    at Object.expect (session.test.ts:47)</span>\n\n<span style='color:#8b949e'>Tests: 1 failed, 147 passed</span></pre></div><div class='panel'><div class='label'>Output: Diagnosis</div><pre><span style='color:#f85149'>Root cause</span>\n<span style='color:#8b949e'>session.test.ts:47 — `status` field is</span>\n<span style='color:#8b949e'>`undefined` after reload. The test</span>\n<span style='color:#8b949e'>creates a session then reads it before</span>\n<span style='color:#8b949e'>the write propagates to the store.</span>\n\n<span style='color:#e3b341'>Likely fix</span>\n<span style='color:#8b949e'>1. Add `await session.save()` before</span>\n<span style='color:#8b949e'>   the reload assertion.</span>\n<span style='color:#8b949e'>2. Or mock the session store so reads</span>\n<span style='color:#8b949e'>   are synchronous in tests.</span>\n\n<span style='color:#58a6ff'>Verify</span>\n<span style='color:#8b949e'>npx vitest run src/auth/session</span>\n<span style='color:#8b949e'>Add: console.log(session) after reload</span></pre></div></div></body></html>"}}