Documentation
¶
Overview ¶
Package skill provides the skill/plugin system for Chronos agents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages installed skills.
func NewRegistry ¶
func NewRegistry() *Registry
type Skill ¶
type Skill struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author,omitempty"`
Tags []string `json:"tags,omitempty"`
Manifest map[string]any `json:"manifest,omitempty"` // from SKILL.md or JSON manifest
Tools []string `json:"tools,omitempty"` // tool names this skill provides
}
Skill represents an installable capability with metadata.
func LoadFromDir ¶ added in v0.12.1
LoadFromDir walks root looking for SKILL.md files and returns one *Skill per file. Each SKILL.md is expected to begin with a YAML frontmatter block delimited by lines containing only `---`; the frontmatter carries the metadata fields (Name, Version, Description, Author, Tags, Tools), and the remaining Markdown body is captured into Manifest["body"] so callers can inject it into an agent's system prompt.
Layout convention: root/<skill-name>/SKILL.md. The skill's Name defaults to the containing directory's basename when the frontmatter omits `name`. Files without a leading `---` block are skipped so unrelated Markdown in the tree does not accidentally become a skill.
A missing root directory is not an error — LoadFromDir returns (nil, nil). This lets callers set skills_dir unconditionally without requiring the dir to exist for every project.