Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
pproenca avatar

Clean Code

  • 681 installs
  • 186 repo stars
  • Updated July 24, 2026
  • pproenca/dot-skills

clean-code is a Code Review & Quality skill that applies Robert C. Martin Clean Code principles with incorrect-vs-correct examples for developers who want to eliminate readability and maintainability issues across any co

About

clean-code is a rule-based agent skill from pproenca/dot-skills that encodes Clean Code principles as structured guidance with impact ratings, anti-pattern examples, corrected alternatives, and explicit exception cases. Each rule follows a consistent template—title, impact level, incorrect code block, correct code block, and when-not-to-use notes—so an agent can audit or rewrite code against named maintainability standards rather than vague style preferences. Developers reach for clean-code when refactoring legacy modules, standardizing team conventions, or preparing diffs for human review where naming, function size, and clarity violations are common. The readme excerpt references Clean Code chapter citations and multi-language bad/good snippets, making the skill suitable for Java and other stacks without tying to one framework.

  • 48 rules across 10 categories including naming, functions, comments, formatting, error handling, objects, classes, and t
  • Each rule provides incorrect vs correct code examples with explicit 'When NOT to use' exceptions
  • Polyglot guidance that works with Java, TypeScript, Python, and other languages
  • Modern updates that correct outdated 2008 advice for contemporary agent-driven development
  • Hard-gated review workflow that produces annotated code with severity levels before commit

Clean Code by the numbers

  • 681 all-time installs (skills.sh)
  • Ranked #193 of 1,356 Code Review & Quality skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pproenca/dot-skills --skill clean-code

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs681
repo stars186
Security audit3 / 3 scanners passed
Last updatedJuly 24, 2026
Repositorypproenca/dot-skills

How do you apply Clean Code rules automatically?

Automatically apply Clean Code principles and eliminate common readability and maintainability issues across any codebase.

Who is it for?

Developers refactoring messy modules or aligning a mixed-language codebase with Robert C. Martin readability standards before pull request review.

Skip if: Teams that only need framework-specific lint autofixes from ESLint or Prettier without principle-level explanations and exception guidance.

When should I use this skill?

The user asks to clean up code, improve readability, apply Clean Code, or fix maintainability smells with before-and-after examples.

What you get

Refactored code snippets, rule-by-rule fix notes, and documented exception cases per Clean Code chapter references.

  • Refactored code snippets
  • Rule-by-rule fix guidance

Files

SKILL.mdMarkdownGitHub ↗

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

PriorityCategoryImpactPrefix
1Meaningful NamesCRITICALname-
2FunctionsCRITICALfunc-
3CommentsHIGHcmt-
4FormattingHIGHfmt-
5Error HandlingHIGHerr-
6Objects and Data StructuresMEDIUM-HIGHobj-
7BoundariesMEDIUM-HIGHbound-
8Classes and SystemsMEDIUM-HIGHclass-
9Unit TestsMEDIUMtest-
10Emergence and Simple DesignMEDIUMemerge-

Quick Reference

1. Meaningful Names (CRITICAL)

  • `name-intention-revealing` - Use names that reveal intent
  • `name-avoid-disinformation` - Avoid misleading names
  • `name-meaningful-distinctions` - Make meaningful distinctions
  • `name-pronounceable` - Use pronounceable names
  • `name-searchable` - Use searchable names
  • `name-avoid-encodings` - Avoid encodings in names
  • `name-class-noun` - Use noun phrases for class names
  • `name-method-verb` - Use verb phrases for method names

2. Functions (CRITICAL)

  • `func-small` - Keep functions small
  • `func-one-thing` - Functions should do one thing
  • `func-abstraction-level` - Maintain one level of abstraction
  • `func-minimize-arguments` - Minimize function arguments
  • `func-no-side-effects` - Avoid side effects
  • `func-command-query-separation` - Separate commands from queries
  • `func-dry` - Do not repeat yourself

3. Comments (HIGH)

  • `cmt-express-in-code` - Express yourself in code, not comments
  • `cmt-explain-intent` - Use comments to explain intent
  • `cmt-avoid-redundant` - Avoid redundant comments
  • `cmt-avoid-commented-out-code` - Delete commented-out code
  • `cmt-warning-consequences` - Use warning comments for consequences

4. Formatting (HIGH)

  • `fmt-vertical-formatting` - Use vertical formatting for readability
  • `fmt-horizontal-alignment` - Avoid horizontal alignment
  • `fmt-team-rules` - Follow team formatting rules
  • `fmt-indentation` - Respect indentation rules

5. Error Handling (HIGH)

  • `err-use-exceptions` - Separate error handling from happy path
  • `err-write-try-catch-first` - Write try-catch-finally first
  • `err-provide-context` - Provide context with exceptions
  • `err-define-by-caller-needs` - Define exceptions by caller needs
  • `err-avoid-null` - Avoid returning and passing null

6. Objects and Data Structures (MEDIUM-HIGH)

  • `obj-data-abstraction` - Hide data behind abstractions
  • `obj-data-object-asymmetry` - Understand data/object anti-symmetry
  • `obj-law-of-demeter` - Follow the Law of Demeter
  • `obj-avoid-hybrids` - Avoid hybrid data-object structures
  • `obj-dto` - Use DTOs for data transfer

7. Boundaries (MEDIUM-HIGH)

  • `bound-wrap-third-party` - Wrap third-party APIs
  • `bound-learning-tests` - Write learning tests for third-party code

8. Classes and Systems (MEDIUM-HIGH)

  • `class-small` - Keep classes small
  • `class-cohesion` - Maintain class cohesion
  • `class-organize-for-change` - Organize classes for change
  • `class-isolate-from-change` - Isolate classes from change
  • `class-separate-concerns` - Separate construction from use

9. Unit Tests (MEDIUM)

  • `test-first-law` - Follow the three laws of TDD
  • `test-keep-clean` - Keep tests clean
  • `test-one-assert` - One concept per test
  • `test-first-principles` - Follow FIRST principles
  • `test-build-operate-check` - Use Build-Operate-Check pattern

10. Emergence and Simple Design (MEDIUM)

  • `emerge-simple-design` - Follow the four rules of simple design
  • `emerge-expressiveness` - Maximize expressiveness

How to Use

Read individual reference files for detailed explanations and code examples:

  • Section definitions - Category structure and impact levels
  • Rule template - Template for adding new rules

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Related skills

How it compares

Pick clean-code when you want principle-level refactors with explained exceptions; pick ESLint or SonarQube rules when you need automated CI enforcement only.

FAQ

What does the clean-code skill fix?

The clean-code skill applies Robert C. Martin Clean Code principles by flagging readability and maintainability issues, showing incorrect anti-patterns beside corrected examples, and noting explicit exception cases so agents do not over-apply each rule.

Does clean-code work for any programming language?

The clean-code skill is language-agnostic: each rule uses incorrect and correct code blocks that can target Java and other languages, with impact ratings and chapter references rather than a single-framework linter config.

Is Clean Code safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.