skillscan

package
v0.1.5558 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
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.

View Source
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.

View Source
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

func SecretName(k string) bool

SecretName is whether a variable's or header's name says it holds a secret.

func UnwrapCmd

func UnwrapCmd(cmd string, args []string) (string, []string)

UnwrapCmd is the command cmd /c runs, with its arguments: the command itself for any other.

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.

func File

func File(rel string, b []byte) []Finding

File is what one file holds: rel is its place in the skill's folder.

func Server

func Server(c Config) []Finding

Server is what an MCP server's settings hold. A variable's or a header's value is never quoted: only its name.

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.

func (*Report) Kinds

func (r *Report) Kinds() []string

Kinds is each kind found, warnings' first, in the order found.

func (*Report) Warns

func (r *Report) Warns() int

Warns is how many of the findings listed are warnings.

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.

func Runner

func Runner(cmd string, args []string) (Run, bool)

Runner reads a package runner's line, under cmd /c too. ok is false for any other command, and for a runner given a folder of this computer's, which is read as files.

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 New

func New() *Scanner

New is a Scanner with nothing read yet.

func (*Scanner) Add

func (s *Scanner) Add(rel string, b []byte)

Add reads one file of the skill: rel is its place in the skill's folder, with /.

func (*Scanner) Put

func (s *Scanner) Put(fs ...Finding)

Put adds findings read elsewhere, as a server's settings are (Server), in the order given, each counted with its file's.

func (*Scanner) Report

func (s *Scanner) Report() *Report

Report is what was found: warnings first, SKILL.md's first among them, then by file and line.

Jump to

Keyboard shortcuts

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