discovery

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package discovery locates SKILL.md bundles within fetched material and enforces naming and frontmatter schema rules.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoSkill is returned when no SKILL.md can be found.
	ErrNoSkill = errors.New("no SKILL.md found")
	// ErrAmbiguousSkill is returned when multiple skills are found and no
	// explicit path selects one.
	ErrAmbiguousSkill = errors.New("multiple SKILL.md found; specify a path")
)

Sentinel discovery errors.

Functions

This section is empty.

Types

type Skill

type Skill struct {
	// Dir is the absolute directory containing SKILL.md.
	Dir string
	// RelDir is Dir relative to the search root (forward-slash, "." at root).
	RelDir string
	// Frontmatter is the parsed, validated SKILL.md frontmatter.
	Frontmatter metadata.Frontmatter
	// Body is the markdown body.
	Body []byte
	// Warnings carries non-fatal validation warnings (e.g. unknown keys).
	Warnings []string
}

Skill is a discovered, validated skill bundle.

func Discover

func Discover(root, explicitPath string) (Skill, error)

Discover locates the skill within root. When explicitPath is set, only that subpath is consulted (explicit path wins, FR-011); otherwise the tree is searched and exactly one SKILL.md must be present (FR-011, FR-013).

Jump to

Keyboard shortcuts

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