# Prompt template

> Canonical: https://skillalmanac.com/glossary/prompt-template | Last verified: 2026-11-24 | Index status: not offered to search engines

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.

## 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](/glossary/prompt) whose structure is fixed and whose input changes. In a coding setting you meet the idea in [slash commands](/glossary/slash-command), [agent skills](/glossary/agent-skill) and [instruction files](/glossary/agent-instruction-file), 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](/glossary/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](/glossary/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](/glossary/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](/glossary/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.

## Worked examples in this catalogue

### [prompt-writing](https://skillalmanac.com/skills/skill-almanac/prompt-writing)

Status: illustrative example from the item's own documentation, not executed for this page.

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.

### [formal-letter-writer](https://skillalmanac.com/skills/skill-almanac/formal-letter-writer)

Status: illustrative example from the item's own documentation, not executed for this page.

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.

### [internal-comms](https://skillalmanac.com/skills/anthropic/internal-comms)

Status: illustrative example from the item's own documentation, not executed for this page.

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.

## Related terms

- [Prompt](https://skillalmanac.com/glossary/prompt.md)
- [Prompt engineering](https://skillalmanac.com/glossary/prompt-engineering.md)
- [System prompt](https://skillalmanac.com/glossary/system-prompt.md)
- [Few-shot prompting](https://skillalmanac.com/glossary/few-shot-prompting.md)
- [Prompt chaining](https://skillalmanac.com/glossary/prompt-chaining.md)
- [Prompt injection](https://skillalmanac.com/glossary/prompt-injection.md)
- [Prompt library](https://skillalmanac.com/glossary/prompt-library.md)

## Sources

- [Generate better prompts in the developer console](https://claude.com/blog/prompt-generator), Anthropic (accessed 2026-11-24)
- [Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering), OpenAI (API Docs) (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
