Documentation
¶
Index ¶
Constants ¶
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 )
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
NormalizeName applies the same Unicode normalization used when comparing skill names across configuration, imports, and user-managed sources.
Types ¶
type Finding ¶
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.