skills

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandCommand

func ExpandCommand(text string, store *Store) string

func FormatForPrompt

func FormatForPrompt(skills []Skill) string

func FormatInvocation

func FormatInvocation(skill Skill, args string) string

FormatInvocation formats a skill invocation (package-level, embedded-only).

func LoadAll

func LoadAll(cliPaths []string) (*Store, []Diagnostic)

LoadAll loads skills from all sources with override support. Priority (later overrides earlier): embedded < .aiscan/skills/ < .agent/skills/ < CLI paths.

func LoadEmbedded

func LoadEmbedded() ([]Skill, []Diagnostic)

func LoadEmbeddedStore

func LoadEmbeddedStore() (*Store, []Diagnostic)

func LoadFromDir

func LoadFromDir(dirPath string, source SkillSource) ([]Skill, []Diagnostic)

LoadFromDir loads skills from a local directory. Each subdirectory with a SKILL.md is a skill.

func LoadFromFile

func LoadFromFile(filePath string) (Skill, []Diagnostic, bool)

LoadFromFile loads a single skill from a markdown file path.

func ReadBody

func ReadBody(name string) string

ReadBody reads a skill's markdown body from embeddedFS only (package-level convenience).

func ReadFile

func ReadFile(embedPath string) string

ReadFile reads any file from the embedded skills filesystem.

func SplitFrontmatter

func SplitFrontmatter(raw string) (map[string]string, string)

SplitFrontmatter separates YAML frontmatter from markdown body. Returns a string map for backward compatibility.

Types

type Diagnostic

type Diagnostic struct {
	Path    string
	Message string
}

type Frontmatter

type Frontmatter struct {
	Name            string `yaml:"name"`
	Description     string `yaml:"description"`
	Internal        bool   `yaml:"internal"`
	Agent           bool   `yaml:"agent"`
	AgentMaxTurns   int    `yaml:"agent_max_turns"`
	AgentModel      string `yaml:"agent_model"`
	AgentBackground bool   `yaml:"agent_background"`
}

func ParseFrontmatter

func ParseFrontmatter(raw string) (Frontmatter, string)

ParseFrontmatter parses YAML frontmatter into a typed struct and returns the body.

type Skill

type Skill struct {
	Name        string
	Description string
	Location    string
	BaseDir     string
	Internal    bool
	Source      SkillSource

	Agent           bool
	AgentMaxTurns   int
	AgentModel      string
	AgentBackground bool
}

type SkillSource

type SkillSource string
const (
	SourceEmbedded SkillSource = "embedded"
	SourceProject  SkillSource = "project" // .aiscan/skills/
	SourceAgent    SkillSource = "agent"   // .agent/skills/
	SourceCLI      SkillSource = "cli"     // -s path
)

type Store

type Store struct {
	Skills []Skill
	// contains filtered or unexported fields
}

func NewStore

func NewStore(skills []Skill) *Store

func (*Store) AgentTypes

func (s *Store) AgentTypes() []Skill

func (*Store) ByName

func (s *Store) ByName(name string) (Skill, bool)

func (*Store) FormatInvocation

func (s *Store) FormatInvocation(skill Skill, args string) string

FormatInvocation formats a skill invocation with its body. It uses the store to resolve local skill bodies.

func (*Store) GlobVirtual

func (s *Store) GlobVirtual(pattern string) ([]string, bool)

func (*Store) ReadBody

func (s *Store) ReadBody(name string) string

ReadBody reads a skill's markdown body (without frontmatter). It checks the store for local overrides before falling back to embedded.

func (*Store) ReadVirtual

func (s *Store) ReadVirtual(location string) (string, bool, error)

ReadVirtual reads a file from skill sources (embedded or local).

Jump to

Keyboard shortcuts

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