skill

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 8 Imported by: 0

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

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

func NewRegistry(searchPaths ...string) *Registry

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

func (r *Registry) Activate(name string) (string, error)

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

func (r *Registry) Load() error

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

func (r *Registry) MatchesTrigger(input string) []string

MatchesTrigger returns the names of skills whose triggers match the given input (filename glob OR keyword pattern). Empty input returns nothing.

func (*Registry) Names

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

Names returns the loaded skill names in sorted order.

func (*Registry) SHA256

func (r *Registry) SHA256(name string) (string, bool)

SHA256 returns the hash of the named skill's SKILL.md, for TOFU comparison.

func (*Registry) SupportingFile

func (r *Registry) SupportingFile(name, rel string) ([]byte, error)

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

func (r *Registry) Tier1Catalog() []skillmd.Tier1

Tier1Catalog returns the lightweight metadata for all loaded skills, sorted by name. Engine uses this for the system-prompt skill list.

Directories

Path Synopsis
Package skillmd is part of the GoFastr harness.
Package skillmd is part of the GoFastr harness.

Jump to

Keyboard shortcuts

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