dignified-typescript

Guides implementation and review of TypeScript code with honest types and runtime validation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript codebases often accumulate unsafe casts, any types, and misleading type machinery that pass the compiler but fail at runtime. This Skill provides disciplined guidance for designing APIs, modeling domain state, and validating runtime data so types reflect actual behavior. ## Core Features & Use Cases - Runtime boundary design: Treat JSON, environment variables, network responses, and third-party callbacks as unknown until validated, then construct domain types safely. - Domain modeling: Use discriminated unions with exhaustive handling instead of optional-field state merging, and apply satisfies, generics, and branded types only when they express real consumer-visible relationships. - Project-aware verification: Read package.json, tsconfig, lockfiles, and CI to match the repository's TypeScript version, module system, and build targets before designing. - Use Case: When refactoring a public API in a published TypeScript library, use this Skill to keep exported types minimal and stable, validate decoded JSON at boundaries, and compile public consumers to confirm compatibility. ## Quick Start Ask the AI to review or implement a substantial TypeScript module using dignified-typescript principles, validating runtime inputs and modeling state with discriminated unions.

Frequently Asked Questions about dignified-typescript

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

FAQPage Schema
How do I validate JSON data in TypeScript safely?

Decode JSON into `unknown` first, validate it at the runtime boundary, then construct your domain type. Casting decoded JSON directly to a domain type bypasses runtime checking and lets invalid data propagate through the application.

How to model state with discriminated unions in TypeScript?

Define a union where each variant has a distinct tag field, then handle every variant exhaustively in switch statements. This avoids merging states with different invariants into one type full of optional fields.

When should I use satisfies instead of a type annotation?

Use `satisfies` when you want to check a value against a type without widening away useful inference, such as keeping literal types of object properties. A plain annotation widens the inferred type to the annotation.

Does TypeScript type checking guarantee runtime correctness?

No. TypeScript's structural types are erased at compile time and do not enforce runtime immutability or validate external data. Successful type checking must be combined with runtime validation, tests, and verification of emitted JavaScript.

Why should I avoid any and non-null assertions in TypeScript?

`any`, assertions, and blanket suppressions silence the compiler without fixing the underlying boundary or incompatible declaration causing the error. Prefer `unknown` plus validation, and trace the actual source of type errors instead.