Skip to content

Repository files navigation

Prompt Tags

Prompt Tags adds XML-style boundaries around SillyBunny prompt sections. This makes sections such as World Info, Character Description, and Persona explicit without changing their contents.

<world_info>
Eldoria is a kingdom of glass towers…
</world_info>

<character_description>
Seraphina is the guardian of the glade…
</character_description>

<persona>
I am a travelling bard.
</persona>

Install

In SillyBunny, open Extensions, choose Install Extension, and paste:

https://github.com/platberlitz/SillyBunny-PromptTags.git

Reload SillyBunny after installation. You will find Prompt Tags in the Extensions settings panel.

To install from the command line instead:

git clone https://github.com/platberlitz/SillyBunny-PromptTags.git \
  SillyBunny/data/<your-user>/extensions/SillyBunny-PromptTags

Quick start

  1. Open Extensions → Prompt Tags.
  2. Leave Enable prompt tags on.
  3. Open Character & world and review the enabled sections.
  4. Change a tag name if needed. The overview reports queued profile changes and preset save state.

The default profile tags these six sections:

  • World Info before and after
  • Character Description
  • Personality
  • Scenario
  • Persona

Blank sections are skipped, so the extension does not add empty tag pairs. Chat Completion uses the profile automatically when SillyBunny builds the prompt.

Configure sections

Each section has an on/off checkbox and a tag name. For example, changing the Character Description tag to character_card produces:

<character_card>
…character description…
</character_card>

Choose Custom wrapper when a tag name is not enough. Put {{content}} where the section text belongs:

<world_info source="lorebook" priority="high">
{{content}}
</world_info>

SillyBunny macros such as {{char}} and {{user}} work inside a custom wrapper. Prompt Tags resolves macros in the wrapper but leaves the section body unchanged.

The Character & World group starts open. Instructions, Injected Blocks, and Advanced stay collapsed until you need them.

Each group has enable-all, disable-all, and confirmed reset actions. Custom wrappers show a compact preview of the configured opening and closing text without expanding macros or inserting section content.

Profiles and overrides

A profile is a named set of section rules with an internal immutable ID. Duplicate starts a new profile as a copy of the profile you are editing. Rename, Reset, Import, Export, and Delete are under More profile actions. Renaming keeps existing chat and character assignments; deleting one makes old assignments inherit instead of allowing a later profile with the same name to reactivate them. Import results remain visible under the profile editor, including each rejected profile and its reason.

You can assign profiles at four levels:

  1. This chat
  2. This character
  3. This preset
  4. Default profile

Each level takes priority over the ones below it, so a chat override beats a character override, which beats the preset binding, which beats the default. The status below the selectors shows which profile SillyBunny is currently using, why, and which profile you are editing.

Binding a profile to a preset means equipping that preset also equips its tagging. The binding is stored by profile ID, so renaming the profile keeps it. A preset shared by someone else carries an ID that does not exist on your install; Prompt Tags reports that as an unavailable profile and falls back instead of guessing.

Exports are versioned JSON files that contain all profiles. Importing accepts current and v1 exports, rejects malformed profiles with a per-profile reason, and never overwrites a profile with the same name; the imported profile receives a numbered suffix instead.

Prompts in this preset

The sections above are the ones SillyBunny always builds. A Chat Completion preset also carries its own prompt list, including any custom prompts you add in the Prompt Manager, and those differ from preset to preset.

Open Preset overrides → Prompts in "" to tag any of them. Prompt Tags suggests a tag name from the prompt's title, so a prompt called House Rules starts as <house_rules>.

<house_rules>
Keep replies under three paragraphs.
</house_rules>

These tags are stored inside the preset, which has three consequences worth knowing:

  • Equipping another preset swaps both the prompt list and its tags. Switching back brings yours back.
  • Renaming the preset keeps them, and deleting the preset removes them with it.
  • Exporting the preset carries the tags along, so sharing a preset shares its tagging.

A known prompt such as Persona starts Inherited: it shows the effective profile's state and tag, and stays read-only until Override for this preset is enabled. Turning Override off hands that prompt back to the profile. Custom preset prompts retain ordinary controls and become stored overrides when edited.

Disable all effective tags creates disabled overrides wherever an inherited profile rule is currently on. Remove all overrides has a different result: known prompts return to their profile settings, while preset-only prompts become unconfigured. Search and Show overridden only affect visibility, never the scope of either bulk action.

Chat History and Dialogue Examples are left out of this list for the reason given under Limits. This panel applies to Chat Completion; on Text Completion it explains that instead of listing prompts.

Text Completion

Text Completion builds its prompt from the active context template. Prompt Tags offers three ways to work with it:

  • Save tagged copy creates a new context preset and leaves the active preset unchanged. Existing names, including case- or accent-equivalent names, are refused.
  • Update current template adds the edited profile's tags to the active preset and stores the first untagged template for recovery. Repeated updates keep that original baseline.
  • Restore saved version restores a saved copy only when it belongs to the active preset. If the template changed after tagging, Prompt Tags asks before replacing it.
  • Remove this profile's tags strips matching wrappers without replacing unrelated manual edits. It is also available when no saved copy exists.

Existing {{#if}} guards stay in place, so empty sections still render nothing. If a template omits a section or uses the same variable more than once, Prompt Tags leaves that section alone and reports the reason inline (with a console diagnostic for troubleshooting).

Conflicting formatting

SillyBunny can also format World Info, Personality, and Scenario. If one of those settings would create nested wrappers, Prompt Tags shows the current value before offering an explicit replacement with SillyBunny's default. The previous value remains available through Undo unless another setting change occurs first.

Prompt Tags also warns when the active context template adds Markdown headings around sections. It does not remove those headings automatically.

Slash commands

Command Result
/prompttags on|off|toggle Enables, disables, or toggles Prompt Tags. With no argument, it toggles.
/prompttags-set section=charDescription tag=character_card Changes one section in the default profile. Add enabled=true or enabled=false to change its state.
/prompttags-profile Terse Changes the default profile. With no name, it reports the effective profile.

Limits

  • Chat History and Dialogue Examples are not wrapped as blocks in Chat Completion. SillyBunny builds them one message at a time, so block wrapping would tag every message separately.
  • Individual World Info entries are not wrapped. A SillyBunny Regex script with World Info placement and Only Format Prompt can handle individual entries.

Technical notes

Prompt Tags wraps content inside PromptManager.preparePrompt, after wrapper macros resolve. The tags remain inside message content through SillyBunny's prompt post-processing modes, including Single user message. Prompt Manager token counts include the tags.

Per-preset data is stored through SillyBunny's own readPresetExtensionField and writePresetExtensionField, under the preset's extensions.promptTags field. Edits are batched into a single write, because saving a preset extension field writes the preset to the server.

Development

Install development dependencies and run linting, unit tests, and Chromium drawer tests with:

npm test

Run one layer independently with npm run lint, npm run test:unit, or npm run test:browser. Browser installation may be needed once: npx playwright install chromium.

The tests cover section wrapping, macro handling, context-template rewriting, profile resolution, retryable per-preset storage, and settings-drawer behavior at desktop and mobile widths.

About

Adds XML tags to prompts in SillyBunny without needing to manually type them out yourself.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages