Documentation
¶
Overview ¶
Package structure validates the directory layout, frontmatter, token counts, markdown syntax, internal links, and orphan files of a skill package. It is the main validation entry point used by the CLI.
Index ¶
- func CheckFrontmatter(s *skill.Skill) []types.Result
- func CheckInternalLinks(dir, body string) []types.Result
- func CheckMarkdown(dir, body string) []types.Result
- func CheckOrphanFiles(dir, body string) []types.Result
- func CheckStructure(dir string) []types.Result
- func CheckTokens(dir, body string) ([]types.Result, []types.TokenCount, []types.TokenCount)
- func FindUnclosedFence(content string) (int, bool)
- func Validate(dir string, opts Options) *types.Report
- func ValidateMulti(dirs []string, opts Options) *types.MultiReport
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFrontmatter ¶
CheckFrontmatter validates the YAML frontmatter of a parsed skill. It checks required fields (name, description), enforces format and length constraints, validates optional fields, and warns about unrecognized or keyword-stuffed fields.
func CheckInternalLinks ¶
CheckInternalLinks validates relative (internal) links in the skill body. Broken internal links indicate a structural problem: the skill references files that don't exist in the package.
func CheckMarkdown ¶
CheckMarkdown validates markdown structure in the skill.
func CheckOrphanFiles ¶
CheckOrphanFiles walks scripts/, references/, and assets/ to find files that are never referenced (directly or transitively) from SKILL.md.
func CheckStructure ¶
CheckStructure validates the directory layout of a skill package. It checks for the required SKILL.md file, flags unrecognized directories and extraneous root files, and warns about deep nesting in recognized directories.
func CheckTokens ¶
func CheckTokens(dir, body string) ([]types.Result, []types.TokenCount, []types.TokenCount)
CheckTokens counts tokens for the SKILL.md body, reference files, asset files, and non-standard files. It returns validation results, standard token counts, and non-standard ("other") token counts.
func FindUnclosedFence ¶
FindUnclosedFence checks for unclosed code fences (``` or ~~~). Returns the line number of the unclosed opening fence and true, or 0 and false.
func ValidateMulti ¶
func ValidateMulti(dirs []string, opts Options) *types.MultiReport
ValidateMulti validates each directory and returns an aggregated report.