clean-code

Applies Robert C. Martin's Clean Code principles to writing, reviewing, and refactoring code.

3|1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/firstsun-dev/skills --skill clean-code-firstsun-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/firstsun-dev/skills/tree/main/plugins/software-delivery/skills/clean-code
Command: npx skills add https://github.com/firstsun-dev/skills --skill clean-code-firstsun-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent naming, oversized functions, misleading comments, and poor error handling make codebases hard to read, review, and maintain. This Skill provides a structured checklist of Clean Code principles so developers can write, review, and refactor code against a shared, industry-standard baseline. ## Core Features & Use Cases - Naming and Function Guidelines: Enforces intention-revealing names, small single-purpose functions, and limited argument counts. - Code Review Support: Gives reviewers principle-based criteria for pull request feedback covering comments, formatting, error handling, and class design. - Refactoring and Smell Detection: Identifies code smells like rigidity, fragility, and needless complexity, plus TDD and F.I.R.S.T. unit testing rules. - Use Case: While reviewing a pull request, use this Skill to check whether new functions do one thing, avoid side effects, use exceptions instead of return codes, and are covered by failing-first unit tests. ## Quick Start Review this pull request using Clean Code principles and flag any violations in naming, function size, error handling, and test coverage.

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?▼

Check each change against the core principles: intention-revealing names, small single-purpose functions, minimal arguments, no side effects, exceptions instead of return codes, and F.I.R.S.T. unit tests. The Skill provides a checklist covering each of these areas.

What are the main Clean Code rules for writing functions?▼

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

When should I use Clean Code principles for refactoring legacy code?▼

Use them when code shows smells like rigidity, fragility, immobility, or needless repetition. The Skill helps identify these smells and guides incremental refactoring toward smaller functions, better names, and proper error handling.

Does Clean Code recommend writing comments in code?▼

Clean Code treats most comments as a failure to express intent in code and recommends rewriting unclear code instead. Acceptable comments include legal notices, clarification of external library behavior, regex intent explanations, and TODOs.

What are the limitations of using Clean Code guidelines?▼

The guidelines are general heuristics, not environment-specific rules, so output still requires validation, testing, and expert review. They should only be applied when the task clearly matches writing, reviewing, or refactoring code.