parser

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package parser provides SKILL.md file parsing functionality. It extracts YAML frontmatter and markdown body content from skill files according to the Agent Skills Specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParseError

type ParseError struct {
	Path string // Path to the file that failed to parse
	Err  error  // Underlying error
}

ParseError represents an error that occurred during skill file parsing.

func (*ParseError) Error

func (e *ParseError) Error() string

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

type Parser

type Parser struct{}

Parser handles SKILL.md file parsing operations.

func New

func New() *Parser

New creates a new Parser instance.

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader, path string) (*claude.Skill, error)

Parse reads and parses a SKILL.md from the given reader. The path parameter is used for error context only.

func (*Parser) ParseBytes

func (p *Parser) ParseBytes(data []byte, path string) (*claude.Skill, error)

ParseBytes parses SKILL.md content from bytes. The path parameter is used for error context only.

func (*Parser) ParseFile

func (p *Parser) ParseFile(path string) (*claude.Skill, error)

ParseFile reads and parses a SKILL.md file from the given path. Returns the parsed Skill or an error if parsing fails.

func (*Parser) ParseHeader

func (p *Parser) ParseHeader(path string) (*claude.Skill, error)

ParseHeader parses only the frontmatter metadata, stopping at the closing ---. This is more efficient for listing skills without reading full content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL