Review Pull Requests
Review open pull requests on a GitHub repository, creating detailed markdown review files.
Arguments
Parse from $ARGUMENTS:
- •
--repo- Repository to review (default: current repo viagh repo view --json nameWithOwner -q .nameWithOwner) - •
--output- Output directory for reviews (default:pr-reviews)
Instructions
- •
Parse arguments from: $ARGUMENTS
- •
Determine repository: If no
--repoprovided, get current repo:bashgh repo view --json nameWithOwner -q .nameWithOwner
- •
Create output directory if it doesn't exist
- •
Fetch open PRs:
bashgh pr list --repo <repo> --state open --json number,title,author,mergeable --limit 100
- •
Filter PRs:
- •Skip PRs with
mergeable: "CONFLICTING" - •Report which PRs were skipped due to conflicts
- •Skip PRs with
- •
Ask how many PRs to review using AskUserQuestion:
- •Show the total number of mergeable PRs available
- •Options: "All (Recommended)", "5", "10", "20"
- •Default/first option should be "All"
- •
Clean up merged PR reviews:
- •Check existing
.mdfiles in the output directory - •For each file named
<number>.md, check if that PR is still open - •Delete review files for PRs that have been merged or closed
- •Report which files were cleaned up
- •Check existing
- •
Review each PR in parallel using the Task tool with
subagent_type: general-purpose. Each subagent should:- •Fetch PR details:
gh pr view <number> --repo <repo> - •Fetch PR diff:
gh pr diff <number> --repo <repo> - •Analyze the changes thoroughly
- •Write a review to
<output>/<number>.mdwith the format from review-template.md
- •Fetch PR details:
- •
Report results with a summary table:
PR Title Author Recommendation #123 Title author Approve/Request Changes/Needs Discussion Include counts: total reviewed, approved, needs changes, skipped due to conflicts, cleaned up.