clean-code

Applies Clean Code principles to writing, reviewing, and refactoring source code.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/ttnhan18062000/rpg-based-simulation --skill clean-code-ttnhan18062000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/ttnhan18062000/rpg-based-simulation/tree/main/docs/archive/legacy_agents_skills_20260722/clean-code
Command: npx skills add https://github.com/ttnhan18062000/rpg-based-simulation --skill clean-code-ttnhan18062000

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code that merely works often becomes hard to read, review, and maintain over time. This Skill applies Robert C. Martin's Clean Code principles to help you write, review, and refactor code so it stays readable, testable, and maintainable. ## Core Features & Use Cases - Naming and Function Guidance: Enforces intention-revealing names, small single-purpose functions, and minimal argument counts. - Code Review Checklists: Provides principle-based criteria for pull request feedback, covering comments, formatting, error handling, and the Law of Demeter. - Refactoring and Smell Detection: Identifies rigidity, fragility, immobility, and needless complexity, plus TDD and F.I.R.S.T. unit testing rules. - Use Case: When reviewing a teammate's pull request, use this Skill to flag functions doing more than one thing, misleading names, and missing unit tests with concrete, principle-based feedback. ## 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 apply Clean Code principles when reviewing a pull request?

Review pull requests against concrete principles: check that functions are small and do one thing, names are intention-revealing, comments are not compensating for unclear code, and changes include failing-then-passing unit tests. The Skill provides a checklist for each area.

What are the rules for writing clean functions?

Functions should be small, do exactly one thing, operate at a single level of abstraction, and have descriptive verb-based names. Aim for zero to two arguments, avoid side effects, and never return or pass null.

When should I write comments in code?

Comments are appropriate for legal notices, clarifying external library behavior, explaining regex intent, and TODOs. Avoid comments that restate code, mislead, or mark positions; prefer rewriting unclear code so it explains itself.

What are the three laws of TDD?

First, write no production code without a failing unit test. Second, write only enough test to fail. Third, write only enough production code to pass that failing test. Tests should also follow F.I.R.S.T.: Fast, Independent, Repeatable, Self-Validating, Timely.

What are the limitations of Clean Code heuristics?

The principles are guidelines, not absolute rules; strict adherence can conflict with performance constraints or framework conventions. Judgment is needed when applying rules like maximum argument counts or the Law of Demeter in real codebases.