| name | itx:review-pr |
| description | Request code review for a pull request |
| argument-hint | [pr-number] |
name: itx:review-pr
PR Review
Request a code review for a pull request.
Instructions
-
Identify PR:
-
Get PR Details:
gh pr view <number> --json number,title,body,files,additions,deletions
gh pr diff <number>
-
Check Review Configuration:
ITX_CONFIG="$(git rev-parse --show-toplevel)/.claude/itx-config.json"
if [ -f "$ITX_CONFIG" ]; then
REVIEW_ENABLED=$(jq -r '.mcp.review_enabled // false' "$ITX_CONFIG")
REVIEW_TOOL=$(jq -r '.mcp.review_tool // "mcp__atx__request_review"' "$ITX_CONFIG")
else
REVIEW_ENABLED="false"
fi
-
Execute Review:
If MCP Review Enabled
Use the configured MCP tool for automated review:
# Use the tool specified in config (default: mcp__atx__request_review)
$REVIEW_TOOL(prompt="Review PR #<number>")
Process Review Results:
- If rating <= 3/5 or blocking issues exist:
- List issues to fix
- Recommend specific changes
- If rating > 3/5 and no blockers:
Report:
## Automated Review Summary
**PR**: #<number> - <title>
**Rating**: <X>/5
### Blocking Issues
<table or "None">
### Warnings
<list or "None">
### Suggestions
<list or "None">
### Verdict
<READY FOR MERGE / NEEDS CHANGES>
If MCP Review Not Enabled (Manual Review)
Perform manual review using checklist:
Review Checklist:
-
Code Quality:
-
Testing:
-
Documentation:
-
Architecture:
-
PR Hygiene:
Report:
## Manual Review Summary
**PR**: #<number> - <title>
### Review Checklist Results
#### Code Quality: /
<findings>
#### Testing: /
<findings>
#### Documentation: /
<findings>
#### Architecture: /
<findings>
#### PR Hygiene: /
<findings>
### Issues to Address
<list blocking issues or "None">
### Suggestions
<list improvements or "None">
### Verdict
<READY FOR MERGE / NEEDS CHANGES>
-
Add Review Comment (for both modes):
Post review summary as PR comment:
gh pr comment <number> --body "<review summary from above>"
-
Update Issue Status (if configured):
ITX_CONFIG="$(git rev-parse --show-toplevel)/.claude/itx-config.json"
if [ -f "$ITX_CONFIG" ]; then
PROJECT_ENABLED=$(jq -r '.github.project_board.enabled // false' "$ITX_CONFIG")
if [ "$PROJECT_ENABLED" = "true" ]; then
REMOTE_URL=$(git config --get remote.origin.url)
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's/.*[:/]([^/]+\/[^/]+)(\.git)?$/\1/')
OWNER=$(echo "$OWNER_REPO" | cut -d'/' -f1)
REPO=$(echo "$OWNER_REPO" | cut -d'/' -f2)
PROJECT_ID=$(jq -r '.github.project_board.project_id' "$ITX_CONFIG")
STATUS_FIELD_ID=$(jq -r '.github.project_board.status_field_id' "$ITX_CONFIG")
IN_REVIEW_ID=$(jq -r '.github.project_board.status_options.in_review' "$ITX_CONFIG")
ISSUE_NUM=$(gh pr view <number> --json number --jq '.number')
NODE_ID=$(gh api repos/$OWNER/$REPO/issues/$ISSUE_NUM --jq '.node_id')
ITEM_ID=$(gh api graphql -f query='
query($projectId: ID!, $contentId: ID!) {
node(id: $projectId) {
... on ProjectV2 {
items(first: 100) {
nodes {
id
content {
... on Issue { id }
}
}
}
}
}
}
' -f projectId="$PROJECT_ID" -f contentId="$NODE_ID" | \
jq -r ".data.node.items.nodes[] | select(.content.id == \"$NODE_ID\") | .id")
gh project item-edit --project-id "$PROJECT_ID" --id "$ITEM_ID" \
--field-id "$STATUS_FIELD_ID" --single-select-option-id "$IN_REVIEW_ID"
fi
fi
Configuration
Enable MCP-based automated review in .claude/itx-config.json:
{
"mcp": {
"review_enabled": true,
"review_tool": "mcp__atx__request_review"
}
}
Default (no config): Manual review mode with checklist
See CONFIG.md for full configuration options.
Notes
MCP Review Mode:
- Automated specialist reviews
- Faster turnaround
- Requires MCP server configuration
- Rating-based approval (> 3/5)
Manual Review Mode:
- Comprehensive checklist-based review
- No external dependencies
- Requires human reviewer
- Detailed findings documentation
Best Practices:
- Review promptly after PR creation
- Address all blocking issues before merge
- Use suggestions to improve code quality
- Update PR description with review findings
Prompt Logging
REQUIRED: Append prompt log to .itx/<N>/02_VERIFY.md.
See AGENTS.md for format specification.