What problem does it solve?
This Skill enforces pragmatic coding standards to ensure code is maintainable, efficient, and easy to understand, reducing technical debt and improving development velocity.
Core Features & Use Cases
- Enforces Core Principles: Adheres to SRP, DRY, KISS, YAGNI, and the Boy Scout Rule.
- Clear Naming Conventions: Guides variable, function, and constant naming for readability.
- Function Best Practices: Promotes small, single-purpose functions with minimal arguments.
- Code Structure Guidelines: Encourages guard clauses, flat structures, and composition.
- AI Coding Etiquette: Defines how AI agents should interact with users regarding code requests and bug fixes.
- Pre-Edit Checks: Mandates thinking about dependencies and impact before modifying files.
- Post-Completion Verification: Requires self-checking for goal completion, code correctness, and error-free execution.
- Script Output Handling: Standardizes how AI agents report and act upon validation script results.
- Use Case: When asked to refactor a complex function, the AI will apply these principles to simplify it, rename variables for clarity, and ensure it performs only one task. When fixing a bug, the AI will ensure all dependent files are also updated in the same task.
Quick Start
Apply the clean-code skill to refactor the provided JavaScript function to adhere to the DRY principle.