skills

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package skills loads explicitly selected local Agent Skills documents. It never runs scripts, resolves references, installs skills or grants tools.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfig   = errors.New("skills: invalid configuration")
	ErrFormat   = errors.New("skills: invalid skill document")
	ErrLimit    = errors.New("skills: size or count limit exceeded")
	ErrRead     = errors.New("skills: catalog read failed")
	ErrNotFound = errors.New("skills: skill not found")
	ErrRevision = errors.New("skills: reviewed revision does not match")
)

Functions

This section is empty.

Types

type Activation

type Activation struct {
	Info Info   `json:"info"`
	Body string `json:"body"`
}

Activation identifies the exact reviewed snapshot and its Markdown body. The caller, not this package, decides whether and how to use that text.

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is an immutable collection of locally read snapshots. It owns no open filesystem handle and is safe for concurrent reads. It is not a live directory view or an authority registry.

func Load

func Load(ctx context.Context, directory string, cfg Config) (*Catalog, error)

Load reads only SKILL.md in direct, valid-name child directories of an explicitly selected root. Missing documents and non-candidates are skipped. A malformed candidate, unreadable visible entry or exceeded bound fails without returning a partial catalog.

func (*Catalog) Activate

func (c *Catalog) Activate(name, revision string) (Activation, error)

Activate returns the exact snapshotted body only for a matching reviewed revision. The digest is content identity, not permission or trust. No filesystem read, model request, tool registration or execution occurs.

func (*Catalog) Inspect

func (c *Catalog) Inspect(name string) (Document, error)

Inspect returns a copy of the parsed document for explicit caller review.

func (*Catalog) List

func (c *Catalog) List() []Info

List returns only names, descriptions and revisions in directory order.

type Config

type Config struct {
	MaxSkills    int
	MaxFileBytes int
}

Config bounds one local catalog. Zero selects 64 skills and 64 KiB per document. Hard ceilings are 128 skills, 128 KiB/file and 1 MiB accepted raw document bytes in total.

type Document

type Document struct {
	Info          Info              `json:"info"`
	License       string            `json:"license,omitempty"`
	Compatibility string            `json:"compatibility,omitempty"`
	AllowedTools  string            `json:"allowed_tools,omitempty"`
	Metadata      map[string]string `json:"metadata,omitempty"`
	Body          string            `json:"body"`
}

Document is a parsed, reviewable snapshot. Optional fields are inert metadata; in particular AllowedTools never confers execution authority.

func Parse

func Parse(dirName, raw string) (Document, error)

Parse reads the strict local SKILL.md subset from caller-provided text. dirName is the expected directory identity, not a filesystem path. Markdown body bytes and original-document digest are preserved, including CRLF line endings. No body instruction is interpreted or executed.

type Info

type Info struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Revision    string `json:"revision"`
}

Info is untrusted discovery metadata. Revision hashes the entire raw SKILL.md.

Jump to

Keyboard shortcuts

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