Documentation
¶
Index ¶
- Constants
- func BuildSystemPromptInjection(skills []Skill) string
- func BuildSystemPromptInjectionForActivePaths(skills []Skill, activePaths []string) string
- func BuildSystemPromptInjectionWithTriggers(skills []*Skill) string
- type ExecutionMode
- type ExecutionPlan
- type ExecutionStep
- type LoadOption
- type Planner
- type Registry
- func (r *Registry) All() []*Skill
- func (r *Registry) Get(name string) (*Skill, bool)
- func (r *Registry) LoadFromDirs(ctx context.Context, l *logger.Logger, dirs []string, opts ...LoadOption) error
- func (r *Registry) LoadSkills(skills []Skill)
- func (r *Registry) LookupCommand(cmd string) (*Skill, bool)
- func (r *Registry) LookupKeyword(text string) (*Skill, bool)
- func (r *Registry) MatchAll(text string) []*Skill
- func (r *Registry) MatchRegex(text string) (*Skill, []string)
- func (r *Registry) Register(skill *Skill)
- type Skill
- type Trigger
Constants ¶
const SkillFileName = "SKILL.md"
Variables ¶
This section is empty.
Functions ¶
func BuildSystemPromptInjectionForActivePaths ¶ added in v1.8.11
func BuildSystemPromptInjectionWithTriggers ¶ added in v1.8.0
Types ¶
type ExecutionMode ¶ added in v1.6.4
type ExecutionMode string
ExecutionMode defines how a group of skills should be executed
const ( ModeParallel ExecutionMode = "parallel" ModeSerial ExecutionMode = "serial" )
type ExecutionPlan ¶ added in v1.6.4
type ExecutionPlan struct {
Steps []ExecutionStep
}
ExecutionPlan represents the ordered execution of skills
type ExecutionStep ¶ added in v1.6.4
type ExecutionStep struct {
Mode ExecutionMode
Skills []*Skill
}
ExecutionStep represents a single step in an execution plan
type LoadOption ¶ added in v1.8.11
type LoadOption func(*loadConfig)
func WithDedupeByRealpath ¶ added in v1.8.11
func WithDedupeByRealpath(v bool) LoadOption
func WithResolveSymlinks ¶ added in v1.8.11
func WithResolveSymlinks(v bool) LoadOption
type Planner ¶ added in v1.6.4
type Planner struct {
// contains filtered or unexported fields
}
Planner handles skill intention recognition and execution planning
func NewPlanner ¶ added in v1.6.4
NewPlanner creates a new skill planner
type Registry ¶ added in v1.6.4
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the registration and lookup of skills
func NewRegistry ¶ added in v1.6.4
func NewRegistry() *Registry
NewRegistry creates a new skill registry
func (*Registry) LoadFromDirs ¶ added in v1.8.0
func (r *Registry) LoadFromDirs(ctx context.Context, l *logger.Logger, dirs []string, opts ...LoadOption) error
LoadFromDirs scans dirs for SKILL.md, loads them and registers into the registry.
func (*Registry) LoadSkills ¶ added in v1.6.4
LoadSkills registers a list of skills
func (*Registry) LookupCommand ¶ added in v1.6.4
LookupCommand finds a skill by command trigger (e.g., "/help")
func (*Registry) LookupKeyword ¶ added in v1.6.4
LookupKeyword finds a skill by keyword trigger
func (*Registry) MatchAll ¶ added in v1.6.4
MatchAll finds all skills matching the input via command, keyword, or regex
func (*Registry) MatchRegex ¶ added in v1.6.4
MatchRegex finds the first skill matching a regex trigger
type Skill ¶
type Skill struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Path string `yaml:"-"` // Absolute path to the SKILL.md file
Content string `yaml:"-"` // The markdown content (instructions)
Triggers []Trigger `yaml:"triggers"`
Tags []string `yaml:"tags"`
Priority int `yaml:"priority"`
Timeout time.Duration `yaml:"timeout"`
Retries int `yaml:"retries"`
Fallback string `yaml:"fallback"`
Dependencies []string `yaml:"dependencies"`
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
Paths []string `yaml:"paths"`
WhenToUse string `yaml:"when_to_use"`
AllowedTools []string `yaml:"allowed_tools"`
}
Skill represents a loaded AgentSkill
func FilterSkillsForActivePaths ¶ added in v1.8.11
func LoadSkillsFromDirs ¶
func LoadSkillsFromDirs(ctx context.Context, l *logger.Logger, dirs []string, opts ...LoadOption) ([]Skill, error)
LoadSkillsFromDirs scans the provided directories for **/SKILL.md files and loads them (opencode-compatible).