clean-code

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

1|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill clean-code-hamzaoui-louai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend/tree/main/.opencode/skills/clean-code
Command: npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill clean-code-hamzaoui-louai

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 "Clean Code" by Robert C. Martin to transform working code into clean, readable, and maintainable code. ## Core Features & Use Cases - Principle-Based Review: Evaluates naming, function size, comments, formatting, error handling, and class design against established Clean Code heuristics. - Refactoring Guidance: Identifies code smells such as rigidity, fragility, and needless complexity, then suggests concrete improvements. - Testing Discipline: Promotes TDD's three laws and the F.I.R.S.T. principles for unit tests. - Use Case: When reviewing a pull request, use this Skill to get constructive, principle-based feedback on function length, naming clarity, argument counts, and side effects before merging. ## Quick Start Review this function and refactor it according to Clean Code principles, explaining each change you make.

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?

Apply Clean Code refactoring by making functions small and single-purpose, using intention-revealing names, removing redundant comments, and keeping one level of abstraction per function. The Skill provides a checklist covering function size, naming, arguments, and tests.

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

Review code by checking naming clarity, function length under 20 lines, single responsibility per function, minimal arguments, and absence of side effects. The Skill structures feedback around these principle-based criteria for pull requests.

What are the most important Clean Code rules for functions?

Functions should be small, do exactly one thing, maintain one level of abstraction, and take zero to two arguments ideally. They should have descriptive verb names and avoid hidden side effects on global state.

When should I not use Clean Code refactoring?

Avoid applying it when the task does not match the described scope, or when environment-specific validation and testing are required. The Skill is guidance, not a substitute for expert review, so ask for clarification if success criteria are unclear.

Does Clean Code guidance apply to unit testing?

Yes, it includes the Three Laws of TDD and the F.I.R.S.T. principles: tests should be Fast, Independent, Repeatable, Self-Validating, and Timely. Write a failing test before writing production code.