关于 stale-pr-reminder
stale-pr-reminder 是用于检查仓库开放 Pull Request 并生成优先级报告的技能。它依据 PR 年龄、更新情况、评审关注度和合并冲突进行分类。
主要功能
- 01按陈旧程度分类 PR
- 02检查创建与更新时间
- 03考虑评审评论和合并冲突
- 04生成分组链接报告
- 05默认排除机器人 PR
适用场景
- 01安排逾期 PR 跟进优先级
- 02查找等待评审的 PR
- 03识别有合并冲突的旧 PR
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ oschina/ gitee-agent-skills --skill stale-pr-reminder安装后在 Claude Code 中输入/stale-pr-reminder确认已加载。
详细介绍
陈旧 PR 提醒
扫描代码仓库中的陈旧 Pull Request,并生成按优先级排序的行动报告。
什么是“陈旧 PR”?
陈旧 PR 是指符合以下情况的 Pull Request:
- 已打开很长时间,且没有更新
- 尚未获得审查者关注
- 存在尚未解决的合并冲突
陈旧程度
| 级别 | 时长 | 操作 |
|---|---|---|
| 🔴 严重 | > 28 天 | 关闭或返工 |
| 🟠 高 | > 14 天未更新 | 提醒作者 |
| 🟡 中等 | > 7 天未审查 | 指派审查者 |
| 🟢 轻微 | > 3 天无活动 | 观察 |
| ✅ 最新 | < 3 天 | 无需操作 |
步骤
步骤 1:获取已打开的 PR
调用 list_repo_pulls 获取所有已打开的 PR:
INPUT:
- owner: repository owner
- repo: repository name
- state: "open"
- sort: "created"
- direction: "asc"
- per_page: 100
步骤 2:获取 PR 详情
对每个 PR 调用 get_pull_detail:
EXTRACT:
- number: PR number
- title: PR title
- user.login: author username
- created_at: creation timestamp
- updated_at: last update timestamp
- mergeable: false = has conflicts
- draft: is draft PR
步骤 3:获取评论(可选)
调用 list_comments(resource_type: pull)检查审查活动:
ANALYZE:
- has_reviewer_comments: any comment from non-author
- last_comment_date: most recent comment timestamp
步骤 4:计算陈旧程度
无需执行代码。AI 可以直接解析时间戳。
今天的日期:2026-03-17
对每个 PR:
- 解析
created_at(格式:YYYY-MM-DDTHH:MM:SSZ,例如:2026-01-15T10:30:00Z) - 以相同方式解析
updated_at - 计算 created_at 与今天(2026-03-17)之间的天数
- 计算 updated_at 与今天之间的天数
- 检查
mergeable: false(存在冲突) - 检查
draft: true
分类规则:
critical:时长 > 28 天severe:时长 > 14 天且距上次更新 > 14 天moderate:时长 > 7 天且没有审查者评论mild:时长 > 3 天且距上次更新 > 3 天fresh:其他情况
步骤 5:生成报告
创建包含链接的分组报告:
## Stale PR Report: {owner}/{repo}
### Critical (> 28 days)
| PR | Title | Age | Author |
|----|-------|-----|--------|
| [#{num}](https://gitee.com/{owner}/{repo}/pulls/{num}) | {title} | {age}d | @{author} |
### Severe (> 14 days no update)
| PR | Title | Age | Last Update |
|----|-------|-----|-------------|
| [#{num}](https://gitee.com/{owner}/{repo}/pulls/{num}) | {title} | {age}d | {days}d ago |
### Moderate (> 7 days no review)
| PR | Title | Age |
|----|-------|-----|
| [#{num}](https://gitee.com/{owner}/{repo}/pulls/{num}) | {title} | {age}d |
### Summary
- Critical: {count}
- Severe: {count}
- Moderate: {count}
- Fresh: {count}
使用示例
示例 1:基本检查
User: "Check for stale PRs in myrepo"
AI: Scanning myrepo...
Found 10 open PRs:
- 2 Critical (> 28 days)
- 3 Severe (> 14 days)
- 5 Moderate (> 7 days)
[Shows report]
示例 2:检查特定作者
User: "Are there any stale PRs from @alice?"
AI: Found 2 stale PRs from @alice:
- PR #42: 25 days old, needs rebase
- PR #45: 12 days old, waiting for review
注意事项
- 提及陈旧 PR 时保持委婉
- 默认排除机器人 PR(dependabot、renovate)
- 尊重“wip”“draft”“on-hold”标签
评论
支持 Markdown