← ClaudeAtlas

ci-sweeplisted

React to CI failures on main or active branches — diagnose the failure type, propose a minimal fix for regressions, re-run flakes, and escalate infrastructure failures. Designed to run with /loop 15m.
manastalukdar/ai-devstudio · ★ 1 · DevOps & Infrastructure · score 75
Install: claude install-skill manastalukdar/ai-devstudio
# CI Sweep Reduce the time main stays red. Monitors CI, classifies each failure, and takes the smallest safe action — or escalates when human judgment is needed. ## Usage ``` /ci-sweep # check CI status on current branch /ci-sweep --branch main # sweep a specific branch /ci-sweep --run <run-id> # analyze a specific workflow run /ci-sweep --report-only # diagnose but do not apply any fix ``` Run on a loop for continuous reaction: ``` /loop 15m /ci-sweep --branch main /loop 5m /ci-sweep # during active development ``` ## Behavior ### Step 1 — Check CI status ```bash # Get recent runs on the target branch BRANCH="${ARGUMENTS#*--branch }" BRANCH="${BRANCH:-$(git branch --show-current)}" gh run list --branch "$BRANCH" --limit 5 \ --json databaseId,name,status,conclusion,createdAt,headSha \ --jq '.[] | select(.status == "completed" and .conclusion != "success")' ``` If all runs are passing → report "CI green" and exit immediately. ### Step 2 — Get failure details ```bash # Fetch logs for the failing job gh run view <run-id> --log-failed 2>/dev/null | tail -100 # Identify the failing step gh run view <run-id> --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name, steps: [.steps[] | select(.conclusion == "failure")]}' ``` ### Step 3 — Classify the failure | Type | Signals | Action | |---|---|---| | **Regression** | New failure on a line changed in recent commits | → Step 4: minimal-fix