Documentation
¶
Overview ¶
Package metadata models and parses SKILL.md YAML frontmatter, including the declared requires block.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFrontmatter = errors.New("invalid frontmatter")
ErrInvalidFrontmatter is returned for malformed or schema-invalid SKILL.md frontmatter.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
Frontmatter Frontmatter
Body []byte
Warnings []string
}
Document is the result of parsing a SKILL.md: its frontmatter, the markdown body, and any non-fatal warnings.
func Parse ¶
Parse extracts and validates the frontmatter from SKILL.md content, returning the document with its markdown body and any unknown-key warnings. A missing name is rejected.
func ParseLenient ¶ added in v0.1.0
ParseLenient is like Parse but accepts a missing name (the skill folder supplies identity during discovery, FR-007); a present name must still be kebab-case and the description is still required. It is the parser used by the recursive scanner so a name-less SKILL.md is discoverable rather than fatal.
type Frontmatter ¶
type Frontmatter struct {
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version,omitempty"`
License string `json:"license,omitempty"`
Compatibility any `json:"compatibility,omitempty"`
Requires Requires `json:"requires,omitempty"`
}
Frontmatter is the parsed SKILL.md YAML frontmatter (FR-012).
func (Frontmatter) Validate ¶
func (f Frontmatter) Validate() error
Validate checks the required-field and naming rules (FR-012, FR-013).
func (Frontmatter) ValidateLenient ¶ added in v0.1.0
func (f Frontmatter) ValidateLenient() error
ValidateLenient is like Validate but treats a missing name as acceptable: a discovered skill takes its identity from its folder, so the frontmatter name is optional. A name that *is* present must still be lowercase kebab-case, and the description remains required.
type Requires ¶
type Requires struct {
Skills []string `json:"skills,omitempty"`
Commands []string `json:"commands,omitempty"`
Environment []string `json:"environment,omitempty"`
MCP []string `json:"mcp,omitempty"`
}
Requires holds declared needs that are recorded and surfaced, never resolved transitively (FR-032).