Lesson 17 of 1570
Prompt Templates: Write Once, Use Forever
Turn your best prompts into reusable templates with variables. This is how pros scale: one great template, thousands of runs.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1From prompt to template
- 2templates
- 3variables
- 4reuse
Concept cluster
Terms to connect while reading
Section 1
From prompt to template
A prompt is a one-off message. A template is a reusable prompt with placeholders you fill in each time. If you're doing the same task more than twice — summarizing articles, translating messages, rewriting emails — make a template.
Your first template
Placeholders in {{double braces}} are where input goes.
You are a concise news editor.
Summarize the following article for a reader with 2 minutes to spare.
Requirements:
- 3 bullet points.
- Include the main claim, the key evidence, and the biggest caveat.
- Neutral tone, no opinion.
Article:
"""
{{ARTICLE_TEXT}}
"""Each time you need a summary, you paste a new article into the placeholder. Same structure, same quality bar, different input. Your output stays consistent across hundreds of summaries.
A more advanced template
Multiple variables let you tune the template for different jobs.
ROLE: You are a {{TONE}} writing coach for {{AUDIENCE}}.
TASK: Rewrite the user's draft to be {{GOAL}}.
RULES:
- Preserve the original meaning.
- Do not invent new facts.
- Keep the rewrite within {{WORD_COUNT}} words.
- Flag any unclear passages with [UNCLEAR: ...].
DRAFT:
"""
{{DRAFT_TEXT}}
"""
OUTPUT:
1. The rewritten version.
2. Three specific notes on what you changed and why.- {{TONE}} = 'supportive' or 'tough-love'
- {{AUDIENCE}} = 'high school seniors' or 'startup founders'
- {{GOAL}} = 'more concise' or 'more persuasive'
- {{WORD_COUNT}} = 150 or 500
Template hygiene
- 1Use a clear placeholder style ({{CAPS}} is common).
- 2Document what each variable expects.
- 3Keep an example filled-in version next to the template.
- 4Version your templates. v1, v2, v3 — with notes on what changed.
- 5Test with weird inputs (empty, very long, wrong format).
Key terms in this lesson
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “Prompt Templates: Write Once, Use Forever”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Builders · 28 min
The Five-Part Prompt: Role, Context, Examples, Constraints, Format
Pro prompters follow a structure. Give the AI a role, set the context, show examples, set constraints, and pick a format. This framework alone 10x's your output quality.
Builders · 22 min
Iterate, Don't Rewrite
Beginners scrap their prompt and start over. Pros keep the good parts and change only what isn't working. Here's how to iterate like a craftsperson.
Builders · 30 min
Structured Output: JSON and XML
When your prompt feeds into code, you need machine-readable output. JSON mode and XML tags make the AI's response parseable instead of loose prose.
