> ## 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.

# Creating Snippets

> Learn how to create and manage snippets effectively

## Creating Your First Snippet

### Navigation

1. Go to **Settings > Snippets** in the main navigation
2. Click **Create Snippet** to start
3. Fill in the required information

![Create Snippet](https://mintlify.s3.us-west-1.amazonaws.com/autoblocks/images/prompt-snippets/create-snippet.png)

### Snippet Configuration

#### Name Requirements

Snippet names must follow these rules:

* **Format**: Letters, numbers, slashes, underscores, and hyphens only
* **Pattern**: `^[a-zA-Z0-9]+([/_-][a-zA-Z0-9]+)*$`
* **Length**: 1-100 characters
* **Hierarchy**: Use forward slashes for organization (e.g., `system/greeting`)

#### Good Naming Examples

```
✅ system/greeting
✅ responses/error-handling
✅ validation/email-format
✅ templates/appointment-confirmation
✅ brand/voice-tone
✅ legal/privacy-notice
```

#### Poor Naming Examples

```
❌ system greeting (spaces not allowed)
❌ responses.error (dots not allowed)
❌ validation@email (special characters not allowed)
❌ /system/greeting (cannot start with slash)
❌ system/greeting/ (cannot end with slash)
```

#### Content Guidelines

* **Be specific**: Write clear, focused content
* **Use variables**: Include template variables like `{{ name }}` when needed
* **Keep it modular**: Each snippet should serve a single purpose
* **Test thoroughly**: Verify content works in different contexts

### Example Snippet Creation

#### System Instructions

```
Name: system/customer-service
Content: You are a customer service representative for Autoblocks. 
Always be helpful, professional, and solution-oriented. If you cannot 
resolve an issue, escalate to a human agent.
```

#### Response Templates

```
Name: responses/appointment-confirmed
Content: Thank you, {{ customerName }}! Your appointment is confirmed 
for {{ appointmentDate }} at {{ appointmentTime }}. You'll receive a 
confirmation email shortly.
```

#### Validation Messages

```
Name: validation/required-field
Content: This field is required. Please provide the requested information 
to continue.
```

## Managing Snippets

### Viewing Snippets

The snippets dashboard shows:

* **Snippet name** and hierarchy
* **Usage count** (how many prompts reference it)
* **Last updated** timestamp
* **Quick actions** (edit, delete)

### Usage Tracking

Each snippet displays its usage count:

* **Green badge**: Actively used snippets
* **Gray badge**: Unused snippets
* **Number**: Count of referencing prompts

### Editing Snippets

1. Click on a snippet from the list
2. Modify the content as needed
3. Add an optional **commit message** describing changes
4. Save to create a new revision

⚠️ **Important**: Changes immediately affect all referencing prompts.

### Revision History

View complete revision history:

* **Content changes** over time
* **Author** of each revision
* **Commit messages** explaining changes
* **Timestamps** for change tracking

![Snippet Revision History](https://mintlify.s3.us-west-1.amazonaws.com/autoblocks/images/prompt-snippets/snippet-revision.png)

![Save Snippet](https://mintlify.s3.us-west-1.amazonaws.com/autoblocks/images/prompt-snippets/save-snippet.png)
