Documentation
¶
Overview ¶
Package skilltool implements the SkillTool — the agent's way to invoke slash-command skills (plugin commands and ~/.claude/commands/*.md files).
When the model calls SkillTool with a skill name, the tool:
- Looks up the command body from the loaded plugin/skill registry.
- Substitutes $ARGUMENTS with the supplied args string.
- Runs a nested agent loop with the skill body as the first user message.
- Returns the nested agent's final text response.
This mirrors SkillTool.ts executeForkedSkill() — a forked sub-agent that runs the skill prompt in an isolated context and returns its result.
Reference: src/tools/SkillTool/SkillTool.ts
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// QualifiedName is the slash-command name ("pluginName:commandName" or just "commandName").
QualifiedName string
// Description is shown in /skills and the system prompt skill listing.
Description string
// Body is the markdown body (frontmatter stripped).
Body string
}
Command is one resolved skill command, ready to execute.
type Loader ¶
type Loader interface {
// FindCommand looks up a command by name (with or without leading slash,
// with or without plugin prefix). Returns nil if not found.
FindCommand(name string) *Command
}
Loader discovers available skill commands. Implemented by the plugin loader.
type SubAgent ¶
type SubAgent interface {
Run(ctx context.Context, messages []api.Message, handler func(interface{})) ([]api.Message, error)
}
SubAgent is the minimal interface the SkillTool needs from the agent loop to spawn a nested run.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool implements the SkillTool.
func New ¶
New returns a SkillTool. runAgent is a closure that runs a nested agent loop with the given prompt as the first user message and returns the final assistant text.
func (*Tool) Description ¶
func (*Tool) InputSchema ¶
func (*Tool) InputSchema() json.RawMessage
func (*Tool) IsConcurrencySafe ¶
func (*Tool) IsConcurrencySafe(json.RawMessage) bool
func (*Tool) IsReadOnly ¶
func (*Tool) IsReadOnly(json.RawMessage) bool