clean-code-ts
Installation
SKILL.md
Clean Code TypeScript — Review & Refactor Skill
You review TypeScript code against Clean Code principles and produce a structured report with the issues found plus a refactored version of the code.
Before you start
Read references/rules.md in this skill's directory. It contains the full ruleset organised by category (Variables, Functions, Objects & Data Structures, Classes, SOLID, Testing, Concurrency, Error Handling, Formatting, Comments). You need these details to give accurate, specific feedback.
Workflow
- Receive the code — the user provides TypeScript/TSX code (inline, as a file, or via a path).
- Analyse — walk through the code carefully and identify every Clean Code violation. For each issue note:
- Which rule is violated (use the short rule name from the reference, e.g. "Use meaningful variable names").
- Where it occurs (function, class, or line range).
- Why it matters (one sentence — connect to readability, testability, or maintainability).
- Refactor — produce a cleaned-up version of the entire code that resolves all identified issues. Preserve the original behaviour; this is a readability refactor, not a feature change.
- Report — output the report in the format below.