> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autoblocks.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Snippets Overview

> Learn about the snippet system for creating reusable prompt content

## What are Snippets?

Snippets are reusable text blocks that can be referenced within prompts. They provide a powerful templating system that allows you to:

* Create reusable content across multiple prompts
* Maintain consistency in messaging
* Update content globally across all referencing prompts
* Organize prompt content with hierarchical naming

![Snippets Overview](https://mintlify.s3.us-west-1.amazonaws.com/autoblocks/images/prompt-snippets/overview.png)

## Core Concepts

### Snippet Structure

Each snippet consists of:

* **Name**: Hierarchical identifier (e.g., `system/greeting`, `validation/email`)
* **Content**: The actual text content that will be inserted
* **Revisions**: Version history of content changes
* **References**: Tracking which prompts use the snippet

### Reference Types

Snippets can be used in two ways:

1. **Referenced**: Snippet maintains its identity and updates propagate automatically
2. **Expanded Inline**: Snippet content is copied directly into the template (loses reference)

### Version Control

* **Latest Content**: Snippets always use the most recent revision
* **No Version Pinning**: References point to snippets, not specific versions
* **Immediate Updates**: Changes to snippets affect all referencing prompts instantly

## Key Benefits

### Consistency

* Maintain consistent messaging across multiple prompts
* Ensure brand voice and tone alignment
* Standardize common responses and instructions

### Efficiency

* Write once, use everywhere
* Reduce duplication across prompt templates
* Faster content updates across the entire system

### Organization

* Hierarchical naming for logical grouping
* Clear ownership and attribution
* Centralized content management

### Collaboration

* Shared snippet library across teams
* Clear revision history with commit messages
* Usage tracking to understand impact

## Use Cases

### System Instructions

```
Name: system/conversation-style
Content: You are a helpful assistant. Always respond in a professional 
and friendly tone. Keep responses concise and accurate.
```

### Common Responses

```
Name: responses/error-handling
Content: I apologize, but I encountered an error processing your request. 
Please try again or contact support if the issue persists.
```

### Validation Rules

```
Name: validation/email-format
Content: Please provide a valid email address in the format: 
user@domain.com
```

### Templates

```
Name: templates/appointment-confirmation
Content: Your appointment is scheduled for {{ date }} at {{ time }}. 
Please arrive 15 minutes early and bring a valid ID.
```

## Integration with Prompts

### Template Editor

* **@-symbol triggers**: Type `@snippet-name` to reference snippets
* **Autocomplete**: Search and select from available snippets
* **Preview on hover**: See snippet content without expanding
* **Inline expansion**: Convert references to static content

### Reference Management

* Automatic tracking of snippet usage in prompt revisions
* Reference cleanup when prompts are updated
* Usage count display for impact assessment

### Deployment Behavior

* Only deployed prompt revisions maintain persistent snippet references
* Non-deployed revisions clean up references when updated
* Deployment transfers snippet relationships to the new revision

## Important Considerations

### Immediate Impact

⚠️ **Critical**: Updating a snippet immediately affects ALL prompts that reference it. There's no way to pin prompts to specific snippet versions.

### Breaking Changes

* Snippet updates can break dependent prompts without warning
* No rollback mechanism for snippet changes
* Testing recommended before updating widely-used snippets

### Deletion Protection

* Cannot delete snippets that are currently referenced
* System shows usage count to understand impact
* Must remove all references before deletion is allowed

## Getting Started

1. **Navigate to Settings > Snippets**
2. **Create your first snippet** with a descriptive name
3. **Add content** that you want to reuse
4. **Reference in prompts** using the template editor
5. **Monitor usage** through the snippets dashboard

Check our [Creating Snippets Guide](/v2/guides/prompt-snippets/creating) for detailed setup instructions.
