{"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":"0df50c0a2edf1fd035cad1b77be1adc089ecdadf3ac1ffc37c38814323ef697a","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"}}