| name | review-pr |
| description | PR code review. Input URL → code analysis → post structured review comment + save MD. Auto-detects domain (backend/frontend/PLC). Usage: /review-pr <PR_URL> |
| argument-hint | <pr_url> [--no-post] [--no-save] |
| allowed-tools | Bash(python3 *), Read, Grep, WebFetch |
/review-pr - PR Code Review
Analyzes code from a Bitbucket PR URL and automatically posts structured review comments to the PR. Auto-detects the code domain (backend, frontend, PLC) from file extensions in the diff.
Options
| Option | Description |
|---|
| (none) | Review + post PR comment + save local MD |
--no-post | Skip posting PR comment (analysis only) |
--no-save | Skip saving local MD file |
Required Execution Workflow
Follow the steps below in order. Do not skip any step.
Step 1: Parse Arguments
Parse the PR URL and options from user input.
Input: <pr_url> [--no-post] [--no-save]
Step 2: Fetch PR Data
python3 scripts/review_pr.py fetch <pr_url>
Analyze the JSON output. If a diff_file key exists, the diff was saved to a separate file — read it using the Read tool.
Step 3: Auto-Detect Domain & Analyze Code
- Read the entire diff and detect the primary domain from file extensions:
- Backend:
.py, .go, .java, .cs, .rb, .rs, .sql, .env, Dockerfile
- Frontend:
.tsx, .jsx, .ts (in src/components/), .css, .scss, .vue, .svelte
- PLC:
.ST, .st, .xml (PLCOpen format)
- Mixed/General: Falls back to the generic review rubric
- Load the appropriate domain reference file:
- Analyze the diff using the domain-specific review perspectives.
- Review the target branch history for related commits to understand root cause.
- Write a structured review following the domain reference's output format.
- Save to
/tmp/review_pr_{id}.md as a temp file.
Review language: Write the review in Korean.
Step 4: Post Comment to PR
Execute only if --no-post option is NOT present.
python3 scripts/review_pr.py comment <pr_url> < /tmp/review_pr_{id}.md
Step 5: Save Local MD
Execute only if --no-save option is NOT present.
- Get filename info:
python3 scripts/review_pr.py save <pr_url>
- Save the
/tmp/review_pr_{id}.md content to reviews/{filename}. Create the reviews/ directory if it doesn't exist.
Step 6: Summary
Show the user a summary of results:
- PR info reviewed (title, branch, author)
- Number of issues found (must-fix before merge / suggested improvements)
- Final verdict (APPROVED / APPROVED with suggestions / CHANGES REQUESTED)
- Comment posting status and URL
- MD save path
Resources