К основному содержанию
скилл CX Codex

ci-fix-monitor · zaxbyhub, opencode — скилл для Claude Code: что делает и как установить

Скилл ci-fix-monitor для Claude Code отслеживает проверки CI у PR, разбирает ошибки по логам и помогает внести исправления и отправить их снова.

MIT ★ 539 обновлён 2026-10-29

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add ZaxbyHub/opencode-swarm --skill ci-fix-monitor -a claude-code
Открыть на GitHub

Что делает ci-fix-monitor

Скилл проверяет статусы CI у PR и разбирает сбои: например, ошибки тестов, линтера, заголовка PR или проверки npm-пакета. Он предлагает сверить логи, определить, вызвана ли ошибка изменениями PR, проблемой на main или окружением, а затем выбрать исправление и отправить его в репозиторий.

Для форматирования в инструкциях используются команды Biome, для пересборки — bun run build, а для отставшей от main ветки — git fetch и git rebase. Если перебазирование остановится из-за конфликтов, инструкция требует отменить его и передать решение пользователю: автоматически разрешать конфликты нельзя.

Какие задачи решает

  • разобрать причину красных проверок CI у PR
  • найти в логах ошибку теста или линтера
  • исправить заголовок PR, не создавая коммит
  • устранить ошибку проверки npm-пакета
  • обновить ветку, отставшую от main

Примеры запросов агенту

  • Проверь CI у моего PR, найди причину красных проверок и предложи исправление.
  • Разбери логи упавшего теста и исправь ошибку, если она появилась из-за моих изменений.
  • Проверь, почему ветка отстаёт от main, и выполни безопасное перебазирование по инструкции.

Как установить ci-fix-monitor

1Через Skills CLI (Vercel)

npx skills add ZaxbyHub/opencode-swarm --skill ci-fix-monitor -a claude-code

2Вручную: положить файлы

~/.claude/skills/ci-fix-monitor/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/ci-fix-monitor/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о ci-fix-monitor

Как установить ci-fix-monitor в Claude Code?

Выполните npx skills add ZaxbyHub/opencode-swarm --skill ci-fix-monitor -a claude-code. Файл скилла появится по пути ~/.claude/skills/ci-fix-monitor/SKILL.md.

Что делает ci-fix-monitor?

Скилл проверяет CI у PR, читает логи и классифицирует сбои. По результатам он помогает выбрать исправление и отправить изменения повторно.

Что делать, если перебазирование остановилось на конфликтах?

Инструкция предписывает выполнить git rebase --abort и передать решение пользователю. Автоматически разрешать конфликты нельзя.

Исходный текст

SKILL.md · MIT
---
name: ci-fix-monitor
description: >
  Monitor CI on a PR, diagnose failures, fix them, and re-push until green.
  Covers reading CI logs, classifying failure types (check-title, package-check,
  test failures, lint), determining the correct fix, and re-pushing.
metadata:
  audience: swarm-plugin
---

# CI Fix & Monitor Protocol

Activates when the user asks to monitor CI, fix CI failures, or resolve red
checks on a PR.

## Environment note — tool availability

This skill was originally written for desktop Claude Code (Windows) with `gh`
CLI. In the **remote execution / GitHub MCP** environment, use the equivalent
MCP tools instead:

| Capability needed | `gh` CLI | Example remote-MCP shape (resolve the real names via ToolSearch) |
|---|---|
| `gh pr checks <number>` | `mcp__github__pull_request_read` method `get_check_runs` |
| `gh pr view <number> --json checks` | `mcp__github__pull_request_read` method `get_check_runs` |
| `gh run view <run-id> --job <job-id> --log` | `mcp__github__get_job_logs` with `job_id` and `return_content: true` |
| `gh pr edit --title` | `mcp__github__update_pull_request` with `title` |
| `gh pr view --json mergeable` | `mcp__github__pull_request_read` method `get` |

> MCP tool names are injected by the runtime harness and are NOT stable across
> environments. Treat the right-hand column as an example SHAPE only: resolve
> the actual tools by CAPABILITY (PR read with check-run support, job-log read,
> PR update) via `ToolSearch` before first use in a session — never assume a
> specific `mcp__github__*` name exists (issue #2131 finding 9).

## Step 1 — Fetch current status

Fetch all check runs for the PR head commit. If all green: report success
and stop.

## Step 2 — Classify each failure

| Failure type | Root cause pattern | Fix action |
|---|---|---|
| **check-title** | PR title lacks `<type>(<scope>):` prefix | Update title via PR edit |
| **package-check** | npm tarball validation failed (source/build/package-manifest problem) | Fix source/build/manifest — see section below. Not generated-file drift. |
| **branch behind main** | Branch is behind main; main had a release commit; CI uses merge-commit checkout | Rebase onto main, force-push — see section below |
| **lint/quality: format** | Code style violations (long lines, spacing) | `bunx biome format --write <files>` then commit |
| **lint/quality: lint** | Lint rule violations (noExplicitAny, etc.) | `bunx biome check --write <files>` or fix manually |
| **unit test** | Test failures | Read log, fix code, commit |
| **integration** | Integration failures | Read log, check if pre-existing on main |
| **macOS unit test** | Cross-platform file I/O race (atomic write-then-read returns null on macOS) | See "macOS file I/O fixes" below |
| **security** | SAST/secret findings | Read log, fix or suppress with justification |
| **smoke** | Smoke test failures | Read log, check if environment-specific |

## macOS file I/O fixes (cross-platform atomic write)

macOS/APFS has different filesystem timing than Linux ext4. `fs.renameSync` can
complete before the data is visible to subsequent reads. The most common
manifestation is `unit (macos-latest)` failing on tests that write-then-read
atomic files (e.g., `curator atomic write > writeCuratorSummary > after write,
readCuratorSummary reads file back successfully`), while the same tests pass
on `ubuntu-latest` and `windows-latest`.

**Canonical patterns:** See
`file:.opencode/skills/writing-tests/SKILL.md`
§ Cross-Platform Requirements → "macOS rename-visibility race" for the
full three-layer fix pattern (bunWrite + ENOENT retry + Node FileHandle.sync()
not fsync()). This skill is a triage pointer; the canonical technical
reference lives in `writing-tests` so it survives any regeneration of this
`generated/` file.

**Related security test pattern:** if the CI failure involves a long task ID
or path, the security test `ADVERSARIAL: Command Services Attack Vectors >
Attack Vector 1: Malformed Arguments > EVIDENCE: extremely long task ID
(buffer overflow) - ACCEPTED by regex but no crash` requires a path length
guard BEFORE `validateSwarmPath` in `src/evidence/manager.ts:loadEvidence`.
See `file:.opencode/skills/engineering-conventions/SKILL.md`
for the evidence file flow that this gate check triggers on macOS CI.

## Step 3 — Diagnose with logs

For every failed check, fetch the full log content. Fetch only the tail
(last 80–100 lines) unless the error is near the start.

Read the log carefully before concluding root cause. Distinguish between:
- a failure introduced by this PR,
- a pre-existing failure on `main` (verify by checking main's last CI run for
  the same check), and
- a failure caused by the CI environment or branch drift.

## Step 4 — Fix

### check-title
No commit needed. Update the PR title.

### package-check failure

`package-check` validates the npm tarball (`npm pack` + tarball contents). A
failure is a source/build/package-manifest problem, **not** generated-file
drift. `dist/` is generated and NOT committed — do not stage it. Run
`bun run build` locally only when you need the bundle to verify the failure:

```bash
bun run build
node --input-type=module -e "await import('./dist/index.js'); console.log('dist import OK')"
```

Fix the underlying source/build/`package.json` `files` manifest issue, then
commit the source fix (not `dist/`) and push.

### branch behind main (version drift)

**Identifying this case:** A version string differs (`version: "X.Y.Z"` changed
to a higher version) because main had a release commit after the branch was cut,
and GitHub Actions checks out the merge-commit for CI. Rebase onto main to pick
up the release commit.

**Fix:**

```bash
git fetch origin main
git rebase origin/main       # fast-forward the branch onto the release commit
# If the rebase halts with conflicts, run `git rebase --abort` and escalate
# to the user — do not attempt to resolve a conflicted rebase automatically.
git push --force-with-lease origin <branch>   # force-push is required after rebase
```

> `--force-with-lease` is safe here: it refuses to overwrite commits that
> appeared on the remote after your last fetch. After the rebase, the local
> branch has diverged from remote history — a regular push will be rejected.

- Do NOT stage or commit `dist/` — it is generated and NOT committed; there is no committed-dist drift check
- After a rebase, a force-push is required and expected — do not try a regular push

### lint/quality: format violations

Biome format violations (line too long, spacing, bracket style) — these can
appear when a code change introduces a line that exceeds Biome's print-width.
Auto-fix only the changed files to minimize noise:

```bash
bunx biome format --write src/path/to/changed-file.ts
bun test src/path/to/changed-file.test.ts   # verify tests still pass after format
git add <files>
git commit -m "style: apply Biome formatting"
git push origin <branch>
```

> Do NOT run `bunx biome format --write .` on the entire repo unless instructed
> — this can introduce formatting changes in unrelated files and bloat the diff.

### lint/quality: lint rule violations

```bash
bunx biome check --write <specific-file>
# or fix manually if --write does not handle the rule
```

### integration failures

Check whether the same check failed on `main`'s last CI run before treating
it as PR-introduced. If pre-existing: document the finding and skip. If
introduced by this PR: collect the full failure log, the test name, and the
first error line, then delegate to a coder with that evidence.

### security (SAST/secret findings)

Fetch the full log. If it is a secret/credential finding: confirm the file
and line, remove or rotate the credential, and commit the fix. If it is a
SAST code-quality finding: collect the rule ID, file, and line, then
delegate to a coder. Do NOT suppress findings without an explicit
justification comment approved by the user.

### unit test / smoke failures
Delegate to coder with specific failure details (test name, assertion, first
error line). See execute skill.

## Step 5 — Push and monitor

After pushing, subscribe to PR activity (if in webhook/MCP context) and wait
for the next CI event rather than polling. Do not push a second time until the
CI result from the first push is confirmed.

If no CI event arrives after a reasonable wait (e.g., checks are still queued
and stalled), re-fetch check status manually via `get_check_runs` and report
the stall state to the user rather than waiting indefinitely.

### Merge-queue entry stuck (orphaned entry)

When a PR has been queue-eligible for longer than the threshold (default 150
minutes; override with `--threshold <minutes>`) with no
`gh-readonly-queue/main/pr-<n>-*` build in a non-terminal state (`queued`
counts as active — run-level status stays `queued` under runner contention
while the group's jobs execute), run the detector (issue #3265):

```
node scripts/check-merge-queue-progress.mjs --pr <n>
```

The detector prints `<VERDICT> pr=<n> age=<minutes> state=<state>`; exit 2
only for `ORPHANED`, 0 otherwise, 1 for usage/gh errors. On `ORPHANED` with
`state=OPEN`, apply the printed recovery:
`gh pr close <n> --comment "orphaned queue entry" && gh pr reopen <n> && gh pr merge <n>`.
The detector itself suppresses the recovery when the PR is not OPEN. Never
cancel runs that do not PREDATE the current entry — blanket-cancelling
non-completed runs is harmful (ghost-concurrency zombies hold the workflow's
concurrency group and a re-enqueued entry queues behind them). A removed
entry (`UNKNOWN` over `removed_from_merge_queue`) is cross-checked against
PR state: `MERGED` consumed it legitimately; an `OPEN` PR is the
bot-eviction class whose recovery is a plain re-enqueue (`gh pr merge
--auto`). Verify the check rollup manually — the detector does not fetch it.
The `reviewDecision` rollup reads EMPTY even with live approvals; use the
reviews API.

### Failed merge-group batch classification

For a failed `merge_group` batch, classify it before diagnosing
(issue #3487):

```
bun scripts/ci/merge-group-stale-runner-classifier.ts --run <run-id>
```

The classifier reads per-job step evidence (never logs alone) and exits 0
for every verdict, 1 for usage/gh errors. `runner-stale-clone`: routed jobs
died at their `actions/checkout` step with hosted legs green — repair is
out-of-band, then re-enqueue idempotently; do NOT `gh run rerun --failed` an
evicted batch. `test-failure` outranks a coexisting checkout death: a real
failing job is named in the reason; read its log. `unknown`: evidence gap or
unexplained failure — inspect the run manually. Real work failures can never
be excused as runner-side, even with no logs.

These steps shell out to `gh` and repo-local scripts; in the remote/MCP
environment where `gh` is unavailable, report the queue or batch state to
the user instead of attempting the recovery.

## Step 6 — Verify all green

Do NOT declare victory until ALL required checks pass. A check in `skipped`
state is acceptable only if the same check was skipped on the base branch
(i.e. the workflow gates on a path filter). Confirm this explicitly.

## Standalone retry bound

When this skill is invoked directly (not composed via `swarm-ci-monitor`'s
own 5-iteration counter), cap fix-push cycles at 5 iterations. If the PR is
still not green after 5 fix-push cycles, stop and escalate to the user with
the last failing check and a short log excerpt rather than looping
indefinitely.

© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm

Похожие скиллы

Все скиллы по теме «DevOps и инфраструктура» →

Сначала — ci-fix-monitor от других авторов.

ci-fix-monitor ZaxbyHub Скилл ci-fix-monitor для Claude Code отслеживает статусы проверок в pull request и исправляет сбои сборки. Диагностирует падения CI в проектах opencode-swarm до полного прохождения проверок. CX Codex +1 ★ 539звёзд репо fix-ci cursor Скилл fix-ci для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode — находит упавшие проверки PR, читает логи и применяет минимально нужный фикс. CX Codex +1 2 600установок fix-pr prathamdby Скилл fix-pr для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode разбирает замечания ревью и ошибки проверок в pull request. Он проверяет каждое замечание, вносит обоснованные правки и при включённой отправке пушит их. CX Codex +1 621установок diagnosing-ci-and-merge-bottlenecks PostHog Скилл diagnosing-ci-and-merge-bottlenecks для Claude Code анализирует состояние CI и путь pull request от открытия до слияния. Находит медленные workflow, зависшие PR и расходы на CI. CX Codex +1 320установок gh-fix-ci официальный openai Скилл gh-fix-ci находит упавшие проверки GitHub Actions в пулл-реквесте, собирает логи ошибок и готовит план исправлений. Скилл применяет правки только после подтверждения. CX Codex +1 12 100установок agent-9-status-monitor happycapy-ai Субагент agent-9-status-monitor для Claude, который следит за открытыми пул-реквестами: ловит мержи, закрытия, новые ревью и падения CI, обновляет историю и шлёт алерты соседним агентам роя. CX Codex ★ 138звёзд репо openai-gh-fix-ci OpenAI Плагин openai-gh-fix-ci разбирает упавшие проверки GitHub Actions в пулреквестах через утилиту gh, находит причины ошибок и готовит план правок. ★ 540звёзд репо

Из того же набора121

Весь набор →
ai_slop_reviewer Субагент ai_slop_reviewer находит скрытые дефекты, фиктивные тесты, пустые заглушки и галлюцинации в коде, написанном языковыми моделями. Помогает провести жёсткий аудит перед релизом. CX Codex +1 ★ 539звёзд репо codebase-review-swarm Скилл codebase-review-swarm проводит глубокий аудит репозитория с привязкой выводов к исходному коду. Подходит для проверки безопасности, QA, доступности и других выбранных направлений. CX Codex +1 ★ 539звёзд репо specify Включает режим SPECIFY: агент проверяет, какая спека действует в проекте, и собирает .swarm/spec.md с требованиями и критериями успеха. CX Codex +1 ★ 539звёзд репо ci-fixer ci-fixer — субагент для Claude Code, который поэтапно разбирает и исправляет падения GitHub Actions в репозитории opencode-swarm. CX Codex +1 ★ 539звёзд репо issue-tracer2 Субагент issue-tracer2 берёт GitHub Issue, ищет причину бага в коде по цепочке гипотез и доводит дело до фикса, тестов и PR. CX Codex +1 ★ 539звёзд репо issue-ingest Скилл issue-ingest разбирает issue из GitHub на причину и спецификацию. Запускается командой /swarm issue <url> и готовит данные для перехода к плану исправления. CX Codex +1 ★ 539звёзд репо deep-dive Скилл deep-dive для Claude Code проводит аудит выбранной части кодовой базы без изменения исходников. Проверяет несколько аспектов проекта и собирает подтверждённые находки. CX Codex +1 ★ 539звёзд репо guardrail-patterns Скилл guardrail-patterns для opencode-swarm: разбирает устройство защитных блоков в checkDestructiveCommand() и показывает, что ломается при их правке. CX Codex +1 ★ 539звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой