Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

clean-code-ts-react

БесплатноБез исполняемых скриптовНе проверен

Use when writing, reviewing, or refactoring TypeScript or React code for craftsmanship — naming, function and component shape, error handling, data modeling…

pproencaот pproenca★ 231 звезда на GitHub

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

Robert C. Martin (Uncle Bob) TypeScript 5.x + React 19 Best Practices

Craftsmanship principles from Robert C. Martin's Clean Code (2008), re-expressed for modern TypeScript and React. Contains 61 rules across 11 categories, prioritized by cognitive cost across a code change's lifetime. Examples use TS 5.x and React 19 idioms — but the rules are about timeless principles, not specific APIs.

What Makes This Skill Different

Three things set this apart from a generic clean-code copy:

  1. Modern idioms as vehicle. Examples use TS 5.x (satisfies, branded types, discriminated unions, const type parameters) and React 19 (function components, hooks, use(), Server Components where relevant). But the rule is always the principle, never the syntax.
  2. "When NOT to apply" is first-class. Every rule has 2-3 concrete scenarios where the principle should bend — not generic disclaimers, real situations. Loop counters can be i. Single-use code shouldn't be DRY. Some HOCs are unavoidable.
  3. Meta category for principle conflicts. Category 11 names the most common tensions explicitly — DRY vs Single Responsibility, small functions vs deep modules (Ousterhout), type precision vs ergonomic APIs, tests as spec vs documentation. The mark of seniority is knowing which to bend.

When to Apply

Reference these guidelines when:

  • Writing new TypeScript or React code and wanting craftsmanship feedback
  • Reviewing a pull request for clarity, naming, or abstraction
  • Refactoring existing code for readability or maintainability
  • Designing function, hook, or component APIs
  • Deciding whether to extract, abstract, or duplicate
  • Resolving a tension between two clean-code rules (see Category 11)

Skip this skill and use:

  • react for React 19 API patterns (concurrent rendering, Server Components, ref-as-prop, useActionState, <Context>-as-provider)
  • typescript for compiler performance, tsconfig tuning, type-system perf
  • refactor for mechanical refactoring workflows
  • tdd for the TDD workflow itself

Rule Categories by Priority

Order reflects cognitive cost across a change's lifetime (read → understand → modify → verify → ship → maintain). Earlier stages cascade — bad names taint every read.

Priority Category Impact Prefix Rules
1 Meaningful Names CRITICAL name- 8
2 Functions, Components & Hooks CRITICAL func- 8
3 Self-Documentation (Types & Comments) HIGH doc- 5
4 Formatting (Beyond Prettier) HIGH fmt- 4
5 Error Handling HIGH err- 7
6 Data Shape & Immutability MEDIUM-HIGH data- 6
7 Boundaries MEDIUM-HIGH bound- 4
8 Composition over Inheritance MEDIUM-HIGH comp- 6
9 Tests MEDIUM test- 5
10 Emergence & Simple Design MEDIUM emerge- 4
11 Meta: When Principles Conflict MEDIUM meta- 4

Total: 61 rules.

Quick Reference

1. Meaningful Names (CRITICAL)

2. Functions, Components & Hooks (CRITICAL)

3. Self-Documentation: Types & Comments (HIGH)

Полный SKILL.md на GitHub

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

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

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

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

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

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

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

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

AGENTS.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/bound-isolate-framework.mdreferences/bound-learning-tests.mdreferences/bound-type-assertions-at-edges.mdreferences/bound-wrap-third-party-hooks.mdreferences/comp-avoid-hoc-stacks.mdreferences/comp-children-over-props.mdreferences/comp-context-only-when-needed.mdreferences/comp-render-props-vs-hooks.mdreferences/comp-separate-construction-from-use.mdreferences/comp-small-components.mdreferences/data-branded-types.mdreferences/data-demeter-prop-drilling.mdreferences/data-discriminated-unions-over-flags.mdreferences/data-dto-vs-domain.mdreferences/data-readonly-by-default.mdreferences/data-structural-typing-pitfalls.mdreferences/doc-avoid-redundant-comments.mdreferences/doc-delete-commented-out-code.mdreferences/doc-jsdoc-public-api.mdreferences/doc-satisfies-narrows-with-check.mdreferences/doc-types-over-comments.mdreferences/emerge-four-rules.mdreferences/emerge-premature-abstraction.mdreferences/emerge-reveal-intent.mdreferences/emerge-yagni-types.mdreferences/err-early-return.mdreferences/err-error-boundaries.mdreferences/err-narrow-unknown.mdreferences/err-no-swallow.mdreferences/err-null-vs-undefined.mdreferences/err-result-vs-throw.mdreferences/err-suspense-for-loading.mdreferences/fmt-imports-grouped.mdreferences/fmt-newspaper-order.mdreferences/fmt-team-rules-over-preference.mdreferences/fmt-vertical-density.md

FAQ

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

Use when writing, reviewing, or refactoring TypeScript or React code for craftsmanship — naming, function and component shape, error handling, data modeling, tests, and abstraction. Translates Robert C. Martin's Clean Code principles into modern TS+React idioms (TS 5.x, React 19), with first-class "When NOT to apply" guidance and a Meta category for principle conflicts (DRY vs SRP, small functions vs deep modules, type safety vs ergonomics). Triggers on code review, refactoring for clarity, naming, function/component design, "is this clean?", "make this more readable", "right abstraction?" — even when the user doesn't say "clean code". Does NOT cover React-specific APIs (RSC, hooks API surface) — use the `react` skill. Does NOT cover TS compiler perf or tsconfig — use the `typescript` skill.

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

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

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

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

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

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