What problem does it solve?
This Skill enforces pragmatic coding standards to ensure code is concise, direct, and avoids over-engineering or unnecessary comments, leading to more maintainable and understandable software.
Core Features & Use Cases
- Enforces SOLID principles: Promotes Single Responsibility, Don't Repeat Yourself, Keep It Simple, You Aren't Gonna Need It, and the Boy Scout Rule.
- Standardizes Naming Conventions: Ensures clear and intent-revealing names for variables, functions, and constants.
- Optimizes Function Design: Guides developers to write 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 Style Guidelines: Provides specific instructions for AI agents on how to handle feature requests, bug reports, and unclear requirements.
- Pre-edit Checks: Mandates a "think first" approach before editing any file, considering imports, tests, and shared components.
- Post-completion Verification: Requires a mandatory self-check before marking a task as complete, ensuring goals are met, code works, and no errors are left.
- Script Output Handling: Defines a strict protocol for running, parsing, summarizing, and acting upon validation script outputs.
Quick Start
Use the clean-code skill to refactor the provided code snippet, ensuring it adheres to the Single Responsibility Principle and has clear variable names.