AISuffer
Engineers

10 Prompt Templates Every Developer Should Save

Dmytro Antonyuk Dmytro Antonyuk 2 min read

Save these templates — they’ll save you hours every day.

1. Code Review

Review the following code. Focus on:
- Security (SQL injection, XSS, etc.)
- Performance (Big-O, unnecessary operations)
- Readability (naming, structure)
- Edge cases
- SOLID principles compliance

Code:
[paste code]

Format:
🔴 Critical issues
🟡 Recommendations
🟢 What's done well

2. Debugging

I have a bug:
Expected behavior: [what should happen]
Actual behavior: [what happens]
Steps to reproduce: [how to reproduce]

Code:
[paste code]

Analyze possible causes, starting with the most likely.
For each cause, suggest a fix.

3. Refactoring

Refactor this code following:
- Clean Code principles
- DRY (Don't Repeat Yourself)
- Single Responsibility Principle
- Current project conventions

Explain each change in one sentence.

Code:
[paste code]

4. Writing Tests

Write unit tests for the following function.
Framework: [Jest/Pytest/other]

Cover:
- Happy path (main scenario)
- Edge cases (empty values, null, large numbers)
- Errors (invalid data, network errors)
- Boundary values

Function:
[paste code]

5. Documentation

Write JSDoc/docstring for this function:
- Description of what it does
- @param for each parameter with type and description
- @returns with type and description
- @throws for possible errors
- @example with 2-3 usage examples

Function:
[paste code]

6. API Design

Design a REST API for [entity description].
Consider:
- RESTful conventions
- Proper HTTP methods and status codes
- Pagination and filtering
- Input validation
- Versioning

Format: table with Method, Endpoint, Description, Request Body, Response.

7. SQL Optimization

Optimize this SQL query:
- Analyze the EXPLAIN plan
- Suggest indexes
- Rewrite the query if needed
- Estimate complexity before/after

Query:
[paste SQL]

Table schema:
[paste schema]

8. Git Commit Message

Based on this diff, write a commit message:
- Format: Conventional Commits (feat/fix/refactor/docs/test)
- Short title under 72 characters
- "Why" description in body

Diff:
[paste diff]

9. Architecture Decision

I need to [task description].

Context:
- Stack: [technologies]
- Scale: [users/data volume]
- Constraints: [budget, time, team size]

Suggest 2-3 approaches, for each provide:
- Solution description
- Pros and Cons
- Implementation complexity (low/medium/high)
- Recommendation with rationale

10. Migration/Upgrade

I need to migrate from [old] to [new].

Current state:
[description]

Create a step-by-step migration plan:
1. Preparation (pre-migration tasks)
2. Migration (steps in order)
3. Verification (how to confirm everything works)
4. Rollback plan (how to revert if something goes wrong)

How to Use These Templates

  1. Save them to a file or notes app
  2. Replace [placeholders] with your data
  3. Adapt to your stack and conventions
  4. Iterate — refine the prompt after the first response

More prompt techniques in Top 5 Prompt Lifehacks.

Dmytro Antonyuk

AI Automation Researcher. Researches AI for corporate AI automation — agents, tools, and prompt engineering.

Related articles

Stay updated on AI

Get weekly insights on AI agents, tools, and prompt engineering delivered to your inbox.