Ci triage

From jellyrock/jellyrock · View interactive version

Ci triage is an AI agent skill from the GitHub repository jellyrock/jellyrock. Diagnose a failed CI workflow run and fix it the /snag way. A tested read-only script fetches the run, reports every failed job and step with the log region around its errors (not the post-job cleanup), and classifies each against this repo's gates.tsv, printing the banner a gate carries when its ob

How to use this skill

Skill file

/ci-triage: diagnose a failed CI run

This repo

Contract

Goal. Take a failed CI run from red to a chosen, verified fix in one session. A tested script does the mechanical read (fetch the run, find every failed job and step, cut each job's log to the region around its errors, classify each step against this repo's gates.tsv), so the session's effort goes to the diagnosis: is it transient, does it reproduce locally, what is the root cause. From there it follows /snag's method: a decision screen with the evidence and at least two candidate fixes, the user's pick, the fix built test-first and committed, never pushed.

Inputs. The arguments are a run id or a run URL (the id is the number after /runs/); with none, the skill lists the newest failed runs on the current branch and asks which. It reads the run through ci-triage-state.sh, the step map and banners in this skill's gates.tsv (the repo's own file), each gate's local command in this skill's ## This repo, and the code and history the failure points at.

Outputs. The state read's report in the conversation; for a transient failure, the re-run command for the user to run; otherwise /snag's decision screen, then on the user's pick either a fix (its test, one commit on a fix/ci-{{run id}} branch when it started on the default branch, and /snag's report) or a filed followup. A step gates.tsv did not know gets its line proposed.

Success criteria.

Failure modes to avoid.

When not to use.

Implementation

Two repo-owned parts: gates.tsv beside the script maps each CI step to a category, an optional sub-check pattern and a banner (its header says the format); this skill's ## This repo gives each gate's local command and anything the repo's gates need beyond the shared steps.

Step 1: Which run

A run URL gives its id after /runs/. With no arguments, read the branch (git branch --show-current), then list the newest failures on it and ask in chat which one:

bash .claude/skills/pr/forge.sh run list --branch {{branch}} --status failure --limit 5

None on this branch: say so, and offer the same list for the default branch (bash .claude/skills/pr/forge.sh repo default-branch).

Step 2: The state read

bash .claude/skills/ci-triage/ci-triage-state.sh {{run id}}

| Exit | Meaning | Do |

|---|---|---|

| 0 | the run failed; each failed job is reported | Step 3 |

| 2 | the run did not fail, or has not finished | Say which, and stop. |

| 3 | the run could not be fetched or read | Say what its ERROR: and BANNER: lines name, and stop. |

Never re-fetch what it printed with your own forge.sh calls. Its output is the evidence the decision screen cites.

Step 3: Read each failed job

For each FAILED JOB section: the step, the category, the sub-check when the gate wraps several checks in one step (the sub-check, not the step name, is the finding), any BANNER: line, and the tail. A banner outranks the obvious fix; follow it. Several failed jobs often share one cause (a build failure that fails every job after it): name which, and diagnose the cause once.

Step 4: Transient or code?

Transient: a platform outage, a runner that never started, a network fetch or tool install that failed upstream, a device or service the job needs that was unreachable, or a time limit hit with nothing in the tail pointing at code. Then print the re-run command alone in its own block, say why it looks transient, and stop: triage it only if it fails again.

bash .claude/skills/pr/forge.sh run rerun {{run id}}

Anything else is code or configuration: continue.

Step 5: Reproduce locally

Run the gate's local command from this skill's ## This repo; with none there, the command in the tail's ##[group]Run … line. Keep the command and the lines that show the failure. It fails in CI but passes locally: the difference between the two environments is the finding, never a reason to change the check. It cannot be run here (it needs a network service, a tool or a device this machine lacks): say so, and work from the tail.

Step 6: Root cause

Read the file and line the tail names, and the change that brought it in (the state read's commit: line is the commit the run tested):

git log --oneline -10 -- {{path}}
git diff "origin/$(bash .claude/skills/pr/forge.sh repo default-branch)...HEAD" -- {{path}}

For a failing test, read the test and the code it covers. Ask whether the diagnostic is the cause or a symptom of one upstream (a type error at a call site whose contract changed), and name the cause at a file and line.

Step 7: Decide and build, the `/snag` way

Read .claude/skills/snag/SKILL.md and follow its Steps 2 to 7, carrying in what Steps 2 to 6 here found (the reproduction and the root cause are done; finish its Step 2 with the history, what depends on the code, and at least two fixes). Three differences:

Sub-agent invocation

A parent that wants a failed run diagnosed without the conversation starts a sub-agent with model: "opus" and this Task prompt; the parent then shows /snag's decision screen itself:

Read .claude/skills/ci-triage/SKILL.md and follow Steps 2 to 6 for run {{run id}}. Edit nothing, commit nothing, and do not re-run the run or push. Report each failed job with its step, category, sub-check and banners; whether the failure looks transient and why; the reproduction command and what it showed, or why it could not run; the root cause at a file and line with the evidence; and at least two candidate fixes with their footprint and risk. End your report with a "Captures for /log" section: one "- <type>: <title> — <body>" bullet per journal-worthy item this work surfaced, where <type> is one of [this repo's capture types](../../../AGENTS.md#capture-types); omit the section if there are none, and never write to journals yourself. A parent writing that prompt for an Explore sub-agent (which loads no instruction files) spells the types out from the slot in place of the link.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.