WR

This skill provides rules for writing clean, efficient Nix code, focusing on module design, explicit bindings, and performance patterns.

Install

mkdir -p .claude/skills/writing-nix && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6787" && unzip -o skill.zip -d .claude/skills/writing-nix && rm skill.zip

Installs to .claude/skills/writing-nix

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Write idiomatic and maintainable Nix code. Use when creating or refactoring Nix expressions, Home Manager or NixOS modules, overlays, packages, and flake outputs, especially when deciding module merge semantics, binding locality, option defaults, and conditional structure.
273 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Enforces explicit module system merging over decorative abstractions
  • Applies linting rules for Nix bindings like let/inherit
  • Validates module options using mkDefault/mkForce priority
  • Identifies anti-patterns like with and rec in expressions
  • Optimizes performance via strict folds and file set operations

How it works

It applies a structured reference-based checklist (module style, bindings, assertions, anti-patterns) to evaluate and refactor Nix expressions for clarity and maintainability.

Inputs & outputs

You give it
Nix code snippet or configuration module
You get back
Refactored, idiomatic Nix code following the style guide

When to use writing-nix

  • Writing NixOS modules
  • Refactoring flake outputs
  • Optimizing Nix expressions
  • Implementing Home Manager configurations

About this skill

Writing Nix

Write boring, explicit Nix that follows this skill's opinionated style. Prefer module merge semantics, narrow scopes, and simple attrset composition over decorative abstractions.

Quick Start

  1. Read repository docs for local constraints and layout. Treat them as authoritative; use this skill's defaults where repository canon is silent.
  2. Identify the task shape and load only the relevant reference files:
  3. Apply the narrowest ruleset needed. Do not bulk-load every reference file unless the task truly spans them.

Always Prefer

  • Explicit lib. usage, a justified local inherit (...), or expression-local with when it is narrower and clearer than repeated prefixes.
  • Local bindings over hoisted helper names.
  • Module-system merging over hand-written if/else.
  • Small, intentional option surfaces.
  • Normal assignments, mkDefault, and mkForce used intentionally by merge priority.

Style Authority

  • Treat repository contributor docs as authority for local Nix conventions.
  • Use this skill as default guidance where repository canon is silent.
  • If two repository-local sources conflict, call out conflict before editing.
  • Avoid top-level, block-level, and wide-scope with. Expression-local with is acceptable for a single value when it reduces noisy repetition and keeps scope obvious, such as type = with lib.types; nullOr (either str path);.
  • Do not request a style fix solely because new code uses expression-local with lib.types; in one type = ...; assignment.
  • Keep edits surgical; do not clean up unrelated Nix while touching a module.

Validation

After edits, run the most relevant repo checks available for the task (nix fmt, focused eval/build/test, or module-specific validation).

When not to use it

  • When writing short, disposable scripts where full module rigor is overkill
  • When forced to work within strict external style requirements that contradict this guide

Prerequisites

Nix package managerBasic understanding of NixOS modules

Limitations

  • Does not automatically fix logic errors in the code
  • Requires manual selection of the relevant reference file for large projects
  • Style rules may conflict with established legacy codebases

How it compares

It prioritizes 'boring' and explicit Nix over complex abstractions, directly reducing evaluation debt and dependency confusion.

Compared to similar skills

writing-nix side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
writing-nix (this skill)12moNo flagsAdvanced
ansible-fix05moReviewBeginner
cloudflare-manager259moReviewIntermediate
storage-networking67moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

ansible-fix

diegosouzapw

ALWAYS use this skill immediately after running 'ansible-galaxy init' to create a new Ansible role. Also use when the user asks to fix ansible-lint errors or when ansible-lint output shows fixable issues like yaml[comments], schema[meta], meta-incorrect, name[play], or role-name[path] violations.

00

cloudflare-manager

qdhenry

Comprehensive Cloudflare account management for deploying Workers, KV Storage, R2, Pages, DNS, and Routes. Use when deploying cloudflare services, managing worker containers, configuring KV/R2 storage, or setting up DNS/routing. Requires CLOUDFLARE_API_KEY in .env and Bun runtime with dependencies installed.

25135

storage-networking

pluginagentmarketplace

Master Kubernetes storage management and networking architecture. Learn persistent storage, network policies, service discovery, and ingress routing.

663

aws-solution-architect

alirezarezvani

Design AWS architectures for startups using serverless patterns and IaC templates. Use when asked to design serverless architecture, create CloudFormation templates, optimize AWS costs, set up CI/CD pipelines, or migrate to AWS. Covers Lambda, API Gateway, DynamoDB, ECS, Aurora, and cost optimization.

2047

terraform-module-library

wshobson

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

759

cloud-architect

sickn33

Expert cloud architect specializing in AWS/Azure/GCP multi-cloud infrastructure design, advanced IaC (Terraform/OpenTofu/CDK), FinOps cost optimization, and modern architectural patterns. Masters serverless, microservices, security, compliance, and disaster recovery. Use PROACTIVELY for cloud architecture, cost optimization, migration planning, or multi-cloud strategies.

649

Search skills

Search the agent skills registry