Fleet PR Agent
Multi-repository pull request monitoring, triage, and summary tool for engineering teams and AI agent fleets managing many repos at once.
What It Does
- - Scans one or more GitHub repos for open PRs using the
gh CLI - Prioritizes by: staleness, review status, CI pass/fail, label priority
- Generates a structured Markdown triage report (no external dependencies — pure Python stdlib +
gh) - Supports concurrent scanning of multiple repos in a single run
Prerequisites
- -
gh CLI authenticated (gh auth status) - Python 3.6+ (standard library only — no pip packages required)
- Repos accessible to your GitHub token
Quick Start
CODEBLOCK0
Usage as Claude Code Skill
When invoked as /fleet-pr-agent, provide repos:
CODEBLOCK1
The agent will:
- 1. Fetch all open PRs from each repo via INLINECODE5
- Score and rank them by urgency (stale > failing CI > needs review > draft)
- Output a prioritized Markdown summary
Triage Priority Rules
| Priority | Condition |
|---|
| P0 - Critical | CI failing + older than 3 days |
| P1 - High |
Approved but not merged, or review requested > 2 days ago |
| P2 - Medium | Open > 5 days, no review activity |
| P3 - Low | Draft PRs, recently opened |
Output Format
CODEBLOCK2
Configuration
Set env vars to override defaults:
| Variable | Default | Description |
|---|
| INLINECODE6 | INLINECODE7 | Days before a PR is considered stale |
| INLINECODE8 |
3 | Weight multiplier for CI-failing PRs |
|
FLEET_PR_MAX_PRS |
50 | Max PRs to fetch per repo |
Architecture
- -
scripts/triage.py — Pure Python 3 triage engine (stdlib only) - No external package dependencies
- Uses
gh pr list --json for all data fetching - Portable across Linux, macOS, Windows (Python + gh required)
License
MIT
Fleet PR Agent
面向工程团队和同时管理多个仓库的AI代理集群的多仓库拉取请求监控、分类和摘要工具。
功能说明
- - 使用 gh CLI 扫描一个或多个 GitHub 仓库中的开放 PR
- 按以下维度排序:陈旧度、审查状态、CI 通过/失败、标签优先级
- 生成结构化的 Markdown 分类报告(无外部依赖——纯 Python 标准库 + gh)
- 单次运行支持并发扫描多个仓库
前置条件
- - gh CLI 已认证(gh auth status)
- Python 3.6+(仅标准库——无需 pip 包)
- 你的 GitHub Token 可访问的仓库
快速开始
bash
扫描单个仓库
python3 scripts/triage.py owner/repo
扫描多个仓库
python3 scripts/triage.py owner/repo1 owner/repo2 owner/repo3
生成分类报告到文件
python3 scripts/triage.py owner/repo --output report.md
作为 Claude Code 技能使用
当调用 /fleet-pr-agent 时,提供仓库列表:
/fleet-pr-agent owner/repo1 owner/repo2
该代理将:
- 1. 通过 gh 从每个仓库获取所有开放 PR
- 按紧急程度评分和排序(陈旧 > CI 失败 > 需要审查 > 草稿)
- 输出按优先级排序的 Markdown 摘要
分类优先级规则
| 优先级 | 条件 |
|---|
| P0 - 严重 | CI 失败 + 超过 3 天 |
| P1 - 高 |
已批准但未合并,或审查请求超过 2 天 |
| P2 - 中 | 开放超过 5 天,无审查活动 |
| P3 - 低 | 草稿 PR,近期开放 |
输出格式
markdown
PR 分类报告 — 2026-03-27
P0 — 严重(2)
P1 — 高(1)
P2 — 中(3)
...
摘要
配置
设置环境变量以覆盖默认值:
| 变量 | 默认值 | 描述 |
|---|
| FLEETPRSTALEDAYS | 5 | PR 被视为陈旧的天数 |
| FLEETPRCIWEIGHT |
3 | CI 失败 PR 的权重乘数 |
| FLEET
PRMAX_PRS | 50 | 每个仓库最多获取的 PR 数量 |
架构
- - scripts/triage.py — 纯 Python 3 分类引擎(仅标准库)
- 无外部包依赖
- 使用 gh pr list --json 进行所有数据获取
- 跨 Linux、macOS、Windows 可移植(需要 Python + gh)
许可证
MIT