What problem does it solve?
This skill helps developers transform code that works into clean, readable, and maintainable software by applying established clean-code principles.
Core Features & Use Cases
- Meaningful Names: use intention-revealing, pronounceable, and consistent names.
- Small, Single-Purpose Functions: keep functions focused on one task and of manageable size.
- Descriptive Comments & Clear Documentation: replace or minimize comments with self-explanatory code, while documenting intent where necessary.
- Formatting & Structure: organize code like a newspaper where high-level ideas are at top and details at the bottom; keep related lines close together.
- Data & Object Design: apply proper data hiding, DTO usage, and avoid deep object chains (Law of Demeter).
- Error Handling: prefer exceptions and avoid returning null; ensure predictable failure modes.
- Testing & Quality Gates: follow testing discipline and ensure code readability accompanies unit tests.
- Classes & Responsibilities: prefer small, cohesive classes with a single responsibility.
Quick Start
Refactor a small function to apply meaningful names, single responsibility, and clear formatting.