Code Review & Refactor
Get an expert-level code review with actionable refactoring suggestions.
Use case
Getting structured code review feedback with specific refactoring suggestions
Works best with
Input needed
The code to review (full file or snippet), the language/framework, and what aspects to focus on (performance, readability, security, etc.)
Output format
Line-by-line review with severity levels, explanations, and refactored code examples
Example use
Paste a React component with performance issues. The prompt identifies unnecessary re-renders, suggests useMemo/useCallback placements, and provides the refactored version.
Editor’s Note
Most useful for medium-complexity code. For trivial code, the suggestions are obvious; for very large codebases, it lacks full context. Always test refactored code — the suggestions are directionally correct but may introduce subtle bugs.
Full Prompt
Act as a senior software engineer conducting a code review. Review the code below and provide: 1. **Summary** — What the code does in 1–2 sentences. 2. **Issues Found** — List bugs, anti-patterns, security risks, and performance concerns (ranked by severity: Critical / Medium / Low). 3. **Refactored Version** — Provide the improved code with inline comments explaining key changes. 4. **Tests to Add** — List 3–5 unit test cases to cover edge cases. ``` [PASTE CODE HERE] ``` Language: [LANGUAGE]
Tags
