Documentation
¶
Overview ¶
Package skill parses SKILL.md frontmatter for transitive dependency resolution and the sandbox directory name a skill occupies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MarkerNames = [...]string{"SKILL.md", "skill.md", "Skill.md"}
MarkerNames are the spellings of the file that marks a skill directory, in lookup order; the first one present is read.
Functions ¶
func SandboxName ¶ added in v0.48.0
SandboxName is the directory name a skill takes under <configDir>/skills/. It prefers a valid SKILL.md frontmatter name so nested forge skills that share a leaf directory (github, gitlab) upload to distinct destinations. When the frontmatter is missing, unreadable, or not a valid name, it falls back to filepath.Base.
Declared names are only consulted for absolute paths: a relative path would be read against the process's current working directory, not the harness tree, so a CWD-relative SKILL.md could choose the identity mergeSkills sees. LoadWithBase resolves a harness's relative skill paths against the caller's workspace root (or fetches them for a URL-sourced harness) before any merge, so the fallback to filepath.Base is reached only for paths nothing resolved.
Types ¶
type SkillMeta ¶
type SkillMeta struct {
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
Dependencies []string `yaml:"dependencies,omitempty"`
Policy string `yaml:"policy,omitempty"`
}
SkillMeta holds parsed YAML frontmatter from a SKILL.md file.
func ParseFrontmatter ¶
ParseFrontmatter extracts the YAML frontmatter block (delimited by "---") from SKILL.md content and unmarshals it into SkillMeta. Returns nil (no error) if the content has no frontmatter. Returns an error only if frontmatter is present but malformed.