code-review

A checklist for reviewing code changes against the rules and standards of a software project before they are merged or released.

In plain words
What is it for?
Use it to review current changes or a feature branch, identify the affected files and applicable rules, and include available SonarQube scan results, where SonarQube is a code-quality analysis tool.
Why use it?
It helps find bugs, rule violations, and risky changes early, while keeping review findings focused and actionable.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/e-gov/cursor-prompts/code-review
Clone the repo
git clone --depth 1 https://github.com/e-gov/cursor-prompts
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 745 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00745
Opus 5 $0.00000 $0.00373
Sonnet 5 $0.00000 $0.00149
Haiku 4.5 $0.00000 $0.00075

Measured 2d ago against content hash 6c140e816f10, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/code-review.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Review Guide

Objective

Ensure every change is checked against the workspace's full rule set so issues are found early, fixes are targeted, and merges remain low-risk.

When to Run This Checklist

  • A user explicitly requests a review (e.g., “Enter Code Review Mode: …”).
  • A feature branch is ready for feedback before merge or release.
  • You discover unexpected changes and need to assess their safety.

Review Workflow

  1. Confirm Scope

    • Ask which files/commits to inspect; default to all current changes (git diff --name-only HEAD).
    • Note each file's role (source, config, doc, test, infra) to understand which rules will apply.
  2. List Applicable Rules

    • Collect all rule sources: always-applied rules, .cursor/rules/**/*.mdc, team guidelines, coding standards.
    • If a SonarQube MCP server is available in the session, run a SonarQube scan on the target scope and include findings in this review.
    • Map SonarQube issues by rule key/severity to the same checklist format and deduplicate overlaps with manual findings.
    • If the SonarQube MCP server is not configured or unavailable, explicitly note this and continue with rule-based review.
    • Build a quick checklist grouped into standards, architecture, framework usage, performance, security, testing, documentation.
  3. Inspect Each File

    • For every applicable rule, decide: compliant, partial, or non-compliant.
    • Capture references (line numbers, behaviors) for both strengths and issues.
    • Assign severity:
      • Critical – security/correctness/data loss.
      • High – significant standard violations or likely bugs.
      • Medium – maintainability, clarity, missing tests.
      • Low – style or minor consistency improvements.
  4. Summarize Findings

    • Use a concise per-file summary such as:
      ### File: path/to/file.ext
      
      - Overall: Minor issues
      - Critical: 0, High: 1, Medium: 2, Low: 0
        **Key Findings**
      - [High] Architecture – Direct API call from component (rule 010-architecture)
      - [Medium] Testing – No regression test for new branch
        **Suggested Fixes**
      
      1. Move API call into existing service layer.
      2. Add unit test covering the new edge case.
      
    • Reference the exact rule or guideline behind each issue.

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 71 lines · 0 tokens per session scan A 6c140e816f10

Subscribe to this mod's changes

code-review is a command published in the GitHub repository e-gov/cursor-prompts (34 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 745 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.