Managing prompt snippets
Prompt snippets are small named prompt fragments —
personas, tones of voice, target audiences, image
styles, layouts — that editors manage centrally.
Consuming extensions (for example nr_repurpose)
query snippets by tag and compose them into their
prompts.
Snippets are deliberately not prompt templates: a prompt template is a complete, versioned prompt with model parameters, while a snippet is a reusable building block without any model binding.
Adding a snippet
- Navigate to Admin Tools > LLM > Snippets.
- Click New Snippet.
-
Fill in the fields:
- Identifier
- Unique technical identifier (e.g.,
persona-friendly-expert). - Name
- Display name (e.g.,
Friendly Expert). - Tags
- Comma-separated tags consuming extensions search for (see below).
- Snippet text
- The prompt fragment itself.
- Metadata (JSON)
- Optional JSON object with extra settings.
- Click Save.
Tag convention
Tags are free-form, comma-separated strings. There
is no fixed vocabulary — consuming extensions agree
on tags with the editors. Matching is exact per tag
and case-insensitive: the tag style does not
match a snippet tagged lifestyle.
Established tags so far:
| Tag | Used for |
|---|---|
audience | Target audience descriptions |
tone_of_voice | Tone-of-voice instructions |
persona | Writing/speaking personas |
layout | Layout instructions (e.g. for slides) |
style | Image / visual style descriptions |
Persona snippets may carry a voice hint in their metadata so speech features can pick a matching text-to-speech voice:
{"voice": "nova"}
Using snippets from an extension
Query snippets by tag through the public
Prompt and compose the
selected fragments with the
Prompt:
$audiences = $this->promptSnippetRepository
->findActiveByTag('audience');
$tones = $this->promptSnippetRepository
->findActiveByTag('tone_of_voice');
$sections = $this->promptSnippetComposer->composeSections([
'TARGET AUDIENCE' => $audiences[0] ?? null,
'TONE OF VOICE' => $tones[0] ?? null,
]);
compose renders each non-null
snippet as a LABEL: block followed by the
snippet text, joined by blank lines. Null entries
and empty snippets are skipped.
See ADR-031 for the design rationale.