nemoclaw-maintainer-find-review-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFind PR to Review
查找待评审PR
Search for open PRs labeled + , associate each with its linked issue, detect duplicates (multiple PRs targeting the same issue), and present a clean summary so you can decide what to review or close.
securitypriority: high搜索带有和标签的开放PR,将每个PR与其关联的Issue绑定,检测重复项(多个针对同一Issue的PR),并生成清晰的汇总信息,帮助你决定评审或关闭哪些PR。
securitypriority: highPrerequisites
前置条件
- (GitHub CLI) must be installed and authenticated.
gh - You must be in a GitHub repository (or the user must specify ).
OWNER/REPO
- 必须安装并认证(GitHub CLI)。
gh - 你需要处于某个GitHub仓库中(或者用户必须指定)。
OWNER/REPO
Step 1: Fetch candidate PRs
步骤1:获取候选PR
List all open PRs that carry both the and labels:
securitypriority: highbash
gh pr list --label security --label "priority: high" --state open --limit 50 --json number,title,author,headRefName,labels,body,createdAtIf the result is empty, report that there are no matching PRs and stop.
列出所有同时带有和标签的开放PR:
securitypriority: highbash
gh pr list --label security --label "priority: high" --state open --limit 50 --json number,title,author,headRefName,labels,body,createdAt如果结果为空,报告没有匹配的PR并停止操作。
Step 2: Extract linked issues
步骤2:提取关联Issue
For each PR, parse the body for linked issue references. Look for these patterns (case-insensitive):
- ,
Fixes #NNN,Closes #NNNResolves #NNN - /
Related Issuesection containingLinked Issue#NNN - Issue number in the PR title, e.g. suffix
(#NNN) - Branch name containing an issue number, e.g.
fix/something-NNN
Build a mapping: .
PR# → [issue numbers]If a PR has no detectable linked issue, mark it as .
(no linked issue)针对每个PR,解析其内容以查找关联的Issue引用。查找以下模式(不区分大小写):
- 、
Fixes #NNN、Closes #NNNResolves #NNN - 包含的
#NNN/Related Issue章节Linked Issue - PR标题中的Issue编号,例如后缀
(#NNN) - 包含Issue编号的分支名称,例如
fix/something-NNN
构建映射关系:。
PR# → [Issue编号列表]如果某个PR无法检测到关联Issue,标记为。
(no linked issue)Step 3: Detect duplicates
步骤3:检测重复项
Group PRs by linked issue number. Any issue with two or more open PRs is a duplicate group.
For each duplicate group, fetch a brief summary of each competing PR to help the user decide which to keep:
bash
gh pr view <number> --json number,title,author,createdAt,additions,deletions,reviewDecision,statusCheckRollup --jq '{number,title,author: .author.login,created: .createdAt,additions,deletions,review: .reviewDecision,checks: [.statusCheckRollup[]?.conclusion] | unique}'按关联的Issue编号对PR进行分组。任何拥有两个或更多开放PR的Issue都属于重复组。
针对每个重复组,获取每个竞争PR的简要摘要,帮助用户决定保留哪一个:
bash
gh pr view <number> --json number,title,author,createdAt,additions,deletions,reviewDecision,statusCheckRollup --jq '{number,title,author: .author.login,created: .createdAt,additions,deletions,review: .reviewDecision,checks: [.statusCheckRollup[]?.conclusion] | unique}'Step 4: Check for superseded PRs
步骤4:检查被替代的PR
Also flag PRs whose body contains phrases like:
- /
follow-up to #NNN/supersedes #NNN/replaces #NNNfolds in #NNN
where is another open PR number in the candidate list. These indicate one PR has absorbed another.
#NNN同时标记内容中包含以下短语的PR:
- /
follow-up to #NNN/supersedes #NNN/replaces #NNNfolds in #NNN
其中是候选列表中的另一个开放PR编号。这些短语表示一个PR已经整合了另一个PR的内容。
#NNNStep 5: Present results
步骤5:展示结果
Duplicates / Superseded
重复项/被替代PR
If duplicates or superseded PRs exist, present them first in a table:
markdown
undefined如果存在重复PR或被替代PR,首先以表格形式展示:
markdown
undefinedDuplicate PRs (same issue)
重复PR(同一Issue)
| Issue | PR | Author | Title | +/- | Status |
|---|---|---|---|---|---|
| #804 | #1121 | user1 | ... | +50/-10 | Checks passing |
| #804 | #1300 | user2 | ... | +80/-20 | Checks failing |
Recommendation: #1121 is smaller and passing checks — consider closing #1300.
For superseded PRs:
```markdown| Issue | PR | 作者 | 标题 | +/- | 状态 |
|---|---|---|---|---|---|
| #804 | #1121 | user1 | ... | +50/-10 | 检查通过 |
| #804 | #1300 | user2 | ... | +80/-20 | 检查失败 |
建议: #1121改动更小且检查通过——考虑关闭#1300。
对于被替代PR:
```markdownSuperseded PRs
被替代PR
- #1416 supersedes/folds in #1392 (shell-quote sandboxName) → Consider closing #1392 if #1416 covers its scope.
undefined- #1416 替代/整合了 #1392(shell-quote sandboxName) → 如果#1416覆盖了#1392的范围,考虑关闭#1392。
undefinedClean candidates
无重复候选PR
Present non-duplicate PRs in a table:
markdown
undefined以表格形式展示无重复的PR:
markdown
undefinedReview candidates (no duplicates)
评审候选(无重复)
| PR | Issue | Title | Author | Age |
|---|---|---|---|---|
| #1476 | #577 | disable remote uninstall fallback | user1 | 2d |
| #1121 | #804 | Landlock read-only /sandbox | user2 | 6d |
undefined| PR | Issue | 标题 | 作者 | 时长 |
|---|---|---|---|---|
| #1476 | #577 | 禁用远程卸载回退 | user1 | 2天 |
| #1121 | #804 | Landlock 只读/sandbox | user2 | 6天 |
undefinedSummary line
总结建议
End with a one-line recommendation of which PR to review first, preferring:
- Older PRs (waiting longest)
- PRs with passing checks
- PRs with smaller diff size (easier to review)
最后给出一行关于优先评审哪个PR的建议,优先级如下:
- 更早的PR(等待时间最长)
- 检查通过的PR
- 差异内容更小的PR(更容易评审)
Notes
注意事项
- Do NOT automatically close any PRs. Only present findings and recommendations.
- If the user specifies additional filters (e.g., a specific scope label like ), apply them.
OpenShell - If the user asks for a different priority label, adjust accordingly.
- 不要自动关闭任何PR。仅展示发现的问题和建议。
- 如果用户指定额外的筛选条件(例如,特定范围标签如),请应用这些条件。
OpenShell - 如果用户要求使用不同的优先级标签,请相应调整。