skill

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("skill not found")

ErrNotFound is returned when a skill cannot be found in any search path.

Functions

func StripFrontmatter

func StripFrontmatter(content []byte) []byte

StripFrontmatter removes the YAML frontmatter block, returning only the body.

Types

type Frontmatter

type Frontmatter struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Model       string `yaml:"model,omitempty"`
	Schedule    string `yaml:"schedule,omitempty"`
}

Frontmatter is the parsed YAML header from a SKILL.md file.

func ParseFrontmatter

func ParseFrontmatter(content []byte) (Frontmatter, []byte, error)

ParseFrontmatter extracts YAML frontmatter from markdown content. Returns parsed metadata, the body (content after closing ---), and any error. If no frontmatter is found, returns zero Frontmatter and full content as body.

func (Frontmatter) IsTaskType

func (f Frontmatter) IsTaskType() bool

IsTaskType returns true if this skill has schedule frontmatter.

type Resolver

type Resolver struct {
	SearchPaths []string
}

Resolver resolves skills from ordered search paths.

func (Resolver) DiscoverTaskTypes

func (r Resolver) DiscoverTaskTypes() ([]SkillMeta, error)

DiscoverTaskTypes returns only skills with noodle: frontmatter.

func (Resolver) List

func (r Resolver) List() ([]SkillInfo, error)

List returns resolved skills from configured paths, with first match winning.

func (Resolver) ListWithMeta

func (r Resolver) ListWithMeta() ([]SkillMeta, error)

ListWithMeta returns all skills with parsed frontmatter.

func (Resolver) Resolve

func (r Resolver) Resolve(name string) (SkillPath, error)

Resolve resolves a skill by name using first-match-wins precedence.

func (Resolver) ResolveWithMeta

func (r Resolver) ResolveWithMeta(name string) (SkillMeta, error)

ResolveWithMeta resolves a skill by name and parses its frontmatter.

type SkillInfo

type SkillInfo struct {
	Name       string
	Path       string
	SourcePath string
	HasSkillMD bool
}

SkillInfo describes a resolved skill for listing.

type SkillMeta

type SkillMeta struct {
	Name        string
	Path        string
	SourcePath  string
	Frontmatter Frontmatter
}

SkillMeta is the full resolved metadata for a skill, including parsed frontmatter.

type SkillPath

type SkillPath struct {
	Path       string
	SourcePath string
}

SkillPath is the resolved path for a skill and where it was found.

type SkillWatcher

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

SkillWatcher watches configured skill paths for filesystem changes and triggers a callback when skills are added, modified, or deleted.

func NewSkillWatcher

func NewSkillWatcher(paths []string, onChange func()) (*SkillWatcher, error)

NewSkillWatcher creates a watcher for the given skill search paths. For each path: if the directory exists, add a watch and scan for subdirectories (each skill is a subdirectory with a SKILL.md). If a path doesn't exist yet, watch the nearest existing parent directory for Create events.

func (*SkillWatcher) Close

func (sw *SkillWatcher) Close() error

Close shuts down the underlying fsnotify watcher.

func (*SkillWatcher) Run

func (sw *SkillWatcher) Run(ctx context.Context)

Run processes filesystem events until ctx is cancelled.

Jump to

Keyboard shortcuts

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