Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("skill not found")
ErrNotFound is returned when a skill cannot be found in any search path.
Functions ¶
func StripFrontmatter ¶
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 ¶
DiscoverTaskTypes returns only skills with noodle: frontmatter.
func (Resolver) List ¶
List returns resolved skills from configured paths, with first match winning.
func (Resolver) ListWithMeta ¶
ListWithMeta returns all skills with parsed frontmatter.
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 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.