What Is a Prompt Template?
Static structure + dynamic variables: the anatomy of a reusable prompt.
From One-Off Prompts to Templates
A one-off prompt is written for a single use. A prompt template is designed to be reused — the structure stays constant while specific details change each time it is run.
Templates transform prompt engineering from a craft into a system. Instead of rewriting a prompt from scratch every time you need to generate a similar output, you fill in the variable parts and reuse the invariant structure.
The Template Anatomy
Every prompt template has two kinds of parts:
Invariant parts — the fixed instructions, format requirements, role definitions, style rules, and constraints that do not change between uses. These are the template's structure.
Variable parts — the specific details that change with each use: product name, audience, topic, tone, context, examples. These are the template's slots.
A good template maximizes reuse by encoding all the invariant knowledge that would otherwise be re-typed every time.
All lessons in this course
- What Is a Prompt Template?
- Creating Fill-in-the-Blank Patterns
- Variable Substitution Techniques
- Reusing Templates Across Tasks