clean-code

Applies Robert C. Martin's Clean Code principles when writing, refactoring, or reviewing code.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/vnovakovits/claude-skills --skill clean-code-vnovakovits
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/vnovakovits/claude-skills/tree/main/plugins/engineering-practices/skills/clean-code
Command: npx skills add https://github.com/vnovakovits/claude-skills --skill clean-code-vnovakovits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code is read far more often than it is written, yet most codebases accumulate unclear names, oversized functions, duplication, and misleading comments that slow every future change. This Skill gives Claude a shared, concrete rulebook of Clean Code heuristics so that writing, refactoring, and reviewing code consistently optimizes for the reader. ## Core Features & Use Cases - Naming, Functions, and Formatting Rules: Enforces intention-revealing names, small single-purpose functions, limited arguments, and newspaper-style vertical formatting. - Design and Error-Handling Guidance: Covers objects vs data structures, the Law of Demeter, exception-based error handling, boundary wrapping, and SOLID principles. - Smells and Heuristics Catalog: Provides the full Chapter 17 reference catalog (C1–T9) plus a quick application checklist for systematic code review. - Use Case: Ask Claude to review a legacy method before merging. It will flag flag arguments, hidden side effects, train-wreck call chains, and missing tests, then suggest concrete refactors aligned with the Boy Scout Rule. ## Quick Start Ask Claude to review this class against Clean Code principles and suggest specific improvements.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I apply Clean Code principles when refactoring legacy code?▼

Start with the Boy Scout Rule: leave each file cleaner than you found it. Extract small functions that do one thing, replace flag arguments with separate functions, remove duplication, and rename variables to reveal intent before changing behavior.

What are the most important Clean Code rules for functions?▼

Functions should be small (two to four lines is normal), do one thing at one level of abstraction, take zero to two arguments, avoid flag arguments and side effects, and follow Command-Query Separation. Descriptive long names beat short cryptic ones.

Does Clean Code guidance apply to languages other than Java or C#?▼

Yes, the principles are language-agnostic: naming, function size, DRY, error handling, and test discipline apply everywhere. Language-specific notes exist, such as C# interface naming conventions and .NET thread-safe collections, but the heuristics transfer.

When should I write comments according to Clean Code?▼

Comments are a necessary evil used only to compensate for failure to express intent in code. Good uses include legal notices, intent explanation, warnings of consequences, and public API documentation. Redundant, misleading, or commented-out code should be deleted.

What are the F.I.R.S.T principles for unit tests?▼

F.I.R.S.T means tests should be Fast, Independent, Repeatable, Self-validating, and Timely. Each test covers one concept using Arrange-Act-Assert structure, and test code must stay as clean as production code so the suite remains maintainable.