Clean code

From sickn33/agentic-awesome-skills · View interactive version

Clean code is an AI agent skill from the GitHub repository sickn33/agentic-awesome-skills. 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.\"

How to use this skill

Skill file

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:

These are design heuristics, not universal language rules or authority to change behavior. Follow the actual repository conventions; exceptions versus result types, nullability, argument counts and test cadence depend on the language and task. Preserve necessary rationale, security and license comments. Refactor only within scope and verify the relevant behavior.

1. Meaningful Names

2. Functions

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

6. Error Handling

7. Unit Tests

1. Don't write production code until you have a failing unit test.

2. Don't write more of a unit test than is sufficient to fail.

3. Don't write more production code than is sufficient to pass the failing test.

8. Classes

9. Smells and Heuristics

🛠️ Implementation Checklist

Example

User request:

Refactor this working code for clearer names, smaller units, explicit errors, and preserved behavior; verify it with focused tests.

Limitations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.