npx skills add ...
npx skills add launchdarkly/agent-skills --skill snippets
npx skills add launchdarkly/agent-skills --skill snippets
Create and manage prompt snippets — reusable text blocks referenced inside config variation prompts. Keeps common instructions, personas, and guardrails consistent across multiple configs.
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 config variations, and verify everything is wired correctly.
This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
create-prompt-snippet -- create a new reusable text blocklist-prompt-snippets -- browse existing snippets in the projectget-prompt-snippet -- inspect a specific snippet's contentOptional MCP tools:
update-prompt-snippet -- edit a snippet's text, name, or tagsdelete-prompt-snippet -- permanently remove a snippetupdate-ai-config-variation -- update variation prompts to reference snippetsPrompt 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 config variations.
When a snippet is updated, a new version is created. Config variations that reference the snippet can pick up the latest version, keeping all your configs in sync.
| 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 |
safety-guardrails, json-output-format, support-personaBefore creating snippets, understand what's shared:
get-ai-config for eachlist-prompt-snippets to avoid duplicatesUse create-prompt-snippet with:
key -- unique identifier (lowercase, hyphens, e.g. safety-guardrails)name -- human-readable display nametext -- the reusable prompt text contentdescription (optional) -- explain when/why to use this snippettags (optional) -- categorize for discovery (e.g. ["guardrails", "safety"])get-prompt-snippet to confirm the snippet was created with the correct textlist-prompt-snippets to see it in the project listingReport results:
Use update-prompt-snippet to modify an existing snippet. Only pass the fields you want to change:
Each update creates a new version. Existing config variations referencing the snippet can pick up the new version.
| Situation | Action |
|---|---|
| Snippet key already exists | Use get-prompt-snippet to check, then either update or choose a different key |
| 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 delete-prompt-snippet with confirm: true |
list-prompt-snippets first{
"projectKey": "my-project",
"snippetKey": "safety-guardrails",
"text": "Updated guardrail text with new compliance requirements..."
}