clean-code
/clean-code
Use when writing, reviewing, or refactoring code for maintainability and readability. Triggers on code reviews, naming discussions, function design, error handling, and test writing. Based on Robert C. Martin's Clean Code handbook with modern corrections.
- Author
- pproenca ↗
- Repository
- dot-skills ↗
- Licence
- MIT
- Last repository change
- 15.08.2026
Assessment and security
- Files in this package
- 52
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 15.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when writing, reviewing, or refactoring code for maintainability and readability. Triggers on code reviews, naming discussions, function design, error handling, and test writing. Based on Robert C. Martin's Clean Code handbook with modern corrections.
Original author description
Use when writing, reviewing, or refactoring code for maintainability and readability. Triggers on code reviews, naming discussions, function design, error handling, and test writing. Based on Robert C. Martin's Clean Code handbook with modern corrections.
How it works
- When to Apply
- Rule Categories by Priority
- Quick Reference
- How to Use
- Reference Files
SKILL.md preview
--- name: clean-code description: Use when writing, reviewing, or refactoring code for maintainability and readability. Triggers on code reviews, naming discussions, function design, error handling, and test writing. Based on Robert C. Martin's Clean Code handbook with modern corrections. --- # Robert C. Martin (Uncle Bob) Clean Code Best Practices Comprehensive software craftsmanship guide based on Robert C. Martin's "Clean Code: A Handbook of Agile Software Craftsmanship", updated with modern corrections where the original 2008 advice has been superseded. Contains 48 rules across 10 categories, prioritized by impact to guide code reviews, refactoring decisions, and new development. Examples are primarily in Java but principles are language-agnostic. ## When to Apply Reference these guidelines when: - Writing new functions, classes, or modules - Naming variables, functions, classes, or files - Reviewing code for maintainability issues - Refactoring existing code to improve clarity - Writing or improving unit tests - Wrapping third-party dependencies ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Meaningful Names | CRITICAL | `name-` | | 2 | Functions | CRITICAL | `func-` | | 3 | Comments | HIGH | `cmt-` | | 4 | Formatting | HIGH | `fmt-` | | 5 | Error Handling | HIGH | `err-` | | 6 | Objects and Data Structures | MEDIUM-HIGH | `obj-` | | 7 | Boundaries | MEDIUM-HIGH | `bound-` | | 8 | Classes and Systems | MEDIUM-HIGH | `class-` | | 9 | Unit Tests | MEDIUM | `test-` | | 10 | Emergence and Simple Design | MEDIUM | `emerge-` | ## Quick Reference ### 1. Meaningful Names (CRITICAL) - [`name-intention-revealing`](references/name-intention-revealing.md) - Use names that reveal intent - [`name-avoid-disinformation`](references/name-avoid-disinformation.md) - Avoid misleading names - [`name-meaningful-distinctions`](references/name-meaningful-distinctions.md) - Make meaningful distinctions - [`name-pronounceable`](references/name-pronounceable.md) - Use pronounceable names - [`name-searchable`](references/name-searchable.md) - Use searchable names - [`name-avoid-encodings`](references/name-avoid-encodings.md) - Avoid encodings in names - [`name-class-noun`](references/name-class-noun.md) - Use noun phrases for class names - [`name-method-verb`](references/name-method-verb.md) - Use verb phrases for method names ### 2. Functions (CRITICAL) - [`func-small`](references/func-small.md) - Keep functions small - [`func-one-thing`](references/func-one-thing.md) - Functions should do one thing - [`func-abstraction-level`](references/func-abstraction-level.md) - Maintain one level of abstraction - [`func-minimize-arguments`](references/func-minimize-arguments.md) - Minimize function arguments - [`func-no-side-effects`](references/func-no-side-effects.md) - Avoid side effects - [`func-command-query-separation`](references/func-command-query-separation.md) - Separate commands from queries - [`func-dry`](references/func-dry.md) - Do not repeat yourself ### 3. Comments (HIGH) - [`cmt-express-in-code`](references/cmt-express-in-code.md) - Express yourself in code, not comments - [`cmt-explain-intent`](references/cmt-explain-intent.md) - Use comments to explain intent - [`cmt-avoid-redundant`](references/cmt-avoid-redundant.md) - Avoid redundant comments - [`cmt-avoid-commented-out-code`](references/cmt-avoid-commented-out-code.md) - Delete commented-out code - [`cmt-warning-consequences`](references/cmt-warning-consequences.md) - Use warning comments for consequences ### 4. Formatting (HIGH) - [`fmt-vertical-formatting`](references/fmt-vertical-formatting.md) - Use vertical formatting for readability - [`fmt-horizontal-alignment`](references/fmt-horizontal-alignment.md) - Avoid horizontal alignment - [`fmt-team-rules`](references/fmt-team-rules.md) - Follow team formatting rules - [`fmt-indentation`](references/fmt-indentation.md) - Respect indentation rules ### 5. Error Handling (HIGH) - [`err-use-exceptions`](references/err-use-exceptions.md) - Separate error handling from happy path - [`err-write-try-catch-first`](references/err-write-try-catch-first.md) - Write try-catch-finally first - [`err-provide-context`](references/err-provide-context.md) - Provide context with exceptions - [`err-define-by-caller-needs`](references/err-define-by-caller-needs.md) - Define exceptions by caller needs - [`err-avoid-null`](references/err-avoid-null.md) - Avoid returning and passing null ### 6. Objects and Data Structures (MEDIUM-HIGH) - [`obj-data-abstraction`](references/obj-data-abstraction.md) - Hide data behind abstractions - [`obj-data-object-asymmetry`](references/obj-data-object-asymmetry.md) - Understand data/object anti-symmetry - [`obj-law-of-demeter`](references/obj-law-of-demeter.md) - Follow the Law of Demeter - [`obj-avoid-hybrids`](references/obj-avoid-hybrids.md) - Avoid hybrid data-object structures - [`obj-dto`](references/obj-dto.md) - Use DTOs for data transfer ### 7. Boundaries (MEDIUM-HIGH) - [`bound-wrap-third-party`](references/bound-wrap-third-party.md) - Wrap third-party APIs - [`bound-learning-tests`](references/bound-learning-tests.md) - Write learning tests for third-party code ### 8. Classes and Systems (MEDIUM-HIGH) - [`class-small`](references/class-small.md) - Keep classes small - [`class-cohesion`](references/class-cohesion.md) - Maintain class cohesion - [`class-organize-for-change`](references/class-organize-for-change.md) - Organize classes for change - [`class-isolate-from-change`](references/class-isolate-from-change.md) - Isolate classes from change - [`class-separate-concerns`](references/class-separate-concerns.md) - Separate construction from use ### 9. Unit Tests (MEDIUM) - [`test-first-law`](references/test-first-law.md) - Follow the three laws of TDD - [`test-keep-clean`](references/test-keep-clean.md) - Keep tests clean - [`test-one-assert`](references/test-one-assert.md) - One concept per test - [`test-first-principles`](references/test-first-principles.md) - Follow FIRST principles - [`test-build-operate-check`](references/test-build-operate-check.md) - Use Build-Operate-Check pattern ### 10. Emergence and Simple Design (MEDIUM) - [`emerge-simple-design`](references/emerge-simple-design.md) - Follow the four rules of simple design - [`emerge-expressiveness`](references/emerge-expressiveness.md) - Maximize expressiveness ## How to Use Read individual reference files for detailed explanations and code examples: - [Section definitions](references/_sections.md) - Category structure and impact levels - [Rule template](assets/templates/_template.md) - Template for adding new rules ## Reference Files | File | Description | |------|-------------| | [references/_sections.md](references/_sections.md) | Category definitions and ordering | | [assets/templates/_template.md](assets/templates/_template.md) | Template for new rules | | [metadata.json](metadata.json) | Version and reference information |
Files in this package (52)
- SKILL.md 7 KB
- metadata.json 1 KB
- assets/templates/_template.md 1 KB
- references/_sections.md 2 KB
- references/bound-learning-tests.md 2 KB
- references/bound-wrap-third-party.md 2 KB
- references/class-cohesion.md 2 KB
- references/class-isolate-from-change.md 2 KB
- references/class-organize-for-change.md 2 KB
- references/class-separate-concerns.md 2 KB
- references/class-small.md 2 KB
- references/cmt-avoid-commented-out-code.md 1 KB
- references/cmt-avoid-redundant.md 1 KB
- references/cmt-explain-intent.md 2 KB
- references/cmt-express-in-code.md 2 KB
- references/cmt-warning-consequences.md 2 KB
- references/emerge-expressiveness.md 2 KB
- references/emerge-simple-design.md 2 KB
- references/err-avoid-null.md 2 KB
- references/err-define-by-caller-needs.md 2 KB
- references/err-provide-context.md 2 KB
- references/err-use-exceptions.md 3 KB
- references/err-write-try-catch-first.md 2 KB
- references/fmt-horizontal-alignment.md 2 KB
- references/fmt-indentation.md 1 KB
- references/fmt-team-rules.md 2 KB
- references/fmt-vertical-formatting.md 2 KB
- references/func-abstraction-level.md 2 KB
- references/func-command-query-separation.md 2 KB
- references/func-dry.md 3 KB
- references/func-minimize-arguments.md 2 KB
- references/func-no-side-effects.md 2 KB
- references/func-one-thing.md 3 KB
- references/func-small.md 3 KB
- references/name-avoid-disinformation.md 1 KB
- references/name-avoid-encodings.md 2 KB
- references/name-class-noun.md 1 KB
- references/name-intention-revealing.md 2 KB
- references/name-meaningful-distinctions.md 1 KB
- references/name-method-verb.md 2 KB
- references/name-pronounceable.md 1 KB
- references/name-searchable.md 1 KB
- references/obj-avoid-hybrids.md 2 KB
- references/obj-data-abstraction.md 2 KB
- references/obj-data-object-asymmetry.md 2 KB
- references/obj-dto.md 2 KB
- references/obj-law-of-demeter.md 2 KB
- references/test-build-operate-check.md 2 KB
- references/test-first-law.md 2 KB
- references/test-first-principles.md 2 KB
- references/test-keep-clean.md 2 KB
- references/test-one-assert.md 2 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · pproenca/dot-skills | 100 | MIT |
| hanspeterdietiker/open-agent-skills | 100 | MIT |
| FrancoStino/opencode-skills-collection | 100 | MIT |
| rootcastleco/rei-skills | 100 | MIT |
| iWiiCK/iwiick-ai-agent-plugin | 100 | MIT |
| sickn33/agentic-awesome-skills | 100 | MIT |
| sagargupta16/claude-skills | 100 | MIT |
| claude-dev-suite/claude-dev-suite | 100 | MIT |
| jonax1337/clean-code-skill | 100 | MIT |
Database snapshot: 13.11.2026 · package version f9da638dc9d0 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100clean-code-reviewer
Reviews code against Robert C. Martin's Clean Code principles. Use when users share code for review, ask for refactoring suggestions, or want to improve code quality. Produces actionable feedback organized by Clean Code principles with concrete before/after examples. - 100clean-architecture
Clean Architecture principles and best practices from Robert C. Martin's book. This skill should be used when designing software systems, reviewing code structure, or refactoring applications to achieve better separation of concerns. Triggers on tasks involving layers,… - 100clean-architecture
Use when designing system boundaries, dependency direction, and layered architecture — based on Robert C. Martin's "Clean Architecture." USE FOR: dependency rule enforcement, layer separation, boundary design, use case isolation, screaming architecture, presenter/viewmodel… - 100clean-code-ts-react
Use when writing, reviewing, or refactoring TypeScript or React code for craftsmanship — naming, function and component shape, error handling, data modeling, tests, and abstraction. Translates Robert C. Martin's Clean Code principles into modern TS+React idioms (TS 5.x, React… - 100ddd-architecture-clean
Comprehensive guidance for Clean Architecture (整洁架构) — Robert C. Martin's Clean Architecture with Enterprise Business Rules, Use Cases, Interface Adapters, and Frameworks layers. Covers core entities, use case interactors, dependency rules, and full implementation steps with… - 100coding-principles
This skill provides language-agnostic coding principles for maintainability, readability, and quality. Automatically loaded when implementing features, refactoring code, reviewing code quality, or when the user mentions "clean code", "best practices", "code quality", or "maintainability".