Skip to main content
Prompt snippets are reusable template fragments that you can include in any prompt. They help you maintain consistency, reduce duplication, and make updates easier.

What Are Snippets?

A snippet is a named piece of Liquid template that can be included in any prompt:
{% include 'json-output-instructions' %}
When the prompt is rendered, the snippet content is inserted in place.

Why Use Snippets?

Consistency

Use the same instructions across all prompts

Maintainability

Update once, applied everywhere

Cleaner Prompts

Keep prompts focused on their specific task

Best Practices

Encode your standards into reusable components

Creating a Snippet

1

Navigate to Prompt Snippets

Click Prompt Snippets in the sidebar.
2

Click Create Snippet

Click the Create Snippet button.
3

Configure the Snippet

FieldDescription
NameDisplay name (e.g., “JSON Output Instructions”)
SlugIdentifier used in includes (e.g., “json-output-instructions”)
ContentThe template content
4

Save

Click Save to create the snippet.

Slug Requirements

The slug is what you use in {% include %} tags:
  • Lowercase letters and hyphens only
  • No spaces or special characters
  • Must be unique across your tenant
json-output-instructions
tone-formal
JSON Output (spaces, capitals)
tone/formal (special characters)

Using Snippets

Include a snippet in any prompt template:
You are a helpful assistant.

{{ inputs.instruction }}

{% include 'json-output-instructions' %}

Where Snippets Work

  • ✅ Prompt templates
  • ✅ Within other snippets (nested includes)
  • ❌ Input/output schemas (JSON only)

Example Snippets

JSON Output Instructions

Slug: json-output-instructions
## Output Format
Return your response as valid JSON only.
- Do not include any text before or after the JSON
- Do not wrap in markdown code blocks
- Ensure all strings are properly escaped
- Use double quotes for strings

Tone Guidelines

Slug: tone-formal
## Tone Guidelines
- Use professional, formal language
- Avoid contractions (use "do not" instead of "don't")
- Maintain a respectful, objective tone
- Be concise and direct
Slug: tone-casual
## Tone Guidelines
- Keep it friendly and approachable
- Contractions are fine
- Use conversational language
- Feel free to add light humor when appropriate

Error Handling Instructions

Slug: error-handling
## Handling Uncertain Cases
If you cannot complete the task or the input is invalid:
- Return a JSON object with "error": true
- Include "message" explaining the issue
- Do not make up information
- Example: {"error": true, "message": "Input text is too short to analyze"}

Language Instructions

Slug: respond-in-language
{% if inputs.language %}
## Response Language
Respond in {{ inputs.language }}. If you cannot write fluently in this language, respond in English and note the limitation.
{% endif %}

Conditional Snippets

Snippets can use the same input variables as your prompt:
{% if inputs.detailed_response %}
Provide a comprehensive, detailed response with examples and explanations.
{% else %}
Keep your response concise and to the point.
{% endif %}

Nested Includes

Snippets can include other snippets: Snippet: standard-instructions
{% include 'tone-formal' %}
{% include 'json-output-instructions' %}
{% include 'error-handling' %}
In your prompt:
Analyze this text: {{ inputs.text }}

{% include 'standard-instructions' %}
Avoid circular includes (A includes B, B includes A). This will cause an error.

Managing Snippets

Editing Snippets

  1. Open Prompt Snippets
  2. Click the snippet to edit
  3. Make changes
  4. Save
Changes to snippets apply immediately to all prompts that include them. Test affected prompts after making changes.

Deleting Snippets

Before deleting a snippet:
  1. Search for its usage in prompts
  2. Remove or replace the {% include %} tags
  3. Then delete the snippet
Deleting a snippet used by prompts will cause those prompts to fail with an “include not found” error.

Finding Snippet Usage

To find which prompts use a snippet:
  1. Open the snippet
  2. Look for a Used By or References section
  3. Click through to see the prompts

Best Practices

Each snippet should do one thing well. Prefer multiple small snippets over one large one.
The slug should clearly indicate what the snippet does: json-output-instructions not snippet1.
Add comments in the snippet content explaining its purpose.
When you update a snippet, test the prompts that use it.
Build a collection of standard snippets for common patterns in your organization.

Common Snippet Patterns

CategorySnippets
Output Formatjson-output, markdown-output, plain-text
Tonetone-formal, tone-casual, tone-technical
Error Handlingerror-handling, validation-rules
Personaexpert-analyst, friendly-assistant
Constraintsword-limit, brevity, no-speculation

Next Steps