skill

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatForPrompt

func FormatForPrompt(skills []Skill) string

func MaterializeBundled added in v0.6.2

func MaterializeBundled(s *Skill) (string, error)

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"`
	WhenToUse   string `yaml:"when-to-use"`

	Arguments []string `yaml:"arguments"`

	Location string `yaml:"-"`

	Content string `yaml:"-"`

	Raw 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 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