💡 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 of the error
2. Explain why it is happening
3. Provide the corrected code
4. Suggest how to prevent this type of error in the future
Please 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 and explain your reasoning.
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 you made.
Write comprehensive unit tests for the following function/class. Use [JEST / PYTEST / NUNIT — specify your framework]. Cover:
- Happy path cases
- Edge cases
- Error/exception cases
- Boundary conditions
Code to test:
[PASTE CODE HERE]
Explain the following code as if you were explaining it 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]
Convert the following [SOURCE LANGUAGE] code to [TARGET LANGUAGE]. Preserve the exact logic and functionality. Use idiomatic patterns for the target language — do not just translate syntax directly.
[PASTE CODE HERE]
After the conversion, note any significant differences in how the two languages handle the key logic.
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]
Write a SQL query for the following requirement. Use [PostgreSQL / MySQL / SQL Server — specify]. Return only the query with inline comments explaining each clause.
Requirement: [DESCRIBE WHAT YOU NEED]
Tables available:
[PASTE SCHEMA OR DESCRIBE TABLES]