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

skillvalidator

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 11 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"
	// FindingCodeDirectorySkillFileName reports non-canonical directory skill filenames.
	FindingCodeDirectorySkillFileName = "SKILL_DIRECTORY_FILENAME"
	// FindingCodeSizeRecommendation reports SKILL.md files that exceed MaxRecommendedSkillLines.
	FindingCodeSizeRecommendation = "SKILL_SIZE_RECOMMENDATION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Code     string
	Severity Severity
	Path     string
	Message  string
}

Finding is a single deterministic validator diagnostic.

func ValidateDirectory

func ValidateDirectory(parsed ParsedSkill) []Finding

ValidateDirectory validates source-path and directory-format conventions.

func ValidateMetadata

func ValidateMetadata(parsed ParsedSkill) []Finding

ValidateMetadata validates frontmatter-level skill requirements.

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
	SourceFormat    SourceFormat
	LineCount       int
	FrontMatterKeys []string
	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 skill source bytes into validator input. path supplies the canonical name and source format 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 skill source file into validator input.

type Severity

type Severity string

Severity indicates validation finding severity.

const (
	// SeverityWarn indicates a non-blocking standards warning.
	SeverityWarn Severity = "warn"
)

type SourceFormat

type SourceFormat string

SourceFormat describes how a source skill is represented on disk.

const (
	// SourceFormatFlat is `.agent-layer/skills/<name>.md`.
	SourceFormatFlat SourceFormat = "flat"
	// SourceFormatDirectory is `.agent-layer/skills/<name>/SKILL.md`.
	SourceFormatDirectory SourceFormat = "directory"
)

Jump to

Keyboard shortcuts

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