Documentation
¶
Index ¶
- Constants
- func SkillsDir() (string, error)
- type Command
- type Skill
- func (s *Skill) AddCommand(cmd *Command) error
- func (s *Skill) CommandNames() []string
- func (s *Skill) GetCommand(name string) *Command
- func (s *Skill) HasCommands() bool
- func (s *Skill) InspectContent() string
- func (s *Skill) InspectTitle() string
- func (s *Skill) RemoveCommand(name string) error
- func (s *Skill) Save(dir string) error
- func (s *Skill) SaveCommand(cmd *Command) error
- func (s *Skill) ToMarkdown() string
- func (s *Skill) Validate() error
Constants ¶
const ( // SkillFileName is the standard skill file name (Claude Code format) SkillFileName = "SKILL.md" // LegacySkillFileName is the legacy JSON format LegacySkillFileName = "skill.json" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct {
Name string `yaml:"name" json:"name"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
// Content is the markdown prompt content (after frontmatter)
Content string `yaml:"-" json:"-"`
// FileName is the source file name (e.g., "review.md")
FileName string `yaml:"-" json:"-"`
}
Command represents a single command within a skill Each command is a .md file with YAML frontmatter
func (*Command) ToMarkdown ¶
ToMarkdown converts a command to markdown format with YAML frontmatter
type Skill ¶
type Skill struct {
Name string `yaml:"name" json:"name"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
// Content is the markdown prompt content (after frontmatter) for the default command
Content string `yaml:"-" json:"-"`
// Commands are additional subcommands defined in separate .md files
// Invoked as skill-name:command-name
Commands []*Command `yaml:"-" json:"-"`
// Path is the directory containing this skill
Path string `yaml:"-" json:"-"`
// Scope indicates where this skill came from ("local" or "global")
Scope string `yaml:"-" json:"-"`
// Tool indicates which tool owns this skill (e.g., "claude", "gemini", "agentctl")
Tool string `yaml:"-" json:"-"`
// Legacy fields (for backwards compatibility with skill.json)
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Author string `yaml:"author,omitempty" json:"author,omitempty"`
Prompts map[string]string `yaml:"prompts,omitempty" json:"prompts,omitempty"`
Files []string `yaml:"files,omitempty" json:"files,omitempty"`
}
Skill represents a skill/plugin configuration Skills use SKILL.md format with YAML frontmatter (matching Claude Code) A skill can have multiple commands (subcommands) via additional .md files
func GlobalSkills ¶
GlobalSkills loads all skills from the global skills directory
func Load ¶
Load loads a skill from a directory It first tries SKILL.md (Claude Code format), then falls back to skill.json It also loads any additional .md files as subcommands
func ProjectSkills ¶
ProjectSkills loads all skills from a project's .claude/skills directory
func (*Skill) AddCommand ¶
AddCommand adds a new command to the skill
func (*Skill) CommandNames ¶
CommandNames returns the names of all commands in the skill
func (*Skill) GetCommand ¶
GetCommand returns a command by name, or nil if not found
func (*Skill) HasCommands ¶
HasCommands returns true if the skill has any subcommands
func (*Skill) InspectContent ¶ added in v0.3.0
InspectContent returns the formatted content for the inspector viewport
func (*Skill) InspectTitle ¶ added in v0.3.0
InspectTitle returns the display name for the inspector modal header
func (*Skill) RemoveCommand ¶
RemoveCommand removes a command from the skill
func (*Skill) SaveCommand ¶
SaveCommand saves a single command to the skill directory
func (*Skill) ToMarkdown ¶
ToMarkdown converts the skill to SKILL.md format