skills

package
v0.6.2-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package skills provides an agentic skills system where the model can autonomously invoke specialized capabilities based on task context. Skills are packaged as directories containing a SKILL.md file with YAML frontmatter describing the skill's purpose and instructions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterByAllowlist

func FilterByAllowlist(skills map[string]*Skill, allowed []string) map[string]*Skill

FilterByAllowlist filters skills by an allowlist of names If the allowlist is empty, all skills are returned

func Initialize

func Initialize(ctx context.Context, llmConfig llmtypes.Config) (map[string]*Skill, bool)

Initialize discovers and configures skills based on configuration and CLI flags. It reads skills.enabled from config and respects the --no-skills flag (bound to no_skills in viper). Returns the discovered skills and whether skills are enabled.

Types

type Discovery

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

Discovery handles skill discovery from configured directories

func NewDiscovery

func NewDiscovery(opts ...Option) (*Discovery, error)

NewDiscovery creates a new skill discovery instance

func (*Discovery) DiscoverSkills

func (d *Discovery) DiscoverSkills() (map[string]*Skill, error)

DiscoverSkills finds all available skills from configured directories

func (*Discovery) GetSkill

func (d *Discovery) GetSkill(name string) (*Skill, error)

GetSkill returns a specific skill by name

func (*Discovery) ListSkillNames

func (d *Discovery) ListSkillNames() ([]string, error)

ListSkillNames returns the names of all available skills

type Metadata

type Metadata struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
}

Metadata represents the YAML frontmatter in SKILL.md files

type Option

type Option func(*Discovery) error

Option is a function that configures a Discovery

func WithDefaultDirs

func WithDefaultDirs() Option

WithDefaultDirs initializes with default skill directories

func WithDefaultDirsForCWD

func WithDefaultDirsForCWD(cwd string) Option

WithDefaultDirsForCWD discovers repository skills on the selected workspace, without changing the process directory used by other conversations.

func WithSkillDirs

func WithSkillDirs(dirs ...string) Option

WithSkillDirs sets custom skill directories

type Skill

type Skill struct {
	Name        string // Unique name from frontmatter
	Description string // Brief description for model decision-making
	Directory   string // Full path to the skill directory
	Content     string // Full content of SKILL.md (body, not frontmatter)
}

Skill represents a discovered skill with its metadata

Jump to

Keyboard shortcuts

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