skill

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package skill provides core skill manipulation and security checking logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateEntropy added in v1.0.0

func CalculateEntropy(s string) float64

CalculateEntropy calculates the Shannon entropy of a string. Higher entropy indicates more randomness, which is common in secrets/keys.

func CreateSkillTemplate added in v0.2.0

func CreateSkillTemplate(name, destDir string) error

CreateSkillTemplate creates a new skill directory with template files

func FindSkillMD

func FindSkillMD(skillPath string) bool

FindSkillMD checks if a skill has a SKILL.md file

func GenerateReport added in v1.0.0

func GenerateReport(result *CheckResult, format string) (string, error)

GenerateReport generates a report in the specified format ("md", "html", or "json")

Types

type CheckResult added in v1.0.0

type CheckResult struct {
	SkillName string
	Findings  []Finding
}

CheckResult contains all findings for a skill

func CheckSafety added in v1.0.0

func CheckSafety(skillPath string) (*CheckResult, error)

CheckSafety performs security checks on a skill directory

type Finding added in v1.0.0

type Finding struct {
	RuleID      string
	Severity    Severity
	Description string
	Module      string // The skill or module name where this finding occurred
	File        string
	Line        int
	Match       string
}

Finding represents a single security issue found in a skill

type Meta added in v1.0.0

type Meta struct {
	Name         string   `yaml:"name"`
	Description  string   `yaml:"description"`
	Version      string   `yaml:"version"`
	Author       string   `yaml:"author"`
	Dependencies []string `yaml:"dependencies"`
	Tags         []string `yaml:"tags"`
}

Meta represents metadata parsed from SKILL.md

func ParseSkillMD

func ParseSkillMD(skillPath string) (*Meta, error)

ParseSkillMD parses a SKILL.md file and extracts frontmatter metadata

type Rule added in v1.0.0

type Rule struct {
	ID          string
	Description string
	Severity    Severity
	Regex       *regexp.Regexp
	Entropy     float64 // Minimum entropy threshold (0 to ignore)
	Tags        []string
}

Rule represents a security check rule

type Severity added in v1.0.0

type Severity string

Severity represents the severity of a security finding

const (
	// SeverityInfo indicates informational findings
	SeverityInfo Severity = "INFO"
	// SeverityWarning indicates potential issues
	SeverityWarning Severity = "WARNING"
	// SeverityCritical indicates critical vulnerabilities
	SeverityCritical Severity = "CRITICAL"
)

type TemplateData added in v1.0.0

type TemplateData struct {
	Name        string
	Description string
	Author      string
}

TemplateData holds data for the skill template

Jump to

Keyboard shortcuts

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