
Clean Code
- 9.5k installs
- 44k repo stars
- Updated July 27, 2026
- sickn33/antigravity-awesome-skills
clean-code is an agent skill that 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.\".
About
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.\" --- name: clean-code description: "This skill embodies the principles of \"Clean Code\" by Robert C. 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. 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: - **Writing new code**: To ensure high quality from the start. - **Reviewing Pull Requests**: To provide constructive, principle-based feedback. - **Refactoring legacy code**: To identify and remove code smells.
- **Writing new code**: To ensure high quality from the start.
- **Reviewing Pull Requests**: To provide constructive, principle-based feedback.
- **Refactoring legacy code**: To identify and remove code smells.
- **Improving team standards**: To align on industry-standard best practices.
- **Use Intention-Revealing Names**: `elapsedTimeInDays` instead of `d`.
Clean Code by the numbers
- 9,485 all-time installs (skills.sh)
- +227 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #98 of 2,184 Testing & QA skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
clean-code capabilities & compatibility
- Capabilities
- **writing new code**: to ensure high quality fro · **reviewing pull requests**: to provide construc · **refactoring legacy code**: to identify and rem · **improving team standards**: to align on indust · **use intention revealing names**: `elapsedtimei
- Use cases
- documentation
What clean-code says it does
--- name: clean-code description: "This skill embodies the principles of \"Clean Code\" by Robert C.
- **Reviewing Pull Requests**: To provide constructive, principle-based feedback.
- **Refactoring legacy code**: To identify and remove code smells.
- **Improving team standards**: To align on industry-standard best practices.
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill clean-codeAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 9.5k |
|---|---|
| repo stars | ★ 44k |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | sickn33/antigravity-awesome-skills ↗ |
What problem does clean-code solve for developers using this 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.\"
Who is it for?
Developers who need clean-code patterns described in the cached skill documentation.
Skip if: Skip when docs are empty or the task is outside the skill's documented scope.
When should I use this 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.\"
What you get
Actionable workflows and conventions from SKILL.md for clean-code.
By the numbers
- Sourced from ClawForge and added to antigravity-awesome-skills on 2026-02-27
- Marked with risk level safe in the skill manifest
Files
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:
- Writing new code: To ensure high quality from the start.
- Reviewing Pull Requests: To provide constructive, principle-based feedback.
- Refactoring legacy code: To identify and remove code smells.
- Improving team standards: To align on industry-standard best practices.
1. Meaningful Names
- Use Intention-Revealing Names:
elapsedTimeInDaysinstead ofd. - Avoid Disinformation: Don't use
accountListif it's actually aMap. - Make Meaningful Distinctions: Avoid
ProductDatavsProductInfo. - Use Pronounceable/Searchable Names: Avoid
genymdhms. - Class Names: Use nouns (
Customer,WikiPage). AvoidManager,Data. - Method Names: Use verbs (
postPayment,deletePage).
2. Functions
- Small!: Functions should be shorter than you think.
- Do One Thing: A function should do only one thing, and do it well.
- One Level of Abstraction: Don't mix high-level business logic with low-level details (like regex).
- Descriptive Names:
isPasswordValidis better thancheck. - Arguments: 0 is ideal, 1-2 is okay, 3+ requires a very strong justification.
- No Side Effects: Functions shouldn't secretly change global state.
3. Comments
- Don't Comment Bad Code—Rewrite It: Most comments are a sign of failure to express ourselves in code.
- Explain Yourself in Code:
# Check if employee is eligible for full benefits
if employee.flags & HOURLY and employee.age > 65:vs
if employee.isEligibleForFullBenefits():- Good Comments: Legal, Informative (regex intent), Clarification (external libraries), TODOs.
- Bad Comments: Mumbling, Redundant, Misleading, Mandated, Noise, Position Markers.
4. Formatting
- The Newspaper Metaphor: High-level concepts at the top, details at the bottom.
- Vertical Density: Related lines should be close to each other.
- Distance: Variables should be declared near their usage.
- Indentation: Essential for structural readability.
5. Objects and Data Structures
- Data Abstraction: Hide the implementation behind interfaces.
- The Law of Demeter: A module should not know about the innards of the objects it manipulates. Avoid
a.getB().getC().doSomething(). - Data Transfer Objects (DTO): Classes with public variables and no functions.
6. Error Handling
- Use Exceptions instead of Return Codes: Keeps logic clean.
- Write Try-Catch-Finally First: Defines the scope of the operation.
- Don't Return Null: It forces the caller to check for null every time.
- Don't Pass Null: Leads to
NullPointerException.
7. Unit Tests
- The Three Laws of TDD:
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.
- F.I.R.S.T. Principles: Fast, Independent, Repeatable, Self-Validating, Timely.
8. Classes
- Small!: Classes should have a single responsibility (SRP).
- The Stepdown Rule: We want the code to read like a top-down narrative.
9. Smells and Heuristics
- Rigidity: Hard to change.
- Fragility: Breaks in many places.
- Immobility: Hard to reuse.
- Viscosity: Hard to do the right thing.
- Needless Complexity/Repetition.
🛠️ Implementation Checklist
- [ ] Is this function smaller than 20 lines?
- [ ] Does this function do exactly one thing?
- [ ] Are all names searchable and intention-revealing?
- [ ] Have I avoided comments by making the code clearer?
- [ ] Am I passing too many arguments?
- [ ] Is there a failing test for this change?
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related skills
How it compares
Use clean-code for principled readability refactors; use a linter or formatter skill when you only need automated style enforcement without structural redesign.
FAQ
What does clean-code do?
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.\"
When should I use 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.\"
Is clean-code safe to install?
Review the Security Audits panel on this page before installing in production.