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é
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.
documentation-generation-doc-generate
"You are a documentation expert specializing in creating comprehensive, maintainable documentation from code. Generate API docs, architecture diagrams, user guides, and technical references using AI-powered analysis and industry best practices."
api-documentation-generator
"Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices"