typescript-strict

Enforce strict TypeScript patterns with exhaustive switches and branded types.

224|27|Updated May 12, 2026
One-click install
npx skills add https://github.com/WrongStack/WrongStack --skill typescript-strict-wrongstack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-strict
Source: https://github.com/WrongStack/WrongStack/tree/main/packages/core/skills/typescript-strict
Command: npx skills add https://github.com/WrongStack/WrongStack --skill typescript-strict-wrongstack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps enforce strict TypeScript patterns in WrongStack to improve type safety and reduce bugs by guiding exhaustive switches, branded types, discriminated unions, and noUncheckedIndexedAccess.

Core Features & Use Cases

  • Enforces exhaustive switches with assertNever guards to prevent runtime surprises.
  • Encourages branded types for invariants and safer type boundaries.
  • Promotes discriminated unions for robust, explicit data shape handling.
  • Enforces noUncheckedIndexedAccess to require undefined handling in arrays and object lookups.
  • Use Case: When reviewing a TypeScript module, apply the skill to validate patterns and update types accordingly across functions and APIs.

Quick Start

Enable the TypeScript Strict Mode skill in WrongStack and turn on strict type checking for your project.

Frequently Asked Questions about typescript-strict

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

FAQPage Schema
How do I enforce exhaustive switch statements in TypeScript?

Enforce exhaustive switch statements in TypeScript by using assertNever guards within default cases to catch unhandled discriminant variants at compile time, preventing runtime surprises during refactoring.

What are branded types and when should I use them in TypeScript?

Branded types in TypeScript create safer type boundaries by tagging primitive values to enforce invariants, which should be used when distinguishing identifiers or ensuring only validated data passes into functions.

How do I handle undefined values from noUncheckedIndexedAccess in TypeScript?

Handle undefined values from noUncheckedIndexedAccess by explicitly checking for undefined when retrieving values from arrays or objects, requiring your code to safely manage potentially missing elements.

Does this TypeScript strict pattern require specific compiler options?

Yes, this strict TypeScript pattern requires specific compiler options including strict: true, noUncheckedIndexedAccess, noImplicitReturns, and exactOptionalPropertyTypes to validate per-file patterns effectively.

What's the best way to structure data models with discriminated unions in TypeScript?

Structure data models with discriminated unions in TypeScript by tagging variants with a shared literal property, enabling robust explicit shape handling and exhaustive type checking across APIs.

Can I use strict TypeScript patterns to validate code during CI?

Yes, you can use strict TypeScript patterns to validate code during CI by implementing checks that ensure tsc passes, applying pattern validation across exported APIs and internal utilities.