Compare commits

..

1 Commits

Author SHA1 Message Date
8622b35f48 feat: package skills as per-skill Nix derivations (task 0001)
Add the content tier: a standalone flake that auto-discovers each skill
(a directory containing a SKILL.md, at any depth) and exposes it as an
individually addressable derivation built by lib.mkSkill. Directories
without a SKILL.md are descended through as cosmetic containers; once a
SKILL.md is found, that directory's subfolders are its assets, not
further skills. Skill names must be globally unique across the tree — a
collision is a hard eval-time error, not a warning.

A fixture-driven skill-build check under `nix flake check` exercises the
recursive walk, the builder, the SKILL.md-at-$out-root contract, the
eval-time name passthru, and the collision error. The repo ships no real
skill content yet, so packages.<system> is empty today.
2026-07-22 16:51:40 -04:00

View File

@@ -8,17 +8,9 @@
let
inherit (pkgs) lib;
# A valid tree covering every discovery shape at once: two top-level skills
# (alpha, delta), a skill nested under a cosmetic container (beta, which also
# owns an asset subfolder whose own SKILL.md must NOT become a skill), and a
# skill several containers deep (gamma).
discovered = discoverSkills ./fixtures/valid;
built = map (skill: mkSkill { inherit pkgs; inherit (skill) name src; }) discovered;
# Discovery of a tree with two skills resolving to the same name must throw at
# eval.
# tryEval catches the throw, so the check can assert discovery failed rather
# than silently clobbering.
collision = builtins.tryEval (discoverSkills ./fixtures/collision);
discoveredNames = lib.sort (a: b: a < b) (map (skill: skill.name) discovered);