Documentation
¶
Overview ¶
Package skill provides a runtime-agnostic skill registry backed by flicknote.
Skills are markdown documents (commands, methodologies, reference sheets) stored in flicknote and accessed by agents via `ttal skill get <name>`. The registry maps human-readable names to flicknote hex IDs and provides per-agent filtering.
Plane: shared
Index ¶
- func DefaultPath() string
- func ParseFrontmatter(content []byte) (name, description string, body []byte)
- type Registry
- func (r *Registry) Add(s Skill, force bool) error
- func (r *Registry) Get(name string) (*Skill, error)
- func (r *Registry) List() []Skill
- func (r *Registry) ListForAgent(agent string) []Skill
- func (r *Registry) Remove(name string) (Skill, []string, error)
- func (r *Registry) ReverseLookup(flicknoteID string) (*Skill, bool)
- func (r *Registry) Validate() []string
- type Skill
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the default path for the skills registry.
func ParseFrontmatter ¶
ParseFrontmatter extracts name and description from YAML frontmatter, and returns the body content with frontmatter stripped. Used by `add --file` and `migrate` to auto-populate skill metadata and upload only the body to flicknote (no frontmatter pollution).
Single-pass over bytes.Split lines so bodyStart tracks real byte offsets. Handles both LF and CRLF line endings correctly.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry provides access to the skills registry.
func Load ¶
Load reads the registry from path. Prints warnings to stderr for dangling allow-list references.
func (*Registry) Add ¶
Add adds a skill to the registry and saves. If force is false and the name already exists, an error is returned.
func (*Registry) ListForAgent ¶
ListForAgent returns skills filtered by the agent's allow-list, sorted alphabetically. If the agent is not in the [agents] table, all skills are returned.
func (*Registry) Remove ¶
Remove removes a skill from the registry and all agent allow-lists, then saves. Returns the removed skill and the list of agents it was removed from.
func (*Registry) ReverseLookup ¶
ReverseLookup finds a skill by flicknote ID prefix (8-char hex).