typescript-pro

Design scalable TypeScript type systems with generics, conditional types, and type guards.

Updated Apr 24, 2026
One-click install
npx skills add https://github.com/otto-poblysh/pedagemy-early-access --skill typescript-pro-otto-poblysh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-pro
Source: https://github.com/otto-poblysh/pedagemy-early-access/tree/main/.agents/skills/typescript-pro
Command: npx skills add https://github.com/otto-poblysh/pedagemy-early-access --skill typescript-pro-otto-poblysh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Teams struggle to maintain correctness and scalability in TypeScript codebases when type relationships become complex, error-prone, or inconsistent across layers.

Core Features & Use Cases

  • Advanced type architecture: Apply generics, conditional types, mapped types, and discriminated unions to model real domain constraints (e.g., request/response state machines or API contracts).
  • Safer runtime integration: Build custom type guards and branded types to prevent accidental mixing of semantically different values (e.g., UserId vs OrderId).
  • End-to-end type safety: Configure tRPC-style patterns so the types stay aligned from server to client, reducing integration bugs.

Example use case: When implementing an API-backed UI for a workflow (idle/loading/success/error), use discriminated unions and type guards to ensure every UI state renders correctly and exhaustively, while branded IDs prevent passing the wrong identifier type to endpoints.

Quick Start

Implement your domain types first using branded types and discriminated unions, then add type guards and validate the build with strict TypeScript settings.

Frequently Asked Questions about typescript-pro

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

FAQPage Schema
How do I maintain type safety across server and client using tRPC?

To maintain end-to-end type safety with tRPC, configure type-first API design patterns that keep types aligned from server to client. This requires strict tsconfig settings and validating type relationships using tsc --noEmit to reduce integration bugs.

What is the best way to prevent mixing different identifier types in TypeScript?

The best way to prevent mixing identifiers is using branded types. By branding semantically different values like UserId and OrderId, you enforce type-first domain constraints that stop accidental mixing and ensure correctness as code evolves.

How do I model complex API state machines in TypeScript?

Model API state machines using advanced type architecture with discriminated unions. Combine conditional and mapped types to represent real domain constraints like idle, loading, success, and error states, ensuring exhaustive UI rendering via type guards.

Do I need strict tsconfig settings to use advanced generics and mapped types?

Yes, strict tsconfig settings are required. Advanced TypeScript type systems using generics, conditional types, and mapped types need strict configuration to validate type-checks correctly and maintain scalable, error-free code across layers.

How do I ensure exhaustive narrowing for workflow states in UI components?

Ensure exhaustive narrowing by applying custom type guards alongside discriminated unions. This combination validates every possible request or response state, guaranteeing that UI components render correctly and handle all scenarios without missing edge cases.

When should I use custom type guards instead of standard TypeScript narrowing?

Use custom type guards for safer runtime integration when standard narrowing cannot validate complex domain constraints. They are essential for verifying branded types and ensuring exhaustive checks across evolving application layers.