Command Palette

Search for a command to run...

Назад к скиллам
скилл № 62538

clean-code

This skill should be used when the user asks to "check clean code", "review code cleanliness", "find code smells", "is this function too long", "are these…

БесплатноБез исполняемых скриптов
florianbuetowот florianbuetow★ 22 звезды на GitHub

Установить clean-code в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Clean Code — Code-Level Cleanliness Analysis

Analyze source code against Robert C. Martin's Clean Code and report what to change. Nine dimensions covering the code you read every day: names, functions, comments, formatting, data, errors, boundaries, tests, concurrency.

This never modifies code. It reports findings; the user decides what to act on.

What this skill is not

SOLID tells you how to structure classes. This works one level down — the code inside them. Three concerns are out of scope, corresponding to the book's chapters 10-12, and are not analyzed here:

  • Class responsibility, inheritance, interface design, dependency inversion
  • Package/module architecture, dependency structure, architectural smells
  • System-level over-engineering and speculative generality

When target code's dominant problem is one of these, say so in one line under Out of scope in the summary — naming the concern, not analyzing it — and report only the code-level findings this skill owns. Noting an out-of-scope concern is a valid, useful outcome; analyzing it here is not.

The nine dimensions

Dimension Chapter Covers Reference
naming 2 Intention-revealing names, disinformation, noise, searchability, consistency references/naming.md
functions 3 Size, one thing, abstraction level, arguments, flags, side effects references/functions.md
comments 4 Comments compensating for bad code, redundancy, rot, commented-out code references/comments.md
formatting 5 Vertical distance, proximity of caller and callee, ordering, density references/formatting.md
objects-data 6 Data/object anti-symmetry, Law of Demeter, train wrecks, hybrids references/objects-data.md
error-handling 7 Exceptions over codes, no null in or out, context, failure visibility references/error-handling.md
boundaries 8 Third-party seams, wrappers, learning tests, code you don't control references/boundaries.md
unit-tests 9 F.I.R.S.T., one concept per test, test readability and independence references/unit-tests.md
concurrency 13 Shared state, synchronized scope, coordination, testing threaded code references/concurrency.md

references/heuristics.md is the Chapter 17 citation registry. It is not a dimension and has no subcommand. It is the authoritative list of valid G/N/C/E/F/T codes and is consulted on every route to attach a verified reference to each finding.

Subcommands

Command Scope
cleancode / cleancode all / cleancode check All nine dimensions
cleancode names / cleancode naming Naming only
cleancode functions Functions only
cleancode comments Comments only
cleancode formatting Formatting only
cleancode objects / cleancode data Objects & Data Structures only
cleancode errors / cleancode error-handling Error Handling only
cleancode boundaries Boundaries only
cleancode tests Unit Tests only
cleancode concurrency Concurrency only

Default to all nine when no subcommand is given. Match a dimension named without the cleancode prefix ("check my error handling").

A narrow subcommand is a filter, not a hint. cleancode functions must not report a rename-only naming finding even when it notices one. cleancode all reports both.

Routing: which dimension owns a finding

This is the rule that keeps subcommands predictable. Without it, the same violation surfaces or vanishes depending on what the user typed.

The owning dimension is the one that owns the smallest concrete refactoring edit that fully resolves the finding.

The chapter that discusses the problem, the section heading of whatever guide you learned it from, and the letter family of the Chapter 17 code never determine routing.

The sufficient fix is to... Dimension
Rename an identifier — variable, function, method, class, or fix its capitalization naming
Change decomposition, signature, parameters, control flow, side effects, or body functions
Add, delete, or rewrite a comment comments
Move code, change ordering, proximity, blank lines, or import grouping — no behavior change formatting
Change data representation, or what an object exposes versus hides objects-data
Change an error path, exception, rejection, or error return error-handling
Add or change a seam, wrapper, adapter, or learning test around an external API boundaries
Change test structure, naming, setup, assertions, independence, or speed unit-tests
Change shared-state access, coordination, scheduling, or synchronization concurrency

Worked consequences of the rule:

  • A function named addToDate that adds a month is naming — the sufficient fix is a rename. Chapter 3 also discu
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/boundaries.md
  • references/comments.md
  • references/concurrency.md
  • references/error-handling.md
  • references/formatting.md
  • references/functions.md
  • references/heuristics.md
  • references/naming.md
  • references/objects-data.md
  • references/unit-tests.md

FAQ

Что делает скилл clean-code?

This skill should be used when the user asks to "check clean code", "review code cleanliness", "find code smells", "is this function too long", "are these names clear", "review my error handling", "check my tests", or "clean up this code". Also triggers when the user mentions Clean Code, Uncle Bob, Robert Martin, meaningful names, function length, comment rot, F.I.R.S.T. tests, or names a dimension directly ("naming", "boundaries", "concurrency"). Supports auditing all nine dimensions at once or focusing on a single dimension.

Как установить скилл clean-code?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл clean-code запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить clean-code с