Variable Syntax
PromptRepo uses a double-curly-brace syntax for variables:Variable names are case-sensitive.
{{userName}} and {{username}} are treated as different variables.Creating Prompts with Variables
Add Variables to Content
When creating or editing a prompt, include variables using the In this example, there are three variables:
{{variableName}} syntax:topicuserNamesubject
Save Your Prompt
Save the prompt normally. PromptRepo automatically detects all variables in the content.
Resolving Variables
The Resolve tab provides a form to fill in variable values and preview the final output.Open the Resolve Tab
Click the Resolve tab in your prompt detail view.
The Resolve tab only appears if your prompt contains at least one variable.
Fill in Variable Values
The system displays an input field for each detected variable. Enter the values you want to substitute:
- topic:
Python programming - userName:
Alex - subject:
list comprehensions
Preview Resolved Content
As you type, the resolved content updates in real-time below the form, showing:
Saving Variable Snapshots
Snapshots let you save specific variable combinations for reuse.Save Snapshot
Click the Save Snapshot button (if available) to store this combination.Snapshots preserve:
- All variable values
- The prompt version they were created with
- A timestamp
View Saved Snapshots
Switch to the Snapshots tab to see all saved variable combinations for this prompt.
Variable Naming Best Practices
Use Descriptive Names
Good:Use Consistent Naming Conventions
Choose a convention and stick to it:- camelCase:
{{userName}},{{maxTokens}} - snake_case:
{{user_name}},{{max_tokens}} - kebab-case:
{{user-name}},{{max-tokens}}
Spaces inside variable names are supported:
{{user name}} is valid, but not recommended for clarity.Advanced Variable Usage
Optional Variables
If a variable is not provided when resolving, the original{{variableName}} placeholder remains in the output:
Variables in Context
Variables can appear multiple times in a single prompt:{{topic}} will be replaced with the same value.
Multiline Variables
Variable values can span multiple lines:Using Variables via API
If you’re accessing prompts via the MCP (Model Context Protocol) API:Common Variable Use Cases
User Personalization
Template Parameters
Dynamic Instructions
Configuration
Troubleshooting
Variables Not Detected
Ensure you’re using the correct syntax with double curly braces:- Correct:
{{variable}} - Incorrect:
{variable},${variable},[[variable]]
Nested Braces
Nested braces are not supported:Special Characters
Variable names support most characters but avoid using:- Closing braces:
}} - Only whitespace
If you need literal double curly braces in your content, this is currently not supported. Variables will always be parsed.