skill

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoveryRoots added in v0.15.0

func DiscoveryRoots(root string) []string

DiscoveryRoots returns every directory that can contribute skills to a workspace. Callers use it to grant narrow resource access before a root is created, so skills generated after a session starts remain usable.

func FormatForPrompt

func FormatForPrompt(skills []Skill) string

func ParseSlashCommand added in v0.12.9

func ParseSlashCommand(text string) (string, bool)

ParseSlashCommand returns the name of a leading Wingman slash command.

func SystemSkillsRoot added in v0.15.3

func SystemSkillsRoot() (string, error)

SystemSkillsRoot returns Wingman's reserved bundled-skill directory.

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 or Codex $skill mention, deduplicated in order of first appearance. A mention only counts when its sigil 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 the invoked skill into the <skill-instructions> block 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"`
	Arguments     []string          `yaml:"-"`
	ArgumentHint  string            `yaml:"-"`

	Location string `yaml:"-"`

	Content string `yaml:"-"`

	Bundled bool `yaml:"-"`

	Plugin string `yaml:"-"`
	// contains filtered or unexported fields
}

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

FindSkill resolves either a bare skill name or a "<plugin>:<skill>" name. A qualified query never falls back to a bare match, so it always reaches the plugin's own skill even when another source shadows the bare name.

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 LoadDir added in v0.12.9

func LoadDir(dir string) []Skill

LoadDir loads skills beneath dir. Directories without SKILL.md are grouping directories and are traversed recursively; a skill directory is a leaf so supporting resources below it cannot be mistaken for additional skills. Symlinked directories are followed once, with their resolved paths used to prevent cycles.

func LoadFile added in v0.12.9

func LoadFile(path string) (Skill, error)

LoadFile parses one SKILL.md and records its containing directory.

func Merge added in v0.6.2

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

Merge layers discovered skills over bundled ones by name. A shadowed plugin skill is kept, but moved behind the winner so only its qualified name resolves; anything else that loses its name is dropped.

func MustDiscover added in v0.6.2

func MustDiscover(root string) []Skill

func MustDiscoverPersonal added in v0.6.2

func MustDiscoverPersonal() []Skill

func Rediscover added in v0.15.0

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

Rediscover repeats project discovery without reprinting diagnostics already reported at startup. It is intended for runtime catalog reconciliation.

func RediscoverPersonal added in v0.15.0

func RediscoverPersonal() ([]Skill, error)

RediscoverPersonal repeats personal discovery without reprinting diagnostics already reported at startup.

func (*Skill) AbsoluteDir added in v0.6.2

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

func (*Skill) ApplySubstitutions added in v0.12.9

func (s *Skill) ApplySubstitutions(content, args, skillDir, projectDir string) string

ApplySubstitutions renders Wingman's body-only skill extensions. The neutral directory variables have Claude-compatible aliases; argument behavior follows Claude Code, including zero-based indexed arguments and fallback appending.

func (*Skill) GetContent added in v0.6.2

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

func (*Skill) InvocationHint added in v0.12.9

func (s *Skill) InvocationHint() string

InvocationHint returns the explicit Claude-compatible argument hint or a neutral hint derived from the declared positional argument names.

func (*Skill) Portable added in v0.12.9

func (s *Skill) Portable() bool

Portable reports whether the skill frontmatter uses only Agent Skills fields.

func (*Skill) Qualified added in v0.12.9

func (s *Skill) Qualified() string

Qualified returns the plugin-scoped name "<plugin>:<skill>", or the bare name for skills that did not come from a plugin. It keeps a plugin skill reachable when a same-named skill from a higher-precedence source shadows it.

Jump to

Keyboard shortcuts

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