skills

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 13 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 FormatVirtualInvocation added in v0.4.0

func FormatVirtualInvocation(name, location, body string) string

FormatVirtualInvocation formats an embedded virtual document (e.g. an OKF tool concept) for prompt injection with the same wrapper as skill invocations.

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 ReadFile

func ReadFile(embedPath string) string

ReadFile reads any file from the embedded skills filesystem.

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
	SourceIOA      SkillSource = "ioa"     // chainreactors/ioa module
)

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).

func (*Store) ReadVirtualBody added in v0.4.0

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

ReadVirtualBody reads a virtual file and returns its body with frontmatter stripped.

Jump to

Keyboard shortcuts

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