Documentation
¶
Overview ¶
Package skill defines the shared types used by every source of glab agent skills (bundled, remote, etc.). It intentionally has no dependencies on the source packages — those import this one.
Index ¶
Constants ¶
const FileName = "SKILL.md"
FileName is the canonical filename for a skill, per the Agent Skills specification (https://agentskills.io).
Variables ¶
This section is empty.
Functions ¶
func ContentHash ¶ added in v1.102.0
ContentHash returns a stable sha256 over a file tree. Empty input returns "" so "nothing on disk yet" callsites don't need a special case.
Types ¶
type Frontmatter ¶ added in v1.123.0
Frontmatter holds the SKILL.md frontmatter keys glab reads.
func ParseFrontmatter ¶ added in v1.123.0
func ParseFrontmatter(content []byte) (Frontmatter, error)
ParseFrontmatter decodes the frontmatter of a SKILL.md.
type FrontmatterParts ¶ added in v1.123.0
type FrontmatterParts struct {
// Head is any leading whitespace plus the opening `---` line.
Head []byte
// Block is the YAML between the delimiters, without the final line break.
Block []byte
// Tail starts at the line break before the closing `---` and runs to EOF.
Tail []byte
}
FrontmatterParts is a SKILL.md split around its YAML frontmatter so a caller can edit Block and reassemble the file byte-for-byte otherwise.
func SplitFrontmatter ¶ added in v1.123.0
func SplitFrontmatter(content []byte) (FrontmatterParts, error)
SplitFrontmatter splits content at the first pair of `---` delimiters. LF and CRLF line endings are both preserved in Head and Tail.
func (FrontmatterParts) Join ¶ added in v1.123.0
func (p FrontmatterParts) Join() []byte
Join reassembles the file from its parts.
type Skill ¶
Skill is a single agent skill. Files maps each path inside the skill directory (relative to the skill root, e.g. "SKILL.md" or "scripts/extract.py") to its contents. Discovery-only operations (such as `glab skills list`) may return Skill values with Files unpopulated; full skill content is only guaranteed after a Get-style lookup.