Code Generator & Debugger
Get production-ready code with explanations, error handling, and best practices for any programming task.
📝 How to Use This Prompt
- Click the Copy Prompt button above
- Paste it into Claude, ChatGPT, Gemini, or your preferred AI
- Replace all variables in brackets
[LIKE_THIS]with your specific details - Hit enter and get high-quality results!
💡 Pro tip: The more specific you are with the variables, the better your output will be.
You are an expert [PROGRAMMING_LANGUAGE] developer. Help me [TASK_TYPE].
Project Context:
- Language/Framework: [PROGRAMMING_LANGUAGE]
- Task type: [TASK_TYPE] (Build feature/Debug code/Refactor/Optimize/Write tests)
- Skill level: [YOUR_SKILL_LEVEL] (Beginner/Intermediate/Advanced)
- Environment: [ENVIRONMENT] (Web/Mobile/Desktop/Backend/Full-stack)
Requirements:
If building a feature:
- Feature description: [FEATURE_DESCRIPTION]
- Expected inputs: [INPUTS]
- Expected outputs: [OUTPUTS]
- Edge cases to handle: [EDGE_CASES]
- Dependencies available: [DEPENDENCIES]
If debugging:
- Paste the error message: [ERROR_MESSAGE]
- Paste relevant code: [CODE_SNIPPET]
- What you've already tried: [ATTEMPTED_SOLUTIONS]
- Expected behavior: [EXPECTED_BEHAVIOR]
- Actual behavior: [ACTUAL_BEHAVIOR]
If refactoring:
- Paste current code: [CURRENT_CODE]
- What's wrong with it: [ISSUES]
- Goals: [REFACTOR_GOALS] (Performance/Readability/Maintainability/DRY)
Output requirements:
Complete, working code
- Include all necessary imports
- Add inline comments for complex logic
- Follow [CODING_STANDARD] conventions
- Handle errors appropriately
Explanation
- How it works (overview)
- Key decisions made
- Trade-offs considered
Usage example
- Show how to implement/call it
- Include sample input/output
- Common gotchas to avoid
Testing
- Suggest test cases
- Include unit test examples if requested
Performance notes (if relevant)
- Time/space complexity
- Optimization opportunities
Example Variables:
- [TASK_TYPE]: Build a feature
- [FEATURE_DESCRIPTION]: "Function that scrapes product prices from an e-commerce site and sends price drop alerts"
- [ENVIRONMENT]: Backend script
- [CODING_STANDARD]: PEP 8
- [DEPENDENCIES]: requests, BeautifulSoup4, sqlite3
Be specific about your use case in the variables above, and I'll provide production-ready code with explanations.
