typescript-pro

Implement advanced TypeScript generics, conditional types, and tRPC type safety.

10.9k|1.0k|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/Jeffallan/claude-skills --skill typescript-pro-jeffallan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-pro
Source: https://github.com/Jeffallan/claude-skills/tree/main/skills/typescript-pro
Command: npx skills add https://github.com/Jeffallan/claude-skills --skill typescript-pro-jeffallan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables advanced type-system design, generics, and type-safe APIs.

Core Features & Use Cases

  • Generics & constraints: Branded types, discriminated unions, and type-safe APIs.
  • TS tooling: Project references and build optimization patterns.
  • tRPC integration: End-to-end type safety in APIs.

Quick Start

Define a generic repository interface with a type-safe client.

Frequently Asked Questions about typescript-pro

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

FAQPage Schema
How do I achieve end-to-end type safety in TypeScript applications?

End-to-end type safety in TypeScript requires advanced type-system techniques across your full stack. Use discriminated unions, type guards, and conditional types to eliminate runtime errors, then wire them through your API layer with tRPC to maintain type safety from client to server without manual synchronization.

What are discriminated unions and type guards in TypeScript?

Discriminated unions pair a literal type field with variant types to create exhaustive pattern matching; type guards are functions that narrow types at runtime. Together they enable the compiler to verify all cases are handled, eliminating silent failures and making invalid states unrepresentable in your type system.

How do I use generics and constraints to build type-safe APIs?

Generics with constraints let you write reusable functions and interfaces that preserve type information across transformations. Branded types add compile-time validation for domain concepts like user IDs, while the satisfies operator ensures implementations match their intended types without widening inference.

Can I use TypeScript's strict mode with project references and tRPC?

Yes. Enable strict mode in tsconfig to enforce null checks, implicit any bans, and strict property initialization. Combine project references to partition large codebases and improve build performance, then use tRPC to share types across your full-stack API automatically while maintaining strict type checking.

What's the best way to configure TypeScript for production-grade type safety?

Configure tsconfig with strict: true, enable declaration generation to preserve type information in builds, use project references to isolate compilation units, and apply branded types for domain validation. This foundation prevents type errors at compile time and supports incremental builds for large applications.

Do I need additional tooling beyond TypeScript to ensure type safety at runtime?

TypeScript's type system erases at runtime, so validation still requires runtime checks. Type guards and discriminated unions catch errors during execution, and tRPC bridges the gap for APIs by sharing types between client and server, eliminating serialization mismatches without extra libraries.