skills

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SkillStatusDraft      = "draft"
	SkillStatusActive     = "active"
	SkillStatusDeprecated = "deprecated"
)
View Source
const PluginID = "tool/skills"

Variables

This section is empty.

Functions

func BuildPromptSection added in v0.11.0

func Create

func Create(ctx context.Context, runtime pkgplugins.ToolRuntime, name, description, content, targetDir string) error

Create creates a new skill with the given name, description, and content body. The skill is created with status=draft and created-at=now. targetDir must be the writable skills directory (userSkillsDir or workspace/skills).

func Deprecate

func Deprecate(ctx context.Context, runtime pkgplugins.ToolRuntime, name, targetDir string) error

Deprecate sets the status of an existing skill to "deprecated".

func Install

func Install(ctx context.Context, source, targetDir string) (string, error)

Install fetches a skill from source and installs it into targetDir.

func NormalizeSkillStatus

func NormalizeSkillStatus(status string) string

func Patch

func Patch(ctx context.Context, runtime pkgplugins.ToolRuntime, name string, updates map[string]string, targetDir string) error

Patch updates frontmatter fields and/or the content body of an existing skill. Supported update keys: "description", "status", "content" (body after frontmatter).

func Remove

func Remove(ctx context.Context, runtime pkgplugins.ToolRuntime, name, skillDir string) error

Remove deletes an installed skill directory after validating the name.

func SkillsDefinition

func SkillsDefinition() tools.Definition

func ValidateSkillName

func ValidateSkillName(name, parentDirName string) []string

ValidateSkillName checks a skill name against the Agent Skills spec.

func WithProjectRoot added in v0.10.1

func WithProjectRoot(ctx context.Context, projectRoot string) context.Context

Types

type LoadSkillsConfig added in v0.10.0

type LoadSkillsConfig struct {
	Runtime       pkgplugins.ToolRuntime
	AnnaHome      string
	AgentRoot     string
	UserRoot      string
	ProjectRoot   string
	UserSkillsDir string
}

LoadSkillsConfig controls skill discovery roots.

type Skill

type Skill struct {
	Name                   string
	Description            string
	Status                 string
	CreatedAt              string
	FilePath               string
	BaseDir                string
	Source                 string
	DisableModelInvocation bool
}

func LoadSkills

func LoadSkills(ctx context.Context, cfg LoadSkillsConfig) []Skill

LoadSkills discovers skills in increasing priority order: builtin -> ANNA_HOME -> agent root -> user root -> project root.

func VisibleSkills

func VisibleSkills(skills []Skill) []Skill

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

func NewTool

func NewTool(annaHome, agentRoot, projectRoot, userSkillsDir string, runtime pkgplugins.ToolRuntime) *Tool

func (*Tool) Definition

func (t *Tool) Definition() tools.Definition

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args map[string]any) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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