code-simplification
Installation
SKILL.md
Code Simplification
Reduce complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug.
Quick Reference
| When to apply | What to check | Key heuristic |
|---|---|---|
| After feature is done, tests pass | Implementation feels heavier than needed | "Would a new team member understand this faster?" |
| During code review | Readability or complexity flags | Each simplification must be a clear net improvement |
| When encountering deep nesting | Conditional complexity | Flatten with guard clauses, not by removing checks |
| When names are unclear | Variable, function, class names | A good name removes the need for a comment |
| After merging duplicated code | Logic repeated across files | Extract once, reference everywhere |
| When an abstraction seems unnecessary | Indirection that obscures the flow | YAGNI: remove it, re-add when needed |
When to Use
Use this skill when: