Skip to content
Search
TechniquesGlossary

Prompt Template

A template turns a prompt that worked once into one the whole team can reuse. Most good templates share the same fields: the role the model plays, the goal, the inputs (each in its own delimited section), the constraints, the output format, and sometimes a few examples (few-shot prompting). The fixed parts carry what you've learned about the task. The placeholders carry what changes.

Treat templates like code. Keep them in one place with version history, and rerun a test set whenever you change one (prompt regression testing). Fill placeholders from code, and keep anything a user or a document supplies inside its own tags, so it can't be confused with your instructions. When the output feeds another system, pair the template with structured output. Templates that hold standing rules for every call belong in the system prompt.

Example

Role: You write first drafts of client advisory letters for an accounting firm.
Goal: Explain {topic} to {client_name}, a {business_type} owner, in plain language.
Inputs:
<notes>
{accountant_notes}
</notes>
Constraints:
- Use only facts from <notes>.
- Under 300 words. No jargon without a one-line explanation.
Format: Greeting, three short paragraphs, a list of next steps, sign-off from {accountant_name}.

When to use it

  • Tasks your team runs again and again with different inputs
  • Sharing a proven prompt with people who didn't write it
  • Pipelines that generate prompts from data

When not to use it

  • One-off requests
  • Pasting untrusted text into a template without delimiters around it