AGENT SKILL

debug-ci

Fix a GitHub Actions run that has failed — e.g. "why did CI fail", "the build is red", "check the Actions run", "/debug-ci". Fetches the failure logs via `gh`, diagnoses the root cause, and fixes it locally. User will review and push.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 0
Forks
0

01 前言 Front Matter

name
debug-ci
description
Fix a GitHub Actions run that has failed — e.g. "why did CI fail", "the build is red", "check the Actions run", "/debug-ci". Fetches the failure logs via `gh`, diagnoses the root cause, and fixes it locally. User will review and push.
allowed-tools
Read, Grep, Glob, Bash, Edit, Write
user-invocable
true

02 资源文件 3

03 SKILL.md 正文

Debug CI

Diagnose a failed GitHub Actions run from its real logs, fix it locally, stop before any git write. Same human-in-the-loop boundary most repos hold — this skill invokes gh, not git commit/git push.

Steps

  1. Confirm gh auth first: gh auth status. If it's not authenticated, tell the user and stop — don't attempt to fix auth yourself.

  2. Fetch and trim the logs in one step. gh run view --log-failed dumps every line of every failed job; this extracts only the error regions, per job and step:

    "${CLAUDE_PLUGIN_ROOT:-${SKILL_TREE_DIR:-$HOME/projects/skill-tree}}/skills/debug-ci/scripts/debug-ci"
    

    With no arguments it takes the newest failing run on the current branch. Useful flags: <run-id> positionally, --branch, --repo owner/name, --context N (lines kept before each error), --max-lines N (ceiling per step), --json.

    Exit codes: 0 extracted, 1 no failing run on that branch, 2 unusable (gh missing, unauthenticated, or the run isn't readable) — in that case report it and stop, don't try to fix auth yourself.

  3. More than one failing run? Stop and ask. If the output ends with Other failing runs on this branch:, name each run (id and workflow) and ask the user which to address, or whether to take them all. Edit nothing until they answer.

  4. Read what it kept, and mind the elisions. Every gap is marked ... N lines omitted .... If the kept region doesn't contain the cause, re-run with a larger --context/--max-lines, or fall back to the raw gh run view <run-id> --log-failed rather than guessing.

  5. Diagnose the root cause from the log, not from guessing at the diff. If the log doesn't make the cause obvious, say so and ask rather than fixing the first plausible thing.

  6. Fix it following this repo's standing conventions (see that repo's own CLAUDE.md, if any): TDD (test first where the failure is a code bug), discrete reviewable steps, invoke the relevant language skill/reference for the code being touched.

  7. Verify locally before reporting done. Run the same check CI ran (test suite, prek/pre-commit, lint) so "should pass now" is backed by a real local run, not an inference from the diff. If the verify skill is installed alongside this one, invoke it for the claim-by-claim version of this check.

  8. Stop. Show the diff. Do not git add/commit/push. Report what was wrong, what changed, and the command the user ran to reproduce the local pass. Pushing and watching the re-run is manual, same as every other change.

Notes

  • This skill only ever reads CI state (gh run/gh api) and writes to the working tree — it has no git-write step to skip, by design. If a future version adds auto-push, that's a deliberate policy change requiring explicit sign-off, not a default.
  • git stash / git stash pop are fine for reproducing a failure against the old code, as long as the end result is non-destructive (tree restored, stash list unchanged) and git blame is untouched.
  • Multiple failing jobs in one run: fix and verify one at a time rather than batching blind fixes across unrelated failures.
  • On older gh (seen on 2.23.0), run view --log-failed exits 0 and prints nothing. The CLI detects that empty answer and refetches via the REST jobs/logs API, so an empty log is never reported as a clean run.

04 同仓库更多 Skills

dannybrown37
dannybrown37/skill-tree

wait-what

Stop. Your plan/idea did not land. Re-pitch it.

★ 0
dannybrown37
dannybrown37/skill-tree

verify

Verify before answering whether something works, still passes, is gone, is used, or is correct — and whenever the user says "can you confirm", "are you sure", "did that actually work", or reports something is "still" broken. Produces the answer plus the evidence that would have falsified it. A failed GitHub Actions run is skill-tree:debug-ci instead.

★ 0
dannybrown37
dannybrown37/skill-tree

ui-designer

Design or restyle a web UI — landing pages, dashboards, docs sites, app chrome — or when the user asks why a site "looks generic", "looks like a template", or wants it to feel intentional. A running list of design lessons learned, applied as rules rather than suggestions.

★ 0
dannybrown37
dannybrown37/skill-tree

two-axis-review

Two-axis review of changes since a fixed point (commit, tag, HEAD~N, or default HEAD~1): Standards (does the code follow this repo's conventions?) and Spec (does the code do what it should?). Axes run as parallel sub-agents so neither masks the other. Use when the user says "review against the spec", "does this follow our conventions", "standards and spec review", or "two-axis review". Not a correctness bug hunt — that's the built-in `/code-review`.

★ 0
dannybrown37
dannybrown37/skill-tree

tui-screenshots

Use for generating or refreshing TUI screenshots for docs — "regenerate the screenshots", "the README screenshots are stale". Drives a Textual/TUI app headlessly and exports SVG. Not for reading a user's screenshot — that is `screenshot`.

★ 0
dannybrown37
dannybrown37/skill-tree

to-tickets

Break a spec, plan, or conversation into tracer-bullet vertical-slice tickets with blocking edges — "turn this into tickets", "break this down", "what's the work?". Pairs with skill-tree:to-spec upstream and skill-tree:handoff downstream.

★ 0