Skip to content

Variables & Templates

Variables mark the parts of a prompt that change from one use to the next. PromptHub asks for those values when you copy or test the prompt, so you do not need to edit the original template each time.

Variable form

  • The task stays the same while the source material changes.
  • A workflow always needs a role, audience, language, or output format.
  • A team should fill the same structure consistently.
  • You repeatedly copy a prompt and replace the same few values.

Use double braces around a variable name:

You are an expert in {{domain}}.
Return the result as {{format}}.
Source:
{{content}}

When you copy or test this prompt, PromptHub detects domain, format, and content and opens a form before rendering the final text.

Rewrite the following content in a {{tone}} tone:
{{content}}
Variable Example
tone formal, conversational, concise
content the source text to rewrite
  • Use clear names such as role, audience, sourceText, or outputFormat.
  • Avoid names such as a, b, or text1 that lose meaning later.
  • Reuse the same name for the same concept across related templates.
  • Keep names short enough to scan in a form.
You are {{role}}.
Task: {{task}}
Input:
{{content}}
Goal: {{goal}}
Constraints:
- {{constraint1}}
- {{constraint2}}
Return the result as {{format}}.
Translate the following content into {{targetLanguage}} and keep terminology consistent:
{{sourceText}}
  • Make frequently changing content a variable.
  • Keep stable role, policy, and output rules in the prompt body.
  • Start with a few variables instead of splitting every sentence.
  • If the form becomes tedious, combine related inputs into one content field.

Check that every variable uses complete double braces, such as {{content}}.

Merge small fields into one structured input. For example, background, question, and additional notes can become one content variable.