aiconfig-snippets
Original:🇺🇸 English
Translated
Create and manage prompt snippets — reusable text blocks referenced inside AI Config variation prompts. Keeps common instructions, personas, and guardrails consistent across multiple configs.
7installs
Added on
NPX Install
npx skill4agent add launchdarkly/agent-skills aiconfig-snippetsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →AI Config Prompt Snippets
You're using a skill that will guide you through creating and managing prompt snippets in LaunchDarkly. Your job is to identify reusable text, create snippets, reference them in AI Config variations, and verify everything is wired correctly.
Prerequisites
This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
- -- create a new reusable text block
create-prompt-snippet - -- browse existing snippets in the project
list-prompt-snippets - -- inspect a specific snippet's content
get-prompt-snippet
Optional MCP tools:
- -- edit a snippet's text, name, or tags
update-prompt-snippet - -- permanently remove a snippet
delete-prompt-snippet - -- update variation prompts to reference snippets
update-ai-config-variation
Core Concepts
What Are Prompt Snippets?
Prompt snippets are named, versioned text blocks stored at the project level. They contain reusable pieces of prompt text — personas, guardrails, output format instructions, domain knowledge — that can be shared across multiple AI Config variations.
When a snippet is updated, a new version is created. AI Config variations that reference the snippet can pick up the latest version, keeping all your configs in sync.
When to Use Snippets
| Scenario | Example |
|---|---|
| Shared persona | "You are a helpful customer support agent for Acme Corp..." used by 5 different configs |
| Safety guardrails | "Never reveal internal pricing. Never generate code that accesses production databases." |
| Output format | "Always respond in JSON with keys: answer, confidence, sources." |
| Domain knowledge | Company-specific terminology, product names, or process descriptions |
| Regulatory text | Compliance disclaimers that must appear in every response |
When NOT to Use Snippets
- Text that is unique to a single variation — just put it in the prompt directly
- Dynamic content that changes per-request — use template variables instead
- Entire prompts — snippets are building blocks, not complete prompts
Core Principles
- Reusability First: Only create a snippet if the text will be used in 2+ places
- Single Responsibility: Each snippet should cover one concern (persona OR guardrails, not both)
- Descriptive Keys: Use keys like ,
safety-guardrails,json-output-formatsupport-persona - Tag for Discovery: Add tags so teammates can find snippets by category
- Verify References: After creating a snippet, confirm it appears in the project
Workflow
Step 1: Identify Reusable Text
Before creating snippets, understand what's shared:
- List existing AI Configs in the project using for each
get-ai-config - Look for repeated text across variation prompts
- Identify text that should stay consistent (guardrails, personas, formats)
- Check existing snippets with to avoid duplicates
list-prompt-snippets
Step 2: Create Snippets
Use with:
create-prompt-snippet- -- unique identifier (lowercase, hyphens, e.g.
key)safety-guardrails - -- human-readable display name
name - -- the reusable prompt text content
text - (optional) -- explain when/why to use this snippet
description - (optional) -- categorize for discovery (e.g.
tags)["guardrails", "safety"]
json
{
"projectKey": "my-project",
"key": "support-persona",
"name": "Customer Support Persona",
"text": "You are a friendly, knowledgeable customer support agent for Acme Corp. Always greet the customer by name when available. Be empathetic but concise. If you don't know the answer, say so honestly and offer to escalate.",
"description": "Standard persona for all customer-facing support configs",
"tags": ["persona", "support"]
}Step 3: Verify
- Use to confirm the snippet was created with the correct text
get-prompt-snippet - Use to see it in the project listing
list-prompt-snippets - Check that version is 1 for newly created snippets
Report results:
- Snippet created with key, name, and text
- Version number confirmed
- Tags applied correctly
Step 4: Update Snippets (When Needed)
Use to modify an existing snippet. Only pass the fields you want to change:
update-prompt-snippetjson
{
"projectKey": "my-project",
"snippetKey": "safety-guardrails",
"text": "Updated guardrail text with new compliance requirements..."
}Each update creates a new version. Existing AI Config variations referencing the snippet can pick up the new version.
Edge Cases
| Situation | Action |
|---|---|
| Snippet key already exists | Use |
| Very long text | Snippets can hold large blocks — but consider splitting into multiple snippets for modularity |
| Snippet referenced by configs | Update carefully — changes propagate to all referencing configs |
| Deleting a referenced snippet | Warn the user that configs will lose the reference. Use |
What NOT to Do
- Don't create snippets for text used in only one place
- Don't put an entire prompt in a single snippet — break it into focused pieces
- Don't delete snippets without checking which configs reference them
- Don't duplicate existing snippets — check first
list-prompt-snippets