typescript-rigor

Enforce TypeScript type safety with discriminated unions, branded IDs, and Zod boundary parsing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/lgerard314/global-plugin --skill typescript-rigor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-rigor
Source: https://github.com/lgerard314/global-plugin/tree/main/plugin/skills/typescript-rigor
Command: npx skills add https://github.com/lgerard314/global-plugin --skill typescript-rigor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript rigor helps teams prevent typing pitfalls by enforcing strong boundaries, discriminated unions, branded IDs, and robust error handling at compile time.

Core Features & Use Cases

  • Enforces discriminated unions to express exhaustive state machines.
  • Promotes branded types for domain-specific IDs to prevent misuses.
  • Encourages parse-at-boundary patterns using Zod to ensure trusted data flows.
  • Guides adjustments to compiler options and generic bounds to improve type safety.

Quick Start

Create a strict boundary for a user object using a branded UserId type and a Zod schema to parse incoming payloads.

Frequently Asked Questions about typescript-rigor

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

FAQPage Schema
How do I enforce parse-at-boundary patterns in TypeScript to ensure type safety?

To enforce parse-at-boundary patterns, use Zod schemas to validate incoming payloads at API boundaries. This ensures trusted data flows into your application, preventing unverified types from propagating through your modules.

What is the best way to prevent misusing domain-specific IDs in TypeScript?

The best way to prevent misusing domain-specific IDs is to use branded types. By branding IDs like UserId, you enforce type safety at compile time, ensuring distinct identifiers are never accidentally interchanged.

How do I express exhaustive state machines using TypeScript typing?

To express exhaustive state machines, implement discriminated unions in your TypeScript domain models. This technique enforces compile-time checks to guarantee all possible states are handled, preventing missing case errors.

Can I use Zod with TypeScript to improve end-to-end type safety across data transformation layers?

Yes, you can use Zod with TypeScript to improve end-to-end type safety. Zod validates data transformation layers by parsing untrusted inputs into strongly typed objects, securing data flow across module boundaries.

How do I adjust tsconfig compiler options and generic bounds for robust typings?

Adjust tsconfig compiler options to strict modes and apply bounded generics to improve type safety. This configuration guides the compiler to enforce robust typings and catch type errors during development.

Why does TypeScript need strict boundary parsing for API schemas and domain models?

TypeScript needs strict boundary parsing for API schemas and domain models to prevent typing pitfalls. Parsing at boundaries ensures only validated, trusted data enters the system, enforcing robust error handling at compile time.