Prompt variables explained: turn one prompt into many
How the {{variable}} pattern lets a single prompt template serve dozens of jobs, when to parameterise, and concrete examples you can copy into your own library.
You write a great prompt for summarising a meeting. The next week you need to summarise a
different meeting, so you copy the old one and edit the details. A month later you have
nine near-identical copies, each slightly different, and no idea which is the good one.
Variables fix this. Instead of nine copies, you keep one template with blanks you fill in
at run time. This guide explains the {{variable}} pattern and when it’s worth using.
What a variable is
A variable is a named placeholder inside a prompt, written with double curly braces:
Summarise the meeting notes below for {{audience}}.
Keep it under {{word_limit}} words and end with a list of action items.
Notes:
{{notes}}
{{audience}}, {{word_limit}}, and {{notes}} are the parts that change every time you
run the prompt. The rest - the instruction to summarise, the request for action items, the
word limit constraint - stays fixed. When you use this prompt, you fill in the three blanks
and the template assembles the final text for you.
The braces are just a marker. They tell you (and the Promptsson workspace) “this is
a slot, not literal text.” The app reads the template, finds every {{name}}, and shows you
a small form with one field per variable. You type the values, and it produces the finished
prompt ready to copy into your model of choice.
Turning one prompt into many
The power of variables is leverage: one well-crafted template covers an entire category of tasks. Consider an email template:
Write a {{tone}} email to {{recipient}} about {{subject}}.
It should be {{length}} and end with this call to action: {{cta}}.
That single template handles a polite nudge to a client, a firm reminder to a supplier, a warm thank-you to a colleague - all without rewriting anything. You change the values, not the structure. The careful work you did on the structure (asking for a call to action, controlling length) is preserved and reused every single time.
This is the natural next step after learning to write a reusable prompt. There, the advice was to underline the parts that change. Variables are simply how you act on that - you lift those underlined parts out into named slots.
When to parameterise, and when not to
Variables are a tool, not a goal. Over-parameterising makes a prompt fiddly to use, because every run becomes a long form to fill in.
Pull something out as a variable when:
- It changes on most runs (the document, the audience, the topic).
- It’s a value you’d otherwise hunt down and paste in by hand.
- The same template clearly serves several real situations you actually face.
Leave it inline when:
- It almost never changes (your house style, a fixed output format).
- Changing it would really mean writing a different prompt, not filling a blank.
- It’s so short you’d rather just edit the text directly.
A good rule of thumb: aim for two to five variables. Fewer than two and you probably didn’t need a template; more than five and the prompt is often trying to do too many jobs at once and should be split.
Practical examples
A few patterns that reuse well:
Code review.
Review this {{language}} function for {{focus}} (e.g. security, readability).
Suggest concrete changes and explain each in one sentence.
{{code}}
Learning helper.
Explain {{concept}} to a {{level}} learner using one everyday analogy,
then give a {{count}}-question quiz to check understanding.
Product copy.
Write {{count}} headline options for {{product}} aimed at {{audience}}.
Each under {{max_words}} words, no exclamation marks.
Notice how each keeps the judgement calls (one analogy, no exclamation marks, one sentence per change) fixed while letting the specifics flow in through variables. The starter library shows useful variable names in context, while the in-app template picker also demonstrates defaults and field types you can adapt.
Choose a field type and default when useful
A bare {{level}} creates a one-line text field. Add syntax inside the placeholder when the
input needs more structure:
{{context:longtext}}
{{count:number=3}}
{{tone:select=direct|warm|formal}}
{{greeting=Hello}}
Use longtext for substantial pasted context, number for numeric input, and select when a
small fixed set of choices is genuinely helpful. Text after = becomes the default; for a
select, the first option is the default. Keep guidance that does not fit in a concise variable
name in the surrounding prompt itself.
Once you’re running the same template often, a brief note alongside its rating can capture what worked. And as your templates multiply, lean on categories and tags so the right one is always a search away.