skills

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCatalogXML

func BuildCatalogXML(skills []SkillRecord) string

BuildCatalogXML generates the <available_skills> XML block for system prompt injection.

func BuildSkillContentXML

func BuildSkillContentXML(record SkillRecord) string

BuildSkillContentXML generates the <skill_content> XML wrapper with the skill body and a list of available resources.

func ListResources

func ListResources(baseDir string) ([]string, error)

ListResources lists files in the scripts/, references/, and assets/ subdirectories of a skill's base directory.

func New

func New() engine.Plugin

New creates a new skills plugin.

Types

type Plugin

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

Plugin manages skill discovery, activation, and resource access.

func (*Plugin) Capabilities

func (p *Plugin) Capabilities() []engine.Capability

func (*Plugin) ConfigSchema

func (p *Plugin) ConfigSchema() []byte

ConfigSchema implements engine.ConfigSchemaProvider.

func (*Plugin) Dependencies

func (p *Plugin) Dependencies() []string

func (*Plugin) Emissions

func (p *Plugin) Emissions() []string

func (*Plugin) ID

func (p *Plugin) ID() string

func (*Plugin) Init

func (p *Plugin) Init(ctx engine.PluginContext) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Ready

func (p *Plugin) Ready() error

func (*Plugin) Requires

func (p *Plugin) Requires() []engine.Requirement

func (*Plugin) Shutdown

func (p *Plugin) Shutdown(_ context.Context) error

func (*Plugin) Subscriptions

func (p *Plugin) Subscriptions() []engine.EventSubscription

func (*Plugin) Version

func (p *Plugin) Version() string

type SkillRecord

type SkillRecord struct {
	Name             string            `yaml:"name"`
	Description      string            `yaml:"description"`
	Location         string            `yaml:"-"`
	BaseDir          string            `yaml:"-"`
	License          string            `yaml:"license"`
	Compatibility    string            `yaml:"compatibility"`
	Metadata         map[string]string `yaml:"metadata"`
	AllowedTools     []string          `yaml:"allowed_tools"`
	OutputSchema     map[string]any    `yaml:"output_schema"`      // inline JSON Schema for structured output
	OutputSchemaFile string            `yaml:"output_schema_file"` // path to .json schema file (relative to skill dir)
	Class            string            `yaml:"class"`              // Semantic class for progressive discovery.
	Subclass         string            `yaml:"subclass"`           // Optional grouping within class.
	Tags             []string          `yaml:"tags"`               // Cross-cutting metadata for filtering.
	Runtime          string            `yaml:"runtime"`            // "yaegi" (default) or "wasm" — selects the codeexec runtime for skill helpers.
	Body             string            `yaml:"-"`
	Scope            string            `yaml:"-"` // "project", "user", "builtin", "config"
	Trusted          bool              `yaml:"-"`
}

SkillRecord holds all parsed data from a SKILL.md file.

func ParseSkillFile

func ParseSkillFile(path string) (*SkillRecord, error)

ParseSkillFile reads and parses a SKILL.md file, extracting YAML frontmatter and the markdown body.

func ScanForSkills

func ScanForSkills(paths []string, logger *slog.Logger) []SkillRecord

ScanForSkills scans the given paths for directories containing SKILL.md files.

Jump to

Keyboard shortcuts

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