mirror of
https://github.com/vinta/awesome-python.git
synced 2026-02-06 04:06:13 +08:00
refactor: replace single PR review with bulk review command
Replace review-pr command with review-pending-prs to enable efficient batch review of open PRs. New command fetches up to 10 unreviewed PRs, performs automated checks, and provides bulk actions (close rejected, label approved, request fixes). 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
65
.claude/commands/review-pending-prs.md
Normal file
65
.claude/commands/review-pending-prs.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# Review Pending PRs
|
||||
|
||||
Review pending PRs against [CONTRIBUTING.md](../../CONTRIBUTING.md) acceptance criteria.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/review-pending-prs
|
||||
```
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Fetch open PRs (skip reviewed): `gh pr list --repo vinta/awesome-python --limit 20 --json number,title,author,url,labels --jq '[.[] | select(.labels | map(.name) | index("claude reviewed") | not)] | .[:10]'`
|
||||
2. For each PR:
|
||||
- Fetch PR details: `gh pr view <number> --repo vinta/awesome-python --json title,body,author,files,url,mergeable,mergeStateStatus`
|
||||
- Fetch PR diff: `gh pr diff <number> --repo vinta/awesome-python`
|
||||
- For each project added, fetch repo stats: `gh api repos/<owner>/<repo> --jq '{stars: .stargazers_count, created: .created_at, updated: .pushed_at, language: .language, archived: .archived}'`
|
||||
3. Review against all criteria in [CONTRIBUTING.md](../../CONTRIBUTING.md)
|
||||
4. Present summary table of 10 PRs with recommendations
|
||||
5. Ask user:
|
||||
|
||||
```
|
||||
Would you like me to:
|
||||
|
||||
1. Close the rejected PRs with comments?
|
||||
2. Add "claude reviewed" label to the approved PRs?
|
||||
3. Add comments to PRs need to be fixed?
|
||||
```
|
||||
|
||||
## Quick Rejection Checks
|
||||
|
||||
Check these rules first - if any fail, recommend rejection:
|
||||
|
||||
- Add more than one project per PR
|
||||
- Duplicate of existing entry
|
||||
- Placed under an inappropriate category
|
||||
- Project is archived or abandoned (no commits in 12+ months)
|
||||
- No documentation or unclear use case
|
||||
- Less than 100 GitHub stars AND not justified as a hidden gem
|
||||
- PR has merge conflicts (notify author to resolve)
|
||||
|
||||
## Output Format
|
||||
|
||||
Provide a simple review:
|
||||
|
||||
1. **Rejection Check** - table with the 3 rules and PASS/FAIL
|
||||
2. **Recommendation** - APPROVE for further review, or REJECT with reason
|
||||
|
||||
## Closing PRs
|
||||
|
||||
If user asks to close/reject:
|
||||
|
||||
```bash
|
||||
gh pr close <number> --repo vinta/awesome-python --comment "<brief reason>"
|
||||
```
|
||||
|
||||
## Mark as Reviewed
|
||||
|
||||
```bash
|
||||
gh pr edit <number> --repo vinta/awesome-python --add-label "claude reviewed"
|
||||
```
|
||||
|
||||
## Extra Instructions (If Provided)
|
||||
|
||||
$ARGUMENTS
|
||||
@@ -1,48 +0,0 @@
|
||||
# Review PR Command
|
||||
|
||||
Review a PR against [CONTRIBUTING.md](../../CONTRIBUTING.md) acceptance criteria.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/review-pr <pr-url>
|
||||
```
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Read [CONTRIBUTING.md](../../CONTRIBUTING.md) for current review criteria
|
||||
2. Extract PR number from argument (supports full URL or just number)
|
||||
3. Fetch PR details: `gh pr view <number> --repo vinta/awesome-python --json title,body,author,files,url`
|
||||
4. Fetch PR diff: `gh pr diff <number> --repo vinta/awesome-python`
|
||||
5. For each project added, fetch repo stats: `gh api repos/<owner>/<repo> --jq '{stars: .stargazers_count, created: .created_at, updated: .pushed_at, language: .language, archived: .archived}'`
|
||||
6. Review against all criteria in CONTRIBUTING.md
|
||||
|
||||
## Quick Rejection Checks
|
||||
|
||||
Check these rules first - if any fail, recommend rejection:
|
||||
|
||||
- Add more than one project per PR
|
||||
- Duplicate of existing entry
|
||||
- Placed under an inappropriate category
|
||||
- Project is archived or abandoned (no commits in 12+ months)
|
||||
- No documentation or unclear use case
|
||||
- Less than 100 GitHub stars AND not justified as a hidden gem
|
||||
|
||||
## Output Format
|
||||
|
||||
Provide a simple review:
|
||||
|
||||
1. **Rejection Check** - table with the 3 rules and PASS/FAIL
|
||||
2. **Recommendation** - APPROVE for further review, or REJECT with reason
|
||||
|
||||
## Closing PRs
|
||||
|
||||
If user asks to close/reject:
|
||||
|
||||
```bash
|
||||
gh pr close <number> --repo vinta/awesome-python --comment "<brief reason>"
|
||||
```
|
||||
|
||||
Keep rejection comments short and reference CONTRIBUTING.md.
|
||||
|
||||
$ARGUMENTS
|
||||
Reference in New Issue
Block a user