Documentation
¶
Overview ¶
Package skill is part of the GoFastr harness.
See docs/harness-architecture.md for the architecture this package implements.
Package skill wraps the SKILL.md parser with the 3-tier progressive-disclosure machinery the engine uses.
Tier 1: name + description loaded at startup (~100 tokens/skill). Tier 2: full SKILL.md body fetched on activation. Tier 3: supporting files in scripts/, references/, assets/ —
fetched only on explicit reference from tier 2.
Index ¶
- type Registry
- func (r *Registry) Activate(name string) (string, error)
- func (r *Registry) Load() error
- func (r *Registry) MatchesTrigger(input string) []string
- func (r *Registry) Names() []string
- func (r *Registry) SHA256(name string) (string, bool)
- func (r *Registry) SupportingFile(name, rel string) ([]byte, error)
- func (r *Registry) Tier1Catalog() []skillmd.Tier1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry indexes available skills by name. At startup it scans configured search paths and loads tier-1 metadata for each. Tier-2 bodies are loaded on first Activate.
func NewRegistry ¶
NewRegistry returns a Registry that scans the given search paths when Load is called. Paths are searched in order; later paths override earlier ones (project-local overrides global which overrides built-in).
func (*Registry) Activate ¶
Activate returns the tier-2 body of a skill, loading it from disk on first call. Subsequent calls hit the in-memory cache.
func (*Registry) Load ¶
Load scans the search paths and populates tier-1 metadata. Errors reading individual files are returned as a joined error; loading continues across remaining files.
func (*Registry) MatchesTrigger ¶
MatchesTrigger returns the names of skills whose triggers match the given input (filename glob OR keyword pattern). Empty input returns nothing.
func (*Registry) SHA256 ¶
SHA256 returns the hash of the named skill's SKILL.md, for TOFU comparison.
func (*Registry) SupportingFile ¶
SupportingFile reads a tier-3 file (under scripts/, references/, or assets/) for the named skill. Refuses paths that escape the skill directory.
func (*Registry) Tier1Catalog ¶
Tier1Catalog returns the lightweight metadata for all loaded skills, sorted by name. Engine uses this for the system-prompt skill list.