Skip to content

Code Audit

Code Audit Before You Ship

AI Tool: CursorCategory: Cursor & AI Coding

Run a structured audit: correctness, security, a11y, and dead code — with file:line findings, not vibes.

The Prompt

Audit this change / area as a staff engineer doing a pre-merge review.

Scope: {{scope}}
What this code is supposed to do: {{intent}}
Risk level (auth, payments, public page, internal): {{risk}}

Report only findings, grouped:
1. Correctness / edge cases
2. Security (injection, authz, secrets, SSRF, unsafe HTML)
3. Accessibility and keyboard use if UI is in scope
4. Performance only if you can point to a real cost
5. Tests that are missing for the failures you found

Each finding: file path, what's wrong, why it matters, and a concrete fix. Severity: high / med / low.

Do not nitpick naming. Do not suggest a rewrite unless the design cannot meet {{intent}}.

Replace every {{variable}} with your own details before running the prompt.

Variables to fill in

3 variables

{{scope}}required
PR, folder or feature to audit.
{{intent}}required
What the code should do.
{{risk}}
How sensitive this area is.

Best for

  • Tech leads
  • Solo founders
  • Reviewers