AI GLOSSARY · PROMPTS AND INSTRUCTIONS

Prompt template

Markdown version

Definition

A prompt template is a reusable prompt with named placeholders, called variables, that are filled in with new data each time it is used. The fixed instructions stay the same while the inputs change.

Also called: prompt templates, templated prompt, prompt variables, prompt template variables.

In plain language

A prompt template is a fill-in-the-blanks prompt. Imagine a form letter with a gap for the customer's name and the order number. The wording stays fixed and you drop in the details for each case. Teams use templates so that a support reply, a summary or a code review is asked for the same way every time, and so that only the changing part needs editing. The limits are that a template is only as good as its fixed wording, and that whatever you put into a blank is read by the model as part of the prompt. Test it with several different inputs, including awkward ones, before you rely on it.

Technical definition

A prompt template separates the constant parts of a prompt, such as the role, instructions, format and examples, from variables that are substituted at call time. Anthropic's prompt generator announcement says the templates it produces use variables in handlebars notation and often place those variables between XML tags, which are input fields where custom data can be inserted. The substitution happens in your application or tool before the request reaches the model, so the model receives one ordinary text prompt. OpenAI's prompt-engineering guide says that it is deprecating reusable prompt objects in the API, with v1/prompts scheduled to shut down on November 30, 2026, and recommends storing production prompts in application code with typed inputs.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Skill by Skill Almanac · Illustrative, not executed

    prompt-writing 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    Prompts written and linted with a fixed structure, injection rules and a numeric test plan.
    Why it exercises the concept
    A fixed structure is what a template holds constant. The test plan is how you check that the template still works when the variables change.
  2. Skill by Skill Almanac · Illustrative, not executed

    formal-letter-writer 40/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    A formal letter for a complaint, request or notice, drafted with a fixed structure, a three-level tone ladder and the facts you supply.
    Why it exercises the concept
    The same idea applied to a document: a fixed structure with slots filled from facts you provide. It shows the template pattern without a model-specific syntax.
  3. Skill by Anthropic · Illustrative, not executed

    internal-comms 34/100 · grade FScored · Method v0.2 · How we score

    What you see
    Templates and formats for writing internal company communications.
    Why it exercises the concept
    Another case of reusable structure for a recurring job. It is a document template and not a prompt with variables, but the benefit is the same: consistent output with the content changing.

How it shows up when you use agents

Templates appear wherever the same kind of request repeats. A code-review prompt with a slot for the diff, a support prompt with a slot for the ticket, a summary prompt with a slot for the document: each is a prompt whose structure is fixed and whose input changes. In a coding setting you meet the idea in slash commands, agent skills and instruction files, which keep reusable wording in one place so you do not retype it.

Two practical points follow from the vendor documents.

  • Variables are just text to the model. Your tool substitutes them before sending. Anthropic's announcement says its generated templates often wrap variables in XML tags, which keeps the data visibly apart from the instructions. Anything a user can type into a variable can also steer the model, so read prompt injection before you feed outside text into a template.
  • Where templates live matters. OpenAI's prompt-engineering guide says it is deprecating reusable prompt objects in its API and recommends keeping production prompts in application code, where review, tests and deployment can cover them. If you rely on a saved prompt ID, check the current guide.

What breaks when this is misunderstood: people edit a template to fix one bad output and quietly break the other cases. Keep a small set of test inputs, run the whole set after every change, and change one thing at a time. For chained steps, each step can have its own template; see prompt chaining.

Common confusions

  • Prompt template versus prompt. A prompt is the text sent to the model. A template is the reusable pattern that produces many prompts once its variables are filled in.
  • Prompt template versus system prompt. A system prompt is standing instructions for a product or session. It can itself be a template, but the two terms are not the same.
  • Prompt template versus few-shot examples. Few-shot prompting puts worked examples in a prompt. A template may include them as fixed text, or may take them as a variable.
  • Myth: a template makes the output consistent by itself. It makes the request consistent. The model's answer can still vary, so check outputs against test cases.

Terms that mention Prompt template

5 terms mention this one

Guides that mention Prompt template

More in Prompts and instructions

Next steps

  1. prompt-writing A skill that exercises it.
  2. Prompt Related term.
  3. System prompt Related term.
  4. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.

Review record

Last verified

Drafted by claude-sonnet-5-5; sources and example targets checked by claude-haiku-5-5 source check; claude-sonnet-5-5 editor pass on 2026-11-24. Last verified .

This entry is still in review, so it is not listed in search engines yet.

Change log (1)
  • : First version.