How to use variables in AI prompt templates
Build a weekly update template with {{variables}}, add hints and example inputs, and copy a filled prompt into your preferred AI assistant.
Updated
A prompt variable is a placeholder for a detail that changes each time you use a prompt. Write it in double braces, such as {{team}}. The editor detects it and gives you a field to fill in, so you can reuse the instructions without editing them each time.
Turn changing details into variables
Start with an ordinary request:
Write a weekly update for Customer support using these notes: Updated the help centre. Waiting for approval of the refund policy. Next: train the team.The team and notes will change. Replace those details with {{team}} and {{notes}} in the section text. Follow the weekly update walkthrough to create the Task and Format sections. The resulting template preview looks like this:
<TASK>
Write a weekly update for {{team}} using these notes:
{{notes}}
</TASK>
<FORMAT>
Use three headings: Progress, Blockers, Next steps.
</FORMAT>The surrounding tags come from the section names automatically. Variable names can contain letters, numbers, underscores, and hyphens, and must start with a letter or underscore. Use {{project_name}} rather than {{project name}}. Reusing the same name in several sections gives them one shared input.
Variable syntax in other tools
Placeholders are a convention, not a standard, so check which form a tool expects before moving a template between them. To fill a {{double-brace}} template without an account, paste it into the template filler.
| Where | Placeholder | Notes |
|---|---|---|
| This app | {{team}} | Letters, numbers, underscores and hyphens; no spaces. |
| Anthropic's prompting guide | {{ANNUAL_REPORT}} | Its examples put each input in its own XML tag around a double-brace placeholder. |
| Google Vertex AI Studio | {animal_name} | Prompt templates use single braces; names cannot contain spaces. |
| LangChain and LangSmith | {name} or {{name}} | f-string or mustache format; mustache also supports loops and conditions. |
| ChatGPT, Claude or Gemini chats | None | The chat sees plain text, so fill in every value before you paste. |
Pitfalls to avoid
- Sending an unfilled placeholder. A model that receives
{{notes}}may invent notes or write about the placeholder itself. Mark inputs the prompt cannot work without as required, so Copy filled prompt waits until they have a value. - Pasted text that gives orders. An email or web page you paste into
{{notes}}can contain sentences that read like instructions. Keep such inputs in their own section, which becomes their own tag, and say in the Task that its contents are material to work with, not instructions to follow. - One name for two meanings. Every use of a name shares one input, so
{{date}}cannot be both a deadline and a meeting day. Use{{due_date}}and{{meeting_date}}. - Vague names.
{{text}}says little when you fill the prompt in weeks later;{{customer_email}}explains itself, and a hint can say the rest.
Add hints and optional settings
- Find Variables below the sections. Variables appear here automatically when you type their placeholders in the section text.
- Add a hint such as "Who will receive this update?" for
team. Hints appear inside the empty input fields when filling the prompt. - If a value must be supplied before a complete copy, open Options for team and select Required team. Variables are optional unless you mark them required.
- In the same options, optionally fill in Example value. Choose Save to keep hints, requirements, and examples with the template. Examples are not inserted automatically.
Fill in the template and copy the result
- In Preview, select Filled. On a phone, select Fill and copy to reach the preview. If you hid the desktop preview, choose Preview to show it again.
- Enter Customer support for
teamand this text fornotes: Updated the help centre. Waiting for approval of the refund policy. Next: train the team. - If you saved example values, Load example values fills those values only when you choose it. It replaces the current values for variables with saved examples.
- Check the preview, choose Copy filled prompt, and paste the result into your assistant. Filling in and copying need no AI provider.
With the sample inputs above, the copied prompt is:
<TASK>
Write a weekly update for Customer support using these notes:
Updated the help centre. Waiting for approval of the refund policy. Next: train the team.
</TASK>
<FORMAT>
Use three headings: Progress, Blockers, Next steps.
</FORMAT>This is the text you send to the assistant, rather than an AI-generated update. Generating the update happens in the assistant you paste into, or through the optional Try once action inside Test with AI, using your connected provider.
Choose the right copy action
- Copy template keeps the placeholders for reuse or editing elsewhere.
- Copy filled prompt substitutes the values you entered. Missing optional values stay as placeholders, with a warning. Missing required values disable this action.
- Copy with placeholders explicitly allows an incomplete copy, including missing required values. Use it when you plan to finish the inputs elsewhere.
- Copy prompt is the label when the prompt has no variables.
Save keeps the template and its variable settings. It does not save the current filled values as example inputs; enter examples in Variables and save them explicitly if needed.
Put it to use
Sign in to keep your own library. Writing, saving, filling in and copying prompts need no AI provider. Paste a prompt, Refine, and Try once are optional actions that use the provider you connect.
Open the appKeep learning
- What is a prompt library?
A prompt library keeps the AI prompts you reuse in one place, named and ready to fill in. What belongs in one, what makes an entry useful, and how to start.
- How to create reusable AI prompts
Turn a prompt you keep retyping into named sections, save it in your library, and keep improving it without losing earlier versions.
- How to organize and reuse your ChatGPT prompts
Keep useful ChatGPT prompts in a personal library with clear names, folders, favourites, search and version history.
- What makes a good AI prompt
The six parts most prompts need (role, context, task, format, constraints and examples), with a complete example and how to test and improve a prompt.
- How to write prompts for coding agents
Brief Claude Code, Codex or Cursor like a work ticket: the goal, where to look, constraints, a checkable definition of done and what to report.
- How to write image generation prompts
Describe subject, setting, composition, style, lighting and format so GPT Image, Midjourney, Stable Diffusion or Gemini produce the picture you have in mind.
- Prompts for research and writing
Get summaries and drafts that stay close to your sources: citations, audience, tone, structure and what the model should do when information is missing.
- How to use your prompt library in ChatGPT and Claude
Connect ChatGPT or Claude to your prompt library to list, open, save and update prompts from a chat, on your own plan and without an API key.