/watch-pr-then-action:watch-pr-then-actionfrom watch-pr-then-action
Polls a GitHub PR until a condition is met (Copilot finished, draft removed, or review submitted), then executes a follow-up action like review or merge.
Ships in watch-pr-then-action. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Poll a GitHub PR until a condition is met, then execute a follow-up action.
watch-pr-then-action <pr-number-or-url> [for <condition>] [then <action>]
<pr-number-or-url> (required) — A PR number (e.g., 2165) or full URLfor <condition> (optional) — What to wait for. See Conditions. Defaults to copilot.then <action> (optional) — Follow-up prompt. Defaults to review PR <number>.Examples:
watch-pr-then-action 2165 — wait for Copilot to finish, then reviewwatch-pr-then-action 2165 for ready — wait for PR to leave draft, then reviewwatch-pr-then-action 2165 for copilot then merge it — wait for Copilot, then mergewatch-pr-then-action https://github.com/org/repo/pull/99 for ready then address the PR commentscopilot (default)Wait for GitHub Copilot to finish work. The only reliable signal is the copilot_work_finished event in the issue events API.
Check command:
gh api repos/<owner>/<repo>/issues/<number>/events --jq '[.[] | select(.event == "copilot_work_finished")] | length'
Done when: result > 0
Waiting message: "PR #<number>: Copilot still working. Will check again in 5 minutes."
Done message: "Copilot has finished work on PR #<number>."
readyWait for a PR to be marked ready for review (moved out of draft). Use when someone has a draft PR and you want to act once they put it up for review.
Check command:
gh pr view <number> --repo <owner/repo> --json isDraft --jq '.isDraft'
Done when: result is false
Waiting message: "PR #<number>: Still in draft. Will check again in 5 minutes."
Done message: "PR #<number> is now ready for review."
reviewWait for a new review to be submitted on the PR (approval, changes requested, or comment).
Check command:
gh api repos/<owner>/<repo>/pulls/<number>/reviews --jq 'length'
Store the initial count on first check. Done when the count increases.
Waiting message: "PR #<number>: No new reviews yet. Will check again in 5 minutes."
Done message: "PR #<number> has received a new review."
for and then (case-insensitive) to extract: PR identifier, condition, and actioncopilot, action → review PR <number>gh repo view --json nameWithOwner -q .nameWithOwner. For a URL, extract owner/repo/number from the path.gh pr view <number> --repo <owner/repo> --json title,isDraft,state
Confirm it exists and report its title and state. If the PR is closed or merged, abort with a message.
Run the condition's check command once. If already met, skip to Step 5.
Use CronCreate to poll every 5 minutes:
*/5 * * * *trueCheck PR #<number> in <owner/repo> for condition "<condition>".
Run: <check command>
If done: cancel cron job <job-id> using CronDelete, then execute: <action>
If not done: report "<waiting message>"
Report the cron job ID so the user can cancel manually if needed.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub jtsternberg/claude-plugins --plugin watch-pr-then-action