From ct
Fetches failing GitHub Actions run logs, correlates with recent commits, and ranks top-3 root-cause hypotheses with minimal fix proposals. Use when CI fails or user pastes a run URL. Read-only — does not apply fixes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ct:ci-failure-triageopusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Remote CI failure diagnosis. Single-snapshot pull of the failing run, commit correlation, ranked hypotheses, fix proposal for user review.
Remote CI failure diagnosis. Single-snapshot pull of the failing run, commit correlation, ranked hypotheses, fix proposal for user review.
The value of this skill is that it separates diagnosis from fixing. It produces a root-cause hypothesis grounded in evidence (log excerpts + commit SHAs) so the user — or a follow-up debugger dispatch — can act with context instead of guessing.
Language/ecosystem agnostic. The correlation between log evidence and commit history is purely textual (file paths, symbol names, error strings). This skill does NOT interpret language-specific build output — it surfaces the error verbatim and ranks which recent commits most plausibly caused it. Hypothesis patterns (dependency resolution failure, missing env var, test assertion diff, etc.) are inferred from the error text itself, not from a preconfigured language list. Works identically for any project that runs on GitHub Actions regardless of the code's language or framework.
debugger agent, which reproduces, verifies, and fixes.gha-security-review.IDENTIFY → Find the failing run
FETCH → Pull failing job + step logs
CORRELATE → Match log evidence to recent commits
HYPOTHESIS → Rank top-3 root causes
LOCATE → Find the source file for the top cause
PROPOSE → Show a minimal-fix diff (do NOT apply)
Get the failing run. Priority order:
https://github.com/<owner>/<repo>/actions/runs/<id>.gh run list --branch "$(git branch --show-current)" --status failure --limit 5
Present the 5 rows. If exactly one row exists, proceed. If multiple, ask the user to pick one before continuing.gh pr checks
Pick the first failing check. If gh pr checks reports no PR, STOP and ask the user for a run ID.Do NOT invent a run ID. If step 1 and step 2 both yield nothing, STOP and ask.
Pull the failing step's output:
gh run view <id> --log-failed
--log-failed captures only failing steps — smaller payload, less noise than --log.
If --log-failed returns empty (some runs fail before any step runs, e.g. YAML parse errors), fall back to:
gh run view <id> --log | tail -200
From the log, extract and record:
If the log has no obvious error marker (no Error, FAIL, exit 1, panic, exception, ##[error]), record the last 40 lines as-is and note "no explicit error marker found."
Tie the log evidence to recent commits.
gh pr view --json baseRefName -q .baseRefName).origin/main (or origin/master if main does not exist).git log --oneline <base>..HEAD
git show --name-only --pretty=format: <sha>
Record the top 3 correlated commits with SHA (short), subject, and correlation level.
Produce a ranked top-3 cause list. Cap at 3. Do NOT speculate beyond the evidence in Phases 2-3.
Format each exactly as:
C1 [confidence HIGH/MED/LOW]: <one-sentence hypothesis>
evidence: <≤3-line log excerpt>
commit: <short-sha> <subject>
Confidence rubric:
If ALL three hypotheses would be LOW, report exactly one LOW hypothesis and state: "Evidence is thin — consider rerunning the job to check for flakiness, or paste more context."
For C1 (the most likely cause), find the source file.
Follow the project CLAUDE.md <tool_priority>:
goToDefinition on the failing symbol.gabb_structure before reading — supports Rust, Go, Python, TS/JS, Kotlin, C++, C#, Ruby.Grep pattern="<symbol>" path="<file_from_log>"
Read the relevant function body (scope: ±10 lines around the line the log points at). Do NOT read the whole file unless the stack trace demands cross-function context.
Show a candidate minimal-fix diff — 5 to 20 lines — with reasoning.
Proposed fix for C1:
<file:line>
<diff snippet, 5-20 lines>
Reasoning: <1-3 sentences tying the diff to the log evidence>
Do NOT apply the diff. Return for user review.
Offer one explicit follow-up option:
To apply this fix, dispatch the
debuggeragent with this diff as input — it will reproduce the failure locally, verify the fix flips red to green, and produce a minimal patch. Or ask for acode-reviewerpass first.
Final report ≤ 500 words. Log excerpts ≤ 40 lines each, maximum 2 excerpts total. Diff ≤ 20 lines.
If the report would exceed 500 words, drop Phase 5's surrounding-code context first, then drop C3, then drop C2. Never drop C1.
## CI Failure Triage — run <id>
**Failing job / step:** <job> / <step>
### Error excerpt (≤40 lines)
```
C1 [HIGH]: ... C2 [MED]: ... C3 [LOW]: ...
file:line Reasoning: ...
Apply via debugger, or request a code-reviewer pass first.
---
## Red flags
| Thought | Reality |
|---------|---------|
| "I'll rerun the job to see if it's flaky" | Out of scope. Let the user decide. |
| "I'll just apply the obvious fix" | No. This skill stops at proposal. |
| "The log is long — I'll summarise it" | Quote verbatim. Paraphrasing hides the real error. |
| "All three commits look plausible" | Rank them with evidence. If none correlates, say so. |
npx claudepluginhub pvillega/claude-templates --plugin ctDiagnoses and fixes GitHub Actions CI failures in pull requests by fetching job logs, identifying root causes like build or test errors, and proposing targeted code changes.
Diagnoses a failing CI run against an 11-pattern playbook, classifies the failure, cites relevant memory, and proposes the exact fix command without applying it.