Review a pull request diff against its stated purpose and project standards, separating blocking issues from suggestions and ending with a merge recommendation.
Review the pull request below. Focus on what the diff changes, judge it against the PR's stated purpose and the project's standards, and end with a clear recommendation. Do not compute code metrics you cannot measure; use tool output only when it is supplied. ## Inputs PR title and description, including linked issue: [PR_DESCRIPTION] Unified diff: [DIFF] Relevant unchanged context (callers, interfaces, schemas): [CONTEXT] Project coding standards or lint configuration: [STANDARDS] CI results and static-analysis output, if available: [TOOL_OUTPUT] ## Instructions 1. Summarize what the PR changes and whether the diff matches its stated purpose. Flag unrelated changes that should be split out. 2. Look for bugs and code smells introduced by the diff: incorrect logic, missing error handling, broken backward compatibility, migrations that cannot roll back. 3. Perform a basic security pass on changed code: injection, authorization, secrets, unsafe deserialization, exposure of personal data. 4. Assess performance impact of changed code paths, such as new queries in loops or missing indexes for new query patterns. 5. Check compliance with [STANDARDS]. Leave pure formatting issues to automated tools. 6. Check tests: do new or changed behaviors have tests, and do the tests assert the behavior rather than the implementation? 7. If [TOOL_OUTPUT] contains complexity or coverage figures, interpret them; otherwise do not estimate cyclomatic complexity, Halstead measures or a maintainability index. ## Return A Markdown report with these sections: - **Summary**: purpose, scope and whether the diff matches it - **Blocking issues**: must be fixed before merge, each with file:line, problem, suggested change - **Non-blocking suggestions** - **Security and compliance notes** - **Tests**: missing cases - **Tool results**: interpretation of supplied CI/static-analysis output, or "not supplied" - **Recommendation**: approve, approve with suggestions, or request changes, with the reason ## Acceptance checks - Every blocking issue references a changed line in the diff. - No metric appears unless it comes from [TOOL_OUTPUT]. - The recommendation is consistent with the blocking issues listed.
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
PR: "Add discount code support to checkout (#412)"
Diff: adds a discount_code column via migration, a POST /checkout/apply-discount handler that runs db.query("SELECT * FROM discounts WHERE code = '" + body.code + "'"), and a frontend input; also renames a CSS class in an unrelated header component
Context: discounts table has columns code, percent_off, expires_at
Standards: ESLint config in repo; all handlers must use the validate() middleware
Tool output: CI green; ESLint reports 0 errorsA report whose blocking issues include the string-concatenated SQL in the new handler (with a parameterized fix), the handler skipping validate() as required by the standards, and no check of expires_at; a non-blocking note that the header CSS rename is unrelated and could be split out; a tests section requesting cases for expired and unknown codes; a tool section noting CI and ESLint passed but do not cover the injection; and a "request changes" recommendation. No complexity or maintainability index values are reported because none were supplied. Illustrative expectation, not a recorded model run.
Ask questions or share concrete improvements.
No comments yet.
Sign in to join the discussion.
Guides for adapting and checking prompts: