prompts

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PromptsDirName = "prompts"

PromptsDirName is the subdirectory within .decsr for custom prompts.

Variables

This section is empty.

Functions

func ExportPrompt

func ExportPrompt(promptName, destDir string) (string, error)

ExportPrompt writes the default embedded prompt to a project-level override file. Returns the path of the written file.

func Load

func Load(name string) (string, error)

Load returns the content of a prompt template by name.

func MustLoad

func MustLoad(name string) string

MustLoad returns the content of a prompt or panics if not found.

func OverrideExists

func OverrideExists(promptName, overrideDir string) bool

OverrideExists returns true if a project-level override exists for the given prompt.

func PromptsForRole

func PromptsForRole(role string) []string

PromptsForRole returns the prompt template names used by a given agent role.

func SetOverrideDir

func SetOverrideDir(dir string)

SetOverrideDir configures a project-level directory to check for prompt overrides. Files in this directory take precedence over embedded defaults.

func SetUserLanguage

func SetUserLanguage(_ string)

SetUserLanguage is retained as a no-op for backwards compatibility. The project policy is that all agents reply exclusively in English regardless of the configured user language.

Types

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader provides system prompt templates from embedded files, with optional project-level overrides from .decsr/prompts/.

func New

func New() *Loader

New creates a Loader backed by embedded prompt files.

func (*Loader) Available

func (l *Loader) Available() []string

Available returns the names of all embedded prompts.

func (*Loader) Load

func (l *Loader) Load(name string) (string, error)

Load returns the content of a prompt template by name. It checks project-level overrides first, then falls back to embedded.

func (*Loader) MustLoad

func (l *Loader) MustLoad(name string) string

MustLoad returns the content of a prompt or panics if not found.

Jump to

Keyboard shortcuts

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