Clean code

From BEKO2210/Firstbrain · View interactive version

Clean code is an AI agent skill from the GitHub repository BEKO2210/Firstbrain. 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:

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

Connections

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.