Best Coding Prompts
Prompts for development, testing, and debugging.
Clean Code Refactoring Expert
Refactor the following [Language] code to follow Clean Code principles. Improve readability, naming conventions, and modularity. Add comments explaining WHY changes were made. Identify any potential bugs or performance bottlenecks. Code: [Insert Code Here]
Unit Test Generator
Write comprehensive unit tests for the following [Language] function using [Testing Framework, e.g., Jest/Pytest]. Cover edge cases, happy paths, and error handling. Mock any external dependencies. Function: [Insert Function Here]
Complex Regex Generator
Create a Regular Expression (Regex) to match [Pattern Description]. Explain how the regex works step-by-step. Provide 3 examples of strings that match and 3 that do not match.
Python Automation Script
Write a Python script to automate [Task, e.g., renaming files in a folder]. Use standard libraries where possible. Add comments explaining each step. Include error handling.
React Component Generator
Create a reusable React functional component for a [Component Name, e.g., Navbar]. Use Tailwind CSS for styling. Include props for customization (e.g., color, links). Ensure it is responsive and accessible.
Complex SQL Query Writer
Write a SQL query to [Goal, e.g., find top 10 customers by spend in last month]. Tables: [Table A (columns), Table B (columns)]. Use JOINs efficiently. Optimize for performance.
Code Bug Fixer & Explainer
I am getting the following error: "[Error Message]". Here is my code: [Insert Code]. Please find the bug, fix it, and explain why it happened so I can learn.
API Documentation Generator
Generate API documentation for the following endpoint: [Method] [URL]. Parameters: [List Params]. Response: [Sample JSON]. Format in Markdown with a description, request example, and response example.