typescript-types

Solve complex TypeScript type logic with generics, conditional types, and mapped types.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bpteam/coder --skill typescript-types-bpteam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-types
Source: https://github.com/bpteam/coder/tree/main/.opencode/skills/typescript-advanced-types
Command: npx skills add https://github.com/bpteam/coder --skill typescript-types-bpteam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Complex type logic in TypeScript can be hard to reason about and error-prone without structured guidance. This skill provides practical patterns and explanations to master generics, conditional types, mapped types, template literal types, and utility types, enabling you to build robust, type-safe code.

Core Features & Use Cases

  • Generics, constraints, and type inference for reusable components
  • Conditional types and distributive patterns for precise type transformations
  • Mapped types and key remapping for flexible API design
  • Template literal types for string-based type safety
  • Advanced patterns like type-safe APIs, event emitters, and builders

Quick Start

Load this skill into your TypeScript workflow and start applying the type patterns to a small TypeScript snippet to see real-time type feedback.

Frequently Asked Questions about typescript-types

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

FAQPage Schema
How do I use TypeScript conditional types to transform types precisely?

TypeScript conditional types enable precise type transformations by checking type compatibility and distributing patterns over union types, allowing you to build robust, type-safe logic for libraries and utilities.

What is the best way to create reusable components with TypeScript generics?

TypeScript generics allow you to create reusable components by defining constraints and leveraging type inference, ensuring strong type safety across libraries and frameworks without losing flexibility.

How do mapped types and key remapping work for API design in TypeScript?

Mapped types in TypeScript iterate over object properties to produce new types, and key remapping allows flexible API design by modifying keys while maintaining strict type safety.

Can I achieve string-based type safety using TypeScript template literal types?

TypeScript template literal types provide string-based type safety by interpolating string unions into fixed string patterns, enabling advanced type-safe APIs and event emitters.

Does this TypeScript skill apply to building type-safe event emitters and builders?

Yes, this skill provides practical patterns for advanced TypeScript types like generics and conditional types, specifically satisfying guidance on building type-safe APIs, event emitters, and builders.

When do I need utility types instead of custom TypeScript type logic?

You need utility types for common type transformations when building TypeScript projects, but complex logic involving mapped or conditional types requires structured guidance to avoid error-prone code.