skillet

module
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT

README

Skillet

A Go toolkit for turning prose expertise into verifiable, runtime-neutral Agent Skills.

skillet is the shared kernel behind a family of skill tools (exegesis, skillsaw, canonizer, modelith). When two of them parse the same SKILL.md or hash the same artifact, they must reach byte-identical answers. skillet provides that logic once, so the tools never drift apart.

Why Use It

  • One identity everywhere. identity.Hash gives a byte-identical content hash across every tool, so hash-pinned manifests cross-check cleanly instead of trusting each tool's word.
  • Deterministic by default. Parsing, scoring, and scanning are pure functions that run entirely in memory. A model handles only what a deterministic check cannot decide, so results stay reproducible and cheap.
  • Auditable verification. A Finding is a static diagnostic tied to a re-runnable Check. A Manifest counts as verified only when every skill passes its gates. A Proof blocks closing until every declared artifact re-hashes to its recorded digest (no-proof-no-close).
  • Enforced runtime neutrality. neutrality.Scan flags the wording or paths that bind a skill to a single agent runtime, the kind that makes other runtimes refuse to install it.
  • Proper Markdown parsing. goldmark parses SKILL.md bodies, so a # inside a code fence never reads as a heading.
  • Small, focused packages. Each one does a single job and depends on little. Take only what you need.

Install

go get github.com/StevenACoffman/skillet

Requires Go 1.26+.

Example

package main

import (
	"fmt"

	"github.com/StevenACoffman/skillet/identity"
	"github.com/StevenACoffman/skillet/judge"
	"github.com/StevenACoffman/skillet/skill"
)

func main() {
	// Load and identify a skill.
	s, err := skill.Load("skills/my-skill")
	if err != nil {
		panic(err)
	}
	fmt.Printf("%s  %s\n", identity.Hash(s.Raw), s.Name)

	// Score model output against deterministic checks.
	res, err := judge.Score("Result: 42", []judge.Check{
		{Op: judge.OpSectionPresent, Arg: "Result"},
		{Op: judge.OpContains, Arg: "42"},
	})
	if err != nil {
		panic(err)
	}
	fmt.Printf("hard=%.0f soft=%.2f\n", res.Hard, res.Soft) // hard=1 soft=1.00
}

Packages

Each package does one job and depends on little. Take only what you need.

Skills and Markdown
Package Purpose
skill Load and parse Agent Skills (SKILL.md): frontmatter plus Markdown body.
markdown Structured view of a skill body via goldmark (headings, fences, lists, tables).
speclint Validate SKILL.md frontmatter against the agentskills.io spec (description cap, allowed keys). The single source of truth for the spec's drift-prone data.
neutrality Red-light scan that flags runtime-binding wording, so a skill installs in any runtime.
frontmatter Split a leading --- YAML block from the Markdown body. Normalizes CRLF, so a caller that forgets to cannot get an empty header instead of an error.
redlines book2skill's mechanical Quality Red Lines: the six RIA-TV++ segments, the per-quotation word ceiling, and a description that states its trigger.
skilllens The three SkillLens quality detectors — failure mechanisms, softening phrases, blacklist sections — returning located evidence rather than diagnostics, so each consumer sets its own severity.
timeseries Detect a regression against a rolling baseline rather than a fixed threshold.
Rulesets and the Distillation Pipeline
Package Purpose
ruleset Typed model of a distilled ruleset. Each Rule carries a severity, level, rationale, ✗/✓ example pair, and source anchor. Render and Parse round-trip.
ruleset/distill Fill a per-source distillation prompt for each source document.
ruleset/synthesize Assemble distilled rulesets into one synthesis prompt.
naming Derive filenames and human titles for the distillation pipeline.
testprompts Conservatively derive judge checks from expected-output prose.
Verification and Scoring
Package Purpose
finding The one shared diagnostic type (severity, category, path, message) every linter and gate emits.
judge Deterministic rule-judge: hard = all checks pass, soft = fraction passed.
manifest Build the machine-readable record of a verified skill tree.
proof No-proof-no-close gate: every declared artifact must exist and match its digest.
identity Content-identity hashing shared across tools, so an artifact has one identity everywhere.
provenance Read and write the header that marks a file as a vendored copy of an upstream artifact.
Optimization and Statistics
Package Purpose
stats Small deterministic statistics (Wilson score intervals and friends).
calibration Measure how well stated confidences match observed outcomes (ECE, MCE, Brier). The reliability complement to stats.
ratchet Keep/revert gate and activation confusion matrix for optimization loops.
auditlog Read and write the optimization log (results.tsv).
Foundations
Package Purpose
errs Shared error type with machine-readable codes (leaf/wrapper convention).
atomicfile Atomic file writes: a crash never leaves a half-written file.
fsutil Small fs.FS-shaped filesystem helpers.

See skillet.modelith.md for the full domain model.

License

See LICENSE.

Directories

Path Synopsis
Package atomicfile contains code related to writing to filesystems atomically.
Package atomicfile contains code related to writing to filesystems atomically.
Package auditlog reads and writes the optimization log (results.tsv): one baseline/keep/revert/error row per experiment, nine tab-separated columns.
Package auditlog reads and writes the optimization log (results.tsv): one baseline/keep/revert/error row per experiment, nine tab-separated columns.
Package calibration measures how well stated confidences match observed outcomes — the reliability complement to package stats, which owns significance.
Package calibration measures how well stated confidences match observed outcomes — the reliability complement to package stats, which owns significance.
Package errs is skillet's shared error vocabulary: one Error type with machine-readable codes, following Ben Johnson's leaf/wrapper convention.
Package errs is skillet's shared error vocabulary: one Error type with machine-readable codes, following Ben Johnson's leaf/wrapper convention.
Package finding is skillet's shared diagnostic type: one Diagnostic that any linter or gate emits, carrying a Severity, an optional Category, an optional location Path, and a human Message.
Package finding is skillet's shared diagnostic type: one Diagnostic that any linter or gate emits, carrying a Severity, an optional Category, an optional location Path, and a human Message.
Package frontmatter separates a leading "---"-delimited YAML block from the markdown body that follows it.
Package frontmatter separates a leading "---"-delimited YAML block from the markdown body that follows it.
Package fsutil provides small, filesystem-shaped helpers shared by skillet tools.
Package fsutil provides small, filesystem-shaped helpers shared by skillet tools.
Package identity provides content-identity hashing shared across skillet tools.
Package identity provides content-identity hashing shared across skillet tools.
Package judge is the deterministic rule-judge for behavioral scoring.
Package judge is the deterministic rule-judge for behavioral scoring.
Package manifest reads and writes the skills-manifest.json a verify pass emits: a machine-readable summary of a verified skill tree that downstream tools consult instead of rediscovering it.
Package manifest reads and writes the skills-manifest.json a verify pass emits: a machine-readable summary of a verified skill tree that downstream tools consult instead of rediscovering it.
Package markdown parses a SKILL.md body into a small structured view, using goldmark (the established Go Markdown parser) instead of hand-rolled regexes.
Package markdown parses a SKILL.md body into a small structured view, using goldmark (the established Go Markdown parser) instead of hand-rolled regexes.
Package naming derives filenames and human titles for the distillation pipeline: a source markdown file's title, and the *_rules.md / *_prompt.md output names beside it.
Package naming derives filenames and human titles for the distillation pipeline: a source markdown file's title, and the *_rules.md / *_prompt.md output names beside it.
Package neutrality implements the runtime-neutrality red-light scan shared by skillet tools.
Package neutrality implements the runtime-neutrality red-light scan shared by skillet tools.
Package proof verifies a proof packet under NO-PROOF-NO-CLOSE: every declared artifact exists on disk and its bytes hash to the recorded digest.
Package proof verifies a proof packet under NO-PROOF-NO-CLOSE: every declared artifact exists on disk and its bytes hash to the recorded digest.
Package provenance reads and writes a comment header that marks a file as a vendored copy of an artifact whose home is another repository, and computes the content digest that header records.
Package provenance reads and writes a comment header that marks a file as a vendored copy of an artifact whose home is another repository, and computes the content digest that header records.
Package ratchet is the acceptance machinery of a darwin-style optimization loop: the keep/revert gate (gate.go) and the activation confusion matrix that feeds it a trigger-accuracy signal (activation.go).
Package ratchet is the acceptance machinery of a darwin-style optimization loop: the keep/revert gate (gate.go) and the activation confusion matrix that feeds it a trigger-accuracy signal (activation.go).
Package redlines enforces book2skill's mechanical Quality Red Lines over an already-loaded skill: the six RIA-TV++ body segments, a per-quotation word ceiling, and a description that states when to invoke the skill.
Package redlines enforces book2skill's mechanical Quality Red Lines over an already-loaded skill: the six RIA-TV++ body segments, a per-quotation word ceiling, and a description that states when to invoke the skill.
Package ruleset is the typed model of a distilled ruleset: a set of Rules, each an imperative with a severity, a level, a rationale, a ✗/✓ example pair, and an optional ↦ source anchor.
Package ruleset is the typed model of a distilled ruleset: a set of Rules, each an imperative with a severity, a level, a rationale, a ✗/✓ example pair, and an optional ↦ source anchor.
conflict
Package conflict finds decidable inconsistencies between the rules of a ruleset.
Package conflict finds decidable inconsistencies between the rules of a ruleset.
distill
Package distill generates the per-source distillation prompts: for each Markdown source under a tree it fills a template with links to the source and to the rules file it should produce, and writes a *_prompt.md beside the output directory.
Package distill generates the per-source distillation prompts: for each Markdown source under a tree it fills a template with links to the source and to the rules file it should produce, and writes a *_prompt.md beside the output directory.
synthesize
Package synthesize assembles distilled rulesets into a single synthesis prompt: it replaces a template's {{RULESETS}} marker with one <ruleset> block per input.
Package synthesize assembles distilled rulesets into a single synthesis prompt: it replaces a template's {{RULESETS}} marker with one <ruleset> block per input.
Package skill loads and parses Agent Skills ("SKILL.md") files — the unified loader shared by exegesis and skillsaw.
Package skill loads and parses Agent Skills ("SKILL.md") files — the unified loader shared by exegesis and skillsaw.
Package skilllens locates the evidence behind the three SkillLens quality dimensions: whether a skill encodes concrete failure mechanisms, whether its instructions are specific rather than softened, and whether it draws a boundary around what not to do.
Package skilllens locates the evidence behind the three SkillLens quality dimensions: whether a skill encodes concrete failure mechanisms, whether its instructions are specific rather than softened, and whether it draws a boundary around what not to do.
Package speclint validates an Agent Skill's frontmatter against the agentskills.io skill spec.
Package speclint validates an Agent Skill's frontmatter against the agentskills.io skill spec.
Package stats holds the small deterministic statistics skillet tools need.
Package stats holds the small deterministic statistics skillet tools need.
Package testprompts is skillet's reader and gate for the test-prompts.json contract shared by exegesis and skillsaw.
Package testprompts is skillet's reader and gate for the test-prompts.json contract shared by exegesis and skillsaw.
Package textnorm folds the differences between two copies of the same words that nobody means as differences: a run of whitespace where a line happened to wrap, and the typographic characters a book, a plain-text extraction and a Markdown file each spell their own way.
Package textnorm folds the differences between two copies of the same words that nobody means as differences: a run of whitespace where a line happened to wrap, and the typographic characters a book, a plain-text extraction and a Markdown file each spell their own way.
Package timeseries detects a quality regression: whether a new measurement has fallen below the baseline set by the ones before it.
Package timeseries detects a quality regression: whether a new measurement has fallen below the baseline set by the ones before it.

Jump to

Keyboard shortcuts

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