skills

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolListSkillsName        = "list_skills"
	ToolLoadSkillName         = "load_skill"
	ToolLoadSkillResourceName = "load_skill_resource"
	ToolRunSkillScriptName    = "run_skill_script"
)
View Source
const DefaultSystemInstruction = `` /* 990-byte string literal not displayed */

DefaultSystemInstruction is the instruction injected when skills are enabled.

Variables

This section is empty.

Functions

func FormatSkillsAsXML

func FormatSkillsAsXML(skills []Skill) string

FormatSkillsAsXML formats skills metadata as an XML block.

Types

type Frontmatter

type Frontmatter struct {
	Name          string
	Description   string
	License       string
	Compatibility string
	AllowedTools  string
	Metadata      map[string]string
}

Frontmatter describes metadata in SKILL.md.

func ReadSkillFrontmatter

func ReadSkillFrontmatter(dir string) (Frontmatter, error)

ReadSkillFrontmatter reads and validates frontmatter from one local skill directory.

func (Frontmatter) Validate

func (f Frontmatter) Validate() error

Validate validates skill frontmatter.

type FrontmatterProvider

type FrontmatterProvider interface {
	Frontmatter() Frontmatter
}

FrontmatterProvider provides skill frontmatter data.

type Resources

type Resources struct {
	References map[string]string
	Assets     map[string][]byte
	Scripts    map[string]string
}

Resources keeps skill files by relative path.

func (Resources) GetAsset

func (r Resources) GetAsset(path string) ([]byte, bool)

func (Resources) GetReference

func (r Resources) GetReference(path string) (string, bool)

func (Resources) GetScript

func (r Resources) GetScript(path string) (string, bool)

func (Resources) ListAssets

func (r Resources) ListAssets() []string

func (Resources) ListReferences

func (r Resources) ListReferences() []string

func (Resources) ListScripts

func (r Resources) ListScripts() []string

type ResourcesProvider

type ResourcesProvider interface {
	Resources() Resources
}

ResourcesProvider provides skill resources data.

type Skill

type Skill interface {
	Name() string
	Description() string
	Instruction() string
}

Skill is the minimal skill contract.

func NewFromDir

func NewFromDir(dir string) ([]Skill, error)

NewFromDir loads all skills discovered under a local directory.

func NewFromEmbed

func NewFromEmbed(fsys fs.FS) ([]Skill, error)

NewFromEmbed loads all skills discovered from an fs.FS root.

type Toolset

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

Toolset provides tools and instructions for loaded skills.

func NewToolset

func NewToolset(skills []Skill) (*Toolset, error)

NewToolset creates a new skill toolset.

func (*Toolset) ComposeTools

func (t *Toolset) ComposeTools(base []tools.Tool) []tools.Tool

ComposeTools merges base tools with skill tools and applies allowed-tools filtering.

func (*Toolset) Instruction

func (t *Toolset) Instruction() string

Instruction returns the instruction block for skills.

func (*Toolset) Tools

func (t *Toolset) Tools() []tools.Tool

Tools returns skill tools.

Jump to

Keyboard shortcuts

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