♻️
Code Review Prompt
Get a thorough code review with actionable feedback
prompt template
Review this code as a senior engineer would: ``` [PASTE_CODE_FOR_REVIEW] ``` **Context:** [WHAT_THIS_CODE_DOES] **PR goal:** [WHY_THIS_CHANGE_WAS_MADE] Review for: 1. **Correctness** — bugs, edge cases, off-by-one errors, race conditions 2. **Security** — injection, XSS, auth bypass, sensitive data exposure 3. **Performance** — unnecessary work, N+1 queries, memory leaks 4. **Readability** — naming, structure, complexity, "WTF per minute" factor 5. **Maintainability** — coupling, testability, future change difficulty For each issue: - **Line reference** — which line(s) - **Severity** — 🔴 Must fix / 🟡 Should fix / 🟢 Nit - **What's wrong** — clear explanation - **Suggested fix** — concrete code change End with: - Overall assessment (Approve / Request changes) - 1-2 things done well (positive feedback matters) - The single most important thing to fix if time is limited
How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More Refactoring Prompts
Related refactoring templates from the vault
♻️
Switch Statement to Strategy Pattern
Use this prompt to switch statement to strategy pattern with AI assistance
Beginnerrefactoringstrategy-pattern
♻️
Nested Conditionals Flattener
Use this prompt to nested conditionals flattener with AI assistance
Intermediaterefactoringconditionals
♻️
Code Smell Detector and Fixer
Identify code smells in existing code and get refactored versions
Intermediaterefactoringcode-review
♻️
Extract Shared Hook from Components
Identify duplicated logic across components and extract into a reusable hook
Intermediaterefactoringreact
You Might Also Like
Prompts from other categories that share similar tags
Keep Exploring the Vault