Build a skills packaging system with Nix as the substrate and a skill CLI as the interface.
mkSkill helperskill CLI provides: skill search, skill help, skill tutorial, skill runmkSkill {
name = "collagen-protocol";
deps = [ pkgs.python3 ];
script = ./run.py;
description = "Pre-workout collagen timing and dosing protocol";
}
skill search <query> — apropos-style search by keywordskill help <name> — show the markdown instructionsskill tutorial <name> — show examples/tutorial sectionskill run <name> [args] — execute the skill's scriptskill list — list all available skillsskills/mkSkill.nix — the builder helperskills/flake.nix (or integration with omni flake)skills/skill-cli/main.py (or Haskell/Rust) — the dispatcherskills/foo/README.md, skills/foo/run.py, skills/foo/default.nixDiscussed with Ben 2026-04-12. Current pain: skill deps leak into global agent runtime env because there's no per-skill isolation. Skills need executable code, not just instructions. This is the Unix package analogy: binary + man page + apropos.
Additional decisions from Ben (2026-04-12):
All skills use mkSkill uniformly — even markdown-only skills are just mkSkill closures with no script/deps. Keeps authoring consistent and avoids a two-tier system.
Discovery/registry: use Nix path-resolution instead of a central registry file. skill search scans the flake's package set at query time (same approach as nix search). Can add a local cache (~/.agents/skills/cache.json or similar) for faster lookups later, but the source of truth is always the flake — not a manually maintained registry.json.
New standalone open-source repo on GitHub. Rust CLI for the skill command (portable, no runtime dep). Nix backend for packaging with mkSkill helper. Architecture: skill CLI (Rust, C layer) wraps Nix packages (B layer). Registry generated at build time from flake package set.