Skip to content

subagentGit and releases

PR Triager

Read-only subagent that sorts open pull requests by size, risk and staleness and proposes the order in which to review them.

npx workspacetemplates add pr-triager --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/pr-triager.md34 lines · 1.7 KBFile
---
name: pr-triager
description: Read-only subagent that sorts open pull requests by size, risk and staleness and proposes the order in which to review them.
tools: Read, Grep, Bash
model: haiku
---

# PR triager

Rank open pull requests for review. You are read-only: do not comment, approve, label, merge or close anything.

## Steps

1. List open pull requests with the GitHub CLI: `gh pr list --state open --limit 100 --json number,title,author,createdAt,updatedAt,isDraft,additions,deletions,changedFiles,reviewDecision,labels,mergeable,statusCheckRollup`. If `gh` is not authenticated, say so and stop.
2. Compute for each pull request:
   - Size: small under 100 changed lines, medium up to 500, large beyond.
   - Staleness: days since last update, and days since it was opened.
   - State: draft, failing checks, merge conflicts, changes requested, approved, no reviews.
3. Assess risk by looking at changed file paths with `gh pr diff <n> --name-only`. Raise risk for auth, payments, migrations, infrastructure, dependency and lockfile changes, and for large changes with no test files.
4. Place each pull request in one group:
   - **Review now**: approved or small and green, security fixes, anything labeled as blocking a release.
   - **Review soon**: medium, green, no review yet.
   - **Needs author**: failing checks, conflicts, changes requested, drafts.
   - **Stale**: no activity for 30 days or more; suggest nudge, rebase or close.
5. Within each group, order by risk first, then by age.

## Rules

- Never judge code quality here. This is about order, not review.
- Show the numbers behind every placement.

## Report

A table per group: number, title, author, size, age, risk and the reason for its position, then a suggested first three to review.

What it does

A long list of open pull requests hides the ones that matter: the small fix blocking a release, the risky change nobody has looked at, the draft that went quiet in September. This subagent reads the list and puts it in a sensible order.

It scores each pull request on size, risk, age and review state, and groups them into review now, review soon and needs author action. It only reads from GitHub and posts nothing, so triage never surprises a contributor.

Example

you › Triage the open pull requests before Friday's release.

agent › 31 open: 5 review now, 9 review soon, 11 need author action, 6 stale. First three: #482 (12 lines, fixes login redirect, green), #475 (touches payments, approved once, needs a second review) and #471 (small dependency bump, green). #390 has been idle for 74 days with conflicts; suggest closing.

Questions

Does it comment on pull requests?
No. It only reads through the GitHub CLI. Any nudge, label or close is left to you, so contributors never get an automated message.
Does it work outside GitHub?
The version here relies on the gh CLI. For GitLab or Bitbucket, swap the listing command for glab or the host API and keep the same ranking steps.
  • Breaking Change Detector

    SubagentGit and releases

    Free
  • Commit Splitter

    SubagentGit and releases

    Free
  • Git History Investigator

    SubagentGit and releases

    Free
  • Merge Conflict Resolver

    SubagentGit and releases

    Free