skills

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSkill  = errors.New("invalid skill")
	ErrSkillNotFound = errors.New("skill not found")
)

Functions

func DefineSkillTool

func DefineSkillTool(skills []Skill, opts ToolOptions) (tools.Tool, error)

func ParseMetadata

func ParseMetadata(text string) (map[string]string, error)

func ValidateName

func ValidateName(name string) error

Types

type Catalog

type Catalog struct {
	Skills      []Skill
	Diagnostics []Diagnostic
}

func Discover

func Discover(sources []Source) (Catalog, error)

type Diagnostic

type Diagnostic struct {
	Kind       string
	SkillName  string
	Path       string
	SourceKind SourceKind
	Message    string
}

func BuildPrompt

func BuildPrompt(skills []Skill, opts PromptOptions) (string, []Diagnostic)

type PromptOptions

type PromptOptions struct {
	MaxBytes int
}

type Scope

type Scope string
const (
	ScopeProject Scope = "project"
	ScopeUser    Scope = "user"
	ScopeAdmin   Scope = "admin"
	ScopeConfig  Scope = "config"
)

type Skill

type Skill struct {
	Name        string
	Description string
	Path        string
	Scope       Scope
	SourceInfo  SourceInfo
	Enabled     bool
	ContentHash string
}

type SkillLoad

type SkillLoad struct {
	Name        string
	Path        string
	SourceKind  SourceKind
	ContentHash string
	Bytes       int
}

type Source

type Source struct {
	Root         string
	Kind         SourceKind
	Scope        Scope
	DisplayLabel string
	Enabled      bool
}

type SourceInfo

type SourceInfo struct {
	Kind         SourceKind
	Root         string
	RelativePath string
	DisplayLabel string
}

type SourceKind

type SourceKind string
const (
	SourceRepo   SourceKind = "repo"
	SourceUser   SourceKind = "user"
	SourceAdmin  SourceKind = "admin"
	SourceConfig SourceKind = "config"
)

type ToolOptions

type ToolOptions struct {
	OutputPolicy tools.OutputPolicy
	OnLoad       func(SkillLoad)
}

Jump to

Keyboard shortcuts

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