2.2 KiB
2.2 KiB
description, argument-hint
| description | argument-hint |
|---|---|
| Conducts an automated review of a GitHub Pull Request. | [PR number or URL] |
/reviewPR
This command conducts a comprehensive review of a GitHub Pull Request. If no PR number or URL is provided as an argument ($1), it attempts to find the PR associated with the current git branch.
When to use
- Use when: The user explicitly asks to review a pull request, e.g., "review this PR", "can you check PR #123?".
- Suggest when: The user mentions merging code, a pull request, or asks for a code quality check on a branch that has an open PR.
- Example: "User: My feature is ready for review." -> Assistant checks for a PR and suggests
/reviewPR. - Example: "User: /reviewPR 123"
Actions
-
Step 1: Obtain PR Information
- If an argument (
$1) is provided, use it as the PR identifier. - If no argument is provided, use a
workeragent to rungh pr statusto find the current branch's PR number. - If no PR is found, inform the user and stop.
- Use a
workeragent to rungh pr view <PR_NUMBER> --json ...andgh pr diff <PR_NUMBER>in parallel to fetch PR details.
- If an argument (
-
Step 2: Parallel Analysis Phase
- Deploy
investigatoragents concurrently to analyze different aspects of the PR: - Investigator A (Code Quality): Analyze style inconsistencies, complexity, duplication, naming, and error handling.
- Investigator B (Architecture): Verify alignment with project structure, new dependencies, design patterns, and separation of concerns.
- Investigator C (Tests & Docs): Check for appropriate test coverage and documentation updates.
- Deploy
-
Step 3: Synthesize and Generate Report
- Integrate the findings from all investigators.
- Categorize issues by severity (Critical, Important, Suggestion).
- Generate a structured review comment in Markdown format, including a summary, detailed recommendations, and an overall assessment.
-
Step 4: Submit Review
- Use the
AskUserQuestiontool to show the generated review to the user and ask for confirmation before submitting. - If confirmed, use a
workeragent to rungh pr review <PR_NUMBER> --<state> --body "<comment>"to post the review to GitHub.
- Use the