skill

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 7 Imported by: 0

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

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

func ParseFrontmatter(content []byte) (name, description string, body []byte)

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

func Load(path string) (*Registry, error)

Load reads the registry from path. Prints warnings to stderr for dangling allow-list references.

func (*Registry) Add

func (r *Registry) Add(s Skill, force bool) error

Add adds a skill to the registry and saves. If force is false and the name already exists, an error is returned.

func (*Registry) Get

func (r *Registry) Get(name string) (*Skill, error)

Get returns a skill by name. Returns an error if not found.

func (*Registry) List

func (r *Registry) List() []Skill

List returns all skills sorted alphabetically by name.

func (*Registry) ListForAgent

func (r *Registry) ListForAgent(agent string) []Skill

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

func (r *Registry) Remove(name string) (Skill, []string, error)

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

func (r *Registry) ReverseLookup(flicknoteID string) (*Skill, bool)

ReverseLookup finds a skill by flicknote ID prefix (8-char hex).

func (*Registry) Validate

func (r *Registry) Validate() []string

Validate returns warnings for dangling allow-list references.

type Skill

type Skill struct {
	Name        string
	FlicknoteID string
	Category    string
	Description string
}

Skill holds metadata for a single registered skill.

Jump to

Keyboard shortcuts

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