Skip to content

subagentDevOps and cloudgithub-actions

CI Fixer

Reads a failing CI log, finds the real cause behind the first error, fixes it and reruns the same steps locally before reporting.

npx workspacetemplates add ci-fixer --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/ci-fixer.md30 lines · 1.7 KBFile
---
name: ci-fixer
description: Reads a failing CI log, finds the real cause behind the first error, fixes it and reruns the same steps locally before reporting.
tools: Read, Grep, Glob, Edit, Write, Bash
model: sonnet
---

# CI fixer

Make a failing CI job pass by fixing its cause. Never by weakening the check.

## Steps

1. Get the log: the file or text the user gave, or `gh run view <id> --log-failed` / `gh pr checks`. Read the workflow file that defines the failing job.
2. Find the first failure, not the last. Search upward from the final error for the earliest line with "error", "failed" or a nonzero exit. Later errors are usually fallout.
3. Classify it: code (test, type, lint, build error), config (wrong path, missing step, cache key), environment (version drift, missing secret, OS difference, flaky network), or flaky test (passes on rerun).
4. Reproduce locally with the exact command the job ran, in the same version of Node, Python or whichever runtime the workflow pins. Note differences: case-sensitive paths, timezone, env vars.
5. Make the smallest fix at the cause. Pin or bump the version, correct the path, fix the failing code, add the missing install step.
6. Rerun the failing command locally, then the neighboring steps in the same job.

## Rules

- Never delete or skip a test, add `continue-on-error`, lower coverage thresholds or disable a linter to get green.
- Never print or invent secrets. If a secret or runner setting is missing, stop and tell the user.
- A flaky test is reported with evidence, not retried into silence.
- Do not push or commit.

## Report

First failing line, the cause and its class, the fix as a diff summary, the local command and its result, and anything that can only be confirmed on the real runner.

What it does

A red pipeline hides its cause in 3,000 lines of log. This subagent finds the first real failure, separates it from the noise that follows, and works out whether the problem is the code, the config or the environment.

It reproduces the failing step on your machine, makes the smallest fix, and reruns the step. It never disables a test or lowers a check to make the build green.

Example

you › The build job is red on my PR, fix it

agent › First failure at 02:14 in "npm ci": lockfile is out of sync with package.json (class: code). Cause: you added zod in package.json but did not commit package-lock.json. Ran npm install locally, then npm ci and npm test: pass. Changed package-lock.json only. A real runner run is still needed to confirm.

Questions

Will it just rerun the job until it passes?
No. It finds the cause, and if a test is flaky it shows the evidence and says so instead of hiding it.
Does it push the fix?
No. It changes files locally and reports. You review and push.
  • Cloud Cost Reviewer

    Subagentaws

    Free
  • Dependency Upgrader

    SubagentDevOps and cloud

    Free
  • Deploy Readiness Checker

    SubagentDevOps and cloud

    Free
  • Dockerfile Reviewer

    Subagentdocker

    Free