Help us shape the future of Go! Take the 2026 Go Developer Survey

skillvalidator

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxSkillNameLength is the maximum accepted length for skill frontmatter name.
	MaxSkillNameLength = 64
	// MaxDescriptionLength is the maximum accepted length for skill description.
	MaxDescriptionLength = 1024
	// MaxRecommendedSkillLines is the recommended upper bound for SKILL.md lines.
	MaxRecommendedSkillLines = 500
)
View Source
const (
	// FindingCodeNameMissing reports a missing required name field.
	FindingCodeNameMissing = "SKILL_NAME_MISSING"
	// FindingCodeNameInvalid reports an invalid skill name format.
	FindingCodeNameInvalid = "SKILL_NAME_INVALID"
	// FindingCodeNameTooLong reports skill names that exceed MaxSkillNameLength.
	FindingCodeNameTooLong = "SKILL_NAME_TOO_LONG"
	// FindingCodeNameConsecutiveHyphens reports names containing "--".
	FindingCodeNameConsecutiveHyphens = "SKILL_NAME_CONSECUTIVE_HYPHENS"
	// FindingCodeNamePathMismatch reports skill names that do not match canonical source names.
	FindingCodeNamePathMismatch = "SKILL_NAME_PATH_MISMATCH"
	// FindingCodeDescriptionMissing reports a missing required description field.
	FindingCodeDescriptionMissing = "SKILL_DESCRIPTION_MISSING"
	// FindingCodeDescriptionTooLong reports descriptions that exceed MaxDescriptionLength.
	FindingCodeDescriptionTooLong = "SKILL_DESCRIPTION_TOO_LONG"
	// FindingCodeSizeRecommendation reports SKILL.md files that exceed MaxRecommendedSkillLines.
	FindingCodeSizeRecommendation = "SKILL_SIZE_RECOMMENDATION"
)

Variables

This section is empty.

Functions

func NormalizeName added in v0.24.0

func NormalizeName(name string) string

NormalizeName applies the same Unicode normalization used when comparing skill names across configuration, imports, and user-managed sources.

Types

type Finding

type Finding struct {
	Code    string
	Path    string
	Message string
}

Finding is a single deterministic validator diagnostic.

func ValidateParsedSkill

func ValidateParsedSkill(parsed ParsedSkill) []Finding

ValidateParsedSkill validates all configured skill rules for a parsed source.

type ParsedSkill

type ParsedSkill struct {
	SourcePath    string
	CanonicalName string
	LineCount     int
	// Name and Description are nil when the field is absent or null.
	Name        *string
	Description *string
}

ParsedSkill is a parsed skill source used as validation input.

func ParseSkillContent added in v0.16.0

func ParseSkillContent(path string, raw []byte) (ParsedSkill, error)

ParseSkillContent parses already-read <name>/SKILL.md bytes into validator input. path supplies the canonical name from its parent directory and is used for error context; it does not have to exist on the local filesystem, so callers holding a skill tree in memory (imports, merges, upstream comparisons) validate through exactly the same rules as on-disk sources.

func ParseSkillSource

func ParseSkillSource(path string) (ParsedSkill, error)

ParseSkillSource reads and parses a <name>/SKILL.md source file into validator input.

Jump to

Keyboard shortcuts

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