pr-guardian¶
Watch a PR after creation or resume a stalled PR. Loop over CI runs and human, bot, CodeRabbit, Codex, or agent review feedback, fix in batches, comment with the outcome.
Workflow¶
- Identify the PR, branch, remote, base.
- Check initial state with
gh pr view,gh pr checks, recent comments, reviews, and inline review comments. - Watch CI with
gh run watch. - When CI fails, delegate cluster-level diagnosis to the
ci-fixersubagent. - Build a complete feedback inventory and classify each item as
fix,respond,ignore, orblocked. - Address all
fixitems with focused commits. Don't broaden scope. - Explain
respondandignoreitems in review replies or the outcome comment. - Run the adjacent audit reference's executable GraphQL cursor loops for review threads and nested comments, and exhaust its REST pagination commands for reviews, comments, checks, and annotations.
- Use paginated REST review
commit_idvalues to prove expected bot reviews target the current head;gh pr viewreview objects are not sufficient evidence. - Push fixes from an isolated worktree only while the remote head still matches the pinned SHA; repeat until checks pass, requested changes are cleared, actionable threads are handled, or a real blocker remains.
- Keep successful open PRs under durable observation so a same-head late review reactivates the guardian, then comment with the final outcome.
Loop control¶
- Cap retries at 5 unless the user explicitly asks for more.
- If the same CI failure or review comment returns after two fixes, inspect the underlying assumption before trying again.
- Record a dated note in
ledger/current.mdafter each iteration. - Stop and surface to the human on environmental/infrastructure failures.
Install¶
gh skill install s-hiraoku/claude-harnesses pr-guardian --scope project
Part of pr-guardian-pack. Slash command: /pr-guardian.