LabscoConnect MCP ↗
addyosmani logo

code-simplification

Ready to use★ 102k on GitHub
part of addyosmani/agent-skillsby addyosmani

Makes working code easier to read without changing a single output, error or side effect, running the tests after each small edit and undoing any edit that breaks them. It first asks why odd-looking code is there before removing it, sticks to recently changed code unless told otherwise, and follows your project's own style; in the agent-skills plugin, /code-simplify starts it.

WHEN YOUR AGENT SHOULD USE IT

A QUICK BOUNDARY

USE FOR

  • Flatten deeply nested if-statements into early returns.
  • Split a long function into a few well-named ones.
  • Replace a chain of nested ternaries with readable branches.
  • Rename vague variables like data and temp after what they hold.
  • Remove dead code and wrappers that add nothing, once confirmed unused.
  • Plan a codemod instead of hand edits when a cleanup touches 500+ lines.

DO NOT USE FOR

  • Code that is already clean and readable.
  • Code you do not understand yet; read it first.
  • Performance-critical code where the simpler version would be measurably slower.
  • A module you are about to rewrite anyway.