Home / Market / clean code

clean code

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."

skill★ 5075913368 dlskills.shCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: clean-code description: "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.\"" risk: safe source: "ClawForge (https://github.com/jackjin1997/ClawForge)" date_added: "2026-02-27"

---

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

2. Functions

3. Comments

  # Check if employee is eligible for full benefits
  if employee.flags & HOURLY and employee.age > 65:

vs

  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