skill

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package skill implements loading and validation of SKILL.md files (agentskills.io format). Skills live under skills/ in the KB root, one per directory named <namespace>--<skill-name>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogEntry

type CatalogEntry struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version,omitempty"`
	Path        string `json:"path"`
}

CatalogEntry is a compact representation for progressive disclosure (~100 tokens).

func Catalog

func Catalog(skills []Skill) []CatalogEntry

Catalog returns compact catalog entries for progressive disclosure.

type Issue

type Issue struct {
	Path    string
	Message string
	Warning bool // true = warning, false = error
}

Issue represents a validation issue for a skill.

func Validate

func Validate(s *Skill) []Issue

Validate checks a skill for common issues: - name is required - description is required - body exceeds 500 lines is a warning Returns a list of issues (empty = valid).

type Skill

type Skill struct {
	Name        string // from frontmatter
	Description string // from frontmatter (keyword-rich, activation trigger)
	License     string // optional
	Version     string // semver, optional
	Body        string // markdown body (< 500 lines / < 5000 tokens guideline)
	DirPath     string // directory path relative to KB root (e.g. "skills/myns--myskill")
	ServiceRef  string // optional link to a Service concept
}

Skill represents a parsed SKILL.md file.

func LoadAllFromFS

func LoadAllFromFS(fsys fs.FS, root string) ([]Skill, []error)

LoadAllFromFS scans the root directory in fsys and loads all SKILL.md files. Each subdirectory of root that contains SKILL.md is treated as a skill. Returns skills and any errors encountered (non-fatal per skill).

func LoadAllSkills

func LoadAllSkills(kbRoot string) ([]Skill, []error)

LoadAllSkills scans the skills/ directory under kbRoot and loads all SKILL.md files. Returns skills and any errors encountered (non-fatal per skill).

func LoadSkill

func LoadSkill(dirPath string) (*Skill, error)

LoadSkill reads and parses a SKILL.md file from the given directory path. dirPath is the full absolute path to the skill directory.

Jump to

Keyboard shortcuts

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