
Clean Code
Apply Uncle Bob–style Clean Code rules with modern caveats when reviewing or refactoring agent-generated Java and polyglot code.
Overview
Clean Code is a journey-wide agent skill that enforces 48 Robert C. Martin craftsmanship rules—usable whenever a solo builder needs readable, testable code before merging.
Install
npx skills add https://github.com/pproenca/dot-skills --skill clean-codeWhat is this skill?
- 48 rules organized across 10 categories: naming, functions, comments, formatting, errors, objects, boundaries, classes,
- Each rule ships incorrect vs correct examples plus explicit 'When NOT to use' exception cases
- Version 1.0.7 abstract with January 2026 refresh noting where 2008-era advice was superseded
- Polyglot guidance: Java examples, language-agnostic craftsmanship principles
- Structured for agentic review: impact levels, tags, and O'Reilly Clean Code chapter references
- 48 rules across 10 categories
- Guide version 1.0.7 (January 2026)
- Rules include explicit When NOT to use lists per pattern
Adoption & trust: 584 installs on skills.sh; 157 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Agent-generated patches compile but violate naming, sizing, and testing norms that make solo-maintained repos painful to change.
Who is it for?
Indie backends and full-stack repos where you act as reviewer and implementer and want a consistent rulebook beyond linters.
Skip if: Throwaway hackathon spikes you will delete tomorrow, or teams that already enforce an identical rule engine in CI with no agent in the loop.
When should I use this skill?
Reviewing or generating production code where readability, tests, and simple design matter more than speed-only patches.
What do I get? / Deliverables
Reviews apply categorized pass/fail guidance with cited exceptions so refactors align with maintainable craftsmanship instead of one-off style opinions.
- Rule-by-rule review verdicts
- Refactor suggestions with incorrect/correct pairs
- Documented exceptions where a rule should not apply
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Run the 10-category checklist on an agent PR before merging payment logic.
Split a god service into smaller functions using the functions and classes rules while implementing a new endpoint.
Refactor incident-hot paths that agents patched quickly but left opaque naming and missing tests.
Keep CMS integration code readable before handing a feature to a contractor.
How it compares
Skill-backed rule catalog with 'when not to use' caveats—not a linter config or a one-shot 'make it clean' chat prompt.
Common Questions / FAQ
Who is clean-code for?
Solo and indie developers who review AI-written or hand-written code against proven software craftsmanship standards.
When should I use clean-code?
During Ship code review, while refactoring in Build, when debugging opaque modules in Operate, and before Grow when hardening features customers depend on.
Is clean-code safe to install?
It is textual rule metadata without runtime hooks; check the Security Audits panel on this Prism page for the package’s registry verdict.
SKILL.md
READMESKILL.md - Clean Code
## Rule Title Here Brief explanation of the rule and why it matters. Focus on the principle and its impact on code maintainability and readability. **Incorrect (description of what's wrong):** ```java // Bad code example here showing the anti-pattern // Comment explaining the problem ``` **Correct (description of what's right):** ```java // Good code example here showing the solution // Comment explaining the benefit ``` **When NOT to use this pattern:** - Exception case 1 - Exception case 2 Reference: [Clean Code, Chapter N: Topic](https://www.oreilly.com/library/view/clean-code-a/9780136083238/) { "version": "1.0.7", "organization": "Robert C. Martin (Uncle Bob)", "technology": "Software Craftsmanship (examples in Java, principles are language-agnostic)", "date": "January 2026", "abstract": "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 covering naming, functions, comments, formatting, error handling, objects, boundaries, classes, testing, and simple design. Each rule includes 'When NOT to use' caveats, polyglot guidance where applicable, and real-world examples comparing incorrect vs. correct implementations.", "references": [ "https://www.oreilly.com/library/view/clean-code-a/9780136083238/", "https://blog.cleancoder.com/", "https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882" ] } # Sections This file defines all sections, their ordering, impact levels, and descriptions. The section ID (in parentheses) is the filename prefix used to group rules. --- ## 1. Meaningful Names (name) **Impact:** CRITICAL **Description:** Names are the primary documentation. Bad names cascade confusion throughout the codebase, forcing every reader to decipher intent. ## 2. Functions (func) **Impact:** CRITICAL **Description:** Functions are the verbs of code. Small, focused functions enable understanding, testing, and reuse while reducing complexity. ## 3. Comments (cmt) **Impact:** HIGH **Description:** Comments should explain intent, not obvious mechanics. Wrong or stale comments actively mislead readers and cost more than no comments. ## 4. Formatting (fmt) **Impact:** HIGH **Description:** Consistent formatting reduces cognitive load. Code should read top-to-bottom like a newspaper article. ## 5. Error Handling (err) **Impact:** HIGH **Description:** Clean error handling separates happy path from exceptional cases. Use the error mechanism idiomatic to your language (exceptions, Result types, or explicit error returns). ## 6. Objects and Data Structures (obj) **Impact:** MEDIUM-HIGH **Description:** Objects hide data and expose behavior; data structures expose data and have no behavior. Mixing these creates hybrid messes. ## 7. Boundaries (bound) **Impact:** MEDIUM-HIGH **Description:** Third-party code and external APIs are boundaries. Wrap them to isolate change, ease testing, and maintain control over your codebase's interfaces. ## 8. Classes and Systems (class) **Impact:** MEDIUM-HIGH **Description:** Classes should be small and have a single responsibility. Systems should separate construction from use. SRP and DIP are among the highest-leverage design principles. ## 9. Unit Tests (test) **Impact:** MEDIUM **Description:** Tests are first-class citizens that enable safe refactoring. Test code deserves the same care as production code. ## 10. Emergence and Simple Design (emerge) **Impact:** MEDIUM **Description:** Good design emerges from following four rules in order: pass tests, reveal intent, eliminate duplication, minimize elements. Resist the urge to over-engineer. --- title: Write Lear