watch-pr
Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready
от adamayoung★ 182 звезды на GitHub
Установить watch-pr в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Watch PR
Watch the open pull request for the current branch: handle review conversations,
fix failing status checks, and — when asked — merge once everything is green.
Repo is adamayoung/TMDb. GitHub reads/writes (PR state, checks, branch update,
merge) use the GitHub MCP (mcp__github__*, owner/repo from the origin remote);
gh is kept for the blocking CI wait (gh pr checks --watch, which the MCP has
no equivalent for). If an MCP write fails with 401/403 (PAT expired or missing
scope), fall back to the equivalent gh command.
Mode — check the arguments passed to this skill (shown at the end). If they
include merge (e.g. /watch-pr merge or "merge when ready"), enable
merge-when-ready; otherwise run in watch-only mode.
Run in the background. Watching blocks on CI for minutes at a time, so run the watch as a background task — the user can keep interacting while it runs, and is pinged when the PR needs attention or is ready. Don't tie up the foreground on a wait loop.
0. Find the PR
A PR number in the arguments wins. If the arguments include a PR number
(e.g. /watch-pr 123 or /watch-pr merge 123), watch that PR and skip branch
discovery entirely. A caller that launches this skill in the background
(e.g. /deliver Phase 10, which may move the session to another deliverable's
worktree while the watch runs) must pass the number — the watch must never
depend on "current branch" staying stable for its lifetime.
Otherwise, find the open PR for the current branch with mcp__github__list_pull_requests
(owner/repo from the origin remote, head: <owner>:<branch>, state: open), then
read its details with mcp__github__pull_request_read method get — number,
html_url, state,
head.ref, and mergeable_state (the REST merge state: lowercase
clean/blocked/behind/unstable/dirty/unknown/draft — not gh's
uppercase mergeStateStatus). Read the check runs separately with method
get_check_runs (§3).
- No PR for the current branch → stop and tell the user (suggest
/pr). - State not
open→ stop and report. - Thread data is a separate call —
pull_request_readmethodgetdoes not return review threads. Fetch them with methodget_review_comments(delegated to/review-pr-threads); never expect thread data on the PRget. - Pin the tree to the PR, and re-check it every pass. The number alone is
not enough: both sweeps in §1 edit and push the current working tree, so
a drifted CWD doesn't just read the wrong PR, it commits to the wrong branch.
Before each pass assert
git branch --show-currentequals the PR'shead.ref(already fetched above, so this is free). Mismatch → stop and report; never sweep. This is the case §0 exists for — a background watch outlives the session's CWD, and/deliverPhase 10 moves to the next deliverable's worktree while this loop is still running.
Keep a run ledger in your working notes: resolved thread IDs, a topic
signature per handled thread (path:line + short gist), and a fix-attempt
counter per failing check. Use it to avoid repeating work (see Loop Guard).
1. Watch loop
Repeat the pass below until the PR is ready (§3) or stuck (§2).
1a. Review threads
Delegate the thread sweep to /review-pr-threads <number> — always pass
the PR number. Without it the skill falls back to "the current branch's PR"
(review-pr-threads §0), re-introducing exactly the dependency §0 forbids. It resolves the
currently-unresolved threads in one pass (assess → fix+verify / reply-only →
reply → resolve), reusing this run's ledger so a topic you already fixed isn't
re-edited, and returns a summary (fixed w/ SHAs, replied-only, left-for-user,
counts, whether it pushed).
It is a single sweep by design — the across-push convergence is this loop's
job: fold its summary into the ledger, and if it pushed fixes, the next pass picks
up any fresh threads the claude-review bot raises (gated to Critical/High). Do
not duplicate its per-thread logic here.
1b. Status checks
Delegate failing-check fixing to /fix-pr-checks <number> — always pass
the PR number, for the same reason as §1a. It routes each failing
check to the right diagnosis skill (/diagnose-ci-failure or
/diagnose-integration-failure) via a Haiku subagent, applies and verifies the
fix, commits, pushes once, and returns a summary (fixed w/ SHAs, exhausted,
skipped, pending, whether it pushed). It shares this run's ledger, so the
3-attempt cap per check is honoured across passes. Fold its summary into the
ledger; if it pushed, the next pass re-checks.
Waiting stays here (orchestration, not the fix primitive): if checks are
pending and nothing is failing, block efficiently with gh pr checks --watch
rather than polling, then loop. If /fix-pr-checks reports a check exhausted,
stop and report it per the Loop Guard.
1c. Failing checks not cau
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл watch-pr?
Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready
Как установить скилл watch-pr?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл watch-pr запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…