Documentation
¶
Index ¶
- Constants
- type PreparedSkillFork
- type RunSkillArgs
- type Toolset
- func (s *Toolset) FindSkill(name string) *skills.Skill
- func (s *Toolset) Instructions() string
- func (s *Toolset) PrepareForkSubSession(ctx context.Context, args RunSkillArgs) (*PreparedSkillFork, *tools.ToolCallResult)
- func (s *Toolset) ReadSkillContent(ctx context.Context, name string) (string, error)
- func (s *Toolset) ReadSkillFile(skillName, relativePath string) (string, error)
- func (s *Toolset) Skills() []skills.Skill
- func (s *Toolset) Tools(context.Context) ([]tools.Tool, error)
Constants ¶
const ( ToolNameReadSkill = "read_skill" ToolNameReadSkillFile = "read_skill_file" ToolNameRunSkill = "run_skill" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PreparedSkillFork ¶
type PreparedSkillFork struct {
// SkillName is the validated skill name, suitable for span attributes,
// log fields, and sub-session titles ("Skill: <name>").
SkillName string
// Task is the caller-supplied task description, intended to be used as
// the implicit user message of the child session.
Task string
// Content is the expanded SKILL.md content, intended to be used as the
// system message of the child session.
Content string
// Model is the optional model override declared in the SKILL.md
// frontmatter. Empty means "use the parent agent's current model".
Model string
}
PreparedSkillFork carries the validated and expanded data needed to launch a skill as an isolated sub-agent. Callers (typically the runtime) use it to build the child session; this lets the skill-specific business rules (lookup, fork validation, content expansion) live with the toolset rather than the runtime.
type RunSkillArgs ¶
type RunSkillArgs struct {
Name string `json:"name" jsonschema:"The name of the skill to run as a sub-agent"`
Task string `json:"task" jsonschema:"A clear description of the task the skill sub-agent should achieve"`
}
RunSkillArgs specifies the parameters for the run_skill tool.
type Toolset ¶
type Toolset struct {
// contains filtered or unexported fields
}
Toolset provides the read_skill and read_skill_file tools that let an agent load skill content and supporting resources by name. It hides whether a skill is local or remote — the agent just sees a name and description.
func NewSkillsToolset ¶
func (*Toolset) Instructions ¶
func (*Toolset) PrepareForkSubSession ¶
func (s *Toolset) PrepareForkSubSession(ctx context.Context, args RunSkillArgs) (*PreparedSkillFork, *tools.ToolCallResult)
PrepareForkSubSession validates a run_skill request and loads the expanded skill content. It returns either a populated PreparedSkillFork, or a ToolCallResult describing why the call cannot proceed (skill missing, skill not configured for fork mode, content read failure). The caller is responsible for the runtime-specific orchestration (sub-session creation, tracing, event forwarding).
func (*Toolset) ReadSkillContent ¶
ReadSkillContent returns the content of a skill's SKILL.md by name. For local skills, it expands any !`command` patterns in the content by executing the commands and replacing the patterns with their stdout output. Command expansion is disabled for remote skills to prevent arbitrary code execution.
func (*Toolset) ReadSkillFile ¶
ReadSkillFile returns the content of a supporting file within a skill. The path is relative to the skill's base directory (e.g. "references/FORMS.md").