Agent skill

PR Triage

by rtk-ai in rtk-ai/rtk

Audits a repository's open pull requests, deep-reviews chosen ones and drafts review comments that are only posted after you approve them.

Apache-2.0Auto-check: notesDevelopment

SKILL.md written in French; this summary is our English description.

Install PR Triage

skills CLI
$ npx skills add rtk-ai/rtk --skill pr-triage -a claude-code

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

GitHub CLI
$ gh skill install rtk-ai/rtk pr-triage --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/rtk-ai/rtk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/pr-triage .claude/skills/pr-triage && 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
pr-triage
GitHub stars
83k
Token cost
~2.5k tokens
SKILL.md length
704 words
Files
2
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

Audits a repository's open pull requests, deep-reviews chosen ones and drafts review comments that are only posted after you approve them.

  • Works in 3 steps: Audit (toujours exécutée) → Deep Review (opt-in) → Commentaires (validation obligatoire)
  • Auditing all open PRs to see which need attention
  • SKILL.md covers Quand utiliser, Langue, Préconditions and Phase 1 — Audit (toujours…, plus 4 more sections
  • Calls gh and git

What it does

The workflow has three phases: an automatic audit, an opt-in deep review and comments posted only after required validation. You can pass all to review everything, PR numbers to focus on some, and en or fr for the language of the tables and summary; with no argument it runs the audit only, in French. GitHub comments are always written in English. It first checks that you are inside a git work tree and that the GitHub CLI is authenticated, and stops with an explanation if not.

The audit gathers the repo identity, open PRs, collaborators (falling back to the authors of the ten latest merged PRs, then asking you) and for each PR its existing reviews and changed files, prioritizing likely overlaps when a repo has many PRs. It then classifies size from XS under 50 additions up to XL over 1000, flags overlaps when more than half the files are shared, suggests a smallest-first review order for authors with three or more open PRs, and flags PRs idle for over 14 days as stale. A review-comment template ships with it, and a sibling skill handles team recaps. The excerpt is cut off in the audit analysis.

When your agent uses it

  • Auditing all open PRs to see which need attention
  • Spotting overlapping PRs that touch the same files
  • Deep-reviewing selected PRs and drafting review comments
  • Finding stale PRs and deciding a review order

Example prompts

  • “Run /pr-triage and give me the audit table in French.”
  • “Triage the open PRs and show the action table in English.”
  • “/pr-triage 42 57”
  • “Run a deep review on PR 42 and draft the comments, but do not post anything until I approve.”

Requirements

  • The GitHub CLI (`gh`), authenticated
  • A git repository checkout
  • Pre-approved tools (allowed-tools): Bash, Read, Grep, Glob

Workflow steps

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

  1. Audit (toujours exécutée)
  2. Deep Review (opt-in)
  3. Commentaires (validation obligatoire)

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh
    • git

    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

PR Triage loads about 2.5k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 704 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Grep, Glob

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 rtk-ai/rtk at commit e4f0509, republished under its Apache-2.0 licence (© rtk-ai). 704 words, ~2,497 tokens.

Download SKILL.mdSave it as .claude/skills/pr-triage/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
pr-triage
description
PR triage: audit open PRs, deep review selected ones, draft and post review comments. Args: "all" to review all, PR numbers to focus (e.g. "42 57"), "en"/"fr" for language, no arg = audit only in French.
allowed-tools
Bash, Read, Grep, Glob
effort
medium
tags
triage, pr, github, review, code-review, rtk

PR Triage

Quand utiliser

SkillUsageOutput
/pr-triageTrier, reviewer, commenter les PRsTableau d'action + reviews + commentaires postés
/repo-recapRécap général pour partager avec l'équipeRésumé Markdown (PRs + issues + releases)

Déclencheurs :

  • Manuellement : /pr-triage ou /pr-triage all ou /pr-triage 42 57
  • Proactivement : quand >5 PRs ouvertes sans review, ou PR stale >14j détectée

Langue

  • Vérifier l'argument passé au skill
  • Si en ou english → tableaux et résumé en anglais
  • Si fr, french, ou pas d'argument → français (défaut)
  • Note : les commentaires GitHub (Phase 3) restent TOUJOURS en anglais (audience internationale)

Workflow en 3 phases : audit automatique → deep review opt-in → commentaires avec validation obligatoire.

Préconditions

bash
git rev-parse --is-inside-work-tree
gh auth status

Si l'un échoue, stop et expliquer ce qui manque.


Phase 1 — Audit (toujours exécutée)

Data Gathering (commandes en parallèle)
bash
# Identité du repo
gh repo view --json nameWithOwner -q .nameWithOwner

# PRs ouvertes avec métadonnées complètes (ajouter body pour cross-référence issues)
gh pr list --state open --limit 50 \
  --json number,title,author,createdAt,updatedAt,additions,deletions,changedFiles,isDraft,mergeable,reviewDecision,statusCheckRollup,body

# Collaborateurs (pour distinguer "nos PRs" des externes)
gh api "repos/{owner}/{repo}/collaborators" --jq '.[].login'

Fallback collaborateurs : si gh api .../collaborators échoue (403/404) :

bash
# Extraire les auteurs des 10 derniers PRs mergés
gh pr list --state merged --limit 10 --json author --jq '.[].author.login' | sort -u

Si toujours ambigu, demander à l'utilisateur via AskUserQuestion.

Pour chaque PR, récupérer reviews existantes ET fichiers modifiés :

bash
gh api "repos/{owner}/{repo}/pulls/{num}/reviews" \
  --jq '[.[] | .user.login + ":" + .state] | join(", ")'

# Fichiers modifiés (nécessaire pour overlap detection)
gh pr view {num} --json files --jq '[.files[].path] | join(",")'

Note rate-limiting : la récupération des fichiers est N appels API (1 par PR). Pour repos avec 20+ PRs, prioriser les PRs candidates à l'overlap (même domaine fonctionnel, même auteur).

Note : author est un objet {login: "..."} — toujours extraire .author.login.

Analyse

Classification taille :

LabelAdditions
XS< 50
S50–200
M200–500
L500–1000
XL> 1000

Format taille : +{additions}/-{deletions}, {files} files ({label})

Détections :

  • Overlaps : comparer les listes de fichiers entre PRs — si >50% de fichiers en commun → cross-reference
  • Clusters : auteur avec 3+ PRs ouvertes → suggérer ordre de review (plus petite en premier)
  • Staleness : aucune activité depuis >14j → flag "stale"
  • CI status : via statusCheckRollup → clean / unstable / dirty
  • Reviews : approved / changes_requested / aucune

Liens PR ↔ Issues :

  • Scanner le body de chaque PR pour fixes #N, closes #N, resolves #N (case-insensitive)
  • Si trouvé, afficher dans le tableau : Fixes #42 dans la colonne Action/Status

Catégorisation :

Nos PRs : auteur dans la liste des collaborateurs

Externes — Prêtes : additions ≤ 1000 ET files ≤ 10 ET mergeable ≠ CONFLICTING ET CI clean/unstable

Externes — Problématiques : un des critères suivants :

  • additions > 1000 OU files > 10
  • OU mergeable == CONFLICTING (conflit de merge)
  • OU CI dirty (statusCheckRollup contient des échecs)
  • OU overlap avec une autre PR ouverte (>50% fichiers communs)
Output — Tableau de triage
## PRs ouvertes ({count})

### Nos PRs
| PR | Titre | Taille | CI | Status |
| -- | ----- | ------ | -- | ------ |

### Externes — Prêtes pour review
| PR | Auteur | Titre | Taille | CI | Reviews | Action |
| -- | ------ | ----- | ------ | -- | ------- | ------ |

### Externes — Problématiques
| PR | Auteur | Titre | Taille | Problème | Action recommandée |
| -- | ------ | ----- | ------ | -------- | ------------------ |

### Résumé
- Quick wins : {PRs XS/S prêtes à merger}
- Risques : {overlaps, tailles XL, CI dirty}
- Clusters : {auteurs avec 3+ PRs}
- Stale : {PRs sans activité >14j}
- Overlaps : {PRs qui touchent les mêmes fichiers}

0 PRs → afficher Aucune PR ouverte. et terminer.

Copie automatique

Après affichage du tableau de triage, copier dans le presse-papier :

bash
# Cross-platform clipboard
clip() {
  if command -v pbcopy &>/dev/null; then pbcopy
  elif command -v xclip &>/dev/null; then xclip -selection clipboard
  elif command -v wl-copy &>/dev/null; then wl-copy
  else cat
  fi
}

clip <<'EOF'
{tableau de triage complet}
EOF

Confirmer : Tableau copié dans le presse-papier. (FR) / Triage table copied to clipboard. (EN)


Phase 2 — Deep Review (opt-in)

Sélection des PRs

Si argument passé :

  • "all" → toutes les PRs externes
  • Numéros ("42 57") → uniquement ces PRs
  • Pas d'argument → proposer via AskUserQuestion

Si pas d'argument, afficher :

question: "Quelles PRs voulez-vous reviewer en profondeur ?"
header: "Deep Review"
multiSelect: true
options:
  - label: "Toutes les externes"
    description: "Review {N} PRs externes avec agents code-reviewer en parallèle"
  - label: "Problématiques uniquement"
    description: "Focus sur les {M} PRs à risque (CI dirty, trop large, overlaps)"
  - label: "Prêtes uniquement"
    description: "Review {K} PRs prêtes à merger"
  - label: "Passer"
    description: "Terminer ici — juste l'audit"

Note sur les drafts :

  • Les PRs en draft sont EXCLUES des options "Toutes les externes" et "Prêtes uniquement"
  • Les PRs en draft sont INCLUSES dans "Problématiques uniquement" (car elles nécessitent attention)
  • Pour reviewer un draft : taper son numéro explicitement (ex: 42)

Si "Passer" → fin du workflow.

Show full SKILL.md (253 more words)Show less
Exécution des Reviews

Pour chaque PR sélectionnée, lancer un agent code-reviewer via Task tool en parallèle :

subagent_type: code-reviewer
model: sonnet
prompt: |
  Review PR #{num}: "{title}" by @{author}

  **Metadata**: +{additions}/-{deletions}, {changedFiles} files ({size_label})
  **CI**: {ci_status} | **Reviews**: {existing_reviews} | **Draft**: {isDraft}

  **PR Body**:
  {body}

  **Diff**:
  {gh pr diff {num} output}

  Apply your security-guardian and backend-architect skills for this review.
  Additionally, apply the RTK-specific checklist:
  - LazyLock<Regex> for fixed patterns reused across calls
  - anyhow::Result + .context() (no unwrap())
  - Fallback to raw command on filter failure
  - Exit code propagation
  - Token savings ≥60% in tests with real fixtures
  - No async/tokio dependencies

  Return structured review:
  ### Critical Issues 🔴
  ### Important Issues 🟡
  ### Suggestions 🟢
  ### What's Good ✅

  Be specific: quote the file:line, explain why it's an issue, suggest the fix.

Récupérer le diff via :

bash
gh pr diff {num}
gh pr view {num} --json body,title,author -q '{body: .body, title: .title, author: .author.login}'

Agréger tous les rapports. Afficher un résumé après toutes les reviews.


Phase 3 — Commentaires (validation obligatoire)

Génération des drafts

Pour chaque PR reviewée, générer un commentaire GitHub en utilisant le template templates/review-comment.md.

Règles :

  • Langue : anglais (audience internationale)
  • Ton : professionnel, constructif, factuel
  • Toujours inclure au moins 1 point positif
  • Citer les lignes de code quand pertinent (format file.rs:42)
Affichage et validation

Afficher TOUS les commentaires draftés au format :

---
### Draft — PR #{num}: {title}

{commentaire complet}

---

Puis demander validation via AskUserQuestion :

question: "Ces commentaires sont prêts. Lesquels voulez-vous poster ?"
header: "Poster"
multiSelect: true
options:
  - label: "Tous ({N} commentaires)"
    description: "Poster sur toutes les PRs reviewées"
  - label: "PR #{x} — {title_truncated}"
    description: "Poster uniquement sur cette PR"
  - label: "Aucun"
    description: "Annuler — ne rien poster"

(Générer une option par PR + "Tous" + "Aucun")

Posting

Pour chaque commentaire validé :

bash
gh pr comment {num} --body-file - <<'REVIEW_EOF'
{commentaire}
REVIEW_EOF

Confirmer chaque post : ✅ Commentaire posté sur PR #{num}: {title}

Si "Aucun" → Aucun commentaire posté. Workflow terminé.


Gestion des cas limites

SituationComportement
0 PRs ouvertesAucune PR ouverte. + terminer
PR en draftIndiquer dans tableau, skip pour review sauf si sélectionnée explicitement
CI inconnuAfficher ? dans colonne CI
Review agent timeoutAfficher erreur partielle, continuer avec les autres
gh pr diff videSkip cette PR, notifier l'utilisateur
PR très large (>5000 additions)Avertir : "Review partielle, diff tronqué"
Collaborateurs API 403/404Fallback sur auteurs des 10 derniers PRs mergés

Notes

  • Toujours dériver owner/repo via gh repo view, jamais hardcoder
  • Utiliser gh CLI (pas curl GitHub API) sauf pour la liste des collaborateurs
  • statusCheckRollup peut être null → traiter comme ?
  • mergeable peut être MERGEABLE, CONFLICTING, ou UNKNOWN → traiter UNKNOWN comme ?
  • Ne jamais poster sans validation explicite de l'utilisateur dans le chat
  • Les commentaires draftés doivent être visibles AVANT tout gh pr comment

© rtk-ai, 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

SKILL.md and 1 other file in .claude/skills/pr-triage of rtk-ai/rtk.

  • SKILL.md
  • templates/review-comment.md

Open the folder on GitHubat commit e4f0509

Compare with similar skills

PR Triage 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.

PR Triage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PR Triage this skillrtk-ai/rtk83k—~2.5kAutomated safety check: NotesApache-2.0
PR Review State Fetchprisma/orm48k—~767Automated safety check: PassApache-2.0
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Review Triage Phaseprisma/orm48k—~995Automated safety check: PassApache-2.0
Greploop Appsmichaelshimeles/skills1.3k1 repos~3.6kAutomated safety check: PassMIT
Difit Reviewyoshiko-pg/difit3.2k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Official

    Fetches a pull request's canonical review state as JSON, validates it, and renders markdown, a text summary and triage target files from it using bundled scripts.

    48k GitHub stars~767 tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Official

    Runs the triage step of the review-framework loop: reads fetched PR review state, builds `review-actions.json`, validates it and renders `review-actions.md`.

    48k GitHub stars~995 tokensUpdated today
    DevelopmentAuto-check passed
  • Greploop Apps

    michaelshimeles/skills

    Loops on a large pull request, merge request or Perforce changelist, fixing Greptile findings until it scores 5/5 with no unresolved comments.

    1.3k GitHub starsUsed in 1 repo~3.6k tokens
    DevelopmentAuto-check passed
  • Difit Review

    yoshiko-pg/difit

    Review a specific diff (branch, commit, or GitHub PR) and show the findings as comments inside difit, the local diff viewer.

    3.2k GitHub stars~1.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Addresses unresolved pull request review threads and suppressed (low-confidence) Copilot review comments on the current branch, folds each fix into the…

    1.8k GitHub stars~657 tokensUpdated 7 days ago
    DevelopmentAuto-check passed

More from rtk-ai/rtk

  • Enforces red-green-refactor for Rust work, with idiomatic test patterns, a naming convention and a pre-commit gate of cargo fmt, clippy and test.

    83k GitHub stars~753 tokensUpdated today
    Auto-check: notes
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Enforces red-green-refactor for new RTK output filters in Rust, using real captured fixtures, snapshot tests with insta and token-savings assertions.

    83k GitHub stars~1.9k tokensUpdated today
    Auto-check: notes
  • Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.

    83k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Audits open GitHub issues, categorizes them, flags duplicates and linked PRs in three phases, with optional deep analysis and comments posted only after validation.

    83k GitHub stars~3k tokensUpdated today
    Auto-check: notes
  • Runs issue triage and PR triage in parallel, then cross-analyzes the results to flag duplicate coverage, security gaps, P0 issues with no PR, and PR conflicts.

    83k GitHub stars~1.6k tokensUpdated today
    Auto-check: notes

Works with

Categories

Questions about PR Triage

What does PR Triage do?

Audits a repository's open pull requests, deep-reviews chosen ones and drafts review comments that are only posted after you approve them. The workflow has three phases: an automatic audit, an opt-in deep review and comments posted only after required validation. You can pass all to review everything, PR numbers to focus on some, and en or fr for the language of the tables and summary; with no argument it runs the audit only, in French.

When should I use PR Triage?

PR Triage fits situations like: auditing all open PRs to see which need attention; spotting overlapping PRs that touch the same files; deep-reviewing selected PRs and drafting review comments; finding stale PRs and deciding a review order.

How do I install PR Triage in Claude Code?

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

How do I install PR Triage in Codex?

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

Can I use PR Triage 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 rtk-ai/rtk --skill pr-triage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pr-triage, .gemini/skills/pr-triage, .github/skills/pr-triage and .opencode/skills/pr-triage in your project.

What does PR Triage need to run?

Going by SKILL.md and its folder, PR Triage needs the command-line tools its instructions call (gh and git). Our summary lists: The GitHub CLI (`gh`), authenticated; A git repository checkout. Its frontmatter pre-approves these tools: Bash, Read, Grep, Glob.

Does PR Triage 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 PR Triage safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does PR Triage use?

PR Triage 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 PR Triage use?

About 2.5k tokens (SKILL.md is roughly 10k 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 PR Triage?

Skills that share tags, products or a category with PR Triage: PR Review State Fetch (prisma/orm, 48k stars), Pre-Release PR Triage (jamiepine/voicebox, 57k stars), Review Triage Phase (prisma/orm, 48k stars) and Greploop Apps (michaelshimeles/skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PR Triage?

rtk-ai (a GitHub organization) maintains it in rtk-ai/rtk, which has 82,728 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 8, 2026.

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