rokokol

Nix Best Practices Skill — Development skill for Claude Code

Development community

A standard for Nix: what the formatter cannot check, and a checker that holds it.

How to install Nix Best Practices Skill

This entry records only its repository, not the path inside it, so there is no exact command to give. Open rokokol/nix-best-practices-skill and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Nix Best Practices Skill does

A standard for Nix: what the formatter cannot check, and a checker that holds it.

Alternatives in Development

  • Pi Reserved Keybindings — Extensions cannot override these shortcuts — they are silently skipped by registerShortcut() 526 ★
  • Agent Skills Nix — Declarative management of Agent Skills on Nix 216 ★
  • Cargo Nix Plugin — A Nix plugin that resolves Cargo workspaces natively and allows for crate level builds 53 ★

README

nix-best-practices skill

**What the formatter cannot check, and a checker that holds it ʕ•ᴥ•ʔ**

[![Agent Skill](https://img.shields.io/badge/Agent_Skill-6E56CF?style=flat)](https://agentskills.io) ![Nix](https://img.shields.io/badge/Nix-flake-7EBAE4?style=flat&logo=nixos&logoColor=white) ![Bash](https://img.shields.io/badge/Bash-4EAA25?style=flat&logo=gnubash&logoColor=white) [![license](https://img.shields.io/badge/MIT-3DA639?style=flat)](LICENSE) [![ci](https://github.com/rokokol/nix-best-practices-skill/actions/workflows/build.yml/badge.svg)](https://github.com/rokokol/nix-best-practices-skill/actions/workflows/build.yml) [![macos](https://github.com/rokokol/nix-best-practices-skill/actions/workflows/macos.yml/badge.svg)](https://github.com/rokokol/nix-best-practices-skill/actions/workflows/macos.yml)

`nixfmt` owns layout, `statix` owns the language's antipatterns and `deadnix` owns dead code. What none of them can see is the shape of a module header, the scope a `with` opens, whether a derivation says what it is, and whether a lock names a path that exists on one machine alone. Those are the rules this skill writes down, and `check-nix.sh` is the half a machine decides

The second thing those tools cannot see is time. A derivation's hash, an input's private copy, an option's path: each is correct on the machine that wrote it and wrong on the next one, or correct today and wrong after a rename upstream. Most of the rules here are about that gap rather than about taste

Contents

Install

npx skills add -g rokokol/nix-best-practices-skill    # for you, everywhere
npx skills add rokokol/nix-best-practices-skill       # for the project you are standing in

Claude Code also takes it as a plugin: