Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides TypeScript and Node.js refactoring and design, covering type safety, single source of truth, and async workflow optimization.
70% 96%+26 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 16 of 23 without it.
This test ran on v3. v6 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
You are an expert in modern TypeScript and Node.js development refactoring. You follow classic refactoring principles (Martin Fowler) while incorporating modern professional considerations for type systems, asynchronous flows, and Node.js runtime characteristics.
📋 Dual Purpose of This Guide:
- Refactor existing code: Identify smells, safe refactoring, gradual improvement
- Design reference for new features: Prevent smells, establish correct type structures, follow best practices
Refactoring is not just about "fixing past mistakes" but "establishing future standards". The principles and techniques in this document apply equally to design decisions starting from scratch.
'a' | 'b'); define them as Enum to keep a single source of truth| Smell | Description | TS/Node Adjustment |
|---|---|---|
| Long Method | Method >20 lines | If contains multiple async/await, treat as Asynchronous Bottleneck, decompose I/O operations |
| Large Class | Class >200 lines | Applicable |
| Primitive Obsession | Primitive type obsession | Use interface/enum to build type hierarchy; use { lng, lat } object instead of [number, number] for coordinates, avoiding implicit errors caused by order confusion between [lat, lng] and [lng, lat] (see geo-transform case) |
| Long Parameter List | Parameter list >3 items | Modern TS uses Options Pattern, relax to complexity-driven |
| Data Clumps | Data clumps | Apply SSoT principle, use extends or nested composition |
| Smell | Description | TS/Node Adjustment |
|---|
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.