skill

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Overview

Package skill provides the skill/plugin system for Chronos agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromDirInto added in v0.12.1

func LoadFromDirInto(root string, r *Registry) (int, error)

LoadFromDirInto walks root and registers every discovered skill in r, overwriting any existing entry with the same name (Register semantics). It returns the count of skills registered.

Types

type Registry

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

Registry manages installed skills.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (*Skill, bool)

func (*Registry) List

func (r *Registry) List() []*Skill

func (*Registry) Register

func (r *Registry) Register(s *Skill)

func (*Registry) Uninstall

func (r *Registry) Uninstall(name string) error

type Skill

type Skill struct {
	Name        string         `json:"name"`
	Version     string         `json:"version"`
	Description string         `json:"description"`
	Author      string         `json:"author,omitempty"`
	Tags        []string       `json:"tags,omitempty"`
	Manifest    map[string]any `json:"manifest,omitempty"` // from SKILL.md or JSON manifest
	Tools       []string       `json:"tools,omitempty"`    // tool names this skill provides
}

Skill represents an installable capability with metadata.

func LoadFromDir added in v0.12.1

func LoadFromDir(root string) ([]*Skill, error)

LoadFromDir walks root looking for SKILL.md files and returns one *Skill per file. Each SKILL.md is expected to begin with a YAML frontmatter block delimited by lines containing only `---`; the frontmatter carries the metadata fields (Name, Version, Description, Author, Tags, Tools), and the remaining Markdown body is captured into Manifest["body"] so callers can inject it into an agent's system prompt.

Layout convention: root/<skill-name>/SKILL.md. The skill's Name defaults to the containing directory's basename when the frontmatter omits `name`. Files without a leading `---` block are skipped so unrelated Markdown in the tree does not accidentally become a skill.

A missing root directory is not an error — LoadFromDir returns (nil, nil). This lets callers set skills_dir unconditionally without requiring the dir to exist for every project.

Jump to

Keyboard shortcuts

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