Key takeaways

  • A prompt is sent once; a template is a prompt with placeholders that is filled in before each use.
  • The fixed text of a template carries the method, and the variables carry what changes.
  • Build a template once a task has recurred several times or several people need comparable output.
  • Name variables clearly, keep them to a handful and say what a good value looks like.
  • Check a template against several different sets of values before relying on it.

A prompt is a single, complete request sent to a model; a prompt template is a reusable prompt with named blanks that you fill in differently each time. Write a one-off prompt when the task will not recur, and build a template when you expect to run the same kind of task again and want the result to be consistent. The fixed text of a template holds the method, and the variables hold whatever changes from one use to the next.

Two definitions

Prompt. The actual text the model receives for one job. It contains real details: this article, this customer, this deadline. Once sent, it has done its work.

Prompt template. A prompt with the job-specific details removed and replaced by placeholders. On this site, placeholders are written in double braces:

Summarize the meeting notes below for {{audience}}.
Focus on decisions and owners. Keep it under {{word_limit}} words.

<notes>
{{meeting_notes}}
</notes>

Filling the three placeholders produces a prompt. The template itself is never sent to a model as it stands; a model that receives literal {{audience}} will either ask what you meant or guess.

Anthropic's documentation describes the same split for applications: fixed content that stays the same across calls, and variable content that is substituted in each time. The benefit it points to is the one that matters for individuals too: when the fixed part does not move, you can tell whether a change in output came from your inputs or from your instructions.

What a template gives you

  • Consistency. The same structure, constraints and output format every run, whoever fills it in.
  • Speed. You supply three or four values instead of rewriting a page of instructions from memory.
  • A thing you can improve. When an output disappoints, you fix the template once and every later use benefits. A one-off prompt's lessons are lost when you close the tab.
  • Shareability. A colleague can use it without knowing why each line is there.
  • Testability. You can run one template against several sets of values and compare; see how to test AI prompts.

What a template costs

  • Up-front effort. Deciding what is fixed and what varies takes longer than typing a request.
  • Generic output from lazy inputs. A template cannot supply specifics. If {{audience}} is filled with "everyone", the result will read that way.
  • False fit. A template built for product launch emails will produce a product-launch-shaped answer even when your situation is a recall notice. The structure pulls the content toward it.
  • Staleness. Instructions written to work around one model's habits may be unnecessary or counterproductive on a newer one.

Choosing between them

Write a plain prompt when:

  • The task is exploratory and you do not yet know what a good answer looks like.
  • It is a one-time question.
  • The conversation will do the refining for you.

Build a template when:

  • You have done the same kind of task three or more times.
  • Several people need to produce comparable outputs.
  • The output feeds another step, a spreadsheet or code, and needs a predictable format.
  • Getting it wrong is expensive enough to justify writing the constraints down once, carefully.

A useful signal: if you find yourself scrolling back through old chats to copy a prompt that worked, that prompt wants to be a template.

Turning a good prompt into a template

Start from a prompt that already produced a result you were happy with.

1. Mark what changed last time

Go through the text and highlight anything specific to that occasion: names, the pasted document, the audience, the length, the date. Those are candidate variables.

2. Keep the method fixed

The steps, the constraints that prevent known failures and the output format are the valuable part. Leave them as written.

Before:
Write a job description for a senior data engineer at a 40-person
logistics startup in Leeds. Hybrid, two days in the office...

After:
Write a job description for a {{role_title}} at {{company_summary}}.
Working arrangement: {{working_arrangement}}.

3. Name variables for what they contain

{{target_reader}} is better than {{input2}}. Whoever fills in the template, including you in three months, should know what to type without reading the whole prompt.

4. Limit the number

Three to seven variables is a workable range for most tasks. Fewer and the template is probably too rigid; many more and filling it in is as much work as writing a prompt.

5. Say what a good value looks like

Add a short hint or example per variable: "Two or three sentences on what the company does and its size." The quality of the output tracks the quality of these inputs closely.

6. Handle optional inputs

If a variable may be empty, tell the model what to do: "If no brand guidelines are provided, use a neutral, plain style and say that you did so."

7. Delimit long inputs

Wrap pasted material in a labeled block so it cannot be mistaken for instructions, as in the <notes> example above. This matters more in templates than in one-off prompts because you cannot predict what the pasted text will contain.

8. Test with more than one set of values

Fill it in for at least three different realistic cases, including one awkward one: a very short input, an unusual audience. A template that only works for the case it was derived from is still a prompt.

Mistakes that weaken templates

  • Templating too early. A template made from a first attempt freezes its flaws. Iterate on the prompt first; the guide on improving AI responses covers that stage.
  • Making everything a variable. If tone, structure, length and format are all blanks, nothing has been decided and the template adds no value.
  • One template for every situation. Two focused templates are easier to use and maintain than one with a dozen conditional branches.
  • Leaving placeholders unfilled. Check the final text before sending. A stray {{competitors}} often produces invented competitors.
  • Never revisiting it. Note the date and the model you last checked it on, and re-run your test cases when either changes.

How this library uses the distinction

Every prompt page here is a template: a full prompt with named variables, a short version, an explanation of why the structure is built the way it is, and an illustrative filled-in scenario. The job description prompt, the email writing prompt and the content brief prompt are typical examples. Copying one gives you the template; filling in the fields gives you a prompt.

If you want to build your own, the prompt builder starts from the fixed parts of a well-formed prompt and asks you for the variable ones. The fixed parts themselves, goal, context, task, constraints and format, are explained in how to write a good AI prompt.

The short version

A prompt answers today's question. A template captures how you want a kind of question answered, so that the tenth use is as good as the best of the first three. Start with prompts, keep the ones that work, and promote them to templates when repetition makes it worthwhile.

Prompts that put this into practice

Keep reading

Sources and references

  1. Prompt engineering overview — Anthropic
  2. Prompt engineering guide — OpenAI