skillnet
skillnet is a CLI for managing canonical AI skill stores, materialising derived agent views, and recording calibration data for multi-phase-plan.
The supported interface in 0.6.0 is the skillnet binary. This crate does not commit to a stable embeddable Rust API yet.
Install
For a source checkout:
Hook ingestion
skillnet hook install wires Claude Code to record skill invocations through
skillnet hook ingest, storing rows in skill_invocations. Use
skillnet hook status to confirm the managed hook entries are installed. See
the mdBook chapter at docs/src/hook-ingestion.md
for Postgres, SQLite, and Home Manager setup.
Nix Home Manager
Add the flake input and import the module:
inputs.skillnet.url = "git+ssh://git@codeberg.org/caniko/skillnet.git";
# In your Home Manager config:
imports = [ inputs.skillnet.hmModules.default ];
programs.skillnet = {
enable = true;
settings = {
global = {
views = [
{ label = "claude"; path = "/home/alice/.claude/skills"; scope = "global"; }
{ label = "agents"; path = "/home/alice/.agents/skills"; scope = "global"; }
];
};
};
mirrorRoot = "/home/alice/skills-mirror";
database = {
backend = "postgres";
urlFile = config.age.secrets.skillnet-pg-url.path;
};
};
The module is exported as both hmModules.default and hmModules.skillnet.
It installs skillnet on PATH. When settings is declared, the module
renders $XDG_CONFIG_HOME/skillnet/skillnet.toml, which the CLI discovers by
default. When catalogSettings is declared, it renders
$XDG_CONFIG_HOME/skillnet/skillnet.catalog.toml. skillsRoot, mirrorRoot, and the
declarative database options are folded into generated skillnet.toml, so a
normal declarative Home Manager install does not depend on shell-specific env
imports. Without settings, you can still drop your own TOMLs and point
programs.skillnet.configFile at them. When SQLite is selected, the module also
creates the runtime data directory and exports skillnet_DATA_DIR and
SKILLNET_DATA_DIR for compatibility.
If you also want the module to define where the ai-skills checkout lives,
set skillsRoot. On atlas, that path is:
programs.skillnet.skillsRoot = "/data/nvme0/can/Projects/ai-skills";
When configured, the module writes skills_root into skillnet.toml, exports
AI_SKILLS_REPO for compatibility, and warns if the checkout directory is
missing. skillsRoot points at the skills checkout and VCS working tree;
dataDir remains skillnet's runtime database location.
Postgres is the default calibration backend and requires a connection URL. SQLite is also supported by selecting it explicitly:
programs.skillnet = {
enable = true;
package = inputs.skillnet.packages.${pkgs.system}.skillnet;
database = {
backend = "sqlite";
};
};
The Postgres backend is included in default builds. If you override
programs.skillnet.package with a custom --no-default-features build, choose
a package that includes the postgres feature when using the Postgres backend.
The database.url value is written into the Nix store. For production secrets,
prefer database.urlFile, which reads the Postgres URL from a file at shell
initialization time.
Claude Code hook ingestion can also be installed declaratively:
programs.skillnet = {
enable = true;
hooks = {
enable = true;
events = [ "PostToolUse" ];
matchers = [ "Skill" ];
settingsFile = "${config.home.homeDirectory}/.claude/settings.json";
};
};
When enabled, Home Manager runs skillnet hook install during activation after
writeBoundary, so the change is idempotent and respects home-manager switch --dry-run. Setting hooks.enable = false later leaves the settings file
untouched; run skillnet hook uninstall explicitly to remove managed entries.
Options:
programs.skillnet.dataDirdefaults to${config.xdg.dataHome}/skillnet. This is skillnet's runtime database location.programs.skillnet.skillsRootsetsskills_rootin generatedskillnet.toml, exportsAI_SKILLS_REPOfor compatibility, and is the canonical mirror destination/VCS working tree; atlas uses/data/nvme0/can/Projects/ai-skills.programs.skillnet.mirrorRootis the legacy mirror destination option. When bothskillsRootandmirrorRootare set, they must match.programs.skillnet.database.backendselectssqliteorpostgresand defaults topostgres.programs.skillnet.database.pathoptionally sets the SQLite database path; when unset, calibration data lives at<dataDir>/multi-phase-plan/calibration.sqlite.programs.skillnet.database.urlis written into generatedskillnet.tomlwhensettingsis declared, or exported asSKILLNET_DATABASE_URLfor user-managed config.programs.skillnet.database.urlFilereads a Postgres URL from a file at shell initialization time.programs.skillnet.settingsandprograms.skillnet.catalogSettingsrenderskillnet.tomlandskillnet.catalog.tomlfrom Nix.programs.skillnet.configFileandprograms.skillnet.catalogConfigFilepoint the CLI at user-managed TOML files.programs.skillnet.activation.promote,failOnConflict, andallowDeletecontrol Home Manager's activation-timeskillnet syncinvocation. Promotion is off by default for consumer-host safety.programs.skillnet.hooks.enableinstalls skillnet-managed Claude Code hook entries inprograms.skillnet.hooks.settingsFile.programs.skillnet.hooks.eventsandprograms.skillnet.hooks.matcherscontrol the event/matcher pairs passed toskillnet hook install.programs.skillnet.packageoverrides the package. Ifpkgs.skillnetis not available in your package set, useinputs.skillnet.packages.${pkgs.system}.skillnet.
Storage backends
Postgres is the default calibration backend:
[]
= "postgres://skillnet@localhost/skillnet"
SQLite is available by selecting it explicitly:
[]
= "sqlite"
= "/home/alice/.local/share/skillnet/multi-phase-plan/calibration.sqlite"
The path key is optional. Without it, skillnet uses
$skillnet_DATA_DIR/multi-phase-plan/calibration.sqlite,
$SKILLNET_DATA_DIR/multi-phase-plan/calibration.sqlite, or
$XDG_DATA_HOME/skillnet/multi-phase-plan/calibration.sqlite.
Select Postgres with an environment variable:
Or with skillnet.toml:
[]
= "postgres://skillnet@localhost/skillnet"
Or through the Home Manager module:
programs.skillnet = {
enable = true;
package = inputs.skillnet.packages.${pkgs.system}.skillnet;
database = {
backend = "postgres";
urlFile = config.age.secrets.skillnet-pg-url.path;
};
};
--database-url <URL> overrides both environment and config for one command.
Plain URLs in programs.skillnet.database.url are written into the Nix store;
use programs.skillnet.database.urlFile with sops-nix, agenix, or another
secret-backed file for production credentials.
Quick Start
Inspect configured scopes and current view drift:
Materialise derived views and then inspect or regenerate catalog output:
skillnet sync is dry-run-on-conflict for promotion candidates: a real
view-side directory newer than canonical prints would promote ... and exits 2. Rerun with --apply-promote to pull that content into canonical. See
docs/src/commands.md for the full flag table.
Calibration commands are available under the dedicated command group:
Development
Run the default test suite with:
Postgres parity tests run when SKILLNET_TEST_PG_URL points at a test database:
Configuration Model
skillnet keeps canonical skill stores separate from generated agent views:
global/stores the canonical global skills by default.- Project canonical stores live at each project's
canonical_rel, defaulting to.skills. - Global and project views such as
.agents/skillsand.claude/skillsare symlinks generated from canonical stores.
Configuration lives in $XDG_CONFIG_HOME/skillnet/skillnet.toml. Catalog
metadata uses $XDG_CONFIG_HOME/skillnet/skillnet.catalog.toml. The legacy
cwd fallbacks ./skillnet.toml and ./skillnet.catalog.toml still work in
0.6.x with a deprecation warning and are scheduled for removal in 0.7.0.
Run skillnet config migrate from the old config directory to centralise
existing files.
Command Surface
The current top-level commands are:
statuscompletionssyncviewskillscopeprojectcatalogcalibration
Generate shell completions with:
Documentation
- Docs: https://docs.rs/skillnet
- Source: https://codeberg.org/caniko/skillnet
Release Validation
The release-prep flow validates the repository with:
RUSTDOCFLAGS="-D warnings"
License
Licensed under either of:
- MIT (LICENSE-MIT)
- Apache-2.0 (LICENSE-APACHE)