expert-typescript-programmer

Refactor TypeScript files to enforce strict types and eliminate 'any'.

33.3k|2.8k|Updated Oct 26, 2020
One-click install
npx skills add https://github.com/remix-run/remix --skill expert-typescript-programmer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expert-typescript-programmer
Source: https://github.com/remix-run/remix/tree/main/.agents/skills/expert-typescript-programmer
Command: npx skills add https://github.com/remix-run/remix --skill expert-typescript-programmer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TS codebases often struggle to express runtime contracts and enforce strict typing, leading to bugs, maintenance headaches, and subtle regressions when APIs evolve.

Core Features & Use Cases

  • Write type-safe TS code with explicit inputs/outputs and minimal use of any
  • Refactor and review public APIs while preserving compatibility and strong type contracts
  • Use across the Remix repo for generics, discriminated unions, type guards, and tsconfig/module settings

Quick Start

Refactor the target TypeScript files to ensure strict types and eliminate any use of 'any' or type assertions.

Frequently Asked Questions about expert-typescript-programmer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor TypeScript code to eliminate 'any' and enforce strict types?

To refactor TypeScript code for strict types, update your tsconfig module settings, apply explicit inputs and outputs, replace 'any' with generics or discriminated unions, and use import type and satisfies to maintain strong type contracts.

What's the best way to review public APIs in TypeScript without breaking compatibility?

Reviewing public APIs in TypeScript involves preserving compatibility by aligning exports with package boundaries, applying type guards, and ensuring strong type contracts using explicit types and discriminated unions across your .ts and .tsx files.

When do I need to use type guards and discriminated unions in a Remix codebase?

You need type guards and discriminated unions in a Remix codebase when runtime contracts must be strictly enforced, ensuring that evolving APIs and module settings do not introduce subtle regressions or type-safety gaps.

Does this approach to type-safety work with existing tsconfig and module settings?

Yes, this type-safety approach works directly with your existing tsconfig and module settings, applying strict typing rules across .ts and .tsx files to enforce runtime contracts and eliminate type assertions within the Remix repo.

Why does using 'any' in TypeScript lead to maintenance headaches and subtle regressions?

Using 'any' in TypeScript leads to maintenance headaches because it bypasses the compiler's type checking, preventing the enforcement of runtime contracts and causing subtle regressions when public APIs or module settings evolve.

What are the limitations of relying on type assertions instead of explicit types in TypeScript?

Relying on type assertions limits type-safety by overriding the compiler rather than enforcing strict runtime contracts, which increases the risk of bugs and API regressions compared to using explicit types, generics, and the satisfies operator.