outputstyle

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package outputstyle adds a selectable "output style" — a block of persona / tone instructions appended to (or replacing) the system prompt — so the user can shift how the agent communicates without rewriting the system prompt. It mirrors the skill/command loaders: built-in styles plus markdown files with frontmatter discovered under the project and home convention dirs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(base string, st OutputStyle) string

Apply folds a style into a base system prompt: appended when KeepCoding is set, otherwise the style replaces the prompt (a pure persona). A style with an empty body leaves the base untouched.

func DescribeList

func DescribeList(styles []OutputStyle, active string) string

DescribeList renders the available styles as a short listing for /output-style.

func Dirs

func Dirs() []string

Dirs returns the output-style search directories in load order (later wins), mirroring command/skill discovery: home convention dirs, then project ones.

Types

type OutputStyle

type OutputStyle struct {
	Name        string
	Description string
	Body        string
	KeepCoding  bool // true: append to the coding system prompt; false: replace it
	Builtin     bool
	Path        string // file it loaded from ("" for built-ins)
}

OutputStyle is one selectable persona. Body is appended to the system prompt (KeepCoding true) or used as the whole prompt (false). Name is the selector (case-insensitive); Builtin marks the baked-in ones for listing.

func List

func List(dirs []string) []OutputStyle

List returns every available style — built-ins plus the markdown files under dirs — deduped by lowercased name, with custom files overriding built-ins. Sorted by name. Malformed files are skipped.

func Resolve

func Resolve(name string, dirs []string) (OutputStyle, bool)

Resolve finds the style named name (case-insensitive) among dirs + built-ins. An empty or "default" name returns ok=false (no style — leave the prompt as-is).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL