pproenca avatar

Typescript Refactor

A comprehensive refactoring guide that covers modern TypeScript through 6.0 and React 19, organized into 47 rules across nine categories. Worth using when you're cleaning up type architectures, eliminating unsafe casts, or migrating to newer features like the `using` keyword, const type parameters, and inferred type predicates. The prioritization is helpful: it puts discriminated unions and type narrowing at the top, compiler performance in the middle, and quirks lower down. Particularly strong on React component typing, including the shift away from `React.FC` and the new ref-as-prop pattern in React 19. The rule prefixes and quick reference make it easy to scan when you just need a specific pattern.

skills.sh installs
799
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add pproenca/dot-skills --skill typescript-refactor --agent claude-code

Installs into .claude/skills of the current project.

Files

TypeScript Refactor Best Practices

Comprehensive TypeScript and TSX refactoring and modernization guide designed for AI agents and LLMs. Contains 47 rules across 9 categories, prioritized by impact to guide automated refactoring, code review, and code generation. Current to TypeScript 6.0 and React 19.

When to Apply

Reference these guidelines when:

  • Refactoring TypeScript or React/TSX code for type safety and maintainability
  • Designing type architectures (discriminated unions, branded types, generics)
  • Narrowing types to eliminate unsafe as casts
  • Typing React components and hooks (props, refs, events, state) in .tsx files
  • Adopting modern TypeScript 5.x–6.0 features (satisfies, using, const type parameters, inferred type predicates, erasable syntax, with import attributes)
  • Optimizing compiler performance in large codebases (isolatedDeclarations, project references)
  • Implementing type-safe error handling patterns
  • Reviewing code for TypeScript quirks and pitfalls

Rule Categories by Priority

Sponsors

Details

Repository
github.com/pproenca/dot-skills
Categories
Frontend Development, Code Review & Quality, Debugging
First seen
Jun 3, 2026

More from pproenca/dot-skills

All 100
1alirezarezvani avatarcode-to-prdalirezarezvani/claude-skillsReverse-engineer any codebase into a complete Product Requirements Document (PRD). Analyzes routes, components, state management, API integrations, and user int798skills.sh installs
2mindrally avatarstyled-components-best-practicesmindrally/skillsstyled-components best practices for CSS-in-JS development in React applications787skills.sh installs
3jezweb avatarmotionjezweb/claude-skillsBuild React animations with Motion (Framer Motion) - gestures (drag, hover, tap), scroll effects, spring physics, layout animations, SVG. Bundle: 2.3 KB (mini) 785skills.sh installs
4alirezarezvani avatarlanding-page-generatoralirezarezvani/claude-skillsGenerates high-converting landing pages as complete Next.js/React (TSX) components with Tailwind CSS. Creates hero sections, feature grids, pricing tables, FAQ 777skills.sh installs
5adobe avatarappbuilder-testingadobe/skillsGenerate and run tests for Adobe App Builder actions and UI components. Scaffolds Jest unit tests, integration tests against deployed actions, contract tests fo766skills.sh installs
6kostja94 avatarcomparison-table-generatorkostja94/marketing-skillsWhen the user wants to create, optimize, or audit a comparison table section—an in-page block (HTML table or responsive equivalent) comparing products, methods,765skills.sh installs