一键导入
gh-fix-ci
Fully automated GitHub Actions CI fixer: inspect failing checks, apply fixes, semantic-commit-autostage + push, then watch CI and repeat until green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fully automated GitHub Actions CI fixer: inspect failing checks, apply fixes, semantic-commit-autostage + push, then watch CI and repeat until green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Resume and execute implementation work from a plan-tracking GitHub issue that carries issue-hosted source, plan, and execution-state snapshots, preserving progress on the issue when local docs/plans files may be cleaned up.
Use when the user wants to open or continue a GitHub issue as the durable timeline for a discovered problem, investigation, blocker, implementation handoff, or unresolved follow-up loop.
Finalize and close plan-tracking GitHub issues after issue-backed execution is complete and the user or project policy has approved closure.
Open or preview a provider-aware GitHub or GitLab tracking issue for a docs/plans plan bundle, bootstrapping the source doc and plan first when the user has a converged feature discussion but no plan file yet.
Deliver a dispatch-ready plan by sprint: split plan tasks into PR lanes, dispatch subagent work, enforce acceptance gates, and advance through final integration without main-agent implementation.
Close out an existing plan-issue runtime where main-agent owns orchestration and review only, subagents own implementation task lanes, and close gates require approval plus merged PRs.
| name | gh-fix-ci |
| description | Fully automated GitHub Actions CI fixer: inspect failing checks, apply fixes, semantic-commit-autostage + push, then watch CI and repeat until green. |
Prereqs:
--repo).git, gh, and python3 available on PATH.semantic-commit and git-scope available on PATH (required for commits).test-first-evidence, agent-scope-lock, canary-check, web-evidence, and browser-qa.gh auth status succeeds for the repo (workflow scope required for logs).Inputs:
--repo <path>: repo working directory (default .).--pr <number|url>: PR number or URL (optional).--ref <branch|sha>: branch name or commit SHA (optional).--branch <name>: branch name to inspect (alias of --ref).--commit <sha>: commit SHA to inspect (alias of --ref).--limit <n>: max workflow runs to inspect when using branch/commit targets (default 20).--required (only required checks).--max-lines, --context, --json.Outputs:
Exit codes:
Failure modes:
gh missing or unauthenticated for the repo.semantic-commit/git-scope missing (cannot auto-commit).gh pr checks field drift; fallback fields still fail.gh run list failed for branch/commit targets.$AGENT_HOME/skills/automation/ci/gh-fix-ci/scripts/gh-fix-ci.sh$AGENT_HOME/skills/automation/ci/gh-fix-ci/scripts/inspect_ci_checks.pyEvidence and guardrail records are created by invoking the nils-cli primitives directly from the workflow. Do not add gh-fix-ci script flags for evidence unless a future change needs deterministic script-owned behavior.
$AGENT_HOME/skills/automation/ci/gh-fix-ci/scripts/gh-fix-ci.sh --pr 123
$AGENT_HOME/skills/automation/ci/gh-fix-ci/scripts/gh-fix-ci.sh --ref main
$AGENT_HOME/skills/automation/ci/gh-fix-ci/scripts/inspect_ci_checks.py --ref main --json
Use this skill when the user wants end-to-end CI fixing (no manual review pauses): diagnose, fix, commit, push, and keep iterating until CI is green.
Before editing production behavior, capture failing-test evidence or an explicit waiver with test-first-evidence.
This gate applies before editing production behavior.
CI failure evidence may satisfy the failing-test evidence requirement when it includes the failing check, command/log snippet, exit status or failure classification, and affected test/job name.
If the fix is docs-only, generated-only, infra-unavailable, or cannot be reproduced locally, record a waiver reason and substitute validation before editing production files.
Each behavior-changing iteration starts a record before edits:
test-first-evidence init --out <run-dir>/test-first \
--classification <classification> \
--production-path <path> \
--format json
Record CI failure evidence before edits when CI is the failing signal:
test-first-evidence record-failing --out <run-dir>/test-first \
--command "<ci-or-local-command>" \
--exit-code <code> \
--summary "<check>: <failure>" \
--test-name "<job-or-test>" \
--artifact <redacted-artifact> \
--format json
Record an explicit waiver before edits when the failure is docs-only, generated-only, infrastructure-only, external-provider-only, or not locally reproducible:
test-first-evidence record-waiver --out <run-dir>/test-first \
--reason "<reason>" \
--substitute-validation "<validation>" \
--format json
After the fix and before semantic-commit-autostage, push, or final report, record and verify final validation:
test-first-evidence record-final --out <run-dir>/test-first \
--command "<validation-command>" \
--status pass \
--summary "<summary>" \
--format json
then test-first-evidence verify --out <run-dir>/test-first --format json.
Each fix iteration summary must include Change classification, Failing test before fix or Waiver reason, Final validation, and
the test-first-evidence.json path.
agent-out project --topic gh-fix-ci --mkdiragent-scope-lock read --format json.agent-scope-lock is active, run agent-scope-lock validate --changes all --format json before staging, committing, pushing, or
reporting completion. Stop if validation reports out-of-scope changes.agent-scope-lock create --path <path> --owner gh-fix-ci --note <reason> --format json, then clear it on successful completion with
agent-scope-lock clear. If the temporary lock remains, the final report must say why.canary-check when one caller-owned local command is the appropriate post-fix canary:
canary-check run --out <run-dir>/canary --name <name> --command "<command>" --expect-exit 0 --format json
then canary-check verify --out <run-dir>/canary --format json.canary-check to replace project-required tests, release gates, or CI watch; it records one cited local outcome.web-evidence capture <url> --out <run-dir>/web-evidence --label <ci-log|deploy-preview|status-page> --format json only for
static URL evidence related to CI logs, deployment previews, or status pages.web-evidence does not drive a browser, execute JavaScript, reuse cookies, or store auth headers.browser-qa, backed by Browser, Chrome, Playwright, or agent-browser, when evidence requires browser behavior such as JavaScript,
screenshots, console summaries, DOM interaction, authenticated browser state, browser-only status evidence, or deploy preview
inspection.gh authentication with gh auth status. If unauthenticated, ask the user to run gh auth login (repo + workflow scopes).agent-out project --topic gh-fix-ci --mkdiragent-scope-lock read --format json--pr, use it.--ref/--branch/--commit, use that.gh pr view --json number,url on the current branch; if unavailable, fall back to the current branch name (or HEAD
commit when detached).inspect_ci_checks.py, which calls gh pr checks.inspect_ci_checks.py, which calls gh run list + gh run view.detailsUrl is not a GitHub Actions run, label as external and report the URL only.web-evidence capture.browser-qa instead of web-evidence.test-first-evidence record-failing or test-first-evidence record-waiver.canary-check run and canary-check verify.test-first-evidence record-final, then verify with test-first-evidence verify.agent-scope-lock is active, run agent-scope-lock validate --changes all --format json.semantic-commit-autostage (single commit per iteration unless splitting is clearly beneficial).gh pr checks <pr> --watch --interval 10 --required (wait until required checks finish, then confirm pass/fail)gh run list then gh run watch <run-id> --interval 10 --exit-status)inspect_ci_checks.py returns exit code 1 when failures remain so it can be used in automation.log_pending; rerun after the workflow completes.