What are variables in a prompt

Variables turn a prompt into a reusable template. Learn how to define them, name them and use them on HomeCasa Prompts.

A variable is a slot inside a prompt that gets a different value each time you use it. Thanks to variables, the same prompt works for hundreds of similar situations.

Example

Write an 80-word product description for {{product}},
aimed at {{audience}}, with a {{tone}} tone.

If you replace {{product}} with “a reading lamp”, {{audience}} with “students” and {{tone}} with “youthful”, you get a complete prompt without rewriting anything.

How they work on HomeCasa Prompts

In our library, variables are written between double curly braces: {{variable_name}}. On each prompt page:

  1. Click Customize to see the field for each variable.
  2. Type your values: the prompt updates instantly.
  3. Click Copy prompt and paste it into your AI tool.
  4. Use Reset values to go back to the defaults.

The values you type stay in your browser; they are not sent to our servers.

Best practices

  • Clear names: {{target_audience}} beats {{x}}.
  • Example values: a good default shows what kind of information is expected.
  • Only what changes: if something is the same in every use, write it directly in the prompt.
  • Closed lists when it makes sense: tone (formal, friendly…), platform (TikTok, Reels…).

Variables in your own prompts

You can use the same idea in any tool: write your prompt with slots marked as [PRODUCT] or {{product}} and save it in your notes. Before using it, replace the slots. Some tools and automation platforms can fill in variables automatically.

Try creating your own template with the prompt builder.

Learn prompting

  • What is a prompt and how does it work

    A prompt is the instruction you give an artificial intelligence. Learn its parts, why the result depends so much on how you write it, and how to get started.

  • How to create a prompt from scratch

    A 6-step method to go from a vague idea to a clear, reusable prompt, with a complete end-to-end example.

  • How to write effective prompts

    Ten practical principles to write prompts that work on the first try more often: clarity, specificity, examples, format and review.

  • How to write prompts for ChatGPT

    Practical tips to get more out of ChatGPT: message structure, custom instructions, long conversations, files and reviewing answers.

  • How to write prompts for Claude

    How to write prompts for Anthropic's Claude: direct instructions, rich context, long documents, tags for structure and requests for reasoning.

  • How to write prompts to generate images

    The structure that works best in Midjourney, DALL-E, Stable Diffusion, Flux or Firefly: subject, style, light, composition and parameters, with examples.

  • How to write prompts to generate videos

    How to describe a shot for Runway, Kling, Sora or Veo: one subject, one action, camera movement, light and mood. And how to plan multi-shot videos.

  • How to improve a bad prompt

    A diagnostic process to find out why a prompt is not working and how to fix it, with a before-and-after example and a prompt to let the AI help you.

  • What is context in a prompt and how much to give

    Context is the information the AI cannot guess. Learn what to include, what to avoid and how to organize documents and data inside a prompt.

  • How to define roles in a prompt

    What telling the AI “act as…” really does, how to choose a good role, combine it with concrete criteria and avoid roles that do not help.

  • How to structure prompt instructions

    Numbered steps, delimiters, sections and logical order: how to organize a long prompt so the AI does not skip anything.

  • Good and bad prompt examples

    Eight comparisons of real prompts for text, code, image and video, explaining what fails in the bad version and what the good one improves.

  • Common mistakes when writing prompts

    The ten most common prompt-writing mistakes and how to avoid them: from missing context to blindly trusting the answer.

  • Advanced prompting techniques

    Few-shot examples, step-by-step reasoning, prompt chaining, self-critique, structured outputs and evaluation: techniques for more reliable results.