Documentation
¶
Index ¶
- func BuildVariables(skill *Skill, userInput string, args map[string]string, stdin string) map[string]string
- func ReadStdin() string
- func RenderBody(skill *Skill, userInput string, args map[string]string, stdin string) string
- func SkillDirectoryPaths() []string
- func SubstituteVariables(body string, vars map[string]string) string
- type ExecuteOptions
- type ExecuteResult
- type Index
- type Skill
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVariables ¶
func BuildVariables(skill *Skill, userInput string, args map[string]string, stdin string) map[string]string
BuildVariables constructs the variable map for substitution.
func RenderBody ¶
RenderBody applies variable substitution to the skill body and handles defaults.
func SkillDirectoryPaths ¶
func SkillDirectoryPaths() []string
SkillDirectoryPaths returns the list of directories that will be scanned for skills. Useful for debugging and the `skills list` command.
Types ¶
type ExecuteOptions ¶
type ExecuteOptions struct {
UserInput string // User-provided input text
Args map[string]string // Named argument substitutions
Stdin string // Content from STDIN
Model string // Model override (overrides skill's model)
}
ExecuteOptions holds options for executing a skill.
type ExecuteResult ¶
type ExecuteResult struct {
RenderedBody string // The skill body after variable substitution
Model string // The resolved model to use
}
ExecuteResult holds the result of executing a skill.
func Prepare ¶
func Prepare(skill *Skill, opts ExecuteOptions) (*ExecuteResult, error)
Prepare resolves a skill into its rendered body and model, ready for execution. It does not actually call an LLM - that is handled by the processor.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index holds a mapping of skill names to their metadata and paths.
type Skill ¶
type Skill struct {
// Frontmatter fields
Name string `yaml:"name"`
Description string `yaml:"description"`
WhenToUse string `yaml:"when_to_use"`
Model string `yaml:"model"`
AllowedTools []string `yaml:"allowed-tools"`
Arguments []string `yaml:"arguments"`
ArgumentHint string `yaml:"argument-hint"`
Version string `yaml:"version"`
Effort string `yaml:"effort"`
Context string `yaml:"context"`
Paths []string `yaml:"paths"`
UserInvocable *bool `yaml:"user-invocable"`
// Computed fields (not from YAML)
Body string `yaml:"-"` // Markdown body after frontmatter
FilePath string `yaml:"-"` // Absolute path to the skill file
Source string `yaml:"-"` // "user", "project", or "bundled"
Dir string `yaml:"-"` // Directory containing the skill file
}
Skill represents a parsed skill file with frontmatter and body content.
func ParseSkill ¶
ParseSkill parses a skill from its raw content (frontmatter + body).
func (*Skill) DisplayName ¶
DisplayName returns the skill's display name, falling back to filename.
func (*Skill) IsUserInvocable ¶
IsUserInvocable returns whether this skill can be invoked directly by users. Defaults to true if not specified.