Documentation
¶
Overview ¶
Package skill implements user-installed Markdown skills and the SKILL tool that invokes them.
Skills live in two directories. Both layouts are identical:
<root>/skills/
<skill-name>/
SKILL.md
LoadRegistry reads EvvaHome first then WorkDir, so a workdir-local skill transparently overrides a same-named home skill. The first line of every SKILL.md is parsed as `# <skill-name> <description>`; the body is whatever follows. The SKILL tool wraps the body as "Follow these instructions" when the model invokes a skill, so the file content is treated as opaque Markdown — the package does not impose structure beyond the title line.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lookup ¶
type Lookup func() *Registry
Lookup is the late-binding shape NewSkill accepts. The host (cmd/evva) loads the registry at startup and installs it on the agent's ToolState; the SkillTool reads it through Lookup at Execute time so construction order between the tool and the registry doesn't matter — mirrors meta.SpawnerLookup and meta.DeferredLookup.
type Registry ¶
type Registry struct {
// Warnings collects non-fatal load issues (malformed first lines, name
// mismatches, unreadable files). Callers may surface these at startup;
// the loader never blocks boot on them.
Warnings []string
// contains filtered or unexported fields
}
Registry is the merged catalog of installed skills. Construct via LoadRegistry; methods are safe to call from any goroutine because the map is set once at construction and only read afterwards.
func LoadRegistry ¶
LoadRegistry scans homeSkillsDir then workdirSkillsDir and returns the merged registry. Missing directories are treated as empty — having no skills installed is the normal state, not an error.
The order matters: workdir skills overwrite home skills with the same folder name. The override is recorded as a warning so the user can spot surprise shadowing.
func (*Registry) List ¶
List returns every known skill sorted by name. Used by the sysprompt builder so the # Skills section is deterministic across runs.
type SkillMeta ¶
type SkillMeta struct {
Name string
Description string
Path string // absolute path to SKILL.md
Source SkillSource
}
SkillMeta is the resolved metadata for a single skill. Body content is loaded on demand via Registry.LoadBody so the prompt path stays cheap.
type SkillSource ¶
type SkillSource string
SkillSource identifies which directory a skill was loaded from. WorkDir always wins on a name clash; this field is exposed mostly for logging and a future `/skills` slash command that wants to surface the origin.
const ( SourceHome SkillSource = "home" SourceWorkDir SkillSource = "workdir" )
type SkillTool ¶
type SkillTool struct {
// contains filtered or unexported fields
}
SkillTool is the LLM-facing tool that invokes a user-installed skill by name. Execute returns the SKILL.md body wrapped as an instruction block so the model treats it as guidance to follow, not raw content to summarize.
func NewSkill ¶
NewSkill constructs a SkillTool that reads its registry via lookup at Execute time. lookup may be nil (yields a clear runtime error if the model invokes the tool); it may also return nil (same outcome).
func (*SkillTool) Description ¶
func (*SkillTool) Schema ¶
func (t *SkillTool) Schema() json.RawMessage