Documentation
¶
Overview ¶
Package skills implements the agentskills.io discovery and execution protocol.
Skills are directories containing a SKILL.md file with YAML frontmatter (name, description) followed by Markdown instructions. An optional scripts/ subdirectory may contain executable files that agents can run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoSkills = errors.New("no skills found")
ErrNoSkills is returned by NewExecutor when the skills directory exists and was successfully scanned but contained no SKILL.md files. Callers can use errors.Is to detect this case and fall back to a no-op tool.
Functions ¶
func DefaultDir ¶
func DefaultDir() string
DefaultDir returns the default system-wide directory for discovering skills. It resolves to ~/.agents/skills on all platforms.
func SystemPrompt ¶
SystemPrompt returns the <available_skills> XML block for injection into a model system prompt, following the agentskills.io integration guide.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs an agentskills.io-compatible agentic loop.
func NewExecutor ¶
NewExecutor discovers skills in dir, then creates an Executor. The caller is responsible for creating the client and choosing a model.
Returns ErrNoSkills if dir was scanned successfully but contained no SKILL.md files. Other errors (e.g. dir does not exist, permission denied) are returned wrapped from Discover.
func (*Executor) HandleCall ¶
func (e *Executor) HandleCall(ctx context.Context, call *genai.FunctionCall) (*ScriptResult, error)
HandleCall processes an 'activate_skill' or 'run_skill_script' call.
func (*Executor) SkillNames ¶
SkillNames returns the names of all discovered skills.
func (*Executor) SystemPrompt ¶
SystemPrompt returns the agentskills.io instructional block for all skills.
type ScriptResult ¶
ScriptResult holds the output of a RunScript call.
type Skill ¶
type Skill struct {
Name string
Description string
Dir string // absolute path to the skill directory
}
Skill represents a discovered agentskills.io skill.
func Discover ¶
Discover scans dir for agentskills.io-compatible skill directories and returns their parsed metadata. Invisible entries (names starting with ".") and entries that are not directories (including broken symlinks) are skipped. Directories that lack a valid SKILL.md are silently skipped.
func (Skill) Body ¶
Body returns the Markdown body of the skill's SKILL.md with the YAML frontmatter stripped. This is the full instruction text to inject into a model context when the skill is activated.