// Package skillpack is the SKILL.md-subscription battery: it lets an agent host // subscribe to skill packages published as directories/git repos in the // Anthropic "agent skills" format (a SKILL.md manifest plus optional bundled // scripts and reference files) and activate them for a run with progressive // disclosure. // // It is a THIRD, distinct concept from the two "skill" nouns already in the // stack — do not conflate them: // // - majordomo/skill — a lightweight capability bundle (instructions + tools) // appended to an agent eagerly at construction. // - executus/skill — a heavyweight persisted "saved agent" noun. // - executus/skillpack (this package) — an externally-authored, versioned, // on-demand-loaded instruction pack fetched from a Source and pinned by // content digest. // // Progressive disclosure is the reason this is not just a majordomo/skill: // majordomo skills inject their whole instruction text into the system prompt // up front, which does not scale to a catalog of large third-party packs. Here // only each pack's name+description sits in the prompt permanently (the // Catalog); the full body is loaded lazily when the model calls the single // skill_use tool (see Activate). // // Design shape (each piece is nil-safe / host-agnostic, mirroring the other // executus batteries): // // - Manifest / ParseManifest — parse+validate a SKILL.md. // - Tree / Pack / LoadPack — a fetched pack's files, content digest, and // parsed manifest. // - Source (Dir, Git) — where packs come from; Fetch returns the file // tree and the source's resolved ref. // - Subscription + Store — the persisted "this host tracks this pack at // this pinned digest" record; Memory is the zero-dep default. // - PackCache — content-addressed store of pinned pack trees // so activation never re-fetches; Memory default. // - Syncer — checks the tracked ref and records a PENDING // update; applying it is an explicit, separate re-pin (supply-chain guard — // upstream can never silently change what an agent runs). // - Catalog / Activate / Stage — turn a set of resolved packs into a // majordomo agent.Skill (catalog instructions + skill_use tool) and // materialize a pack's files for a sandbox. // // The host (e.g. mort) supplies policy: which sources are allowed, who may // subscribe, and where staged files are mounted. This package supplies only the // mechanism. package skillpack import "errors" // ErrNotFound is returned when a subscription or cached pack lookup misses. var ErrNotFound = errors.New("skillpack: not found") // ErrNoManifest is returned when a fetched tree has no SKILL.md at its root. var ErrNoManifest = errors.New("skillpack: tree has no SKILL.md")