skills

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 18 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 FetchSkillFiles added in v0.13.0

func FetchSkillFiles(ctx context.Context, source string) (skillName string, files map[string]string, cleanup func(), err error)

FetchSkillFiles resolves source, finds the skill directory, and returns the skill name and a map of file paths (relative to the skill root) → content. cleanup is a no-op for git sources (their path is a shared cache — do NOT delete it). For local sources it is also a no-op because the path is the user's local directory.

func InstallToStore added in v0.13.0

func InstallToStore(ctx context.Context, store pkgplugins.SkillStore, source, scope string, userID int64, agentID string) (string, error)

InstallToStore fetches a skill from source and stores it in the given SkillStore. scope must be one of "user" or "agent". For scope="user", userID is used; for scope="agent", agentID is used. Returns the installed skill name on success.

func ListProjectSkills added in v0.13.0

func ListProjectSkills(root string) ([]pkgplugins.Skill, map[string]string, error)

ListProjectSkills walks {root}/.agents/skills/ and returns skill metadata structs with Scope="project". The second return value maps skill name → skill directory path so callers can read file content off disk for a given project skill.

func NormalizeSkillStatus

func NormalizeSkillStatus(status string) string

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 Tool

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

func NewTool

func NewTool(store pkgplugins.SkillStore, annaHome, agentRoot, projectRoot, userSkillsDir string) *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)

Jump to

Keyboard shortcuts

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