Documentation
¶
Index ¶
- Constants
- func GetCodeLanguage(filename string) string
- func IsCodeFile(ext string) bool
- func ParseYAMLFrontmatter(content string) (map[string]interface{}, string, error)
- func ReadSkillFiles(skillDir string) (map[string]string, error)
- type HermesParser
- type HermesSkill
- type OpenClawParser
- type OpenClawSkill
- type ParseResult
- type Parser
- type Skill
- type SkillFormat
- type SkillMeta
Constants ¶
const SkillSourceBuiltin = "builtin"
Variables ¶
This section is empty.
Functions ¶
func GetCodeLanguage ¶
GetCodeLanguage determines the programming language from file extension
func IsCodeFile ¶
IsCodeFile checks if a file extension is a code file
func ParseYAMLFrontmatter ¶
ParseYAMLFrontmatter extracts YAML frontmatter from markdown content Returns the frontmatter map and the remaining content
Types ¶
type HermesParser ¶
type HermesParser struct{}
HermesParser parses Hermes format skills
func NewHermesParser ¶
func NewHermesParser() *HermesParser
NewHermesParser creates a new Hermes parser
func (*HermesParser) Parse ¶
func (p *HermesParser) Parse(skillDir string) (*HermesSkill, error)
Parse parses a Hermes format skill from a directory
func (*HermesParser) ParseAgentsSkillsIO ¶
func (p *HermesParser) ParseAgentsSkillsIO(skillDir string) (*HermesSkill, error)
ParseAgentsSkillsIO parses skills from agentskills.io format This is similar to Hermes but with slight field differences
func (*HermesParser) ParseFromFiles ¶
func (p *HermesParser) ParseFromFiles(files map[string]string) (*HermesSkill, error)
ParseFromFiles parses skill data from a map of files
type HermesSkill ¶
type HermesSkill struct {
Name string
Description string
Version string
Author string
License string
Tags []string
Tools []string
Category string
TriggerConditions []string
Steps []string
Content string
CodeFiles map[string]string // filename -> content
CodeLanguage string
SourcePath string
Metadata map[string]interface{}
}
HermesSkill represents a Hermes format skill
func (*HermesSkill) GetPrimaryCode ¶
func (s *HermesSkill) GetPrimaryCode() (string, string)
GetPrimaryCode returns the primary code file content
func (*HermesSkill) ToSkill ¶
func (s *HermesSkill) ToSkill() *Skill
ToSkill converts HermesSkill to the unified Skill type This allows HermesSkill to be used as an intermediate parsing format
func (*HermesSkill) Validate ¶
func (s *HermesSkill) Validate() error
Validate checks if the skill has all required fields
type OpenClawParser ¶
type OpenClawParser struct{}
OpenClawParser parses OpenClaw format skills
func NewOpenClawParser ¶
func NewOpenClawParser() *OpenClawParser
NewOpenClawParser creates a new OpenClaw parser
func (*OpenClawParser) Parse ¶
func (p *OpenClawParser) Parse(skillDir string) (*OpenClawSkill, error)
Parse parses an OpenClaw format skill from a directory
func (*OpenClawParser) ParseFromFiles ¶
func (p *OpenClawParser) ParseFromFiles(files map[string]string) (*OpenClawSkill, error)
ParseFromFiles parses skill data from a map of files
type OpenClawSkill ¶
type OpenClawSkill struct {
Name string
Description string
Version string
Author string
License string
Tags []string
Tools []string
TriggerConditions []string
Steps []string
Content string
CodeFiles map[string]string // filename -> content
CodeLanguage string
SourcePath string
}
OpenClawSkill represents an OpenClaw format skill
func (*OpenClawSkill) GetPrimaryCode ¶
func (s *OpenClawSkill) GetPrimaryCode() (string, string)
GetPrimaryCode returns the primary code file content
func (*OpenClawSkill) Validate ¶
func (s *OpenClawSkill) Validate() error
Validate checks if the skill has all required fields
type ParseResult ¶
type ParseResult struct {
Format SkillFormat
Name string
Data map[string]interface{}
Content string
CodeFiles map[string]string // filename -> content
RawFrontmatter string
}
ParseResult holds the result of parsing a skill
type Parser ¶
type Parser struct {
HermesParser *HermesParser
OpenClawParser *OpenClawParser
}
Parser is a unified parser that can detect and parse different skill formats
type Skill ¶
type Skill struct {
SkillMeta SkillMeta
Tools []string
Content string
Metadata map[string]interface{}
}
Skill represents a unified skill type
type SkillFormat ¶
type SkillFormat string
SkillFormat represents the format type of a skill
const ( FormatOpenClaw SkillFormat = "openclaw" FormatHermes SkillFormat = "hermes" FormatMagic SkillFormat = "magic" FormatUnknown SkillFormat = "unknown" )
func DetectFormat ¶
func DetectFormat(skillDir string) (SkillFormat, error)
DetectFormat detects the skill format from a directory