clean-code

Reviews and refactors code using Clean Code rules routed through topic reference files.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/Royrahav/my_claude_components --skill clean-code-royrahav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/Royrahav/my_claude_components/tree/main/skills/clean-code
Command: npx skills add https://github.com/Royrahav/my_claude_components --skill clean-code-royrahav

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code that works but is messy—unclear names, oversized functions, swallowed errors, duplicated logic—slows every future change. This Skill applies Robert C. Martin's Clean Code rules systematically when writing, refactoring, or reviewing code, without flooding the context with the entire book. ## Core Features & Use Cases - Router-based rule loading: A symptom map (for reviews) and a context map (for writing) point to one to three topic files under references/ covering naming, functions, comments, formatting, objects, error handling, boundaries, tests, classes, systems, emergence, and concurrency. - Cited, severity-tagged findings: Review findings use stable rule IDs (e.g., FUN-12) with [H]/[M]/[L] severities and a "Don't over-apply" check to avoid false positives. - Dry-run demonstration mode: Generates a random messy program in a chosen language and domain, reviews and refactors it, and presents a planted-vs-caught scorecard with diffs. - Use Case: Ask for a clean-code review of a pull request diff; the Skill scans for symptoms, loads only the relevant rule files, and returns line-cited findings with concrete fixes. ## Quick Start Review this diff with the clean-code skill and cite each finding with its rule ID and a concrete fix.

Frequently Asked Questions about clean-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review code against Clean Code principles?

Scan the changed lines against the symptom map, then load only the one to three reference files covering the flagged rules. Cite each finding as path:line with a rule ID like FUN-12, a one-sentence defect, and a concrete fix, checking the Don't over-apply section for [M] and [H] findings first.

How do I run a clean-code demo or dry run?

Ask for a dry run, optionally pinning a language or domain such as "dry run go payroll". The Skill generates a messy but working program in a temp workspace, reviews and refactors it using its own protocol, and shows diffs plus a planted-vs-caught scorecard without touching your project.

Does Clean Code apply to languages other than Java?

Yes, the Skill adapts each rule's intent to the host language's idioms. Go and Rust use error values or Result instead of exceptions, Python uses snake_case and properties, and non-null type systems in Kotlin, TypeScript strict, C#, Swift, and Rust enforce the null-handling rules directly.

When should I not apply a Clean Code rule?

Each reference file has a Don't over-apply section: skip what formatters and linters already enforce, don't wrap stable standard-library types, don't build adapters for one-off dependencies, and don't split small stable data holders. Project conventions and language idioms override the book's Java-era style.

What are the limitations of rule-based code review?

Severity tags are defaults that context can raise or lower, and [L] findings alone never block a change. The Skill defers deep SOLID analysis, design-pattern selection, and test strategy to sibling skills rather than re-deriving them.