skill

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatForPrompt

func FormatForPrompt(skills []Skill) string

func ParseCommand added in v0.11.7

func ParseCommand(text string) (string, string, bool)

ParseCommand splits a leading "/name args" invocation; args keep their original spacing and may span lines.

Types

type Invocation added in v0.11.7

type Invocation struct {
	Skill *Skill
	Args  string
}

func Invocations added in v0.11.7

func Invocations(text string, skills []Skill) []Invocation

Invocations returns every skill text invokes: the whole text as a leading "/name args" command, or /name mentions anywhere inside it, deduplicated in order of first appearance. A mention only counts when the slash starts a word, so paths and URLs never match.

func (Invocation) Instructions added in v0.11.7

func (inv Invocation) Instructions(workDir string) (string, error)

Instructions loads and expands the invoked skill into the <skill-instructions> block that is attached (hidden) to the message invoking it.

type Skill

type Skill struct {
	Name          string            `yaml:"name"`
	Description   string            `yaml:"description"`
	License       string            `yaml:"license"`
	Compatibility string            `yaml:"compatibility"`
	Metadata      map[string]string `yaml:"metadata"`
	AllowedTools  string            `yaml:"allowed-tools"`

	Location string `yaml:"-"`

	Content string `yaml:"-"`

	Bundled bool `yaml:"-"`
}

func Discover

func Discover(root string) ([]Skill, error)

func DiscoverPersonal added in v0.6.2

func DiscoverPersonal() ([]Skill, error)

func FindSkill added in v0.6.2

func FindSkill(name string, skills []Skill) *Skill

func LoadBundled added in v0.6.2

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

func LoadBundledAt added in v0.12.4

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

LoadBundledAt loads bundled skill metadata and assigns each skill the corresponding directory beneath locationRoot. The caller owns copying the complete resource tree to that location.

func Merge added in v0.6.2

func Merge(bundled, discovered []Skill) []Skill

func MustDiscover added in v0.6.2

func MustDiscover(root string) []Skill

func MustDiscoverPersonal added in v0.6.2

func MustDiscoverPersonal() []Skill

func (*Skill) AbsoluteDir added in v0.6.2

func (s *Skill) AbsoluteDir(workDir string) string

func (*Skill) ApplyArguments added in v0.6.2

func (s *Skill) ApplyArguments(content, args, skillDir string) string

func (*Skill) GetContent added in v0.6.2

func (s *Skill) GetContent(workingDir string) (string, error)

Jump to

Keyboard shortcuts

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