Przejdź do treści
Biblioteka skilli
DevOps i chmura · Analiza

ci-fix

/ci-fix

Naprawia czerwone sprawdzenia CI, klasyfikując pojedynczą awarię albo przeglądając serię, bez wdrożeń i poświadczeń.

Repozytorium
dalcom-skills ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
2
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co sprawdzić przed instalacją
  • 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/inspect_mr_checks.py, scripts/inspect_pr_checks.py

Co robi i kiedy

Naprawia czerwone sprawdzenia CI, klasyfikując pojedynczą awarię albo przeglądając serię, bez wdrożeń i poświadczeń.

Wyzwalacze z opisu

CI is redfix the checksmake CI green
Oryginalny opis (EN)

Use when "CI is red", "fix the checks", or "make CI green", one check needs classifying, or a bounded sweep runs. Not for deploys, credentials, or rerun-as-fix. Non-CI bugs: use grill-core.

Jak działa

  1. Pick the mode and prove who you are
  2. Pin down the failing run
  3. Read the evidence, not the rumor
  4. Classify: name it and hand it off
  5. Fix: smallest change, local proof first
  6. Sweep: one repair per tick, never merged
  7. When to stop instead
  8. What you hand back
Sekcje z nagłówków SKILL.md, w oryginale · 95 linii, 3 254 słów
Podgląd SKILL.md
---
name: ci-fix
description: 'Use when "CI is red", "fix the checks", or "make CI green", one check needs classifying, or a bounded sweep runs. Not for deploys, credentials, or rerun-as-fix. Non-CI bugs: use grill-core.'
---

# CI fix

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`.

## Pick the mode and prove who you are

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.

## Pin down the failing run

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.

## Read the evidence, not the rumor

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.

## Classify: name it and hand it off

Read only; this mode stops before any write.

1. Compare the failure against the commit range and changed files under test and decide whether the failing path was touched by the change or predates it. Before flagging a test failure as a regression, check whether the same test previously passed in CI, and note environment specific or flaky cases rather than treating them as regressions.
2. Classify into exactly one class from observed evidence:
    *   `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.
3. Assign the next owner from the class (regression and configuration to the change author, flake/watch to the test or platform owner, infrastructure to the platform or runner owner, policy/absent-CI to the repository or CI config owner, human escalation to a human reviewer) and state the next action concretely in one sentence.
4. Emit a reviewable fix plan when a PR or MR and an authenticated CLI for its forge are available. On GitHub, view the PR with `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`.

## Fix: smallest change, local proof first

1. Triage every failing check as a root cause or a downstream symptom of another failure; a single root cause may surface as several failing checks. When a check fails only through a failed dependency, verdict it `blocked-by-dependency` naming the blocking check instead of `failed`. Order the work so root causes are fixed before the symptoms they produce.
2. For each root cause failure, read the failure log and the relevant source to determine the smallest deterministic fix for that cause; prefer a code change over workflow plumbing, and for a flaky test fix the nondeterminism instead of rerunning. Request approval before editing any file: the plan is approved in writing with the file paths and change described, or refused. On refusal, report the plan and wait without editing.
3. Implement the approved plan and summarize diffs and tests. Keep the change set inside the failing job or step where possible: `git diff --name-only` lists only the approved file paths and the diff summary matches the approved plan.
4. Run the local equivalent of each failing CI check to confirm the fix before any push, with the command exiting 0 and its output captured.
5. Capture the current remote status with `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.

1. When workflow files must change, keep existing `permissions:` minimal: never broaden token access, never add `pull_request_target`. `git diff` on workflow files touches no permission key outside the previewed set.
2. Create or update the branch. New branch: `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.
3. Stage only the exact paths in the approved preview with `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.
4. Watch the new run: `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.
5. New failures mean repeating from fix step 1 with the new failures as the current set. Stop only when every check in the set is green.

## Sweep: one repair per tick, never merged

1. On each tick, fetch the current set of failing CI checks for the target run and record the attempt number against the configured cap. At the cap, stop and hand off; do not start a new repair.
2. Pick one failing check and reproduce the failure locally in an isolated worktree created from the base commit the CI run used. Reproduce the root cause, or classify the failure non-actionable (flake, environment, upstream). A flake or an ambiguous cause means handing off with evidence, never patching.
3. For a reproducible root cause, implement one minimal isolated repair in the worktree: the smallest change that fixes the reproduced cause and nothing else. Run the verifier in the worktree independently of the repair and confirm the failing check passes with no other check regressing. When the verifier fails or regresses, do not widen the patch; increment the attempt counter and either retry within budget or hand off.
4. Return the verified patch as a proposal (diff or branch) with the reproduced root cause, the verifier evidence, and the attempt count. Do not push, merge, or publish; a worktree repair is never merged. When the circuit breaker trips (repeated non-convergence, repeated flakes, or budget exhaustion), stop the sweep and hand off with the accumulated evidence. The attempt cap reached, non-convergence, or repeated flakes all end the same way: stop, hand off with the accumulated evidence and the attempt count, start no new repair, and swallow nothing.

## When to stop instead

*   CLI unauthenticated for the target forge, or no failing run found for the supplied PR, branch, run ID, or MR host, project, and IID: stop and report; nothing committed or pushed. In classify, skip the fix plan, report the missing prerequisite, and never attempt credential setup.
*   Logs do not identify a root cause (insufficient logs, unreproducible secret or environment failure): report the evidence found and guess no fix; in autonomous mode push nothing.
*   The smallest fix requires widening scope beyond the failing job or step, or broadening workflow permissions: stop and report why; never expand permissions to make tests pass.
*   The local check does not reproduce the CI failure: do not push. Report the reproduction gap with the CI log attached as the blocked state.
*   A fix resolves one check but breaks another: when not yet pushed, amend or discard the fix; when pushed, revert it. Re-triage treating the new break as a root cause.
*   Interactive non-convergence: report remaining failures and the applied diff; roll edited files back via VCS when the user requests it.
*   Autonomous run still red: diagnose the new failure and apply one further in scope fix; with no new actionable cause, stop blocked with the failing run link, the analysis so far, and the exact failing job. Leave the branch and runs in place; never delete or force push to hide a failure unless the user asks.
*   Push or watch interrupted: the remote branch state is authoritative. On GitHub, re-run `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.
*   Push rejected (protected branch, conflict, permission): do not force push. Report the rejection reason as the blocked state.
*   Non-convergent after repeated fix cycles, with new failures appearing in the fix's own code: stop and report the non-convergent state with the failure chain. Never claim green or that the done state holds.
*   A GitLab head change after evidence capture invalidates that evidence; re-inspect before diagnosing. A `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.

## What you hand back

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).
Pliki w paczce (4)
  • SKILL.md 21 KB
  • agents/openai.yaml 1 KB
  • scripts/inspect_mr_checks.py 22 KB
  • scripts/inspect_pr_checks.py 15 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · gosuda/dalcom-skills100Apache-2.0
grixu/cc-toolkit100MIT
fastled/fastled100MIT
kcenon/claude-config100BSD-3-Clause
OutlineDriven/outline-driven-development100Apache-2.0
sean-sunagaku/claude-code-plugin100MIT
dotnet/maui90MIT
jMerta/codex-skills90MIT

Migawka bazy z 13.11.2026 · wersja paczki 5f7395527ca9 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100fix-ci
    Diagnozuje nieudane sprawdzenia CI i czerwone pull requesty, a następnie je naprawia.
  • 90fix-ci
    Znajduje nieudane sprawdzenia w bieżącym PR, czyta logi, rozdziela błędy na prawdziwe, losowe i środowiskowe, naprawia tylko prawdziwe.
  • 100check-ci
    Diagnozuje awarie CI przez analizę logów GitHub Actions, wskazuje przyczyny źródłowe i sugeruje poprawki, gdy workflow się wysypał albo sprawdzenia są czerwone.
  • 90pb-ci-fix
    Naprawia czerwone CI lub konfiguruje GitHub Actions od początku do końca: czyta nieudany przebieg, znajduje przyczynę, poprawia workflow i obserwuje, aż uruchomienie na wypchniętym commicie zzieleni.
  • 90fix-ci
    Diagnozuje czerwone CI dla bieżącej gałęzi: wskazuje pierwszy błąd i przyczynę, na przykład kod, test, nieaktualną bazę gałęzi, awarię lub limit, i stosuje najmniejszą poprawkę.
  • 100cicd-sheriff
    Pilnuje, by odznaki CI/CD w README były zielone, klasyfikując czerwone przebiegi na gałęzi głównej w cyklicznym przeglądzie.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.