Analyze or review a pull request (default: analyze if no action provided)
Analyzes pull requests or submits reviews with approve, request changes, or comment actions.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractary<pr_number> [--action "analyze|approve|request_changes|comment" (default: analyze)] [--comment "<text>"] [--wait-for-ci] [--ci-timeout <seconds>]claude-opus-4-5<CRITICAL_RULES> YOU MUST:
YOU MUST NOT:
WHEN COMMANDS FAIL:
THIS COMMAND IS ONLY A ROUTER. </CRITICAL_RULES>
<WORKFLOW> 1. **Parse user input** - Extract pr_number (required, positional) - Parse optional flag: --action (one of: analyze, approve, request_changes, comment) - Parse optional flag: --comment - If --action not provided, default to "analyze"Determine operation mode
Build structured request
Invoke agent
Handle response
<ARGUMENT_SYNTAX>
This command follows the space-separated argument syntax (consistent with work/repo plugin family):
--flag value (NOT --flag=value)--comment "Great work on this feature!" ✅--comment Great work on this feature! ❌Always use quotes for multi-word values:
✅ /repo:pr-review 456 --action approve --comment "Great work on this feature!"
✅ /repo:pr-review 456 --action request_changes --comment "Please add tests"
❌ /repo:pr-review 456 --action approve --comment Great work on this feature!
Review actions are exact keywords:
analyze (default), approve, request_changes, commentapproved, request-changes, add-comment, reviewExamples:
✅ /repo:pr-review 456
✅ /repo:pr-review 456 --action analyze
✅ /repo:pr-review 456 --action approve
✅ /repo:pr-review 456 --action request_changes --comment "Add tests"
✅ /repo:pr-review 456 --action comment --comment "Nice refactoring"
</ARGUMENT_SYNTAX>
<ARGUMENT_PARSING>
Required Arguments:
pr_number (number): PR number (e.g., 456, not "#456") - positional argumentOptional Arguments:
--action (enum): Action to perform. One of: analyze (default), approve, request_changes, comment
analyze--comment (string): Review comment/feedback, use quotes if multi-word (e.g., "Please add tests for edge cases")--wait-for-ci (boolean flag): Wait for CI workflows to complete before analyzing. Useful when running pr-review immediately after pr-create. No value needed, just include the flag.--ci-timeout (number): Maximum seconds to wait for CI completion (default: 900 = 15 minutes). Only applies when --wait-for-ci is set.--ci-interval (number): Seconds between CI status checks (default: 60). Only applies when --wait-for-ci is set.Maps to: analyze-pr (when action is analyze or not provided) or review-pr (when action is approve/request_changes/comment)
Examples:
/repo:pr-review 456
→ Invoke agent with {"operation": "analyze-pr", "parameters": {"pr_number": "456"}}
/repo:pr-review 456 --action analyze
→ Invoke agent with {"operation": "analyze-pr", "parameters": {"pr_number": "456"}}
/repo:pr-review 456 --action approve --comment "Great work!"
→ Invoke agent with {"operation": "review-pr", "parameters": {"pr_number": "456", "action": "approve", "comment": "Great work!"}}
</ARGUMENT_PARSING>
<EXAMPLES> ## Usage Examples# Analyze PR (default - provides recommendation and options)
/repo:pr-review 456
# Explicitly analyze PR
/repo:pr-review 456 --action analyze
# Analyze PR and wait for CI to complete first (useful after pr-create)
/repo:pr-review 456 --wait-for-ci
# Wait for CI with custom timeout (10 minutes)
/repo:pr-review 456 --wait-for-ci --ci-timeout 600
# Wait for CI with faster polling (every 30 seconds)
/repo:pr-review 456 --wait-for-ci --ci-interval 30
# Approve PR
/repo:pr-review 456 --action approve --comment "LGTM!"
# Approve without comment
/repo:pr-review 456 --action approve
# Request changes
/repo:pr-review 456 --action request_changes --comment "Please add tests"
# Add review comment
/repo:pr-review 456 --action comment --comment "Nice refactoring here"
</EXAMPLES>
<AGENT_INVOCATION>
CRITICAL: After parsing arguments, you MUST actually invoke the Task tool. Do NOT just describe what should be done.
How to invoke: Use the Task tool with these parameters:
Example Task tool invocation (customize based on the specific operation):
Request structure (analyze with wait-for-ci):
{
"operation": "analyze-pr",
"parameters": {
"pr_number": "456",
"wait_for_ci": true,
"ci_polling": {
"interval": 60,
"timeout": 900
}
}
}
Request structure (review):
{
"operation": "review-pr",
"parameters": {
"pr_number": "456",
"action": "approve",
"comment": "Great work!"
}
}
The repo-manager agent will:
wait_for_ci is true, poll until CI completes (or timeout)DO NOT:
<ERROR_HANDLING> Common errors to handle:
Missing PR number:
Error: pr_number is required
Usage: /repo:pr-review <pr_number> [--action "analyze|approve|request_changes|comment"] [--comment "<text>"]
Invalid action:
Error: Invalid action: approved
Valid actions: analyze (default), approve, request_changes, comment
Usage: --action "analyze|approve|request_changes|comment"
PR not found:
Error: Pull request not found: #999
Verify the PR number and try again
</ERROR_HANDLING>
<NOTES> ## Review ActionsThe --wait-for-ci flag enables automatic polling for CI check completion. This is particularly useful when:
pr-review --wait-for-ci immediately after pr-create to wait for CI checks before analyzingpr-create → pr-review without manual timingPolling behavior:
--ci-interval and --ci-timeoutExit conditions:
/repo:pr-comment): General comment on the PRThis command works with:
Platform is configured via /repo:init and stored in .fractary/plugins/repo/config.json.
Related commands:
/repo:pr-create - Create PRs/repo:pr-comment - Add general comments/repo:pr-merge - Merge PRs/repo:init - Configure repo plugin
</NOTES>
/pr-reviewConduct comprehensive PR review from multiple perspectives (PM, Developer, QA, Security)