pr-triage

Decide in one step what a pull-request wake-up needs — nothing (deploy-preview bot comments, duplicate or stale events), a CI fix, a rebase, a review-finding fix, or the merge — and act without spending tokens on noise. Use whenever a PR watcher wakes you ("Update on pull request #N…", "checks failed", "conflicts with its base branch", "new comment", "Vercel commented on the PR"), when a background `gh pr checks --watch` exits, when the user asks "what does this PR need now?", and inside ship, signalbox, or any PR-watch loop. Not for opening a PR, writing a code review of a diff, or a first-time review of someone else's PR; this skill only triages events on a PR you are already driving.

Qu'est-ce que pr-triage ?

pr-triage is a Claude Code agent skill that decide in one step what a pull-request wake-up needs — nothing (deploy-preview bot comments, duplicate or stale events), a CI fix, a rebase, a review-finding fix, or the merge — and act without spending tokens on noise. Use whenever a PR watcher wakes you ("Update on pull request #N…", "checks failed", "conflicts with its base branch", "new comment", "Vercel commented on the PR"), when a background `gh pr checks --watch` exits, when the user asks "what does this PR need now?", and inside ship, signalbox, or any PR-watch loop. Not for opening a PR, writing a code review of a diff, or a first-time review of someone else's PR; this skill only triages events on a PR you are already driving.

Compatible avec✓Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/dxbh0517/dxbh-skills/tree/HEAD/content/fixtures/skill-pr-triage/skills/pr-triage

Installed? Explore more Développement et programmation skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

PR triage

Most PR wake-ups are noise. A Vercel preview comment is not news. Handle each wake in this order and stop at the first match. Do not re-read the diff, re-summarize the PR, or post "still waiting" for noise.

What a wake is

HarnessWake
T3 Codethe watch_pull_request message ("Update on pull request #N…")
Claude Code, Codex, Cursor, otherthe one background gh pr checks <n> --watch --fail-fast exiting, or the user re-invoking you

Outside T3 there is no event payload. Read the state yourself:

gh pr view <n> --json state,isDraft,headRefOid,mergeStateStatus,mergeable,statusCheckRollup,reviews,comments

Map it onto the table below: state → done; mergeStateStatus BEHIND/DIRTY or mergeable CONFLICTING → rebase; statusCheckRollup entries are the head SHA's checks (FAILURE/ERROR/TIMED_OUT/CANCELLED → ci-fail, all SUCCESS/NEUTRAL/SKIPPED → green, any still running → wait); comments and reviews newer than what you handled → finding or noise by author; a review whose commit.oid is not headRefOid is stale. gh pr view omits inline review-thread comments; read them with gh api repos/{owner}/{repo}/pulls/<n>/comments when a review has no body.

Optional speed-up: pipe that JSON into scripts/classify.py (stdlib Python, no network). It applies this table and priority order and prints <class>: <reason>. Keep its state per PR in the scratchpad, or ${TMPDIR:-/tmp}/pr-triage/:

gh pr view <n> --json state,isDraft,headRefOid,mergeStateStatus,mergeable,statusCheckRollup,reviews,comments \
  | python3 scripts/classify.py --last-handled "$S" --save "$S"   # S=${TMPDIR:-/tmp}/pr-triage/<repo>-<n>.json

gh pr view cannot tell required checks from optional ones; pass --optional <check> for each check that does not block merge.

1. Classify the event

EventClass
Comment from a deploy-preview bot: vercel, netlify, cloudflare-pages / cloudflare-workers-and-pages, railway-app, render, fly-io, github-actions deploy summaries, [vc]: payloads, "Preview deployment ready/updated"noise
Comment from codecov, changeset-bot, sonarcloud summary, dependabot notices, bundle-size or Lighthouse bots, unless they report a failure that blocks merge (that shows up as a failing check)noise
Same event already handled (same SHA, same check, same comment id and body)noise
Event about an older SHA than the current headnoise
Required check failed on the head SHAci-fail
Conflicts with base / BEHIND / DIRTYrebase
Review-bot finding (CodeRabbit, Greptile, Macroscope, Copilot, Cursor Bugbot, Claude) or human comment/reviewfinding
All required checks passed on the head SHAgreen
PR merged or closeddone

A deploy-preview comment that says the deployment failed is ci-fail, not noise. Deploy bots edit one comment in place, so a handled comment id with a new body is a new event. Read the build log through the host (Vercel MCP get_deployment + build logs, or vercel inspect --logs <url>; else the check's details link from gh pr checks <n>).

A wake can carry several events. Handle the highest-impact one first: done > rebase > ci-fail > finding > green > noise.

2. Act

  • noise → if the PR is still yours to watch, re-arm the one watcher (T3: watch_pull_request; elsewhere: start gh pr checks <n> --watch --fail-fast in the background again) and end the turn with no message. Nothing else: no file reads, no summaries.
  • ci-fail → read only the failing job's log (T3: ci_logs; elsewhere: gh run view <id> --log-failed). Infra flake (runner died, network, 5xx, timeout with no test failure, rate limit) → rerun once (T3: ci_rerun; elsewhere: gh run rerun <id> --failed). Second identical failure or a real error → fix it on the branch (or delegate, under signalbox), push, watch again.
  • rebase → git fetch, rebase onto the base, resolve, run the checks the conflict touched, git push --force-with-lease to this PR's branch only, watch again.
  • finding → verify against the source before changing anything. Real bug in the intended path → fix. Otherwise decline (see below) and resolve. Keep scope: decline speculative edge cases, extra tests, and refactors as follow-ups.
  • green → if merging was authorized (ship, signalbox, "merge it", "full send"), run the merge gate on a fresh gh pr view: current headRefOid equals the SHA that went green (green_head in the --save state; the reason prints it as "green (head )"), isDraft is false, mergeStateStatus is not BEHIND, DIRTY or BLOCKED (UNSTABLE is fine: only optional checks failed), no unresolved real findings, review bots finished. Then merge (T3: pull_request_merge; elsewhere: gh pr merge <n>). If not authorized ("full stop" means: leave it ready, never merge), stop watching (T3: unwatch_pull_request) and report "ready" in one line.
  • done → stop. Run post-merge steps if ship is driving.

Declining a finding

Reply on the thread, then resolve it:

  • One or two sentences. Lead with the conclusion, then the concrete reason: file:line, the check that covers it, or the reproduction that shows it is fine.
  • No apology, thanks, or status narration. Separate verified fact from judgment.
  • Scan the reply for secrets and private details before posting.
  • Resolve the thread only after GitHub returns the reply's URL.

3. Cut the noise at the source (once per repo)

If deploy-preview comments keep waking you, tell the user once (do not change settings without asking):

  • Vercel: turn off pull-request comments for the project in the Vercel dashboard's Git settings. Previews still deploy and still report as a GitHub check, which is the signal that matters.
  • Netlify / Cloudflare: disable deploy-preview comments in the site's build or Git settings; keep the commit status.

Verify the current option name in the host's docs before giving steps; these settings move.

Rules

  • One waiter per PR. T3: one watch_pull_request. Elsewhere: one background gh pr checks <n> --watch. Never both on the same PR, never a second copy.
  • Only the thread that owns the PR waits on it. Delegated children never watch.
  • Stop waiting when you hand off (ready, blocked, or asking the user).
  • Never sleep, poll, or write a watch loop. Re-arm only after you handled a wake.
  • If GraphQL is rate-limited (gh api rate_limit --jq .resources.graphql), read the PR with gh api repos/{owner}/{repo}/pulls/<n> and checks with gh api repos/{owner}/{repo}/commits/<sha>/check-runs; do not re-arm in a tight loop.
  • Never merge on a stale head or with --admin.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

Skills associés