Provides TypeScript refactoring guidelines across 8 categories including type architecture, narrowing, generics, modern features, error handling, and compiler performance. Use for refactoring, reviewing, or modernizing TS code.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin pproenca-dot-skills-1This skill uses the workspace's default tool permissions.
Comprehensive TypeScript refactoring and modernization guide designed for AI agents and LLMs. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring, code review, and code generation.
Applies Acme Corporation brand guidelines including colors, fonts, layouts, and messaging to generated PowerPoint, Excel, and PDF documents.
Builds DCF models with sensitivity analysis, Monte Carlo simulations, and scenario planning for investment valuation and risk assessment.
Calculates profitability (ROE, margins), liquidity (current ratio), leverage, efficiency, and valuation (P/E, EV/EBITDA) ratios from financial statements in CSV, JSON, text, or Excel for investment analysis.
Comprehensive TypeScript refactoring and modernization guide designed for AI agents and LLMs. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring, code review, and code generation.
Reference these guidelines when:
as castssatisfies, using, const type parameters)| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Type Architecture | CRITICAL | arch- |
| 2 | Type Narrowing & Guards | CRITICAL | narrow- |
| 3 | Modern TypeScript | HIGH | modern- |
| 4 | Generic Patterns | HIGH | generic- |
| 5 | Compiler Performance | MEDIUM-HIGH | compile- |
| 6 | Error Safety | MEDIUM | error- |
| 7 | Runtime Patterns | MEDIUM | perf- |
| 8 | Quirks & Pitfalls | LOW-MEDIUM | quirk- |
arch-discriminated-unions — Use discriminated unions over string enums for exhaustive pattern matchingarch-branded-types — Use branded types for domain identifiers to prevent value mix-upsarch-satisfies-over-annotation — Use satisfies for config objects to preserve literal typesarch-interfaces-over-intersections — Extend interfaces instead of intersecting types for better error messagesarch-const-assertion — Use as const for immutable literal inferencearch-readonly-by-default — Default to readonly types for function parameters and return valuesarch-avoid-partial-abuse — Avoid Partial<T> abuse for builder patternsnarrow-custom-type-guards — Write custom type guards instead of type assertionsnarrow-assertion-functions — Use assertion functions for precondition checksnarrow-exhaustive-switch — Enforce exhaustive switch with nevernarrow-in-operator — Narrow with the in operator for interface unionsnarrow-eliminate-as-casts — Eliminate as casts with proper narrowing chainsnarrow-typeof-chains — Use typeof narrowing before property accessmodern-using-keyword — Use the using keyword for resource cleanupmodern-const-type-parameters — Use const type parameters for literal inferencemodern-template-literal-types — Use template literal types for string patternsmodern-noinfer-utility — Use NoInfer to control type parameter inferencemodern-accessor-keyword — Use accessor for auto-generated getters and settersmodern-verbatim-module-syntax — Enable verbatimModuleSyntax for explicit import typesgeneric-infer-over-annotate — Let TypeScript infer instead of explicit annotationgeneric-constrain-dont-overconstrain — Constrain generics minimallygeneric-avoid-distributive-surprises — Control distributive conditional typesgeneric-mapped-type-utilities — Build custom mapped types for repeated transformationsgeneric-return-type-inference — Preserve return type inference in generic functionscompile-explicit-return-types — Add explicit return types to exported functionscompile-avoid-deep-recursion — Avoid deeply recursive type definitionscompile-project-references — Use project references for monorepo buildscompile-base-types-over-unions — Use base types instead of large union typeserror-result-type — Use Result types instead of thrown exceptionserror-exhaustive-error-handling — Use exhaustive checks for typed error variantserror-typed-catch — Type catch clause variables as unknownerror-never-for-unreachable — Use never to mark unreachable code pathserror-discriminated-error-unions — Model domain errors as discriminated unionsperf-union-literals-over-enums — Use union literals instead of enumsperf-avoid-delete-operator — Avoid the delete operator on objectsperf-object-freeze-const — Use Object.freeze with as const for true immutabilityperf-object-keys-narrowing — Avoid Object.keys type wideningperf-map-set-over-object — Use Map and Set over plain objects for dynamic collectionsquirk-excess-property-checks — Understand excess property checks on object literalsquirk-empty-object-type — Avoid the {} type — it means non-nullishquirk-type-widening-let — Prevent type widening with let declarationsquirk-variance-annotations — Use variance annotations for generic interfacesquirk-structural-typing-escapes — Guard against structural typing escape hatchesRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |