Agent skill

code-simplifier

Simplify and refine code for clarity, consistency, and maintainability while preserving all functionality. Use when asked to "simplify", "clean up", "refine", or "tidy" code, or after a round of changes to polish recently modified code.

Stars 53
Forks 5

Install this agent skill to your Project

npx add-skill https://github.com/edmundmiller/dotfiles/tree/main/config/agents/skills/code-simplifier

SKILL.md

Code Simplifier

Refine code for clarity and maintainability without changing behavior. Prioritize readable, explicit code over compact cleverness.

Scope

Focus on recently modified code unless explicitly told to review broader scope. Identify touched files/sections first, then refine.

Refinement criteria

Preserve functionality

Never change what code does — only how it expresses it. All features, outputs, side effects, and error behaviors stay intact.

Follow project conventions

Read project-level config (AGENTS.md, CLAUDE.md, .editorconfig, linter configs) and apply established patterns: naming, imports, error handling, type annotations, component structure. Don't impose conventions the project doesn't use.

Enhance clarity

  • Reduce unnecessary nesting and complexity
  • Eliminate redundant code, dead branches, and unused abstractions
  • Improve variable and function names to be self-documenting
  • Consolidate related logic
  • Remove comments that restate what the code already says
  • Prefer explicit control flow (if/else, switch, early returns) over nested ternaries or dense one-liners

Maintain balance — avoid over-simplification that:

  • Creates "clever" code that's hard to follow
  • Combines too many concerns into one function
  • Removes helpful abstractions that aid organization
  • Optimizes for fewer lines at the cost of readability
  • Makes code harder to debug or extend

Process

  1. Identify recently modified sections (diffs, changed files; fallback git diff)2. Analyze for clarity, consistency, and convention adherence
  2. Apply refinements — smallest diff that achieves the improvement
  3. Verify functionality is unchanged
  4. Summarize only significant changes worth noting

Expand your agent's capabilities with these related and highly-rated skills.

edmundmiller/dotfiles

zbench

Benchmark interactive zsh performance with zsh-bench and track regressions. Use when benchmarking shell startup, comparing zsh latency after config changes, investigating slow shell, or running git bisect on performance. Trigger phrases: "benchmark zsh", "shell is slow", "zbench", "zsh-bench", "shell startup time", "profile zsh", "zsh performance".

53 5
Explore
edmundmiller/dotfiles

nix-rebuild

Rebuild nix-darwin/NixOS system after dotfiles changes. Use when config files managed by Nix (lazygit, ghostty, etc.) need to be regenerated, or after editing any .nix file in the dotfiles repo.

53 5
Explore
edmundmiller/dotfiles

hass-config-flow

Interact with Home Assistant via the REST API on a NixOS host. Use when adding integrations, querying entities, managing config flows, creating API tokens, or automating HA setup programmatically. Also covers identifying device protocols (Matter, Zigbee, Thread, HomeKit) from the device registry. Trigger phrases: "add HA integration", "configure home assistant", "query HA entities", "create HA token", "HA REST API", "pair homekit", "set up matter in HA", "add spotify to HA", "is this device zigbee or thread", "what protocol is this device", "move devices to ZHA", "identify matter devices".

53 5
Explore
edmundmiller/dotfiles

hass-declarative

Manage Home Assistant automations, scenes, and scripts declaratively via NixOS modules. Covers adding/editing/removing entities in the domain-based Nix structure, the ensureEnabled wrapper (initial_state enforcement), the sweep service that cleans orphaned entities, entity identity (IDs, slugs, unique_ids), the eval test assertions, and the build-time manifest. Trigger phrases: "add HA automation", "new scene", "new script", "remove automation", "declarative HA", "sweep unmanaged", "entity drift", "ghost entity", "orphaned automation", "HA domain file", "eval-automations test", "hass assertion", "ensureEnabled", "initial_state".

53 5
Explore
edmundmiller/dotfiles

agenix-secrets

Create, edit, and wire up agenix-encrypted secrets in this dotfiles repo. Use when adding API keys, tokens, credentials, passwords, or any sensitive values to NixOS host configs. Trigger phrases: "add a secret", "encrypt with agenix", "new age secret", "hide this value", "agenix secret".

53 5
Explore
edmundmiller/dotfiles

linear

Read-only Linear issue access via the Linear GraphQL API.

53 5
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results