typescript-patterns

Enforce strict TypeScript idioms and validate tsconfig hygiene across projects.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill typescript-patterns-aratkruglik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-patterns
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/js-foundation/skills/typescript-patterns
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill typescript-patterns-aratkruglik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript codebases often suffer from subtle type bugs and inconsistent patterns. This skill codifies idioms that catch real bugs in TypeScript across backend and frontend projects, ensuring type safety and maintainability.

Core Features & Use Cases

  • Enforces strong typing, discriminated unions, and safe generics to reduce runtime errors.
  • Guides tsconfig hygiene, strictness best practices, and module-resolution consistency across frameworks.
  • Enables developers to align with project conventions while maintaining framework-agnostic ergonomics.

Quick Start

Audit your project's tsconfig.json for strict options and replace unsafe any usage with unknown-safe primitives.

Frequently Asked Questions about typescript-patterns

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

FAQPage Schema
How do I enforce strict type safety and eliminate runtime bugs in TypeScript?

Enforce TypeScript type safety by encoding idioms like discriminated unions and safe generics to catch bugs at compile time. This discipline ensures consistent type design and reduces runtime errors across backend and frontend projects.

What is the best way to configure tsconfig strictness for a new project?

Configure tsconfig strictness by auditing tsconfig.json for strict options and replacing unsafe any usage with unknown-safe primitives. This enforces module-resolution consistency and robust type checking across frameworks.

When do I need to use discriminated unions in TypeScript?

Use discriminated unions in TypeScript when handling varied data shapes that require safe narrowing at compile time. This pattern catches subtle type bugs by enforcing exhaustive checks, ensuring reliable and bug-free code execution.

Does this TypeScript type design guidance work for both frontend and backend projects?

Yes, this TypeScript type design guidance applies across both backend and frontend projects. It enforces framework-agnostic ergonomics, ensuring consistent type safety, safe generics, and maintenance discipline regardless of the specific framework used.

Why should I replace any usage with unknown-safe primitives in TypeScript?

Replace any usage with unknown-safe primitives in TypeScript to prevent silent runtime failures. Using unknown forces explicit type narrowing and validation, enforcing strict type safety and catching unpredictable data shapes at compile time.

How do I align TypeScript codebase conventions with safe generics usage?

Align TypeScript codebase conventions with safe generics by applying prescriptive guidance and validation to enforce consistent type design. This catches bugs at compile time and maintains maintenance discipline across complex backend and frontend architectures.