/dstack-core:ci-fixfrom DStack Core
Fixes, classifies, or sweeps CI failures on GitHub PRs or GitLab MRs. Use when CI is red, a check needs diagnosis, or a bounded automated repair sweep is needed.
Ships in DStack Core. 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.
Read when SKILL.md points to them; scripts run unread.
Red CI on a PR or branch gets repaired, classified, or swept, depending on what was asked. Three modes cover the work: fix (the default, interactive or autonomous), classify (read only diagnosis with a fix plan), and sweep (a bounded background monitor that proposes one verified repair per tick). Whatever the mode, never widen workflow permissions, never add pull_request_target, and never offer a rerun in place of a code fix. Merge conflicts belong to resolve-merge-conflicts; non CI bugs belong to grill-core.
Say which mode is running and confirm its inputs are present, or report what is missing: classify when the user asks for a diagnosis or plan without a patch, sweep when a bounded monitor over an attempt window is requested, fix otherwise. A bare invocation that repeats a previous report with the same run IDs and head SHA answers with that report in one line and makes no gh call. A bare invocation never starts a sweep.
The target is a PR number or URL on GitHub, or a HOST plus GROUP/PROJECT plus MR IID on GitLab (self managed hosts and forks included), defaulting to the current branch's PR or MR. A working tree already carrying the in progress fix is fine. Select the forge from the verified request URL or repository remote, never a hardcoded host: GitHub targets use gh with workflow and repo scopes, GitLab targets use glab bound to the verified host. Optionally, a specific job ID for full log inspection, or an artifact download when logs alone do not identify the cause.
Classify also needs the check name, its status (failed, absent, pending, unstable, or unexpected), and the run identifier or URL that produced the report; optionally the failing job log, the changed files or commit range under test, and any prior classification of the same check. Sweep needs the base commit the CI run used, the verifier command that independently confirms a repair, and the attempt cap; optionally a flake detection window and a circuit breaker threshold.
Set GH_PAGER=cat on every gh invocation (the CLI has no global pager switch and blocks on a pager in non interactive contexts) and verify authentication with gh auth status, or glab auth status --hostname <HOST> for GitLab paths (never pass --show-token, never log credential values). In fix and sweep an unauthenticated CLI stops the skill before any change: ask the user to run gh auth login or glab auth login --hostname <HOST> for the target forge and mutate nothing until then. Classify stands alone without a CLI, continues without one, and says so.
Classify records the check name, status, and run identifier before reading anything else; an absent check or a check that never ran is a distinct input, not a missing one. Fix and sweep resolve the failing run first. On GitHub that means gh pr view --json number,url for a PR, or gh run list --branch <branch> --status failure --limit 5 then gh run view <run-id> for a non PR branch or supplied run ID. On GitLab it means binding HOST, GROUP/PROJECT, and MR IID and recording the MR head SHA from helper output.
Route by the verified forge. GitHub Actions runs go through the bundled script, which handles gh field drift, run and job ID extraction, and failure snippet extraction, and exits non-zero while failures remain:
python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>" (--json for machine output).
GitLab MRs go through the MR helper, which is read only (never rerun, retry, cancel, or create a pipeline):
python "<path-to-skill>/scripts/inspect_mr_checks.py" --host <HOST> --project <GROUP/PROJECT> --mr <IID> (--json for machine output; --repo only sets the subprocess working directory).
The helper binds HOST, project, and MR IID explicitly. It requires an exact positive integer head_pipeline ID before querying jobs. Missing IDs, booleans, floats, strings, zero, and negative IDs produce missing. It checks the pipeline against the MR head SHA, reads all job pages, and extracts failed-job traces. Each job needs a positive integer ID and a nonempty status; malformed records cannot prove success. Use only the documented flags.
green requires a successful head-matched pipeline, at least one identified passing required job, and no failed, incomplete, or skipped required jobs. An optional-only success set produces missing, not green. An empty job set also produces missing. Other verdicts are failed, running, skipped, and unrelated. Incomplete checks are not diagnosed. On a head mismatch, preserve pipeline ID, SHA, ref, and URL without fetching jobs for the wrong revision.
A pipeline with failures but no passing jobs is failed, even when those failures are optional. Required failures also produce failed when the aggregate pipeline reports success. Optional failures or manual jobs do not block genuine passing required checks; report their actual status and mark them nonblocking. A head change invalidates previous evidence. Re-inspect it. Exit 0 means verified green; failed exits 1; missing, running, skipped, and unrelated exit 2.
The manual fallback is GH_PAGER=cat gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow (rerun with the fields gh accepts when one is rejected), the run id extracted from detailsUrl, then GH_PAGER=cat gh run view <run_id> --json name,workflowName,conclusion,status,url,event,headBranch,headSha, GH_PAGER=cat gh run view <run-id> --log-failed for the failed jobs only or --log for all, GH_PAGER=cat gh run view <run-id> --log --job <job-id> for one failing job, and gh run download <run-id> -D .artifacts/<run-id> for evidence logs cannot supply. When a run log is still in progress, fetch job logs via gh api "/repos/<owner>/<repo>/actions/jobs/<job_id>/logs". A check whose detailsUrl is not a GitHub Actions run is external: report the URL only and never attempt Buildkite or other providers.
Every failing check needs a name, a URL, and a log snippet from command output, or an explicit log_pending or log_unavailable marker; never a fabricated snippet. In classify, preserve the exact failure line, signal, or message. Bind every piece of evidence to the run, commit, job, and step that produced it. When jobs did not begin and logs are absent, inspect check run annotations and platform status before diagnosing product code, and a billing or quota classification requires the actual platform evidence. A never executed check is not a pass. Order generated artifacts, installs, and other prerequisites before the checks that consume them, and do not attribute each newly exposed failure to the latest patch without evidence. For intermittent failures, compare relevant revisions under matched environments and preserve the failure signal, frequency observations, and remaining uncertainty: a retry pass, timeout shaped output, assertion failure, or a fixed number of clean runs does not by itself prove cause or absence. Isolation may change suite interactions and is reported as a scope limit. Reuse one watcher for the same in flight run when available; watcher attachment and partial green counts are not terminal verdicts.
Read only; this mode stops before any write.
regression: the change introduced or exposed the failure; the failing path is in the diff.flake/watch: timing, order, or environment dependent; passes on retry or across runs without a code change.infrastructure: runner, network, quota, service outage, or resource exhaustion, not the code under test.configuration: build, config, dependency, or environment setup, not product logic.policy/absent-CI: absent, skipped, not configured, or blocked by a branch protection or policy rule.human escalation: evidence insufficient, contradictory, or outside the five classes; a human must decide. Name the missing evidence, or state both signals when they imply different classes; never average or pick arbitrarily. When a prior classification of the same check matches the new evidence, note the repeat; when it contradicts, re-classify from the new evidence.GH_PAGER=cat gh pr view <branch> --json number,title,url,state, fetch the check rollup with --json statusCheckRollup, and extract each failed check's logs with GH_PAGER=cat gh run view <run-id> --log-failed, collecting error messages with file paths and line numbers, compilation errors, lint names, test failure messages and stack traces, and build root causes. On GitLab, bind HOST, GROUP/PROJECT, and MR IID, and read the MR head SHA, head pipeline verdict, and failed job evidence from inspect_mr_checks.py --json output. When any check is still in progress, report the partial state and stop; incomplete checks are never diagnosed. Then write the plan: a problem statement summarizing the failing checks, the current state listing each error and its location, proposed changes grouped by category (formatting, linting, compilation, test failures, platform specific), and validation steps (fmt, lint, tests, presubmit). Fix one category at a time and apply no code change; mark any unread run untriaged in the plan. With no PR or MR for the branch, classification stands alone: skip the fix plan, report that none exists, and create nothing. Then stop; any further step that would require a write returns human escalation.blocked-by-dependency naming the blocking check instead of failed. Order the work so root causes are fixed before the symptoms they produce.git diff --name-only lists only the approved file paths and the diff summary matches the approved plan.gh pr checks <pr> (GitHub) or inspect_mr_checks.py --host <HOST> --project <GROUP/PROJECT> --mr <IID> (GitLab). Interactive mode has not pushed, so report local-fix-ready with the local proof and the observed red or pending remote checks; never imply that local edits changed CI. When the remote checks are already green because another actor updated the branch, report the observed green state without attributing it to the local patch.Pushing the fix is an autonomous branch entered only on explicit user ask (for example "push the fix" or "land it on a fix branch"), never self initiated. Before any mutation, preview the failing job, the exact change set, and the target branch ci-fix/<original-branch>; the preview names every file path with its full new content, the branch name, and the PR consequence, and the push waits for explicit human approval. The plan approval from fix step 2 doubles as the push approval once the preview is acknowledged.
permissions: minimal: never broaden token access, never add pull_request_target. git diff on workflow files touches no permission key outside the previewed set.git checkout -b ci-fix/<original-branch>. Existing branch: show its current commits, confirm reuse with the user, git checkout ci-fix/<original-branch>, then git pull origin <original-branch>. git log --oneline -1 shows it carries only the previewed change.git add -- <paths>, then inspect the staged path list and patch; stop when the staged set contains any extra path. Commit fix: resolve CI failure in <job-name>, then push git push -u origin ci-fix/<original-branch> (plain git push once upstream is set). git diff --cached --name-only lists only the approved paths, and git push success is confirmed by git rev-parse origin/ci-fix/<original-branch> showing the pushed SHA.gh run list --branch ci-fix/<original-branch> --limit 1 for the new run id, then gh run watch <new-run-id> --exit-status. Re-trigger only failed jobs with gh run rerun <new-run-id> --failed when the evidence is infrastructure or a confirmed flake and the user approves; a rerun never substitutes for a deterministic fix. Attempt a rerun only when gh repo view <owner>/<repo> --json viewerPermission reports WRITE, MAINTAIN, or ADMIN, because GitHub lets anyone with write permission rerun workflows; with a lower permission, report the rerun as blocked without trying it. When GitHub rejects an attempted rerun, report the exact error as the blocked state and do not retry. gh run view <new-run-id> --json conclusion reporting success closes the loop. A user instruction to stop watching ends this step: report the last observed state and start no watcher. On GitLab, re-inspect with inspect_mr_checks.py --host <HOST> --project <GROUP/PROJECT> --mr <IID> after push, or poll glab ci get --merge-request <IID> -F json for the head pipeline, and read failed job logs with glab ci trace <job> -p <pipeline-id>; never rerun, retry, or write a pipeline from this skill.gh run list --branch ci-fix/<original-branch> --limit 1 and resume watching; on GitLab, re-run glab ci get --merge-request <IID> -F json and resume from the head pipeline. Never re-push blindly.missing or unrelated head pipeline is surfaced with its cause, never green, never skipped. Proving GitLab MR state requires head-bound verification: pipeline head SHA must match the MR head revision, real passing jobs must be observed rather than inferred from empty or skipped sets, and uncertainty states (missing, running, skipped, unrelated) remain explicit blockers with their observed causes rather than assumed passes.Classify returns one chat record with the check name, run identifier, observed failure signal, the single deterministic class, the next owner, and the one sentence next action; no-CI and blocked states count as their own classes and are never omitted or skipped. The reviewable fix plan follows when a PR or MR and its forge CLI are available, with untriaged checks explicitly marked and no code changes applied. Fix interactive returns the failing check report (check name, run URL, log snippet, missing log notes), then the ordered root cause record (per root cause: check name, root cause, changed paths), the applied diff, local check results, and the observed current remote status (gh pr checks output or the inspect_mr_checks.py verdict with head SHA and SHA match); terminal local-fix-ready, blocked with the exact reason, or non-converged. Fix autonomous returns the ordered root cause record plus a summary in fixed order: failing run (link or ID), root cause, fix (what changed), verification (new run link showing green); terminal checks-pass, blocked with the exact reason, or non-passing with the link and analysis. GitLab MRs report provider, host, project, IID, MR state, head SHA, SHA match, head pipeline summary, one verdict (failed, running, missing, skipped, unrelated, green), and per job evidence; exit 0 means verified green only. Sweep returns a terminal classification per swept check: reproduced (with the minimal verified patch as a proposal, verifier evidence, and the attempt count), non-actionable (handoff record with the accumulated evidence), or blocked (stopping reason and accumulated evidence).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gosuda/dstack-skills --plugin dstack-core89 skills in this plugin
/abstract-wellUse when the user wants to classify abstractions as useful, bad, or busy and keep one shallow level. Not for tasks requiring source or remote-system changes./architectUse when non-trivial code needs a design, codebase architecture needs improving through survey and deepening, or one module needs targeted interface narrowing, seams, or testability. Not for rendered visual artifacts, deploy, or irreversible changes./architecture-simplificationUse when the user explicitly asks to simplify an architecture, collapse modules or crates, or cut a dependency graph within approved boundaries. Executes an approved layout direction slice by slice. Not for single-module cleanup: use code-simplification. Not for layout planning from nothing: use architect. Not for blind re-derivation: use breaking-driven.Other plugins' skills for the same job