clean-code
Documentation & Productivité"Applies principles from Robert C. Martin's 'Clean Code'. Use this skill when writing, reviewing, or refactoring code to ensure high quality, readability, and maintainability. Covers naming, functions, comments, error handling, and class design."
Documentation
Clean Code Skill
This skill embodies the principles of "Clean Code" by Robert C. Martin (Uncle Bob). Use it to transform "code that works" into "code that is clean."
🧠 Core Philosophy
> "Code is clean if it can be read, and enhanced by a developer other than its original author." — Grady Booch
When to Use
Use this skill when:
1. Meaningful Names
elapsedTimeInDays instead of d.accountList if it's actually a Map.ProductData vs ProductInfo.genymdhms.Customer, WikiPage). Avoid Manager, Data.postPayment, deletePage).2. Functions
isPasswordValid is better than check.3. Comments
```python
# Check if employee is eligible for full benefits
if employee.flags & HOURLY and employee.age > 65:
```
vs
```python
if employee.isEligibleForFullBenefits():
```
4. Formatting
5. Objects and Data Structures
a.getB().getC().doSomething().6. Error Handling
NullPointerException.7. Unit Tests
8. Classes
9. Smells and Heuristics
🛠️ Implementation Checklist
Compétences similaires
Explorez d'autres agents de la catégorie Documentation & Productivité
file-organizer
Intelligently organizes files and folders by understanding context, finding duplicates, and suggesting better organizational structures. Use when user wants to clean up directories, organize downloads, remove duplicates, or restructure projects.
mermaid-expert
Create Mermaid diagrams for flowcharts, sequences, ERDs, and
risk-metrics-calculation
Calculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis. Use when measuring portfolio risk, implementing risk limits, or building risk monitoring systems.