TypeScript Pro

Diagnose type-safety defects in complex TypeScript applications.

Updated Oct 22, 2025
One-click install
npx skills add https://github.com/franroa/chezmoi --skill typescript-pro-franroa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TypeScript Pro
Source: https://github.com/franroa/chezmoi/tree/main/private_dot_config/opencode/skills/typescript-pro
Command: npx skills add https://github.com/franroa/chezmoi --skill typescript-pro-franroa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables teams to harness advanced TypeScript features to build type-safe, maintainable, and scalable applications with zero-runtime-typ errors.

Core Features & Use Cases

  • Advanced types: Generics, conditional/mapped/types, template literals.
  • Type-safe APIs: Branded types, type guards, and tRPC patterns.
  • Tooling & optimization: Strict tsconfig, project references, and performance considerations.

Quick Start

Define a type-safe API using branded types and a satisfies-based validation, then ensure end-to-end type safety across the stack.

Frequently Asked Questions about TypeScript Pro

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

FAQPage Schema
How do I eliminate type safety errors in complex TypeScript applications?

Type safety errors in TypeScript stem from incomplete type coverage and loose compiler settings. Enable strict mode with all compiler flags, use branded types to distinguish semantically different values, implement type guards and discriminated unions, and apply the satisfies operator for validation. This approach catches errors at compile time rather than runtime across full-stack applications.

What are advanced TypeScript generics and conditional types used for?

Advanced generics, conditional types, and mapped types let you write reusable, type-safe code that adapts to different inputs. Conditional types compute types based on runtime conditions; mapped types transform existing types systematically. Template literal types enable precise string literal unions. These patterns are essential for building type-first APIs and ensuring end-to-end type safety in production systems.

How do I configure TypeScript and tsconfig for strict type checking?

Strict tsconfig configuration enforces comprehensive type checking across your project. Enable strict mode, use project references to partition large codebases, configure declaration file generation, and apply optimization settings for build performance. Proper tooling setup prevents type defects from reaching production and improves developer feedback speed.

Can I build type-safe APIs with tRPC and branded types?

Yes. tRPC enables end-to-end type safety between client and server by sharing TypeScript types. Combine tRPC with branded types—distinct type wrappers around primitives—to enforce semantic constraints at compile time. This pattern prevents invalid data from being accepted or returned, creating a fully type-safe full-stack application.

What's the difference between using type guards versus type predicates for runtime validation?

Type guards are conditional checks that narrow types within a code block; annotated type predicates are functions that return a type predicate assertion, telling TypeScript the type is narrowed after the check passes. Type predicates are more explicit and composable for complex validation workflows, ensuring TypeScript respects your runtime checks.

Why use satisfies operator instead of explicit type annotations?

The satisfies operator validates that a value conforms to a type without widening the inferred type. Unlike explicit annotations, it preserves precise literal types and specific object shapes while still catching type errors. This enables type-safe APIs with better inference and fewer redundant annotations.