What problem does it solve?
This Skill enforces pragmatic coding standards to ensure code is maintainable, understandable, and free from unnecessary complexity or bloat.
Core Features & Use Cases
- Enforces SOLID principles: Promotes Single Responsibility, Don't Repeat Yourself, Keep It Simple, You Ain't Gonna Need It, and the Boy Scout Rule.
- Standardizes Naming Conventions: Ensures clear and intent-revealing names for variables, functions, and constants.
- Guides Function Design: Advocates for small, focused functions with minimal arguments and no side effects.
- Promotes Clean Structure: Encourages guard clauses, flat code, and composition over deep nesting.
- AI Coding Etiquette: Defines how AI agents should interact with users regarding code requests and bug fixes.
- Pre-edit Checks: Mandates critical thinking before modifying any file, considering dependencies and tests.
- Post-completion Self-Check: Requires verification of goal completion, code functionality, and error-free status.
- Script Verification: Outlines mandatory script execution for validation and reporting.
Quick Start
Apply the clean-code skill to refactor the provided code snippet, ensuring it adheres to all defined principles and naming conventions.