HxHippy

Prompt Templates Library

Ready-to-use prompt templates for common development, writing, and analysis tasks.

Last updated: 2024-12-18

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:

  1. Analysis of current query issues
  2. Optimized query with explanation
  3. Recommended indexes
  4. Expected improvement

## Test Case Generator

```text
Generate test cases for this function:

```[language]
[paste function]

Include:

  1. Happy path tests (normal inputs)
  2. Edge cases (empty, null, boundary values)
  3. Error cases (invalid inputs)
  4. 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 Questions

Incident 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:

  1. High-level purpose (what problem it solves)
  2. Step-by-step walkthrough
  3. Why specific approaches were chosen
  4. Potential gotchas or confusing parts
  5. 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:

  1. Refactored code
  2. Explanation of changes
  3. Before/after comparison
  4. 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 relevant

Code 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 educational

Using Templates Effectively

  1. Customize placeholders: Replace [brackets] with your content
  2. Add context: More context = better results
  3. Iterate: Refine based on output quality
  4. Save versions: Keep templates that work well for you
beginner Prompting Updated 2024-12-18
  • prompt templates
  • chatgpt templates
  • claude templates
  • ai templates
  • prompt library