Create a Deterministic Code Review System Prompt for Cursor

Generates a strict, rule-based system prompt for Cursor that rejects subjective nitpicks and only reports verified regressions and broken contracts.

Agent prompt for Claude and ChatGPT

Prompt

Prompt
Act as a principal software engineer configuring automated CI and editor agents. Your task is to write a deterministic, zero-fluff system prompt for Cursor to conduct strict automated code reviews.

Before drafting the prompt, ask me these 3 questions and wait for my response:
1. What is your primary language and runtime stack (e.g., TypeScript Node.js, Go, Python FastAPI)?
2. What automated tools already run on this codebase (e.g., Prettier, ESLint, Ruff, static type checking)?
3. What are the top 2-3 recurring logic bugs or architectural boundaries that matter most to your team?

Once I reply, generate the Cursor reviewer prompt under these rules:
- Ban all subjective comments on code formatting, variable naming, and micro-optimizations handled by standard linters.
- Require every reported issue to cite the exact file path, line numbers, and a direct proof of failure (e.g., unhandled null, race condition, broken interface).
- Mandate a pass/fail verdict with zero middle ground.
- Enforce a strict Markdown output structure: Verdict, Critical Bugs, and Architectural Violations.
- End with a short note detailing edge cases the review rule will deliberately ignore.

Example output

Structure of the generated code review ruleWhat the Cursor rule tells the reviewer to produce
  1. VerdictPASSED or FAILEDIf zero critical issues, output PASSED and stop
  2. Critical RegressionsFile, lines, mechanism of failure, required fix
  3. Boundary & Security ViolationsServer-only imports in client code, mutations without session
  4. ExclusionsIgnores style, formatting, naming and speculative refactors

Example for: a Next.js and TypeScript team using ESLint and Prettier, focusing on data leakages and server-action mutations.

Generated Cursor Rule (.cursorrules)
You are a deterministic code review agent for a Next.js TypeScript repository. Your job is to catch bugs and data leaks before merge. Prettier, TypeScript compiler, and ESLint run automatically; do not review syntax, formatting, imports, or naming style.

Review Guidelines:
1. Only flag verified bugs: unhandled promise rejections, race conditions, missing transaction rollbacks, or missing authentication checks in Server Actions.
2. Do not suggest aesthetic refactors, extra comments, or speculative performance gains.
3. Every issue must include: File Path, Line Numbers, the exact Trigger Condition, and a 2-sentence fix.

Output Format:

## Verdict
State either PASSED or FAILED. (If there are zero critical issues, output PASSED and stop).

## Critical Regressions
- File: [path]
- Lines: [start-end]
- Mechanism of Failure: [Concrete scenario causing a crash or leak]
- Required Fix: [Direct corrective action]

## Boundary & Security Violations
- Check: Did any client component import server-only utilities or environment variables?
- Check: Did database mutations execute without a verified user session?
Exclusions and Assumptions

This rule deliberately ignores all stylistic inconsistencies, lack of unit test coverage on unchanged helper functions, and dependencies that already pass your security scanner.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Filters out linter noise by explicitly banning style critiques already caught by tools like ESLint.
  • Forces a binary pass or fail verdict, avoiding non-actionable suggestions in pull requests.
  • Demands failure proofs and exact line numbers before any issue can be flagged.

Use this prompt in ChatGPT or Claude to generate a dedicated system rule for Cursor (.cursorrules or System Instructions). Be ready with your linter setup and tech stack.

Common edits

  • Add domain-specific boundary rules such as tenant isolation or specific ORM transaction limits.
  • Change the verdict trigger to treat missing unit tests as an automatic failure.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

More in Cursor

Audit Cursor Rules Files for Conflicts and Context Bloat

Get a line-by-line audit of your .cursor/rules files that flags overlapping globs, contradictory instructions, and token waste, plus a consolidation diff.

AI Coding AgentsClaude Code

Audit AI Code Diffs for Performance Regressions

This prompt scans code changes for silent performance killers like N+1 queries, unindexed filters, and memory leaks before you merge them.

Coding

Security Review of a Code Snippet: Ranked Findings With Exploit Path and Fix

Reviews pasted code for injection, broken authorization, secrets, SSRF and similar flaws, and returns only real findings ranked by severity, each with a one-line exploit path and fixed code.

DesignClaude Code

Audit Front-End Code Against Web Interface Guidelines

A SKILL.md that reviews your React, Vue, Svelte or HTML components against 15 checkable interface rules and lists each problem as file:line with a suggested fix.

Coding

Split a large pull request into reviewable commits

Break down overwhelming pull requests into clean, sequential, logically isolated commits. Use it when code reviews stall due to sprawling diffs.