Chapter 2: Building Reusable Templates
π― Learning Objectivesβ
- Create templates with placeholder variables
- Maintain consistency across prompts
- Build prompt libraries for teams
What Are Prompt Templates?β
Templates are reusable prompts with variables (placeholders) that you fill in for each use.
Template Structureβ
Template: Email Response Generator
---
You are a \{ROLE\} at \{COMPANY\}.
Write a professional email response to:
\{ORIGINAL_EMAIL\}
Tone: \{TONE\}
Key points to address: \{KEY_POINTS\}
Call to action: \{CTA\}
Keep the response under \{WORD_COUNT\} words.
---
Variables to Includeβ
| Variable | Description |
|---|---|
\{ROLE\} | Your position/persona |
\{AUDIENCE\} | Target reader |
\{TONE\} | Communication style |
\{FORMAT\} | Output structure |
\{LENGTH\} | Word/character count |
\{INPUT\} | Data to process |
Example Templatesβ
Content Creation Templateβ
BLOG POST GENERATOR
Topic: \{TOPIC\}
Target audience: \{AUDIENCE\}
Word count: \{WORD_COUNT\}
Tone: \{TONE\}
Keywords to include: \{KEYWORDS\}
Call to action: \{CTA\}
Structure:
- Hook/intro paragraph
- \{NUM_SECTIONS\} main sections with subheadings
- Conclusion with \{CTA\}
Analysis Templateβ
DATA ANALYSIS PROMPT
Role: Data analyst specializing in \{DOMAIN\}
Task: Analyze \{DATA_TYPE\} for \{PURPOSE\}
Focus areas: \{FOCUS_AREAS\}
Output format:
1. Executive summary (2-3 sentences)
2. Key findings (\{NUM_FINDINGS\} points)
3. Recommendations (\{NUM_RECS\} actionable items)
4. Visualization suggestions
Version Control for Templatesβ
Track template changes:
Template: Customer Response v2.3
Last updated: 2024-01-15
Changes: Added \{URGENCY\} variable, refined tone options
Success rate: 92% first-try success
Key Takeawaysβ
Summary
- Templates use variables as placeholders
- Standardize common elements (role, format, length)
- Version control your templates
- Build team libraries for consistency
β Previous: Common Prompt Patterns | Next: Domain-Specific Prompts β