ci-loop
БесплатноЗапускает вложенные скриптыНе проверенBabysit CI after a push: a monitor→classify→remediate state machine that watches a run to completion, mechanically fixes trivial/build breakage, reproduces…
от Roasbeef★ 33 звезды на GitHubОб этом скилле
CI Loop
Babysit CI after you push. This is a state machine: watch the latest run to completion, classify each failure, and take the smallest remediation that fits — mechanically fix lint/build breakage, reproduce a failing test locally to tell a flake from a real bug, rerun suspected flakes within a budget, or hand a reproduced failure to a fixer agent that commits a fixup and pushes. After any push it re-monitors the fresh run, and it ends only when CI is green or it can give the user a justified bail. All the watching, reading, and fixing happens in subagents, so each one burns its own context, not yours.
Target: $ARGUMENTS
Why this shape (and why a state machine)
A red CI run on a branch you just pushed is the classic babysitting chore: most
failures are mechanical (a gofmt, a stale generated file, a lint nit) or
transient (one flaky integration test), and a few are real bugs. Doing this by
hand means tabbing back to the run page every few minutes for half an hour. This
loop automates exactly that vigil, and it is a state machine on purpose — the
states encode the judgments that are easy to get wrong:
- Flake vs real bug is a decision, not a guess. The loop never declares a failure a flake without positive local evidence that the test passes. The Reproduce state runs the test locally N times; only a clean local result (plus no plausible cause in the diff) earns a "flake" verdict, and even then it just reruns CI rather than ignoring the failure. When in doubt it returns "reproduced" and escalates to the fixer. A wrong flake call hides a real bug.
- Trivial fixes and real fixes are different risk classes. Lint/build repairs are deterministic and cheap; a code change that has to make a failing test pass is where a careless fix does damage. They are separate states with separate prompts, and the fixer is forbidden from weakening assertions or skipping tests to go green.
- Bailing is a first-class outcome. The point isn't to thrash forever. When the fixer can't produce a verified fix, when a flake won't stop flaking past its budget, or when the failure is non-actionable infra, the loop stops and reports why — it does not keep pushing speculative commits.
Because those guarantees depend on the orchestration actually running every
state in order every cycle, the preferred execution path is a dynamic
workflow (a deterministic JavaScript harness), not model-driven dispatch. The
workflow encodes monitor→classify→fix/reproduce/repair→loop as code that cannot
drift or skip the reproduce-before-flake check. The in-instance path below is the
fallback when the Workflow tool is unavailable or the user passes --inline.
The states are mandatory — do not author a "just rerun it" variant
This skill runs Monitor → Classify → (Fix | Reproduce → Repair) → loop, every cycle. You may adapt the failure taxonomy, the flake budget, the profile, and the local-reproduction method. You may NOT:
- Declare a flake without the Reproduce state. "The test passed on rerun" is not evidence by itself; reproduce locally first. Blind-rerunning a real, deterministic failure burns CI minutes and never converges.
- Skip Classify and fix everything the same way. Pushing a code change to "fix" a broken runner or a registry outage is noise; infra failures get rerun or reported, not patched.
- Make the loop unbounded. Every path leads to green, a bail with a reason, or the max-iters cap. A babysitter that never reports back is worse than none.
Phase 0: Scope, push, and brief (always done by the main loop)
Do this in the first turn, before launching the workflow.
Ensure the branch is pushed and identify the target. The loop watches CI for a commit that exists on the remote, so push first if needed:
git branch --show-current git status -sb # anything unpushed? git push # if the branch isn't on the remote / is behind gh pr view --json number,headRefName,url 2>/dev/null # is there a PR? gh run list --branch "$(git branch --show-current)" --limit 3 \ --json databaseId,headSha,status,conclusion,workflowNameRecord the PR number (if any) and the branch — the loop watches the most recent run for the head commit.
Confirm the push target. This loop pushes fixup commits on its own to trigger fresh CI runs. By default it pushes only to the feature branch and refuses to push to
main/master. If HEAD is on a default branch, stop and confirm with the user before running (or pass--allow-push-to-defaultonly when they explicitly want that).Write a short brief to
.ci-loop/brief.md: what the change does, any context the fixers can't infer from the diff (env quirks, why a test exists, known-flaky suites, accepted tradeoffs). This is what keeps a fixer from "fixing" intended behavior. The brief is re-Read from disk eac
Установить ci-loop в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
TaskWorkflowBashReadWriteEditMultiEditGrepGlobTodoWriteAskUserQuestionВложенные файлы
FAQ
Что делает скилл ci-loop?
Babysit CI after a push: a monitor→classify→remediate state machine that watches a run to completion, mechanically fixes trivial/build breakage, reproduces test failures locally to tell a flake from a real bug, reruns suspected flakes within a budget, hands reproduced failures to a fixer that commits a fixup and pushes, and loops until CI is green or it can justify a bail back to the user. Prefers a deterministic dynamic workflow when available; falls back to in-instance Task dispatch. Use when the user types /ci-loop or asks to watch/babysit/auto-fix CI for a pushed branch or PR until it's green.
Как установить скилл ci-loop?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ci-loop запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic