typescript-type-system-reference

Resolves disputed TypeScript type-system questions using official documentation and compiler verification.

1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/cjthompson/claude-code-config --skill typescript-type-system-reference-cjthompson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-type-system-reference
Source: https://github.com/cjthompson/claude-code-config/tree/main/plugins/typescript-development/skills/typescript-type-system-reference
Command: npx skills add https://github.com/cjthompson/claude-code-config --skill typescript-type-system-reference-cjthompson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? TypeScript developers often face subtle or disputed questions about assignability, inference, narrowing, variance, generics, and conditional types where memory-based answers are unreliable. This Skill grounds those answers in the official TypeScript documentation snapshot and the project's actual pinned compiler, separating documented behavior from empirically observed results. ## Core Features & Use Cases - Topic-indexed reference lookup: A curated index maps each question type (variance, mapped types, ESM/CJS interop, compiler options) to the smallest relevant official documentation files. - Compiler-verified answers: When documentation does not settle an edge case, it guides creating minimal reproductions with positive assignability examples and @ts-expect-error negative cases run against the project's pinned compiler. - Precision guardrails: Distinguishes structural compatibility, excess-property checks, narrowing, inference, and declaration lookup as separate mechanisms, and flags version-sensitive behavior. - Use Case: A teammate claims a callback parameter assignment is safe. Use this Skill to check the variance rules under strictFunctionTypes, reproduce the case with the project's compiler, and report whether the accepted assignability is intentionally unsound. ## Quick Start Ask whether a specific TypeScript generic conditional type distributes over a union and request a verified answer with the project's compiler version.

Frequently Asked Questions about typescript-type-system-reference

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

FAQPage Schema
How do I verify a TypeScript assignability question?

Check the relevant official documentation topic first, then create a minimal reproduction with positive assignability examples and @ts-expect-error negative cases. Run it against the project's pinned compiler and report the version and options used.

How do conditional types distribute over unions in TypeScript?

Conditional types distribute when the checked side is a naked type parameter, applying the branch to each union member. Wrapping both sides in brackets tests the union as a whole instead of distributing.

Why does TypeScript allow unsound callback parameter assignments?

TypeScript intentionally accepts some unsound assignability for method parameters and mutable arrays to keep common patterns ergonomic. Method and function variance differ, and strictFunctionTypes tightens function parameter checking.

Is the TypeScript Handbook a complete language specification?

No, the Handbook is maintained guidance rather than a complete formal specification. For edge cases it does not settle, treat the installed compiler's behavior as empirically observed and report both sources when they conflict.

Can I test type behavior with the TypeScript playground instead of my project?

Testing with a global or playground compiler is discouraged because results depend on the exact compiler version and compiler options. Use the project's pinned compiler and report its version so conclusions stay reproducible.