agentsclimarketplace

Typescript refactor

Skill ComeOnOliver/skillshub/skills/pproenca/dot-skills/typescript-refactor

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.

Install
npx -y skills add ComeOnOliver/skillshub --skill typescript-refactor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

7.5 KB, as published. Nobody here has run it

TypeScript Refactor Best Practices

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.

When to Apply

Reference these guidelines when:

  • Refactoring TypeScript code for type safety and maintainability
  • Designing type architectures (discriminated unions, branded types, generics)
  • Narrowing types to eliminate unsafe as casts
  • Adopting modern TypeScript 4.x-5.x features (satisfies, using, const type parameters)
  • Optimizing compiler performance in large codebases
  • Implementing type-safe error handling patterns
  • Reviewing code for TypeScript quirks and pitfalls

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Type ArchitectureCRITICALarch-
2Type Narrowing & GuardsCRITICALnarrow-
3Modern TypeScriptHIGHmodern-
4Generic PatternsHIGHgeneric-
5Compiler PerformanceMEDIUM-HIGHcompile-
6Error SafetyMEDIUMerror-
7Runtime PatternsMEDIUMperf-
8Quirks & PitfallsLOW-MEDIUMquirk-

Quick Reference

1. Type Architecture (CRITICAL)

2. Type Narrowing & Guards (CRITICAL)

3. Modern TypeScript (HIGH)

4. Generic Patterns (HIGH)

5. Compiler Performance (MEDIUM-HIGH)

6. Error Safety (MEDIUM)

7. Runtime Patterns (MEDIUM)

8. Quirks & Pitfalls (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.