Documentation
¶
Index ¶
- Constants
- func BuildPromptSection(_ context.Context, build pkgplugins.SystemPromptContext) (pkgplugins.SystemPromptSection, error)
- func Create(ctx context.Context, runtime pkgplugins.ToolRuntime, ...) error
- func Deprecate(ctx context.Context, runtime pkgplugins.ToolRuntime, name, targetDir string) error
- func Install(ctx context.Context, source, targetDir string) (string, error)
- func NormalizeSkillStatus(status string) string
- func Patch(ctx context.Context, runtime pkgplugins.ToolRuntime, name string, ...) error
- func Remove(ctx context.Context, runtime pkgplugins.ToolRuntime, name, skillDir string) error
- func SkillsDefinition() tools.Definition
- func ValidateSkillName(name, parentDirName string) []string
- func WithProjectRoot(ctx context.Context, projectRoot string) context.Context
- type LoadSkillsConfig
- type Skill
- type Tool
Constants ¶
const ( SkillStatusDraft = "draft" SkillStatusActive = "active" SkillStatusDeprecated = "deprecated" )
const PluginID = "tool/skills"
Variables ¶
This section is empty.
Functions ¶
func BuildPromptSection ¶ added in v0.11.0
func BuildPromptSection(_ context.Context, build pkgplugins.SystemPromptContext) (pkgplugins.SystemPromptSection, error)
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 NormalizeSkillStatus ¶
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 ¶
ValidateSkillName checks a skill name against the Agent Skills spec.
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 ¶
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