Documentation
¶
Overview ¶
Package types defines the core data types used throughout the skill-validator: validation results, severity levels, token counts, skill modes, and aggregated reports.
Index ¶
- type ContaminationReport
- type ContentReport
- type DimensionScore
- type Level
- type MultiReport
- type ReferenceFileReport
- type Report
- type Result
- type ResultContext
- func (c ResultContext) Error(msg string) Result
- func (c ResultContext) ErrorAtLine(file string, line int, msg string) Result
- func (c ResultContext) ErrorAtLinef(file string, line int, format string, args ...any) Result
- func (c ResultContext) ErrorFile(file, msg string) Result
- func (c ResultContext) ErrorFilef(file, format string, args ...any) Result
- func (c ResultContext) Errorf(format string, args ...any) Result
- func (c ResultContext) Info(msg string) Result
- func (c ResultContext) Infof(format string, args ...any) Result
- func (c ResultContext) Pass(msg string) Result
- func (c ResultContext) PassFile(file, msg string) Result
- func (c ResultContext) Passf(format string, args ...any) Result
- func (c ResultContext) Warn(msg string) Result
- func (c ResultContext) WarnFile(file, msg string) Result
- func (c ResultContext) WarnFilef(file, format string, args ...any) Result
- func (c ResultContext) Warnf(format string, args ...any) Result
- type Scored
- type SkillMode
- type TokenCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContaminationReport ¶
type ContaminationReport struct {
MultiInterfaceTools []string `json:"multi_interface_tools"`
CodeLanguages []string `json:"code_languages"`
LanguageCategories []string `json:"language_categories"`
PrimaryCategory string `json:"primary_category"`
MismatchedCategories []string `json:"mismatched_categories"`
MismatchWeights map[string]float64 `json:"mismatch_weights"`
LanguageMismatch bool `json:"language_mismatch"`
TechReferences []string `json:"tech_references"`
ScopeBreadth int `json:"scope_breadth"`
ContaminationScore float64 `json:"contamination_score"`
ContaminationLevel string `json:"contamination_level"`
}
ContaminationReport holds cross-language contamination metrics.
type ContentReport ¶
type ContentReport struct {
WordCount int `json:"word_count"`
CodeBlockCount int `json:"code_block_count"`
CodeBlockRatio float64 `json:"code_block_ratio"`
CodeLanguages []string `json:"code_languages"`
SentenceCount int `json:"sentence_count"`
ImperativeCount int `json:"imperative_count"`
ImperativeRatio float64 `json:"imperative_ratio"`
InformationDensity float64 `json:"information_density"`
StrongMarkers int `json:"strong_markers"`
WeakMarkers int `json:"weak_markers"`
InstructionSpecificity float64 `json:"instruction_specificity"`
SectionCount int `json:"section_count"`
ListItemCount int `json:"list_item_count"`
}
ContentReport holds content quality metrics computed by the content analyzer.
type DimensionScore ¶
type DimensionScore struct {
Label string // Display name, e.g., "Token Efficiency"
Value int // Score value, typically 1-5
}
DimensionScore holds a single scoring dimension's display name and value.
type MultiReport ¶
MultiReport holds aggregated results from validating multiple skills.
type ReferenceFileReport ¶
type ReferenceFileReport struct {
File string
ContentReport *ContentReport
ContaminationReport *ContaminationReport
}
ReferenceFileReport holds per-file content and contamination analysis for a single reference file.
type Report ¶
type Report struct {
SkillDir string
Results []Result
TokenCounts []TokenCount
OtherTokenCounts []TokenCount
ContentReport *ContentReport
ReferencesContentReport *ContentReport
ContaminationReport *ContaminationReport
ReferencesContaminationReport *ContaminationReport
ReferenceReports []ReferenceFileReport
Errors int
Warnings int
}
Report holds all validation results and token counts.
type Result ¶
type Result struct {
Level Level
Category string
Message string
File string // path relative to skill dir, e.g. "SKILL.md", "references/guide.md"
Line int // 0 = no line info
}
Result represents a single validation finding.
type ResultContext ¶
type ResultContext struct {
Category string
File string // default file; methods like ErrorFile override it
}
ResultContext is a builder that sets Category and a default File once, so individual results inherit location context automatically.
func (ResultContext) Error ¶
func (c ResultContext) Error(msg string) Result
Error creates an error result using the default file.
func (ResultContext) ErrorAtLine ¶
func (c ResultContext) ErrorAtLine(file string, line int, msg string) Result
ErrorAtLine creates an error result with an explicit file and line number.
func (ResultContext) ErrorAtLinef ¶
ErrorAtLinef creates a formatted error result with an explicit file and line number.
func (ResultContext) ErrorFile ¶
func (c ResultContext) ErrorFile(file, msg string) Result
ErrorFile creates an error result with an explicit file.
func (ResultContext) ErrorFilef ¶
func (c ResultContext) ErrorFilef(file, format string, args ...any) Result
ErrorFilef creates a formatted error result with an explicit file.
func (ResultContext) Errorf ¶
func (c ResultContext) Errorf(format string, args ...any) Result
Errorf creates a formatted error result using the default file.
func (ResultContext) Info ¶
func (c ResultContext) Info(msg string) Result
Info creates an info result using the default file.
func (ResultContext) Infof ¶
func (c ResultContext) Infof(format string, args ...any) Result
Infof creates a formatted info result using the default file.
func (ResultContext) Pass ¶
func (c ResultContext) Pass(msg string) Result
Pass creates a pass result using the default file.
func (ResultContext) PassFile ¶
func (c ResultContext) PassFile(file, msg string) Result
PassFile creates a pass result with an explicit file.
func (ResultContext) Passf ¶
func (c ResultContext) Passf(format string, args ...any) Result
Passf creates a formatted pass result using the default file.
func (ResultContext) Warn ¶
func (c ResultContext) Warn(msg string) Result
Warn creates a warning result using the default file.
func (ResultContext) WarnFile ¶
func (c ResultContext) WarnFile(file, msg string) Result
WarnFile creates a warning result with an explicit file.
type Scored ¶
type Scored interface {
DimensionScores() []DimensionScore
OverallScore() float64
Assessment() string
NovelDetails() string
}
Scored is the interface implemented by both SkillScores and RefScores. It allows formatting code to iterate dimensions generically.
type TokenCount ¶
TokenCount holds the token count for a single file.