Documentation
¶
Overview ¶
Package checks provides the ComplianceChecker interface and implementations for validating skill readiness across multiple dimensions.
Index ¶
- Constants
- Variables
- type BodyStructureChecker
- type BodyStructureData
- type CheckResult
- type CheckStatus
- type ComplexityChecker
- type ComplexityData
- type ComplianceChecker
- type ComplianceScoreChecker
- type ComplianceScoreData
- type CrossModelDensityChecker
- type CrossModelDensityData
- type EvalSuiteChecker
- type EvalSuiteData
- type LimitResult
- type ModuleCountChecker
- type ModuleCountData
- type NegativeDeltaRiskChecker
- type NegativeDeltaRiskData
- type OverSpecificityChecker
- type OverSpecificityData
- type ProceduralContentChecker
- type ProceduralContentData
- type ProgressiveDisclosureChecker
- type ProgressiveDisclosureData
- type ScoreCheckData
- type SpecAllowedFieldsChecker
- type SpecCompatibilityChecker
- type SpecDescriptionChecker
- type SpecDirMatchChecker
- type SpecFrontmatterChecker
- type SpecLicenseChecker
- type SpecNameChecker
- type SpecSecurityChecker
- type SpecVersionChecker
- type StatusHolder
- type TokenBudgetChecker
- type TokenBudgetData
- type TokenLimitFileResult
- type TokenLimitsChecker
- type TokenLimitsConfig
- type TokenLimitsData
Constants ¶
const (
// FallbackLimit is the default token limit when no pattern matches.
FallbackLimit = 2000
)
Variables ¶
var DefaultLimits = TokenLimitsConfig{ Defaults: map[string]int{ "SKILL.md": 500, "references/**/*.md": 1000, "docs/**/*.md": 1500, "*.md": 2000, }, Overrides: map[string]int{ "README.md": 3000, "CONTRIBUTING.md": 2500, }, }
DefaultLimits is the built-in fallback when neither .waza.yaml nor .token-limits.json provides limits.
Functions ¶
This section is empty.
Types ¶
type BodyStructureChecker ¶
type BodyStructureChecker struct{}
BodyStructureChecker scans SKILL.md body for actionable structure.
func (*BodyStructureChecker) Check ¶
func (*BodyStructureChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*BodyStructureChecker) Name ¶
func (*BodyStructureChecker) Name() string
type BodyStructureData ¶
type BodyStructureData struct {
Status CheckStatus
HasExamples bool
HasCodeBlocks bool
HasErrorHandling bool
Findings []string
}
BodyStructureData holds the structured output.
func (*BodyStructureData) GetStatus ¶
func (d *BodyStructureData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type CheckResult ¶
type CheckResult struct {
// Name is a stable check identifier used in output and downstream processing.
Name string
// Passed indicates whether the check met its acceptance criteria.
Passed bool
// Summary is a human-readable one-line result intended for concise display.
Summary string
// Details provides optional supporting lines for diagnostics or remediation.
Details []string
// Data carries an optional checker-specific payload for structured consumers.
Data any
}
CheckResult holds the outcome of a single compliance check.
func RunChecks ¶
func RunChecks(checkers []ComplianceChecker, sk skill.Skill) ([]*CheckResult, error)
RunChecks executes each checker against sk, collecting results and errors.
type CheckStatus ¶
type CheckStatus string
CheckStatus represents the three-tier status model used by score checks.
const ( // StatusOK indicates the check passes. StatusOK CheckStatus = "ok" // StatusOptimal indicates the check meets recommended best practice. StatusOptimal CheckStatus = "optimal" // StatusWarning indicates a potential issue was detected. StatusWarning CheckStatus = "warning" )
type ComplexityChecker ¶
type ComplexityChecker struct{}
ComplexityChecker classifies the skill based on token count and module count.
func (*ComplexityChecker) Check ¶
func (*ComplexityChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*ComplexityChecker) Name ¶
func (*ComplexityChecker) Name() string
type ComplexityData ¶
type ComplexityData struct {
Status CheckStatus
Classification string // "compact", "detailed", or "comprehensive"
TokenCount int
ModuleCount int
}
ComplexityData holds the structured output of a complexity check.
func (*ComplexityData) GetStatus ¶
func (d *ComplexityData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type ComplianceChecker ¶
type ComplianceChecker interface {
Name() string
Check(skill.Skill) (*CheckResult, error)
}
ComplianceChecker runs a single compliance check.
func AdvisoryCheckers ¶
func AdvisoryCheckers() []ComplianceChecker
AdvisoryCheckers returns all advisory checkers in display order.
func SpecCheckers ¶
func SpecCheckers() []ComplianceChecker
SpecCheckers returns all spec compliance checkers in display order.
type ComplianceScoreChecker ¶
type ComplianceScoreChecker struct {
Scorer scoring.Scorer
TokenLimit int // overrides the default token hard limit when > 0
WarningThreshold int // overrides the default token warning threshold when > 0
}
ComplianceScoreChecker validates skill frontmatter quality using heuristic scoring.
func (*ComplianceScoreChecker) Check ¶
func (c *ComplianceScoreChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*ComplianceScoreChecker) Name ¶
func (c *ComplianceScoreChecker) Name() string
func (*ComplianceScoreChecker) Score ¶
func (c *ComplianceScoreChecker) Score(sk skill.Skill) (*ComplianceScoreData, error)
Score is a convenience wrapper that returns the typed data directly.
type ComplianceScoreData ¶
type ComplianceScoreData struct {
Score *scoring.ScoreResult
Level scoring.AdherenceLevel
}
ComplianceScoreData holds the structured output of a compliance score check.
type CrossModelDensityChecker ¶
type CrossModelDensityChecker struct{}
CrossModelDensityChecker checks description word count and action verb usage.
func (*CrossModelDensityChecker) Check ¶
func (*CrossModelDensityChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*CrossModelDensityChecker) Name ¶
func (*CrossModelDensityChecker) Name() string
type CrossModelDensityData ¶
type CrossModelDensityData struct {
Status CheckStatus
WordCount int
HasActionVerb bool
ActionVerbIssues []string
}
CrossModelDensityData holds the structured output.
func (*CrossModelDensityData) GetStatus ¶
func (d *CrossModelDensityData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type EvalSuiteChecker ¶
type EvalSuiteChecker struct {
WorkDir string
}
EvalSuiteChecker checks for the presence of an eval.yaml file.
func (*EvalSuiteChecker) Check ¶
func (c *EvalSuiteChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*EvalSuiteChecker) Eval ¶
func (c *EvalSuiteChecker) Eval(sk skill.Skill) (*EvalSuiteData, error)
Eval is a convenience wrapper that returns the typed data directly.
func (*EvalSuiteChecker) Name ¶
func (c *EvalSuiteChecker) Name() string
type EvalSuiteData ¶
type EvalSuiteData struct {
Found bool
}
EvalSuiteData holds the structured output of an eval suite check.
type LimitResult ¶
LimitResult holds a resolved limit and the pattern that matched.
func GetLimitForFile ¶
func GetLimitForFile(filePath string, cfg TokenLimitsConfig, workspaceRelPrefix ...string) LimitResult
GetLimitForFile determines the token limit for a file. An optional workspaceRelPrefix (e.g. "plugin/skills/azure-deploy") is prepended to filePath so workspace-root-relative patterns such as "plugin/skills/**/SKILL.md" can match alongside skill-relative patterns. Patterns are tried in specificity order; for each pattern both the skill-relative and workspace-relative paths are checked.
type ModuleCountChecker ¶
type ModuleCountChecker struct{}
ModuleCountChecker counts .md files in the skill's references/ directory.
func (*ModuleCountChecker) Check ¶
func (*ModuleCountChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*ModuleCountChecker) Name ¶
func (*ModuleCountChecker) Name() string
type ModuleCountData ¶
type ModuleCountData struct {
Status CheckStatus
Count int
}
ModuleCountData holds the structured output of a module count check.
func (*ModuleCountData) GetStatus ¶
func (d *ModuleCountData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type NegativeDeltaRiskChecker ¶
type NegativeDeltaRiskChecker struct{}
NegativeDeltaRiskChecker scans SKILL.md content for patterns that degrade performance.
func (*NegativeDeltaRiskChecker) Check ¶
func (*NegativeDeltaRiskChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*NegativeDeltaRiskChecker) Name ¶
func (*NegativeDeltaRiskChecker) Name() string
type NegativeDeltaRiskData ¶
type NegativeDeltaRiskData struct {
Status CheckStatus
Risks []string
}
NegativeDeltaRiskData holds the structured output.
func (*NegativeDeltaRiskData) GetStatus ¶
func (d *NegativeDeltaRiskData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type OverSpecificityChecker ¶
type OverSpecificityChecker struct{}
OverSpecificityChecker detects hardcoded, instance-specific content.
func (*OverSpecificityChecker) Check ¶
func (*OverSpecificityChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*OverSpecificityChecker) Name ¶
func (*OverSpecificityChecker) Name() string
type OverSpecificityData ¶
type OverSpecificityData struct {
Status CheckStatus
Categories []string
}
OverSpecificityData holds the structured output.
func (*OverSpecificityData) GetStatus ¶
func (d *OverSpecificityData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type ProceduralContentChecker ¶
type ProceduralContentChecker struct{}
ProceduralContentChecker checks whether the description contains procedural language.
func (*ProceduralContentChecker) Check ¶
func (*ProceduralContentChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*ProceduralContentChecker) Name ¶
func (*ProceduralContentChecker) Name() string
type ProceduralContentData ¶
type ProceduralContentData struct {
Status CheckStatus
HasCommonLeadWords bool
HasProcedureKWs bool
}
ProceduralContentData holds the structured output.
func (*ProceduralContentData) GetStatus ¶
func (d *ProceduralContentData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type ProgressiveDisclosureChecker ¶
type ProgressiveDisclosureChecker struct{}
ProgressiveDisclosureChecker flags large inline content.
func (*ProgressiveDisclosureChecker) Check ¶
func (*ProgressiveDisclosureChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*ProgressiveDisclosureChecker) Name ¶
func (*ProgressiveDisclosureChecker) Name() string
type ProgressiveDisclosureData ¶
type ProgressiveDisclosureData struct {
Status CheckStatus
BodyLines int
LargeCodeBlocks int
Recommendations []string
}
ProgressiveDisclosureData holds the structured output.
func (*ProgressiveDisclosureData) GetStatus ¶
func (d *ProgressiveDisclosureData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type ScoreCheckData ¶
type ScoreCheckData struct {
Status CheckStatus
Evidence string
}
ScoreCheckData carries the status and optional evidence for score-style checks.
func (*ScoreCheckData) GetStatus ¶
func (d *ScoreCheckData) GetStatus() CheckStatus
GetStatus implements StatusHolder.
type SpecAllowedFieldsChecker ¶
type SpecAllowedFieldsChecker struct{}
SpecAllowedFieldsChecker ensures all top-level frontmatter keys are spec-allowed.
func (*SpecAllowedFieldsChecker) Check ¶
func (*SpecAllowedFieldsChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecAllowedFieldsChecker) Name ¶
func (*SpecAllowedFieldsChecker) Name() string
type SpecCompatibilityChecker ¶
type SpecCompatibilityChecker struct{}
SpecCompatibilityChecker validates the optional compatibility field.
func (*SpecCompatibilityChecker) Check ¶
func (*SpecCompatibilityChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecCompatibilityChecker) Name ¶
func (*SpecCompatibilityChecker) Name() string
type SpecDescriptionChecker ¶
type SpecDescriptionChecker struct{}
SpecDescriptionChecker validates the description field.
func (*SpecDescriptionChecker) Check ¶
func (*SpecDescriptionChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecDescriptionChecker) Name ¶
func (*SpecDescriptionChecker) Name() string
type SpecDirMatchChecker ¶
type SpecDirMatchChecker struct{}
SpecDirMatchChecker checks that the skill directory's basename matches the name field.
func (*SpecDirMatchChecker) Check ¶
func (*SpecDirMatchChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecDirMatchChecker) Name ¶
func (*SpecDirMatchChecker) Name() string
type SpecFrontmatterChecker ¶
type SpecFrontmatterChecker struct{}
SpecFrontmatterChecker validates that the file has YAML frontmatter with required fields.
func (*SpecFrontmatterChecker) Check ¶
func (*SpecFrontmatterChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecFrontmatterChecker) Name ¶
func (*SpecFrontmatterChecker) Name() string
type SpecLicenseChecker ¶
type SpecLicenseChecker struct{}
SpecLicenseChecker recommends including a license field.
func (*SpecLicenseChecker) Check ¶
func (*SpecLicenseChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecLicenseChecker) Name ¶
func (*SpecLicenseChecker) Name() string
type SpecNameChecker ¶
type SpecNameChecker struct{}
SpecNameChecker validates the name field against the spec's naming rules.
func (*SpecNameChecker) Check ¶
func (*SpecNameChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecNameChecker) Name ¶
func (*SpecNameChecker) Name() string
type SpecSecurityChecker ¶
type SpecSecurityChecker struct{}
SpecSecurityChecker flags security risks in frontmatter string values.
func (*SpecSecurityChecker) Check ¶
func (*SpecSecurityChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecSecurityChecker) Name ¶
func (*SpecSecurityChecker) Name() string
type SpecVersionChecker ¶
type SpecVersionChecker struct{}
SpecVersionChecker recommends including a metadata.version field.
func (*SpecVersionChecker) Check ¶
func (*SpecVersionChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*SpecVersionChecker) Name ¶
func (*SpecVersionChecker) Name() string
type StatusHolder ¶
type StatusHolder interface {
GetStatus() CheckStatus
}
StatusHolder is implemented by check Data types that carry a CheckStatus.
type TokenBudgetChecker ¶
type TokenBudgetChecker struct {
// Limit for SKILL.md tokens; 0 means use scoring.TokenSoftLimit
Limit int
}
TokenBudgetChecker validates that SKILL.md is within its token budget.
func (*TokenBudgetChecker) Budget ¶
func (c *TokenBudgetChecker) Budget(sk skill.Skill) (*TokenBudgetData, error)
Budget is a convenience wrapper that returns the typed data directly.
func (*TokenBudgetChecker) Check ¶
func (c *TokenBudgetChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*TokenBudgetChecker) Name ¶
func (c *TokenBudgetChecker) Name() string
type TokenBudgetData ¶
TokenBudgetData holds the structured output of a token budget check.
type TokenLimitFileResult ¶
TokenLimitFileResult holds check results for a single file.
type TokenLimitsChecker ¶
type TokenLimitsChecker struct {
Config TokenLimitsConfig // zero value triggers auto-loading from skill dir
Paths []string // specific paths to check; nil scans skill dir
Tokenizer tokens.Tokenizer // empty means use TokenizerDefault
WorkspaceRelPrefix string // skill dir relative to workspace root (e.g. "plugin/skills/azure-deploy")
}
TokenLimitsChecker validates that markdown files are within configured token limits.
func (*TokenLimitsChecker) Check ¶
func (c *TokenLimitsChecker) Check(sk skill.Skill) (*CheckResult, error)
func (*TokenLimitsChecker) Limits ¶
func (c *TokenLimitsChecker) Limits(sk skill.Skill) (*TokenLimitsData, error)
Limits is a convenience wrapper that returns the typed data directly.
func (*TokenLimitsChecker) Name ¶
func (c *TokenLimitsChecker) Name() string
type TokenLimitsConfig ¶
type TokenLimitsConfig struct {
Description string `json:"description,omitempty"`
Defaults map[string]int `json:"defaults"`
Overrides map[string]int `json:"overrides"`
}
TokenLimitsConfig holds token limit configuration.
func LoadLimitsConfig ¶
func LoadLimitsConfig(dir string) (TokenLimitsConfig, error)
LoadLimitsConfig unmarshals dir/.token-limits.json or returns DefaultLimits. Note: callers should prefer .waza.yaml tokens.limits; this is the fallback path.
type TokenLimitsData ¶
type TokenLimitsData struct {
Results []TokenLimitFileResult
TotalFiles int
ExceededCount int
}
TokenLimitsData holds the structured output of a token limits check.