skill

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSkillNotFound      = errors.New("skill not found")
	ErrInvalidName        = errors.New("invalid skill name")
	ErrInvalidDescription = errors.New("invalid skill description")
	ErrNameMismatch       = errors.New("skill name does not match directory name")
	ErrInvalidFrontmatter = errors.New("invalid skill frontmatter")
	ErrContentTooLarge    = errors.New("skill content exceeds maximum size")
)

Error types

Functions

func Invalidate

func Invalidate()

Invalidate clears the skill cache, forcing rediscovery on next access.

Types

type Info

type Info struct {
	Name          string         `yaml:"name"`
	Description   string         `yaml:"description"`
	License       string         `yaml:"license,omitempty"`
	Compatibility string         `yaml:"compatibility,omitempty"`
	Metadata      map[string]any `yaml:"metadata,omitempty"`
	Location      string         `yaml:"-"` // File path, not in frontmatter
	Content       string         `yaml:"-"` // Markdown content, not in frontmatter
}

Info represents a skill with its metadata and content.

func All

func All() []Info

All returns all available skills.

func Get

func Get(name string) (*Info, error)

Get returns a skill by name.

type SkillError

type SkillError struct {
	Path    string
	Message string
	Err     error
}

SkillError wraps an error with additional context.

func (*SkillError) Error

func (e *SkillError) Error() string

func (*SkillError) Unwrap

func (e *SkillError) Unwrap() error

Jump to

Keyboard shortcuts

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