Documentation
¶
Overview ¶
Package outputstyle implements output styles: thin, stackable prompt overlays that change how the active persona *talks* without redefining who it is. A style is either a built-in (ported from ref/src/constants/outputStyles.ts) or a Markdown file whose frontmatter names it and whose body becomes the style prompt.
Styles compose with personas rather than replacing them: any style stacks on any main-tier persona. The sysprompt package renders the resolved style; this package owns the catalog (built-ins + disk, layered) and the resolve rules. See docs/roadmap/PRD/output-styles.md.
Index ¶
Constants ¶
const ( SourceBuiltIn = "built-in" SourceUser = "user" SourceProject = "project" )
const DefaultName = "default"
DefaultName is the reserved no-overlay style name. A disk style may deliberately shadow it (same as ref) — that pins a custom voice as the session default for a machine (user tier) or a repo (project tier).
const DirName = "output-styles"
DirName is the flat directory both tiers load styles from: <appHome>/output-styles/*.md (user) and <workdir>/.evva/output-styles/*.md (project). Same two-root layout as skills, but one flat dir — a style is a single file, not a bundle.
Variables ¶
This section is empty.
Functions ¶
func BuiltIns ¶
BuiltIns returns the three shipped styles keyed by name: default (no overlay), Explanatory, and Learning. A fresh map each call — callers layer disk styles on top without mutating shared state.
func LoadAll ¶
LoadAll returns the merged style catalog: built-ins, overlaid by the user tier, overlaid by the project tier (project wins on a name clash, mirroring pkg/skill's AppHome-then-WorkDir precedence and ref's built-in < user < project order). Non-fatal problems — an unreadable dir entry, a style file with an empty body — are skipped and reported as warnings; a broken style file must never break a session.
Types ¶
type Style ¶
type Style struct {
Name string
Description string
Prompt string // "" only for the default style
// KeepCodingInstructions keeps the main prompt's "Doing tasks" coding
// doctrine alongside the style prompt. Mirrors ref's exact check
// (keepCodingInstructions === true): a disk style that omits the
// frontmatter key REPLACES the coding doctrine; built-ins set it true.
KeepCodingInstructions bool
Source string // "built-in" | "user" | "project"
}
Style is one resolved output style. A zero Prompt means "no overlay" — the default style, which must leave the system prompt byte-identical to a style-less build.