A collection of battle-tested prompt templates for common tasks. Copy, customize, and use.
Code Review Template
Review this code for:
1. Security vulnerabilities
2. Performance issues
3. Code style and readability
4. Potential bugs
For each issue found:
- Severity: Critical / High / Medium / Low
- Line number(s)
- Problem description
- Suggested fix with code example
Code to review:
```[language]
[paste code here]Additional context: [describe what the code does]
## Bug Report Analysis
```text
Analyze this bug report and provide:
1. **Summary**: One-sentence description
2. **Root Cause Hypothesis**: Most likely cause
3. **Reproduction Steps**: Clearer steps if needed
4. **Investigation Plan**: What to check first
5. **Potential Fixes**: Ranked by likelihood of success
Bug Report:
---
[paste bug report]
---Documentation Generator
Generate comprehensive documentation for this code:
Include:
- Brief description (1-2 sentences)
- Parameters/arguments with types and descriptions
- Return value with type and description
- Example usage (at least 2 examples)
- Edge cases and error conditions
- Related functions/methods
Code:
```[language]
[paste code]
## API Design Review
```text
Review this API endpoint design:
Endpoint: [METHOD] [path]
Request body: [schema]
Response: [schema]
Evaluate for:
1. RESTful conventions
2. Naming consistency
3. Error handling
4. Versioning considerations
5. Security implications
6. Performance concerns
Provide specific recommendations for improvements.Database Query Optimization
Optimize this SQL query for performance:
```sql
[paste query]Context:
- Database: [PostgreSQL/MySQL/etc]
- Table sizes: [approximate row counts]
- Existing indexes: [list indexes]
- Current execution time: [if known]
Provide:
- Analysis of current query issues
- Optimized query with explanation
- Recommended indexes
- Expected improvement
## Test Case Generator
```text
Generate test cases for this function:
```[language]
[paste function]Include:
- Happy path tests (normal inputs)
- Edge cases (empty, null, boundary values)
- Error cases (invalid inputs)
- Performance test suggestions
Format as [Jest/PyTest/etc] tests with descriptive names.
## Commit Message Writer
```text
Write a commit message for these changes:
Changed files:
[list files]
Diff summary:
[paste key changes or describe them]
Follow conventional commits format:
type(scope): subject
Body explaining why, not what.Technical Specification Template
Create a technical specification for this feature:
Feature: [name]
User Story: As a [user], I want [action] so that [benefit]
Include these sections:
1. Overview (1 paragraph)
2. Goals and Non-Goals
3. Technical Approach
4. Data Model Changes
5. API Changes
6. Migration Plan
7. Testing Strategy
8. Rollout Plan
9. Monitoring & Alerts
10. Open QuestionsIncident Postmortem
Help write an incident postmortem:
Incident Summary:
- Date/Time: [when]
- Duration: [how long]
- Impact: [who/what affected]
- Severity: [SEV level]
Timeline of events:
[paste timeline]
Generate a blameless postmortem with:
1. Executive Summary
2. Impact Analysis
3. Root Cause Analysis (5 Whys)
4. Contributing Factors
5. Lessons Learned
6. Action Items (with owners)Code Explanation
Explain this code as if teaching a junior developer:
```[language]
[paste code]Include:
- High-level purpose (what problem it solves)
- Step-by-step walkthrough
- Why specific approaches were chosen
- Potential gotchas or confusing parts
- How to modify it for common use cases
## Refactoring Assistant
```text
Refactor this code to improve [specific goal]:
Goals: [readability/performance/testability/etc]
Current code:
```[language]
[paste code]Provide:
- Refactored code
- Explanation of changes
- Before/after comparison
- Trade-offs of the new approach
## Architecture Decision Record
```text
Create an ADR (Architecture Decision Record):
Decision: [what needs to be decided]
Context: [background, constraints, requirements]
Options considered: [list options]
Format as:
# ADR-XXX: [Title]
## Status
[Proposed/Accepted/Deprecated/Superseded]
## Context
[Why is this decision needed?]
## Decision
[What is the decision?]
## Consequences
[What are the results?]Email/Communication Templates
Technical Update Email
Write a technical update email for stakeholders:
Topic: [what happened or will happen]
Audience: [technical/non-technical/mixed]
Tone: [formal/casual]
Key points: [list main points]
Include:
- Clear subject line
- TL;DR at top
- Detailed explanation
- Action items if any
- Timeline if relevantCode Review Feedback
Write constructive code review feedback:
Issue type: [bug/style/performance/security]
Severity: [blocking/suggestion]
Current code behavior: [what it does]
Desired behavior: [what it should do]
Write feedback that is:
- Specific and actionable
- Explains the "why"
- Includes a suggested fix
- Respectful and educationalUsing Templates Effectively
- Customize placeholders: Replace [brackets] with your content
- Add context: More context = better results
- Iterate: Refine based on output quality
- Save versions: Keep templates that work well for you
beginnerPromptingUpdated 2024-12-18
Related Guides
Prompt Engineering Fundamentals
Essential techniques for crafting effective prompts that get better results from AI models.
System Prompts Deep Dive
Master system prompts to establish consistent AI behavior, personas, and response patterns.
Few-Shot Learning Techniques
Teach AI models new tasks by providing just a few examples in your prompt.
- prompt templates
- chatgpt templates
- claude templates
- ai templates
- prompt library