/dev-kit:ci-fix [run/job/PR/commit URL | run ID | PR number] [push-authorized] [checkout=<dir>]from dev-kit
Diagnoses failed CI pipelines from GitHub Actions URLs, run IDs, or PR numbers, finds root cause, reproduces locally, and commits a fix with optional authorized push.
Ships in dev-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Target: $ARGUMENTS
push-authorized: when this literal token appears in the arguments, the caller has already been granted consent to push. Push without asking, and run unattended: wherever a step below says to ask the user, end with status blocked instead. pr-shepherd invokes this skill that way. Without the token, every push waits for the user's yes. The token, or that yes, is the explicit, per-branch consent that repository rules reserving git push for humans ask for; say so once in the first status line. It does not cover merging or rebasing the base into the branch, resolving conflicts, force-pushing, or changing the PR itself (close, reopen, base, title, body unless this skill's step says so); a later user message grants one of these only when it names it explicitly.checkout=<dir>: the local checkout to fix in, when the caller works in a worktree on the run's branch. It stands for "the checkout" in step 2, and every git and build command runs there (git -C <dir>, or from that directory).push-authorized, print it before returning to the caller, even when the caller continues in the same turn.Resolve the target to a repository, one or more failed runs, and their failed jobs and steps:
| Target | Resolve with |
|---|---|
…/actions/runs/<run-id> (optionally /attempts/<n>, /job/<job-id>) | gh run view <run-id> -R OWNER/REPO --json workflowName,headBranch,headSha,event,attempt,conclusion,jobs,url |
…/pull/<n> or …/pull/<n>/checks, PR number | gh pr checks <n> --json name,state,bucket,link,workflow; take bucket == "fail", the run ID sits in link |
…/commit/<sha> or …/commit/<sha>/checks | gh run list -R OWNER/REPO --commit <sha> --json databaseId,workflowName,conclusion,headBranch |
| empty | gh pr checks for the current branch's PR; with no PR, gh run list --branch <current> --json databaseId,workflowName,conclusion,headSha,createdAt and keep the newest run per workflow |
A run superseded by a newer green run of the same workflow on the same branch is not a failure; drop it. Use a job's databaseId from --json jobs as its ID. A failing check with no Actions run behind it (a third-party app) has its details in gh api repos/OWNER/REPO/commits/<sha>/check-runs (output, details_url) and gh api repos/OWNER/REPO/check-runs/<id>/annotations.
When nothing is failing (all green, or still pending), end with status nothing-to-fix. The same status applies when steps 2–3 find the cause already fixed on the branch head and no newer run will replace this one (a path filter skips it, a deploy workflow runs only on dispatch): next names the gh workflow run <workflow> --ref <branch> command for a workflow with workflow_dispatch. Never dispatch a deploy workflow yourself.
Fixing happens only in a local clone of the run's repository, on the run's headBranch:
blocked, naming the repository.gh pr checkout <n> or git switch <branch>; a dirty tree stays theirs to stash). Proceed only on the run's branch.headSha: the failure may already be gone. Check whether the failing code still exists on HEAD before fixing it.Read gh run view <run-id> --log-failed (add --job <job-id> per job) into a temp file and search it; failed logs can be huge. When --log-failed is empty or answers 403/404, read gh api repos/OWNER/REPO/actions/jobs/<job-id>/logs, then the step conclusions (gh api repos/OWNER/REPO/actions/jobs/<job-id> --jq '.steps[]|{name,conclusion}') and gh api repos/OWNER/REPO/check-runs/<job-id>/annotations, before concluding anything. When none of them shows the failure (a fork's run, missing permission, expired logs), end with status blocked and ask the user for the log excerpt. A cause guessed from code alone is not a root cause.
Then read the failing step in the workflow YAML (its run:, uses:, versions, env, matrix entry) and the code the error points at. The root cause is found when you can name the change that made it fail (a commit, a dependency release, a runner image or action update) and explain why this check saw it. The first error line is often a symptom of an earlier one; follow it back.
Classify each failed job; jobs sharing one cause are one cause:
attempt is already above 1 with the same failure, it is not transient. Status rerun.git diff origin/<base>...HEAD --stat against the failing test's subject (the test file and the code it exercises): a test whose subject the branch touches is not flaky until it passes locally twice; until then it is code or config. Mark a flaky test for a rerun as above and name it in the report so the flake can be fixed on its own. An unrelated test that was not run locally is still marked for a rerun, but cause says "rerun, unverified flake", never "flaky".not-fixable, naming what an admin must change.Reproduce first: run the failing step's command locally, with the tool versions the workflow pins, and watch it go red. Fix the cause, then the same command goes green. Run the repository's lint and typecheck on the touched files too. When the step cannot run locally (services, secrets, another OS), say so in the report's verified field.
A fix makes the check pass on its merits. A test, lint rule or check that is removed, skipped, loosened, or given continue-on-error only moves the failure out of sight; when that is genuinely the right fix, ask the user first. Changing an assertion so it matches the documented contract (cite the line) is a fix, and the commit message quotes that line. Accepting output the contract does not name is loosening: under push-authorized, status blocked.
One commit per root cause, conventional commit style matching git log. Stage only the fix's files, by explicit file path (git add <file>…), never a directory, -A or -a; pre-existing changes and untracked files (??) in the tree are the user's and stay out.
Push to the run's branch with git push: at once under push-authorized, otherwise ask the user and push on their yes. Pushing a change under .github/workflows/ needs a token with the workflow scope; when the push is refused for it, report pushed: no with that reason. Last, trigger each marked rerun with gh run rerun <run-id> --failed, unless a push to that branch just started fresh runs.
End with this block, exactly these keys, each on one line:
ci-fix result
status: fixed | rerun | nothing-to-fix | not-fixable | blocked
runs: <run URL>, ...
cause: <job / step: why it failed>; ...
commits: <short SHA> <subject>, ... | none
verified: locally | not reproducible locally: <why> | n/a
pushed: yes | no: <why> | n/a
next: <what the user or caller must do, or none>
With several causes, cause lists each one and status takes the first that applies in the order blocked, not-fixable, fixed, rerun, nothing-to-fix.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub grixu/cc-toolkit --plugin dev-kit5 skills in this plugin
/dep-upgrade-checkDependency upgrade compatibility and security check. Gates the target version on known vulnerabilities, malware, and release age, finds everything that changes between the version a codebase resolves today and the target, maps each change to where the code uses it, and returns a safe / safe with changes / breaking verdict with file:line evidence. Use when the user names a package and a target version, links a Renovate or Dependabot pull request, or asks whether bumping a dependency will break the build./merge-in-headMerge the branch's base (its open PR's base, or the branch it was cut from) into the current branch, resolve every conflict by the intent behind both sides, run the project's checks and commit the merge. Use when the user asks to merge main (or develop, or "the base", "the parent") into their branch, to bring a branch or PR up to date, to fix a PR that "has conflicts with main", or to resolve the conflicts of a merge already in progress./pr-openPush the current branch and open a pull request whose body fills the repository's PR template as a short reviewer-first description with a before/after table, honest testing and deploy steps. Use when the user asks to open, create or raise a PR, to push a branch for review, or to refresh an existing PR's description./pr-shepherdShepherd the current branch's pull request, or a stack of pull requests named by number, in a self-paced loop until CI is green and every review thread is resolved, fixing failures and review comments with commits and pushes, and answering the unjustified ones in-thread. Use when the user asks to babysit, watch or drive a PR to green, or to keep fixing CI and review comments until the PR is clean.Other plugins' skills for the same job