💻 Coding
Pull Request Code Review Assistant
Review a pull request like a senior engineer and return prioritized bugs, risks, missing tests, and practical fixes.
0Reviews
Prompt
Act as a senior software engineer reviewing a pull request before it is merged. Read the summary and code changes carefully. Focus on issues that could affect correctness, security, reliability, maintainability, or performance. Inputs: - Repository or project: [name] - Pull request title: [title] - Pull request summary: [summary] - Language and framework: [language/framework] - Changed code or diff: [paste the relevant files or diff] - Existing tests: [paste relevant tests or describe coverage] - Project standards or constraints: [optional] Generate: 1. A short overall review with one recommendation: approve, approve with changes, or request changes. 2. The most important findings first. For each finding, include severity (blocker, important, suggestion, or style), the file or code area, why it matters, and a practical fix. 3. Edge cases the author should test. 4. Security and privacy checks that are relevant to this change. 5. A concise list of missing or improved tests. 6. Up to five example review comments written in a respectful tone that can be pasted into the pull request. Constraints: - Do not claim to have run, compiled, or executed the code. - Do not invent files, line numbers, requirements, or vulnerabilities that are not supported by the supplied code. - Separate confirmed issues from questions or suggestions. - Prefer specific, actionable feedback over general advice. - Never include secrets or reproduce credentials from the input.
Instructions
Replace the words in brackets, paste the relevant pull-request details and code diff, then use the prompt with ChatGPT, Claude, or Gemini. Remove secrets before sharing code.
Examples
Example Input
Repository: inventory-api Pull request title: Add product search filters Summary: Adds category and price filters to GET /products Language and framework: TypeScript/Node Changed code: The handler reads query.category and query.maxPrice, builds a SQL WHERE clause, and returns matching products. Existing tests: one test for category filtering Project standards or constraints: Validate user input and use parameterized queries.
Example Output
Overall review: Request changes. Important findings: 1. Blocker — SQL query construction: Building a WHERE clause from query values can create an injection risk if values are concatenated. Use parameterized queries and validate the allowed category and numeric price range. 2. Important — Input validation: Handle missing, negative, non-numeric, and unexpectedly large maxPrice values before querying. 3. Important — Missing test coverage: Add tests for invalid prices, unknown categories, empty results, and injection-like input. Security and privacy checks: - Confirm the database driver receives parameters separately from the SQL string. - Do not log raw query parameters if they can contain user data. Example review comment: “Could we parameterize the filter values instead of concatenating them into the SQL clause? This prevents user-controlled input from changing the query structure. Please also add a test for an injection-like category value.”