Documentation
¶
Overview ¶
Package skill loads, validates, and exposes Agent Skills.
It implements the SKILL.md format and progressive-disclosure helpers without coupling skills to a particular agent implementation. Applications choose how to inject a catalog instruction and which skill tools to register.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoadTool ¶
NewLoadTool creates a tool that returns one skill's complete instructions and bundled-resource paths.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is an immutable, name-indexed collection of skills.
func Discover ¶
Discover loads skills from the direct child directories of each root. Invalid skills and duplicate names cause discovery to fail.
func NewCatalog ¶
NewCatalog constructs a catalog and rejects invalid or duplicate skills.
func (*Catalog) Instruction ¶
Instruction renders the catalog for request-scoped injection. It returns an empty string when the catalog contains no skills.
type InstructionFormat ¶
type InstructionFormat string
InstructionFormat controls how Catalog.Instruction renders the catalog.
const ( // InstructionFormatText renders a compact, human-readable instruction. InstructionFormatText InstructionFormat = "text" // InstructionFormatJSON renders a machine-structured JSON instruction. InstructionFormatJSON InstructionFormat = "json" )
type Option ¶
type Option func(*options)
Option configures catalog instruction rendering and skill tools. The same options can be shared across Instruction, NewLoadTool, and NewReadResourceTool so tool names remain consistent.
func WithInstructionFormat ¶
func WithInstructionFormat(format InstructionFormat) Option
WithInstructionFormat selects text or JSON catalog rendering.
func WithLoadToolName ¶
WithLoadToolName overrides the default load_skill tool name.
func WithMaxResourceBytes ¶
WithMaxResourceBytes sets the maximum text resource size returned by NewReadResourceTool. The limit must be positive.
func WithReadResourceToolName ¶
WithReadResourceToolName overrides the default read_skill_resource tool name.
func WithUsageInstruction ¶ added in v0.1.1
WithUsageInstruction replaces the default instruction text appended after the skill list. The text should describe when the model should call the load-skill tool. An empty or whitespace-only value keeps the default.
type Skill ¶
type Skill struct {
Name string
Description string
License string
Compatibility string
Metadata map[string]string
AllowedTools []string
Instructions string
Resources []string
// contains filtered or unexported fields
}
Skill is one parsed Agent Skill.