Documentation
¶
Overview ¶
Package skillscan reads a skill's files for what its user would want to know before an agent follows them (狮子座 on Discord): instructions to advertise links or products, or to send data home; install steps that download a program and run it; scripts that reach the network or read credentials; and text a reader of the rendered page doesn't see (zero-width, bidi and tag characters, HTML comments that speak to the model). It reads only the bytes it is given: nothing goes to a network or a model, and the same files always give the same findings.
A finding is something to look at, not a verdict: the page shows each with its file, line and words, and the user decides to install, keep or remove the skill. Nothing here changes a file.
Index ¶
Constants ¶
const ( Promo = "promo" // tells the agent to show links or products to the user Telemetry = "telemetry" // sends data home, or turns telemetry on Download = "download" // downloads a program and runs it Credentials = "credentials" // reads credential files, or the whole environment Hidden = "hidden" // text the rendered page doesn't show Network = "network" // a script reaches the network Program = "program" // a compiled program, which can't be read Secret = "secret" // a script reads a secret from the environment )
The kinds of finding.
const ( Warn = "warn" Note = "note" )
The levels: a warning is what the check is for; a note is worth knowing but ordinary in a skill that calls an API.
const ( Plain = "plain" // reaches another computer without encryption Unpinned = "unpinned" // runs a package's newest version, whatever it is then )
The kinds only a server's settings have.
const ( AtCommand = "command" AtURL = "url" AtEnv = "env" AtHeaders = "headers" )
Where a finding in a server's settings is: its Finding.File.
Variables ¶
This section is empty.
Functions ¶
func SecretName ¶
SecretName is whether a variable's or header's name says it holds a secret.
Types ¶
type Config ¶
type Config struct {
Command string
Args []string
Env map[string]string
URL string
Headers map[string]string
}
Config is an MCP server's settings, as the check reads them.
type Finding ¶
type Finding struct {
Kind string `json:"kind"`
Level string `json:"level"`
File string `json:"file"` // its place in the skill's folder, with /
Line int `json:"line,omitempty"` // from 1; 0 for the file as a whole
Text string `json:"text"` // the line, shortened, what can't be seen shown
}
Finding is one thing found: where, and the words that say it.
type Report ¶
type Report struct {
Findings []Finding `json:"findings"`
More int `json:"more,omitempty"` // findings past the ones listed
}
Report is what was found in one skill.
type Run ¶
type Run struct {
Tool string // as the line has it: npx, bunx, uvx, "pnpm dlx"
PyPI bool // the package is PyPI's, not npm's
Spec string // the package as written
Name string // its name, as the registry has it
Version string // the version asked for; "" for none, a tag or a range
Pinned bool // an exact version, or a commit
}
Run is the package a runner fetches and runs: npx and its kin for npm's registry, uvx and pipx for PyPI's.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner gathers the findings of one skill's files, given one at a time.
func (*Scanner) Add ¶
Add reads one file of the skill: rel is its place in the skill's folder, with /.