pr-guardian
БесплатноЗапускает вложенные скриптыНе проверенContinuously monitor a GitHub PR for merge conflicts, CI failures, and CodeRabbit review comments, then automatically fix any issues found. Polls every 5…
от s-hiraoku★ 21 звезда на GitHubОб этом скилле
PR Guardian
Watch a PR, detect problems, fix them, repeat — until everything is green.
Why this exists
After pushing a PR you typically wait for CI, check for merge conflicts, and respond to CodeRabbit review comments. Each issue requires a separate manual step. PR Guardian automates the entire feedback loop: it polls the PR status at a fixed interval, dispatches the appropriate fix skill when a problem is found, and exits only when all checks pass (or the iteration limit is reached).
Quick start
/pr-guardian # Default: 5 min interval, 20 max iterations
/pr-guardian --interval 3 # Poll every 3 minutes
/pr-guardian --max-iterations 10 # Give up after 10 cycles
Workflow
Step 0: Validate preconditions
Before starting the loop, verify:
ghCLI is installed and authenticated- Current branch has an open PR (
gh pr view) - Display the PR number and URL
If any check fails, report the error and stop.
Step 1: Poll PR status
Run the bundled status script:
bash <skill-path>/scripts/poll_pr_status.sh
This returns a JSON object with these fields:
| Field | Type | Meaning |
|---|---|---|
branch |
string | Current branch name |
pr_number |
int | PR number |
checks_total |
int | Total CI checks (excludes CodeRabbit) |
checks_passed |
int | CI checks that passed |
checks_failed |
int | CI checks that failed |
checks_running |
int | CI checks still in progress |
has_conflict |
bool | Merge conflicts detected |
coderabbit_check |
string | CodeRabbit check status: none/pending/pass/fail |
coderabbit_comments |
int | Number of CodeRabbit inline comments |
all_green |
bool | True when everything passes (including CodeRabbit) |
Important: all_green is only true when ALL of these hold:
- No merge conflicts
- No CI failures
- No CI checks still running
- CodeRabbit check is NOT
pendingAND NOTnone(review must have completed at least once) - No unresolved CodeRabbit inline comments (comments marked
✅ Addressedare excluded) - At least one CI check exists
Step 2: Evaluate and report
Print a concise status line each cycle:
[PR Guardian] Cycle 3/20 — PR #42
CI: 4 passed, 1 failed, 0 running
Conflicts: none
CodeRabbit: review completed, 2 inline comments
→ Action: fixing CodeRabbit comments
Step 3: Dispatch fixes (priority order)
When issues are found, fix them one category at a time in this order. Only fix one category per cycle — after fixing, go back to Step 1 to re-poll, because a fix may have changed the state (e.g., a push triggers new CI runs).
Priority 1 — Merge conflicts
Merge conflicts block everything else. When has_conflict is true:
- Invoke
/fix-conflict - After resolution, the push triggers new CI runs — go back to Step 1
Priority 2 — CI failures
When checks_failed > 0 and checks_running == 0 (wait for running
checks to finish before diagnosing failures):
- Invoke
/fix-ci - After the fix commit is pushed, go back to Step 1
Priority 3 — CodeRabbit review comments
When coderabbit_check == "pass" and coderabbit_comments > 0 and CI
is passing:
- Invoke
/fix-review /fix-reviewwill verify each finding against current code before fixing- After the fix commit is pushed, go back to Step 1
IMPORTANT: Only dispatch /fix-review when coderabbit_check is
"pass" (review completed). If it is "pending", wait — the review is
still in progress and comments may not be final yet.
Step 4: Handle pending states
The correct action is to wait (not fix) when:
checks_running > 0: CI is still running — do not diagnose yetcoderabbit_check == "pending": CodeRabbit review is in progress — wait for it to finish before looking at commentscoderabbit_check == "none": CodeRabbit hasn't started yet (common right after a push) — wait at least one cycle for it to appearchecks_total == 0and it's the first cycle: checks haven't started yet — wait for GitHub Actions to pick up the push
Sleep for the poll interval and re-check. Do not invoke any fix skill while checks are still running or reviews are pending — you would be fixing based on incomplete information.
Step 5: Check exit conditions
After each cycle, check:
- All green (
all_green == true): Print success message and exit - Max iterations reached: Print summary of remaining issues and exit
- Same failure repeated 3 times: The automatic fix is not working. Print what failed and suggest manual intervention, then exit
If none of these conditions a
Установить pr-guardian в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pr-guardian?
Continuously monitor a GitHub PR for merge conflicts, CI failures, and CodeRabbit review comments, then automatically fix any issues found. Polls every 5 minutes and loops until every check is green. Use this skill whenever a PR has just been created or code has been pushed to a PR branch — it should be the default follow-up action after any PR creation or push. Also trigger on: "watch this PR", "guard this PR", "monitor CI", "keep fixing until green", "PRを監視して", "CIが通るまで 直して", /pr-guardian. When a PostToolUse hook reports that a push or PR creation just happened, proactively invoke this skill to start monitoring without waiting for the user to ask.
Как установить скилл pr-guardian?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pr-guardian запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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