Coding & Development Prompt Templates

6 free, copy-paste prompt templates for coding & development. Each template is tested and optimized for ChatGPT, Claude, and Gemini.

API Endpoint Design

Design a RESTful API with proper endpoints, request/response formats, error handling, and authentication.

Design a RESTful API for: [APPLICATION_DESCRIPTION]. Provide: 1) List of all endpoints with HTTP methods and paths, 2) Request body format for POST/PUT endpoints, 3) Response format for each endpoint with example JSON, 4) HTTP status codes and error response format, 5) Authentication approach (JWT, OAuth, API keys), 6) Rate limiting strategy, 7) Pagination format for list endpoints. Follow REST best practices....
Coding & Development API, REST

Debug Error Message

Paste an error message and get a diagnosis, root cause analysis, and step-by-step fix.

I'm getting the following error in my [LANGUAGE/FRAMEWORK] application. Please: 1) Explain what this error means in simple terms, 2) Identify the most likely root cause, 3) Provide a step-by-step fix, 4) Suggest how to prevent this error in the future, 5) Mention any related issues I should also check. Here's the error and relevant code:...
Coding & Development debugging, error

Explain Code Line by Line

Get a line-by-line explanation of any code snippet, perfect for learning and code reviews.

Explain the following code line by line. For each line: state what it does, why it's written that way, and any potential issues or edge cases. At the end, give a high-level summary of what the entire code block accomplishes. Assume the reader knows basic programming but is unfamiliar with this specific code. Language: [LANGUAGE]....
Coding & Development coding, explanation

Generate Unit Tests

Generate comprehensive unit tests for any function, covering edge cases, happy paths, and error states.

Write comprehensive unit tests for the following function. Cover: 1) Happy path (normal expected input), 2) Edge cases (empty input, very large input, boundary values), 3) Error states (invalid input, null, undefined), 4) Performance test cases if applicable. Use [TESTING_FRAMEWORK] and follow best practices. Include setup/teardown if needed. Here's the function:...
Coding & Development testing, unit tests

Refactor Code for Performance

Get suggestions to refactor your code for better performance, with explanations of each improvement.

Analyze the following code for performance bottlenecks and refactor it for optimal performance. For each improvement: 1) Identify the bottleneck, 2) Explain why it's slow, 3) Show the refactored version, 4) Estimate the performance gain (e.g., O(n^2) to O(n log n)). Prioritize changes with the biggest impact first. Keep the same functionality and avoid over-engineering....
Coding & Development performance, refactoring

SQL Query Optimization

Optimize a slow SQL query with indexing suggestions, query restructuring, and EXPLAIN analysis.

Optimize the following SQL query for better performance. Provide: 1) Analysis of why it might be slow (missing indexes, suboptimal joins, etc.), 2) Recommended indexes with CREATE INDEX statements, 3) The rewritten optimized query, 4) Explain what each optimization does, 5) Estimated performance improvement. Assume the database is [DATABASE_TYPE] with the following table schemas:...
Coding & Development SQL, database