Skip to content

Commit 0d53c4f

Browse files
vintaclaude
andcommitted
docs: optimize PR review workflow for efficiency
Improve the PR review command workflow to reduce API calls and clarify the review process: - Fetch PR details in single call (combine list + view data) - Add quick rejection checks before API calls (conflicts, duplicates) - Simplify terminology (APPROVE/REJECT -> PASS/REJECT) - Streamline section headers for clarity - Remove gh pr view from allowed tools (redundant with list) This reduces unnecessary GitHub API calls and makes the review process more efficient. Co-Authored-By: Claude <[email protected]>
1 parent 55c7a04 commit 0d53c4f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.claude/commands/review-pending-prs.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Review pending PRs against CONTRIBUTING.md acceptance criteria.
3-
allowed-tools: Bash(gh api:*), Bash(gh pr close:*), Bash(gh pr diff:*), Bash(gh pr edit:*), Bash(gh pr list:*), Bash(gh pr view:*)
3+
allowed-tools: Bash(gh api:*), Bash(gh pr close:*), Bash(gh pr diff:*), Bash(gh pr edit:*), Bash(gh pr list:*)
44
---
55

66
## Usage
@@ -11,20 +11,23 @@ allowed-tools: Bash(gh api:*), Bash(gh pr close:*), Bash(gh pr diff:*), Bash(gh
1111

1212
## Instructions
1313

14-
1. Fetch 10 open PRs (skip reviewed): `gh pr list --repo vinta/awesome-python --limit 10 --search "-label:\"claude reviewed\"" --json number,title,author,url`
15-
2. For each PR:
16-
- Fetch PR details: `gh pr view <number> --repo vinta/awesome-python --json title,body,author,files,url,mergeable,mergeStateStatus`
17-
- Fetch PR diff: `gh pr diff <number> --repo vinta/awesome-python`
18-
- 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}'`
19-
3. Review against all criteria in [CONTRIBUTING.md](../../CONTRIBUTING.md)
20-
4. Present summary table of 10 PRs with recommendations
21-
5. Ask user:
14+
1. Fetch 10 open PRs with details: `gh pr list --repo vinta/awesome-python --limit 10 --search "-label:\"claude reviewed\"" --json number,title,author,url,body,files,mergeable,mergeStateStatus`
15+
2. Fetch all PR diffs in parallel: `gh pr diff <number> --repo vinta/awesome-python`
16+
3. Run quick rejection checks (no API calls needed):
17+
- Has merge conflicts? (from `mergeable`/`mergeStateStatus`)
18+
- Adds more than one project? (from diff)
19+
- Duplicate entry? (from diff - URL already in README)
20+
- Not a project submission? (from diff - e.g., random files, contributor list)
21+
4. For PRs passing quick checks, fetch repo stats: `gh api repos/<owner>/<repo> --jq '{stars: .stargazers_count, created: .created_at, updated: .pushed_at, language: .language, archived: .archived}'`
22+
5. Review against all criteria in [CONTRIBUTING.md](../../CONTRIBUTING.md)
23+
6. Present summary table with recommendations
24+
7. Ask user:
2225

2326
```
2427
Would you like me to:
2528
2629
1. Close the rejected PRs with comments?
27-
2. Add "claude reviewed" label to the approved PRs?
30+
2. Add "claude reviewed" label to the passed PRs?
2831
3. Do all
2932
```
3033

@@ -44,18 +47,18 @@ Check these rules first - if any fail, recommend rejection:
4447

4548
Provide a simple review:
4649

47-
1. **Rejection Check** - table with the above rules and PASS/FAIL
48-
2. **Recommendation** - APPROVE or REJECT
50+
1. **Rejection Check** - table with the above rules and PASS/REJECT
51+
2. **Recommendation** - PASS or REJECT
4952

50-
## Closing PRs
53+
## Close PRs
5154

5255
If user asks to close/reject:
5356

5457
```bash
5558
gh pr close <number> --repo vinta/awesome-python --comment "<brief reason>"
5659
```
5760

58-
## Mark as Reviewed
61+
## Mark as Passed
5962

6063
```bash
6164
gh pr edit <number> --repo vinta/awesome-python --add-label "claude reviewed"

0 commit comments

Comments
 (0)