pr-triage

pr-triage is a skill for Claude Code, Codex from ChanningLua/prax-agent. It costs 34 tokens per session (2,476 once invoked), scanned A, original, MIT.

A pull-request review tool that checks a proposed set of code changes in a Git repository. A pull request is a request to merge one branch of code into another.

In plain words
What is it for?
Use it to triage a pull request, classify its changes, verify tests, inspect dependencies, and save review notes without automatically approving, merging, closing, or commenting.
Why use it?
It goes beyond reading the change list by checking out the code, running tests, and checking newly added dependencies for known security problems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/channinglua/prax-agent/pr-triage
Any agent
npx skills add ChanningLua/prax-agent --skill pr-triage
Clone the repo
git clone --depth 1 https://github.com/ChanningLua/prax-agent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-triage

README.md
[![agentmods](https://agentmods.dev/badge/skills/channinglua/prax-agent/pr-triage.svg)](https://agentmods.dev/skills/channinglua/prax-agent/pr-triage)
Your own site
<a href="https://agentmods.dev/skills/channinglua/prax-agent/pr-triage"><img src="https://agentmods.dev/badge/skills/channinglua/prax-agent/pr-triage.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,476 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.02476
Opus 5 $0.00017 $0.01238
Sonnet 5 $0.00007 $0.00495
Haiku 4.5 $0.00003 $0.00248

Measured 4d ago against content hash 7a4c4263cfea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pr-triage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/prax/skills/pr-triage/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR Triage Bot

Prax 的杀手锏在这:不只"让 LLM 看 diff 给点评",而是真的 checkout 出来、真的跑测试、真的看新增依赖有没有 CVE。结果比纯 LLM 评论可信一个量级。

何时触发

  • 用户粘 PR URL 或说"triage #42"
  • cron 每天早上 8 点扫 open PRs
  • GitHub webhook 触发(需要额外 hook 配置,本 skill 不负责触发)

输入

  • 必需:PR URL 或 #NNN(本仓库的话)或 PR 分支名
  • 可选:仓库路径(默认当前 cwd)

预检(不满足就停)

# 1. 在 git 仓库里
git rev-parse --show-toplevel

# 2. 有 gh CLI 吗?
command -v gh && gh auth status 2>/dev/null

gh 时走 降级路径(见 Step 2b)。没 git 仓库直接报错。

输出

一份 markdown 审查笔记:

.prax/pr-triage/pr-<NNN>-<YYYYMMDD-HHMMSS>.md

自动 approve / merge / close / comment 到 GitHub。所有外部动作都必须用户明确再触发一次。

工作流程

Step 1:拿 PR metadata

# 完整路径
gh pr view <url> --json number,title,body,files,author,baseRefName,headRefName,additions,deletions,commits

# 提炼
NUM=$(echo $JSON | jq -r '.number')
TITLE=$(echo $JSON | jq -r '.title')
BASE=$(echo $JSON | jq -r '.baseRefName')
HEAD=$(echo $JSON | jq -r '.headRefName')
STATS="+$(echo $JSON | jq -r '.additions'),-$(echo $JSON | jq -r '.deletions')"
FILES=$(echo $JSON | jq -r '.files | length')

Step 2:拿 diff 本体

gh pr diff <url> > /tmp/pr-<NUM>.diff
wc -l /tmp/pr-<NUM>.diff

Step 2b:gh 不可用的降级

gh CLI 时:

# 本仓库的 PR:如果本地 remotes 里有 pull/<num>/head refspec
git fetch origin pull/<NUM>/head:pr-<NUM> 2>/dev/null
git diff origin/<base>...pr-<NUM> > /tmp/pr-<NUM>.diff

如果连 fetch 也不行(外网受限)→ 退化成只读远端分支名模式,不跑测试,只产出分类 + 手动审查清单。

Step 3:分类(硬枚举)

用 PR title + 首个 commit message + files-changed 启发式:

分类 证据
feature title 含 feat(...) / 新文件多 / +100 以上
bug title 含 fix(...) / 行数均衡增删
refactor title 含 refactor / 纯结构调整
chore title 含 chore / 仅 config/yaml
docs *.md 变更
hotfix hotfixurgent

一个 PR 可以多标签,取最强一个作为主分类。

Step 4:风险评分

硬规则,每触发一条加一分:

规则 分数
patch > 500 行 +2
patch > 1000 行 +3(累加)
触达 >10 个文件 +2
package.json/requirements.txt/Cargo.toml/go.mod 且有新增依赖 +2
auth/security/permission/middleware 相关文件 +2
改 CI / .github/workflows/ +2
改数据库迁移文件 +3
PR body 空 +1
没测试伴随(仅 src 没 test) +2

Read the full file on GitHub · 248 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 248 lines · 34 tokens per session scan A 7a4c4263cfea

Subscribe to this mod's changes

pr-triage is a skill published in the GitHub repository ChanningLua/prax-agent (272 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 2,476 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.