mcpField
C
code-simplifier

code-simplifier

github.com/aktsmmDevelopment26366 installsUpdated 1d ago
Repository

About code-simplifier

code-simplifier is a skill for simplifying and refining code, aimed at developers refactoring, reviewing, or maintaining recently changed code. It preserves behavior and follows project standards, with readability and maintainability as its focus.

Key features

  1. 01Preserve existing behavior
  2. 02Follow configured project standards
  3. 03Avoid nested ternaries and overly compact code
  4. 04Limit scope and check tests

Use cases

  1. 01Refine code after a completed task
  2. 02Simplify complex PRs before review
  3. 03Improve code readability and maintainability

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aktsmm/agent-skills --skill code-simplifier

After installing, type/code-simplifierin Claude Code to confirm it loaded.

Bundled filesLICENSE.txtreferences/refactoring-patterns.md

Details

From the project README

Code Simplifier

A guide for simplifying and refining code while preserving functionality.

When to Use

  • Refactor, simplify code, clean up, code review
  • After completing a coding task or writing a logical chunk of code
  • Cleaning up complex PRs before review
  • Refactoring code for better readability and maintainability

Core Principles

1. Preserve Functionality

Change how the code does it, never what it does. Run the existing tests before and after.

2. Apply Project Standards

Follow the project's configured standards (CLAUDE.md, AGENTS.md, .editorconfig, linters) over personal preference.

3. Enhance Clarity
  • Avoid nested ternary operators; prefer switch or if/else chains
  • Avoid overly compact one-liners; choose clarity over brevity
  • Remove comments that only restate obvious code
4. Maintain Balance

Avoid over-simplification that could:

  • Reduce code clarity or maintainability
  • Create overly clever solutions that are hard to understand
  • Combine too many concerns into single functions
  • Remove helpful abstractions that improve organization
  • Make the code harder to debug or extend
5. Focus Scope

Only refine code that has been recently modified or touched, unless explicitly instructed to review a broader scope.

Refactoring Patterns

See references/refactoring-patterns.md for the pattern table, behavior-changing equivalence traps, and review feedback format.

Done Criteria

  • All tests pass after refactoring
  • No functionality changed
  • Code follows project standards
  • No nested ternaries, overly compact one-liners, or new unnecessary abstractions
  • Comments updated where logic changed

Comments

Markdown supported