clean-code

Reviews and refactors source code using Robert C. Martin's Clean Code principles.

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill clean-code-duccuong159
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/DucCuong159/Realtime-chatapp/tree/main/.agent/skills/clean-code
Command: npx skills add https://github.com/DucCuong159/Realtime-chatapp --skill clean-code-duccuong159

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code that merely works often becomes hard to read, maintain, and extend. This Skill applies the principles of Robert C. Martin's "Clean Code" to transform working code into clean, readable, and maintainable code. ## Core Features & Use Cases - Naming & Function Guidance: Enforces intention-revealing names, small single-purpose functions, and minimal arguments. - Code Smell Detection: Identifies rigidity, fragility, needless complexity, side effects, and Law of Demeter violations. - Testing & Error Handling Standards: Promotes TDD's three laws, F.I.R.S.T. test principles, and exception-based error handling. - Use Case: When reviewing a pull request, use this Skill to get principle-based feedback on naming, function size, comments, formatting, and class design before merging. ## Quick Start Review this function using clean code principles and suggest refactors for naming, function size, and error handling.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I refactor code using Clean Code principles?

Start by renaming variables and functions to be intention-revealing, then break large functions into small single-purpose ones. Replace comments with self-explanatory code, use exceptions instead of return codes, and remove code smells like duplication and needless complexity.

How to do a code review based on Clean Code rules?

Check that names are searchable and pronounceable, functions do one thing at one abstraction level, and arguments stay under three. Verify error handling uses exceptions, tests follow F.I.R.S.T. principles, and classes obey the single responsibility principle.

What are the most important Clean Code rules for functions?

Functions should be small, do exactly one thing, and operate at a single level of abstraction. They should have zero to two arguments, descriptive verb names, and no hidden side effects on global state.

When should I not add comments to my code?

Avoid comments that restate what the code already says, explain bad code instead of rewriting it, or serve as position markers and noise. Prefer expressing intent through clear names and structure; reserve comments for legal notes, regex intent, or TODOs.

What are the limitations of applying Clean Code principles?

Clean Code guidance is principle-based and does not replace environment-specific validation, testing, or expert review. Rules like function length or argument counts are heuristics, so judgment is needed for context-specific trade-offs.