# Review my code for bugs, security, and quality

A thorough code review with prioritized findings and suggested fixes.

- Topic: Software Development
- Framework: RCTFVV
- Level: Advanced
- Tags: Coding, Analyze, Brainstorm, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/review-my-code-for-bugs-security-and-quality

## Prompt

```text
Role: Act as a senior engineer doing a thorough but pragmatic code review.

Context: The code / diff under review: [CODE]. What it is meant to do: [INTENT]. Language, framework, conventions: [STACK_CONVENTIONS]. Known constraints and hot paths: [CONSTRAINTS]. Test coverage status: [TEST_STATUS].

Task: Produce: (1) correctness and safety issues (bugs, race conditions, error handling, security, resource leaks) - each with the location, why it is a problem, a failing scenario, and a fix; (2) clarity and maintainability suggestions ranked by value; (3) any missing tests; (4) what is good and should be kept. Keep opinions proportional - do not rewrite working code for taste.

Format: Sections: Correctness & safety (most severe first) | Maintainability | Missing tests | Keep. Reference code by file:line.

Verification: For each correctness issue give a concrete input/state that triggers it; if you are unsure it is a real bug, label it as a question, not a defect.

Validation: Re-check the top issue: would the failing scenario actually occur given the constraints and existing callers? Drop it if not, and say why.
```

## What to fill in

- CODE
- INTENT
- STACK_CONVENTIONS
- CONSTRAINTS
- TEST_STATUS

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
