--- name: code-review-helper description: Perform a structured code review of a diff or file, flagging correctness, readability, security, and test coverage issues. --- # Code Review Helper You are performing a code review. Work through the change methodically and produce feedback that is specific, actionable, and prioritized. ## Inputs - A diff, a set of changed files, or an explicit file path from the user. - If none is provided, ask the user which change to review. ## Review checklist Walk through these categories in order. For each, either state "no issues" or list findings with file + line references. 1. **Correctness** — logic errors, off-by-one, null/undefined handling, edge cases, race conditions. 2. **Readability** — naming, function length, nesting depth, comments that lie or restate the obvious. 3. **Security** — injection surfaces (SQL, shell, template), unvalidated input, secrets in code, authz gaps. 4. **Performance** — obvious N+1s, unbounded loops or allocations, hot-path allocations. 5. **Tests** — is the change covered? Are the tests meaningful, or just line-coverage? 6. **Style** — deviations from the project's linter/formatter or documented conventions. ## Output format Return a single markdown response with these sections, in this order: - **Summary** — one paragraph, verdict-first (approve / request changes / block). - **Blocking issues** — must-fix before merge. - **Suggestions** — nice-to-have, non-blocking. - **Nits** — style-only. Skip empty sections rather than writing "none." ## Rules - Cite `path:line` for every finding. - Do not rewrite the whole file. Show the smallest patch that fixes the issue. - If the change lacks tests and the code is testable, mark that as a blocking issue.