Skip to main content

Agent Skill

The Nixomatic Agent Skill enables AI coding agents to automatically set up reproducible development environments powered by Nix. It works with agents supporting the skills convention, such as Claude Code and Codex. It helps you:

  • Automatically detect required packages from project dependency files
  • Execute commands within a fully configured Nix environment
  • Retry with missing packages when runtime errors occur
  • Document the working environment configuration in your project README

Quick Start

Per-Project Setup

# For Claude Code
mkdir -p .claude/skills
ln -s /path/to/nixomatic-skill/nixomatic .claude/skills/nixomatic

# For Codex
mkdir -p .codex/skills
ln -s /path/to/nixomatic-skill/nixomatic .codex/skills/nixomatic

Global Setup

# For Claude Code (available across all projects)
ln -s /path/to/nixomatic-skill/nixomatic ~/.claude/skills/nixomatic

# For Codex (available across all projects)
ln -s /path/to/nixomatic-skill/nixomatic ~/.codex/skills/nixomatic

How It Works

Once installed, the skill activates when you ask the agent to build, test, run, or set up a project. It follows this workflow:

  1. Project analysis — Scans dependency files (package.json, Cargo.toml, go.mod, etc.) to identify required packages
  2. Environment construction — Generates a nixomatic URL with the detected packages
  3. Command execution — Runs commands inside a nix develop environment
  4. Error recovery — If a command fails due to a missing tool, it adds the package and retries
  5. Documentation — Updates the project README with the finalized nixomatic URL

Detected Languages and Tools

The skill automatically maps project files to Nix packages:

FilePackage(s)
package.jsonnodejs
Cargo.tomlrustc, cargo
go.modgo
requirements.txt, pyproject.tomlpython3
Gemfileruby
pom.xml, build.gradlejdk
mix.exselixir
composer.jsonphp
.csproj, .fsprojdotnet-sdk
Package.swiftswift
stack.yaml, .cabalghc, cabal-install
pubspec.yamldart
build.zig, zig.zonzig

Build tools are also detected:

FilePackage
Makefilegnumake
CMakeLists.txtcmake
meson.buildmeson
Justfilejust
Taskfile.ymlgo-task

Requirements

The skill requires one of the following runtimes on the system:

  • Nix (with flakes support) — used natively
  • Docker — falls back to the nixos/nix image

Package Formats

The skill constructs nixomatic URLs using the same package formats available everywhere in Nix O'matic:

FormatExampleDescription
BasicnodejsLatest version from nixos-unstable
Versioned[email protected]Specific version (resolved via nxv)
Pinnedpython3:3b93cf5Exact nixpkgs commit for full reproducibility

For more details, see the Nixomatic Agent Skill on GitHub.