typescript-clean-code
БесплатноБез исполняемых скриптовНе проверенUse when the user writes, reviews, or refactors TypeScript/JavaScript code, or asks whether code is clean, maintainable, or well-designed; names a smell…
от bmad-labs★ 20 звёзд на GitHubОб этом скилле
Clean Code
The twelve change-shape smells
Shotgun Surgery · Feature Envy · Data Clumps · Long Method · Divergent Change · Duplicated Code · Large Class · Long Parameter List · Primitive Obsession · Message Chains · Dead Code · Speculative Generality
You know each one and its refactoring. The value is the checklist, not the definitions — without the names a diff "looks fine"; with them you find the shape. Run all twelve against any change you review or write.
The smell catalog has four layers
Each examines a different unit, so each sees what the others miss.
| Load | Unit | For |
|---|---|---|
references/smells/tooling.md |
the repository | First, in every review. Which smells a linter decides, so those become one "wire this into CI" finding instead of twenty hand-written ones |
references/smells/rules.md |
a line, a function | Per-line heuristics (C/E/F/G/N/T), plus the review posture and severity vocabulary that govern all four layers |
references/smells/fowler.md |
a modification | The twelve above — detection question, TypeScript remedy, and when NOT to fix for each |
references/smells/typescript.md |
a type | TS1-TS10: any leakage, assertion versus validation, exhaustiveness, strictness flags, branded types |
A diff can satisfy every rule in rules.md and still be badly shaped — that is what
fowler.md is for. Reviewing a change means all four.
Review posture
Three rules that change output more than any catalog entry. Full text in
references/smells/rules.md → "Review posture".
- Approve when the change improves code health, not when it is perfect. There is no perfect code, only better code.
- A correct finding nobody acts on is a false positive. Scan broadly, report selectively — three actionable findings beat twenty true ones.
- Mark polish as ignorable. Conventional Comments labels —
issue,suggestion,nitpick,question,praise— with(blocking)/(non-blocking). An author who cannot tell which comments are optional treats all of them as mandatory, or none of them.
A review is done when all four layers have run, every surviving finding carries
a label and (for an issue) a fix, and the report states how many findings were cut
as unlikely to be acted on.
Contested rules
Three rules in these references are positions with live counter-arguments, marked contested where they appear. Present both sides and prefer the author's demonstrated reasoning over the number:
- Function length —
references/functions/rules.mdRule 1. Detect by "can I name each section?"; the "2-5 lines" figure over-extracts when applied literally. - Comments —
references/comments/rules.md. Keep rationale, invariants, and non-obvious why; delete restatement and stale comments. - G23 polymorphism —
references/smells/rules.md. An exhaustiveswitchover a discriminated union is idiomatic TypeScript, not a smell.
Workflows
Load the workflow file and follow it. Only code-review, pr-review, and
refactoring are folders with step files: load their workflow.md, then the steps in
order. Each step names the references it needs and updates stepsCompleted in the
output document's frontmatter, so a compacted context resumes from the last completed
step via step-01b-continue.md. The other workflows are single files.
| Workflow | For |
|---|---|
workflows/code-review/workflow.md |
Reviewing code for quality |
workflows/pr-review/workflow.md |
Reviewing pull requests |
workflows/refactoring/workflow.md |
Safe refactoring with tests (step 3 sweeps all twelve; steps 5-8 loop) |
workflows/tdd.md |
Test-driven development cycle |
workflows/new-feature.md |
Building new functionality |
workflows/bug-fix.md |
Fixing bugs properly |
workflows/test-strategy.md |
Planning test coverage |
workflows/estimation.md |
Estimating tasks (PERT) |
workflows/deadline-negotiation.md |
Handling unrealistic deadlines |
References
references/<topic>/ holds rules.md (the rules), examples.md (curated
TypeScript bad/good pairs — prefer these over inventing your own), and
knowledge.md (concepts).
Code quality: naming · functions · classes · comments · error-handling · unit-tests · formatting · smells
Professional practice: professionalism · saying-no · commitment · coding-practices · tdd · practicing · acceptance-testing · testing-strategies · time-management · estimation · pressure · collaboration
Load the topic's rules.md before advising on it, and cite the rule you applied —
the design problem it names, not the metric that pointed at it. Where a reference
contradicts your general knowledge, the reference wins: it carries this skill's
TypeScript adaptations and thresholds.
references/index.md maps symptom → reference file.
Установить typescript-clean-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл typescript-clean-code?
Use when the user writes, reviews, or refactors TypeScript/JavaScript code, or asks whether code is clean, maintainable, or well-designed; names a smell (Shotgun Surgery, Feature Envy, Data Clumps, Long Method, Divergent Change, Duplicated Code, Large Class, Long Parameter List, Primitive Obsession, Message Chains, Dead Code, Speculative Generality, god class, stringly typed); asks about TypeScript type hygiene (`any` leakage, `as` assertions, non-null `!`, discriminated unions, exhaustiveness, strict flags, branded types); asks what to enforce with lint or tsconfig (knip, jscpd, dependency-cruiser, typescript-eslint); runs TDD or plans test strategy; or estimates tasks and negotiates deadlines.
Как установить скилл typescript-clean-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл typescript-clean-code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic