skills

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package skills loads SKILL.md directories (Agent Skills standard). It never executes scripts/ and only reads references/ and assets/.

Index

Constants

View Source
const MaxFileBytes = 256 << 10

MaxFileBytes is the largest file ReadFile returns.

Variables

This section is empty.

Functions

func ValidName

func ValidName(name string) bool

ValidName reports whether name is a valid skill (or plugin) name: lowercase letters, digits and single hyphens between them.

Types

type Skill

type Skill struct {
	Name, Description, Body string
	On                      []string
	Output, Model           string
	Tier                    string // godwit-model-tier; only "small" is kept
	Builtin                 bool
	Version                 string // first 16 hex digits of SHA-256 of SKILL.md
	FS                      fs.FS  // the skill directory (built-ins)
	// contains filtered or unexported fields
}

func Builtins

func Builtins() []Skill

Builtins returns the skills compiled into the binary.

func Load

func Load(root fs.FS, builtin bool) (ok []Skill, failed map[string]error)

Load parses every directory of root as a skill. Directories that fail are returned in failed, keyed by name.

func LoadDir

func LoadDir(dir string) (ok []Skill, failed map[string]error, err error)

LoadDir loads the user skills in dir. A missing dir means none; any other error reading it is returned. Per-skill failures go in failed.

func Parse

func Parse(name string, fsys fs.FS) (Skill, []string, error)

Parse reads SKILL.md from fsys, the skill directory named name. The warnings are non-fatal (a scripts/ directory, which is never run).

func (Skill) ReadFile

func (s Skill) ReadFile(p string) ([]byte, error)

ReadFile returns a file under references/ or assets/ of the skill directory. For user skills every path component must be a real directory or file inside the skill: symlinks are refused, so links cannot reach scripts/ or other skills.

func (Skill) References

func (s Skill) References() ([]string, error)

References lists the regular files under references/, as paths ReadFile takes. Symlinks are left out (ReadFile refuses them).

Jump to

Keyboard shortcuts

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