Agent skill
nix-cleanup
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/productivity/nix-cleanup
SKILL.md
Nix Cleanup
What I do
- Keep cleanup aligned with this repo's linting and workflow rules.
- Run checks in a safe order and summarize findings before edits.
- Apply small hygiene fixes (unused bindings, repeated keys, legacy syntax) when requested.
When to use me
Use this skill when you want a janitorial pass before committing, or when Nix lint errors need cleanup.
Workflow
- Run
nix flake check --no-buildto validate the flake without builds. - Run
nix run nixpkgs#statix -- check .for linting. - Run
nix run nixpkgs#deadnix -- .for unused bindings. - Summarize findings and ask before auto-fixing.
- If approved, apply
statix fixand/ordeadnix -e, then re-run checks.
Hygiene rules
- Avoid repeated keys in attribute sets; nest under a single key.
- Remove empty
letblocks and unused arguments. - Prefer
lib.mkIfover nested ifs. - Use
mkEnableOptionfor boolean options. - Use
pkgs.stdenv.hostPlatform.systeminstead ofsystem.
Safety
- Never run destructive commands.
- Never touch dotfile-managed program configs (see dotfiles policy).
- Ask before changes that alter secrets or host definitions.
Didn't find tool you were looking for?