vibecode.sh
Blocks

Variable

Create dynamic placeholders for customizable prompts

Variable

The Variable block creates dynamic placeholders in your prompts that can be filled in with different values each time. Variables make your prompts reusable and customizable, turning a single prompt template into a flexible tool that adapts to different inputs.

When to Use

Use Variable blocks when:

  • Reusable templates: Same prompt structure, different inputs each time
  • User inputs: Names, topics, or preferences that change
  • Dynamic content: Data that comes from external sources
  • A/B testing: Comparing prompt variations with controlled changes
  • Parameterized workflows: Building prompt libraries for teams

How to Use

  1. Add a Variable block to your prompt canvas
  2. Define your variable with a clear, descriptive name
  3. Use the syntax {{variable_name}} in other blocks where the value should appear
  4. Provide default values or descriptions for clarity
  5. Fill in values before running the prompt

Syntax

Variables use double curly braces:

{{variable_name}}

Examples:

  • {{user_name}} - A person's name
  • {{product_description}} - Longer text content
  • {{programming_language}} - A specific option
  • {{max_words}} - A numeric value

Examples

Customer Support Template

Variables defined:

{{customer_name}} - The customer's first name
{{issue_type}} - bug, feature request, or billing
{{product}} - The product they're asking about

Used in prompt:

Write a friendly support response to {{customer_name}} regarding
their {{issue_type}} with {{product}}. Acknowledge their concern
and provide next steps.

Code Generation Template

Variables defined:

{{function_name}} - Name for the new function
{{input_type}} - TypeScript type for the input
{{output_type}} - TypeScript type for the return value
{{description}} - What the function should do

Used in prompt:

Create a TypeScript function called {{function_name}} that:
- Accepts a parameter of type {{input_type}}
- Returns {{output_type}}
- Purpose: {{description}}

Include JSDoc comments and handle edge cases.

Content Localization Template

Variables defined:

{{original_text}} - The content to adapt
{{target_market}} - The market/region (e.g., "UK", "Australia")
{{tone}} - formal, casual, or playful

Used in prompt:

Adapt the following content for the {{target_market}} market:

{{original_text}}

Adjust spelling, idioms, and cultural references appropriately.
Maintain a {{tone}} tone throughout.

Tips

  • Use descriptive names: {{user_query}} is clearer than {{q}} or {{input}}
  • Include expected format: Note if a variable should be a number, list, or specific format
  • Provide examples in descriptions: "e.g., 'JavaScript', 'Python', 'Rust'"
  • Set sensible defaults: Good defaults make templates immediately usable
  • Group related variables: Keep variables for the same concept together
  • Validate inputs: Consider what happens with empty, very long, or unusual values
  • Document your variables: Future you (or your team) will thank you

On this page