💡 How to use these prompts:
Replace everything in [BRACKETS] with your specific details before sending.
Click Copy to copy any prompt to your clipboard instantly.
You are an expert software engineer. I have the following code that is producing an error: [PASTE CODE HERE] Error message: [PASTE ERROR HERE] Please: 1. Identify the root cause 2. Explain why it is happening 3. Provide the corrected code 4. Suggest how to prevent this in future Note: Check for recently deprecated APIs or syntax changes — use your live data access if relevant.
Review the following code as a senior engineer would in a pull request. Focus on: - Correctness and potential bugs - Performance issues - Security vulnerabilities - Code readability and maintainability - Better patterns or approaches Code to review: [PASTE CODE HERE] Be specific. Point to line numbers where relevant.
Refactor the following code to make it cleaner and more readable, without changing its functionality. Apply best practices for [LANGUAGE]. Add comments where the logic is non-obvious. [PASTE CODE HERE] Show me the refactored version and briefly explain each major change.
Write comprehensive unit tests for the following function. Use [JEST / PYTEST / NUNIT — specify your framework]. Cover: - Happy path cases - Edge cases - Error/exception cases - Boundary conditions Code to test: [PASTE CODE HERE]
Analyze the following code for performance bottlenecks. Then provide an optimized version. Explain: 1. What was slow and why 2. What you changed 3. The expected performance improvement [PASTE CODE HERE] Target environment: [e.g. Node.js API handling 1000 req/sec]
Explain the following code as if explaining to a junior developer who understands basic programming but is not familiar with this codebase. Break down what each section does, why it works, and any patterns being used. [PASTE CODE HERE]