跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

ci-auto-fix

Diagnoses and fixes failing GitHub Actions CI, verifies locally, pushes, and confirms the checks pass on the new revision — never weakens checks. Triggers on "CI is failing", "fix the CI", "the build is red", "/ci-auto-fix".

mthines · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add mthines/agent-skills --skill ci-auto-fix

技能说明


name: ci-auto-fix description: > Diagnoses and fixes failing GitHub Actions CI, verifies locally, pushes, and confirms the checks pass on the new revision — never weakens checks. Triggers on "CI is failing", "fix the CI", "the build is red", "/ci-auto-fix". disable-model-invocation: false argument-hint: '[|]' license: MIT metadata: author: mthines version: '4.0.0' workflow_type: command tags: [ci, github-actions, auto-fix, evidence-gate, regression-detection]

CI Auto-Fix

Find the cause, make the smallest justified fix, and verify CI on the resulting revision. Investigation scales with uncertainty and blast radius; completion checks apply to every path. Maximum four fix-push cycles per invocation.

Read anti-patterns first. Load other references only at the decision they support. Reuse evidence from a caller when its revision, run attempt, and scope match; do not repeat discovery to satisfy phase labels.

Phase 0 — Resolve access and target

Resolve GitHub access once using github-access. Commands below show the gh path; use that reference's mapping for MCP and report capability gaps.

Accept a PR URL, Actions run URL/ID, or check-run ID. With no argument, resolve the current branch's open PR; if none exists, look for a failed run on its current SHA. Ask only if the target remains ambiguous. Do not choose an old failed run when the current revision is already green. Resolve check-run IDs to their run; do not assume check and workflow IDs are interchangeable.

Record repository, branch, PR (if any), baseline SHA, run IDs/attempts, and local working-tree state. Verify that the checkout matches the target before editing. For a fork, identify the head repository and push destination explicitly. Preserve unrelated local changes; use an isolated worktree when needed. State the target.

Phase 1 — Capture and group failures

List checks and jobs before fetching logs. Capture the complete baseline: failed, passed, pending, skipped, and blocked jobs, including workflow and matrix identity. For each distinct failing job, fetch logs once per run attempt, save them locally, and extract the failing command, error, and enough surrounding context to explain it. Expand excerpts if the cause remains unclear; do not dump entire logs into context.

Group matching failures by likely root cause. Inspect one representative of a repeated signature, then confirm the other jobs share its command/environment; a different runtime or signature deserves its own investigation. Record which failures each proposed fix covers. Independent justified fixes may share a push; do not serialize matrix duplicates into separate CI cycles.

Phase 2 — Inspect the relevant surface

Start with the failed command, affected source/configuration, and the workflow job that invokes it. Follow relevant needs, reusable workflows, composite actions, caches, artifacts, runtime versions, and matrix inputs.

Expand to callers and sibling jobs when modifying shared configuration or when failures suggest a common cause. Read all workflows only when the dependency surface actually spans them or cannot yet be bounded. A source formatting fix does not require unrelated workflow inspection.

Phase 3 — Classify and choose a path

Record one verdict per root-cause group. Classification uncertainty calls for a targeted diagnostic step, not an immediate speculative fix. An authorized transient-infra rerun goes directly to Phase 7 on the unchanged SHA; skip edit/commit/push phases and do not consume a fix-push cycle.

Mechanical path requires all of the following:

  • Logs identify the exact command and affected files, and inspection supports a single cause.
  • The repository provides a deterministic correction (such as formatting), or the compiler error has a narrow correction with unambiguous intended behavior.
  • No assertion, public API, runtime behavior, dependency selection, security boundary, or shared workflow behavior needs a judgment call.
  • An appropriate local check can verify the correction.

Use a short evidence note in the transcript: cause, files, correction, and check. No separate plan file or confidence-skill invocation is needed. Inspect the resulting diff; a supposedly mechanical tool that changes broader behavior exits this path. Snapshot regeneration and a compiler-silencing cast are not inherently mechanical fixes.

Diagnostic path applies otherwise. Follow the evidence gate and record the hypothesis, supporting and conflicting evidence, affected consumers, and verification in the compact plan. Use a targeted reproduction or discriminating check to resolve competing explanations before editing.

Any contradictory evidence, failed local verification, wider-than-expected diff, or unexplained CI failure moves a mechanical fix into the diagnostic path.

Optional memory: check whether LoreKit memory.* tools are connected before loading self-improvement-loop. If available, query only the current failure signature and touched paths; reuse results until the hypothesis or surface changes. Lessons never substitute for current evidence.

Phase 4 — Apply the justified fix

Fix the cause in the appropriate surface: source, workflow, dependency constraint/ lockfile, or environment. Keep changes limited to the diagnosed cause. For tests, establish whether the assertion or production behavior is wrong; preserve coverage. Apply the evidence gate and anti-patterns to every path, including tool-generated edits. Do not change unrelated failures just because their files are nearby.

Phase 5 — Verify locally

Run the smallest check that can falsify the diagnosis, then the affected CI command or equivalent scope before pushing. Broaden validation for shared callers, platform/matr

阅读完整来源 ↗