cleanup

Detect anti-patterns and dead code in Nix codebases.

4|Updated Feb 20, 2023
One-click install
npx skills add https://github.com/Hayao0819/dotfiles --skill cleanup-hayao0819
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/Hayao0819/dotfiles/tree/main/.claude/skills/cleanup
Command: npx skills add https://github.com/Hayao0819/dotfiles --skill cleanup-hayao0819

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers clean Nix codebases by detecting anti-patterns, removing dead code, and aligning code with best practices to improve readability and reliability.

Core Features & Use Cases

  • Anti-pattern detection: identify problematic patterns like rec { } usage, top-level with, and brittle lookup paths.
  • Dead code and redundancy cleanup: remove unused bindings, duplicated declarations, and unnecessary conditionals.
  • Consistency and modularity: enforce naming conventions and guide module structure across projects.
  • Use Case: when maintaining a large Nix configuration repo, use this Skill to systematically clean up and validate the codebase.

Quick Start

Run the cleanup skill on your Nix codebase to start an automated quality pass and report results.

Frequently Asked Questions about cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up and refactor a large Nix codebase to remove dead code?

To clean up a Nix codebase, you can systematically detect and remove anti-patterns, unused bindings, and duplicated declarations across multiple files. This refactoring process enforces style consistency and improves overall configuration readability and reliability.

What are common Nix anti-patterns I should look for during static analysis?

Common Nix anti-patterns include using rec { } constructs, applying top-level with statements, and relying on brittle lookup paths. Identifying and remediating these problematic patterns ensures your codebase aligns with best practices for reliability.

How do I validate my Nix configuration after a major code refactor?

You can validate a Nix configuration refactor by running final validation checks using nix flake check and nix eval. This ensures the refactored modules maintain structural consistency and functional correctness without breaking existing setups.

Can I use an automated cleanup workflow for my Nix dotfiles repositories?

Yes, automated phase-based cleanup workflows are applicable to Nix configurations and dotfiles repositories. They guide module structure, eliminate redundant conditionals, and enforce naming conventions across your project files.

What is the best way to enforce modularity and consistency across Nix modules?

The best way to enforce modularity is to apply static analysis guidelines that standardize naming conventions and guide module structure across projects. This systematically eliminates redundancies and aligns multi-file configurations.