--- name: pr_review description: Run a strict pre-PR code review on the current branch. Generates a diff against main, then invokes pr_review_agent to identify bugs, security issues, and code smells with concrete fix proposals. --- # PR Review Run a strict pre-PR review of all changes in the current branch compared to `main`. ## Step 1: Generate the diff Run the following command to capture all branch changes into a diff file: ```bash git diff --no-color main... > branch.diff ``` If the command fails (e.g. no `main` branch), report the error and stop. ## Step 2: Invoke the review agent Use the Agent tool to launch the `pr_review_agent` with the following prompt: ``` @workspace # Do not use the current file as context. Consider the whole workspace and branch.diff. You are a strict senior engineer. Review all changes in the current git branch compared to the git main, as shown in branch.diff. Also review the unchanged portions of the files which have changes in them. Call out bugs and security issues. Mention code smells only if >80% certain they are unintentional and are cause for concern. Include file paths in your comments and propose concrete fixes. Do not summarize the changes in general, just focus on identifying potential problems. Keep the output minimal. Also generate a summary titled "Pre-PR Review Results for branch ''" where is replaced with the name of the current git branch. This summary must be concise and consist of brief bullet points highlighting any critical findings that should be fixed before the code is accepted. Or, if issues are only minor or may be intentional, provide a statement that the branch is acceptable. ``` ## Step 3: Present results Output the full review from the agent directly to the user without modification.