Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder assembles prompt sections into a single system prompt string.
func DefaultBuilder ¶
func DefaultBuilder() *Builder
DefaultBuilder returns a Builder pre-loaded with the four built-in sections.
func LoadAgentFromDir ¶
func LoadAgentFromDir(base *Builder, dir string, logger *zap.SugaredLogger) *Builder
LoadAgentFromDir overlays per-agent prompt overrides on top of a shared base builder. The directory should be <promptsDir>/agents/<agentName>/. If the directory does not exist, the base builder is returned unmodified.
func LoadFromDir ¶
func LoadFromDir(dir string, logger *zap.SugaredLogger) *Builder
LoadFromDir loads .md files from the given directory and overrides matching default sections. Unknown .md files are added as custom sections with priority 900+.
func (*Builder) Add ¶
func (b *Builder) Add(s PromptSection) *Builder
Add appends a section. If a section with the same ID already exists, it is replaced (last-writer-wins).
func (*Builder) Clone ¶
Clone returns a deep copy of the builder so the caller can diverge independently (e.g. per sub-agent customization).
type PromptSection ¶
type PromptSection interface {
ID() SectionID
Priority() int // Lower = first. Identity=100, Safety=200, ...
Render() string // Empty string = omitted
}
PromptSection produces a titled block of text for the system prompt.
type SectionID ¶
type SectionID string
SectionID identifies a prompt section.
const ( SectionIdentity SectionID = "identity" SectionAgentIdentity SectionID = "agent_identity" SectionSafety SectionID = "safety" SectionConversationRules SectionID = "conversation_rules" SectionToolUsage SectionID = "tool_usage" SectionCustom SectionID = "custom" SectionAutomation SectionID = "automation" )
type StaticSection ¶
type StaticSection struct {
// contains filtered or unexported fields
}
StaticSection is a simple prompt section with fixed content.
func NewStaticSection ¶
func NewStaticSection(id SectionID, priority int, title, content string) *StaticSection
NewStaticSection creates a new static prompt section.
func (*StaticSection) ID ¶
func (s *StaticSection) ID() SectionID
func (*StaticSection) Priority ¶
func (s *StaticSection) Priority() int
func (*StaticSection) Render ¶
func (s *StaticSection) Render() string
Render returns the section content with an optional title header.