Agent skill

Watch PR

by adamayoung in adamayoung/TMDb

Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready

Apache-2.0Auto-check passedTesting & QA

Install Watch PR

skills CLI
$ npx skills add adamayoung/TMDb --skill watch-pr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install adamayoung/TMDb watch-pr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/adamayoung/TMDb.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/watch-pr .claude/skills/watch-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
watch-pr
GitHub stars
178
Token cost
~3.4k tokens
SKILL.md length
2,022 words
Files
1
Skills in repo
18
Repo updated
First seen
Licence
Apache-2.0

At a glance

Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready

  • Works in 4 steps: Find the PR → Watch loop → Loop guard (do not get stuck) → …
  • Testing & QA work in your project
  • SKILL.md covers 0. Find the PR, 1. Watch loop, 2. Loop guard (do not get stuck) and 3. Ready / merge, plus 1 more section
  • Calls gh, git and make

What it does

Watch PR is an agent skill from adamayoung/TMDb. Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA. It works with GitHub and Model Context Protocol. The repository describes itself as: The Movie Database Swift Package. The licence is Apache-2.0.

When your agent uses it

  • Testing & QA work in your project

Example prompts

  • “/watch-pr”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Find the PR
  2. Watch loop
  3. Loop guard (do not get stuck)
  4. Ready / merge

What it can do on your machine

Read from SKILL.md and the folder at commit a3f1311. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh
    • git
    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Watch PR loads about 3.4k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 2,022 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from adamayoung/TMDb at commit a3f1311, republished under its Apache-2.0 licence (© adamayoung). 2,022 words, ~3,389 tokens.

Download SKILL.mdSave it as .claude/skills/watch-pr/SKILL.md (or your agent's skills folder).
name
watch-pr
description
Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready

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_read method get does not return review threads. Fetch them with method get_review_comments (delegated to /review-pr-threads); never expect thread data on the PR get.
  • 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-current equals the PR's head.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 /deliver Phase 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 caused by this PR (usually a flaky integration test)

/fix-pr-checks assumes the fix belongs on this branch. That is wrong when the failing check — most often a live integration test — is broken or flaky independently of this PR's diff. Patching it onto the feature branch would muddy the PR's scope and leave the test broken for everyone else. Triage before fixing here:

  1. Is the failing test in this PR's diff? mcp__github__pull_request_read method get_files (pullNumber: <n>) — if the failing test's file is not in that list, this PR did not cause it.

  2. Transient or deterministic? Re-run the failed jobs once with mcp__github__actions_run_trigger method rerun_failed_jobs (run_id: <id>), then watch the re-run (the loop's gh pr checks --watch, §1b). Passes on re-run → a transient live-API flake; note it and continue. Fails again and not in this PR's diff → a pre-existing problem (e.g. a brittle live-data assertion).

  3. A pre-existing failure is a main problem — hand it to /fix-integration-failures, which fixes it on its own branch off main, runs make ci, and opens/merges a PR (never on this feature branch). Tell the user you're opening a second PR to unblock this one; if they'd rather you stop, report and stop. Once that fix is on main, bring this PR's branch up to date (mcp__github__update_pull_request_branch, pullNumber: <n>) and re-watch — the check now passes.

2. Loop guard (do not get stuck)

  • Thread dedup is /review-pr-threads' job — it shares this ledger, so it won't reprocess a handled thread or re-edit a topic already fixed this run (it replies with the earlier SHA and resolves). Keep passing it the same ledger.
  • Check-fix attempts are /fix-pr-checks' job — it shares this ledger and caps each check at 3 fix→push attempts. When it reports a check exhausted, stop and report it to the user — never loop forever.
  • The claude-review bot re-reviews on every push (synchronize), so your fixes trigger fresh reviews — this is expected, not new work to fear. By policy it now posts inline threads only for Critical/High findings (Medium/Low live in its summary comment, which is advisory — do not turn summary bullets into code changes). A converging PR should see each push's inline batch shrink; if the same severity-gated topic reappears across pushes, treat it as noise per the rule above (reply with the earlier SHA, resolve, don't re-edit).
  • Re-sweep after every push — "ready" is only true of the current tip. Any push to the branch (a check fix, and a caller's exceptional post-gate commit such as an approved skill edit or a /deliver retro amendment) re-triggers claude-review, which can post a fresh Critical/High thread that blocks the merge (required_review_thread_resolution). Never declare ready off a thread/check snapshot taken before the latest push: after the last push settles, run one more full pass (thread sweep + check re-confirm) before §3. A single early "0 unresolved" check is not a standing guarantee.
  • End the loop when a full pass resolves no new threads and has no actionable check failures. Hard backstop: ~10 passes, then report and stop.
  • Waiting: use gh pr checks --watch for in-flight CI. When only waiting on a human to review, pause and resume later with ScheduleWakeup (a few minutes while CI is active; longer when idle). This skill also composes with /loop if the user prefers harness-driven cadence.
Show full SKILL.md (749 more words)Show less

3. Ready / merge

The PR is ready when every review thread is resolved, no check is failing or pending, AND the branch is up to date with main (the main ruleset requires it before merge).

Verify check completeness explicitly — a running check is not a pass. Read the checks with mcp__github__pull_request_read method get_check_runs (owner/repo from origin, pullNumber: <n>). "No check failing" is not the same as "all checks passed": a run still in_progress / queued has no conclusion yet, so a filter like "any conclusion != success?" reports it as absent, not pending — reading as green when it isn't. Confirm readiness positively: every check run has status == "completed" and conclusion == "success" on the current head commit. get_check_runs is scoped to the head commit, but a re-run can still leave duplicate rows for a check name — key on the latest run per name. Do not infer green from a gh pr checks --watch exit alone; re-read the check runs. And when mergeable_state is blocked, rule out a pending required check first (it is the common cause) before attributing the block to a review/policy rule like code-owner review. (Bit #361: a still-running "Build and Test" was misread as green and the block was wrongly pinned on code-owner review.)

Rebase before declaring ready, never after. main advances while you watch (other PRs merge), leaving the branch BEHIND. The moment the PR is otherwise green, bring it up to date — mcp__github__update_pull_request_branch (pullNumber: <n>; a merge of main, no force-push) — and wait for the re-triggered CI to go green again before you call it ready. "Ready" must mean "mergeable right now": never surface a BEHIND PR as ready and leave the user waiting on a rebase + re-run. Update once at the ready point, not eagerly on every main advance — each update re-runs the full ~4–7 min CI matrix.

On ready, move the issue to In review — before reporting. Ready means the PR is waiting on a human, which is exactly what that column tells them, and the board is how they see it without reading this run's output. Take the issue number from the closing keyword in the PR body (Closes #NNN / Fixes #NNN), which /pr requires on every PR that has an issue. That is deliberately the only source: it is the same link GitHub uses to close the issue on merge, so it cannot disagree with what actually happens, and it needs no extra argument — a second bare number beside the PR number would be ambiguous to parse. Column vocabulary and the exact call: .github/ISSUE_FILING.md → Board status — the column lifecycle. No issue reference → skip the move and say so in the summary; a failed board write is reported, never fatal, and never a reason to withhold a ready PR.

Do this in both modes. In merge-when-ready it is momentary — the merge closes the issue and the board's own automation takes it to Done — but it is still correct while the merge is in flight, and it is what the board shows if the merge then fails.

  • Watch-only: report "PR is ready" with a short summary (threads handled, checks green, branch up to date, issue moved to In review) and stop — wait for the user's explicit go-ahead before merging.

  • Merge-when-ready: on ready, capture the head branch name first (you need it to delete the remote branch — merge_pull_request has no delete-branch option), merge with mcp__github__merge_pull_request (owner/repo from origin, pullNumber: <n>, merge_method: squash), then delete the remote branch, and report the result:

    bash
    git push origin --delete <branch>   # only after the squash-merge has landed

    On a 401/403, fall back to gh pr merge --squash --delete-branch.

Several PRs queued? Merge in dependency order. Stack one on another (base the later PR on the earlier branch) only when they genuinely depend on each other or the merge order is fixed up front — then merging the first leaves the next already up to date, with no second rebase. Keep independent PRs on separate main-based branches and rely on the rebase-before-ready rule above rather than coupling unrelated work.

Guardrails

  • Never edit .github/workflows/* or other CI/config to force a check green, and never force-push, without surfacing to the user first.
  • If a requested change is ambiguous or risky, reply on the thread with your assessment and leave it for the user (note it in the final summary) rather than guessing.
  • There is no pre-commit hook (.git/hooks/ holds only *.sample). Nothing lints on your behalf — run /lint before committing, or the PR's Lint job is the first thing that tells you.

Arguments: $ARGUMENTS

© adamayoung, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/watch-pr of adamayoung/TMDb.

Open the folder on GitHubat commit a3f1311

Compare with similar skills

Watch PR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Watch PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Watch PR this skilladamayoung/TMDb178—~3.4kAutomated safety check: PassApache-2.0
Rocketmq Rust Issue Generatormxsm/rocketmq-rust1.5k—~1.6kAutomated safety check: PassApache-2.0
Reviewapollographql/apollo-mcp-server314—~2.9kAutomated safety check: PassMIT
Octocode Chrome Devtoolsbgauryy/octocode949—~1.6kAutomated safety check: PassMIT
Record E2E Giflablup/backend.ai-webui133—~907Automated safety check: NotesLGPL-3.0
Gh Issue Fix FlowAFK-surf/OpenBridge4301 repos~490Automated safety check: PassMIT

Similar skills

  • A skill your agent uses when the user asks to create, draft, prepare, or publish a GitHub issue for the rocketmq-rust project — bugs, features, enhancements, refactors, docs, unit tests, CI…

    1.5k GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Review

    apollographql/apollo-mcp-server

    Review a GitHub pull request for a Rust codebase. An agent skill from apollographql/apollo-mcp-server.

    314 GitHub stars~2.9k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Octocode Chrome Devtools

    bgauryy/octocode

    A skill your agent uses when a live page needs Chrome DevTools/CDP evidence: network failures, console errors, performance, DOM/CSS actionability, screenshots/PDF, cookies/storage…

    949 GitHub stars~1.6k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Record E2E Gif

    lablup/backend.ai-webui

    Record Playwright e2e tests as one GIF per test case (video → ffmpeg palette GIF) and return a markdown table for a PR description.

    133 GitHub stars~907 tokensUpdated today
    Testing & QAAuto-check: notes
  • Gh Issue Fix Flow

    AFK-surf/OpenBridge

    End-to-end GitHub issue fix workflow using gh, local code changes, builds/tests, and git push.

    430 GitHub starsUsed in 1 repo~490 tokens
    Testing & QAAuto-check passed
  • GitHub Issues

    github/awesome-copilot

    Official

    Create, update, and manage GitHub issues using MCP tools. An agent skill from github/awesome-copilot.

    40k GitHub starsUsed in 2 repos~2.3k tokens
    Testing & QAAuto-check passed

More from adamayoung/TMDb

All 18 skills in this repo
  • Writes and maintains DocC /// comments for the public API of the TMDb Swift package, following the project's summary patterns and comment structure.

    178 GitHub stars~2.6k tokensUpdated 7 days ago
    Auto-check passed
  • Diagnoses a failing scheduled TMDb Integration run, re-runs transient failures, and fixes real API drift on its own branch with a PR, merging it only when told to.

    178 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check passed
  • Drives an approved plan to completion test-first, deriving a Canon TDD test list, showing it before any code and stopping only when every item is written, passing and green.

    178 GitHub stars~4.5k tokensUpdated 7 days ago
    Auto-check passed
  • TMDb Backlog Triager

    adamayoung/TMDb

    Grooms the Backlog column of a GitHub project board by re-verifying each issue against current main, closing dead ones, promoting actionable ones to Ready and naming the decision the rest need.

    178 GitHub stars~5k tokensUpdated 7 days ago
    Auto-check passed
  • Canon TDD Workflow

    adamayoung/TMDb

    Has your agent build features and fix bugs in Canon TDD order: write a test list, then one failing test, make it pass, refactor, and repeat until the list is empty.

    178 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Capture Knowledge

    adamayoung/TMDb

    Records non-obvious lessons from a finished task, such as gotchas, API quirks and design decisions, into a project's knowledge folder before a pull request opens.

    178 GitHub stars~2.3k tokensUpdated 7 days ago
    Auto-check passed

Categories

Questions about Watch PR

What does Watch PR do?

Watch the current branch's PR — reply to and resolve review threads, fix failing checks, and optionally merge when ready. Watch PR is an agent skill from adamayoung/TMDb.

When should I use Watch PR?

Watch PR fits situations like: testing & QA work in your project.

How do I install Watch PR in Claude Code?

Run `npx skills add adamayoung/TMDb --skill watch-pr -a claude-code`. Or copy the skill folder (.claude/skills/watch-pr in adamayoung/TMDb) into .claude/skills/watch-pr in your project. Claude Code loads it when a task matches its description.

How do I install Watch PR in Codex?

Run `npx skills add adamayoung/TMDb --skill watch-pr -a codex`. Or copy the skill folder (.claude/skills/watch-pr in adamayoung/TMDb) into .agents/skills/watch-pr in your project. Codex loads it when a task matches its description.

Can I use Watch PR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add adamayoung/TMDb --skill watch-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/watch-pr, .gemini/skills/watch-pr, .github/skills/watch-pr and .opencode/skills/watch-pr in your project.

What does Watch PR need to run?

Going by SKILL.md and its folder, Watch PR needs the command-line tools its instructions call (gh, git and make).

Does Watch PR access the network?

SKILL.md contains no URLs. Its commands use gh and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Watch PR safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Watch PR use?

Watch PR is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Watch PR use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Watch PR?

Skills that share tags, products or a category with Watch PR: Rocketmq Rust Issue Generator (mxsm/rocketmq-rust, 1.5k stars), Review (apollographql/apollo-mcp-server, 314 stars), Octocode Chrome Devtools (bgauryy/octocode, 949 stars) and Record E2E Gif (lablup/backend.ai-webui, 133 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Watch PR?

adamayoung (a GitHub user) maintains it in adamayoung/TMDb, which has 178 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on October 3, 2026.

Source: adamayoung/TMDb on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.