typescript-expert

Generate TypeScript code with Zod runtime validation and strict type safety.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/Probably-Group/Dev-AID --skill typescript-expert-probably-group
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: typescript-expert
Source: https://github.com/Probably-Group/Dev-AID/tree/main/.dev-aid/skills/expert/typescript-expert
Command: npx skills add https://github.com/Probably-Group/Dev-AID --skill typescript-expert-probably-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents TypeScript from being misused as if it provided runtime safety, which can lead to security vulnerabilities and runtime crashes when external or untrusted data enters your system.

Core Features & Use Cases

  • Runtime validation with Zod: Validate external inputs with schemas (e.g., unknown → parse → typed data) rather than trusting compile-time types.
  • Strict TypeScript patterns: Enforce strict mode, avoid any, handle null/undefined safely, and reduce unsafe assertions.
  • Security-oriented TypeScript guidance: Apply guardrails against common classes of issues like prototype pollution, XSS, injection risks, and unsafe dependency handling.
  • Advanced type techniques for API quality: Use branded types, discriminated unions, generics, and utility types to create safer interfaces and clearer error/state modeling.
  • Testing requirements with type coverage: Use runtime tests plus type tests (e.g., expect-type) to ensure both behavior and type contracts stay correct.

Quick Start

Use the typescript-expert skill to generate a TypeScript API module that validates every external input with Zod, enables strict compiler options, avoids any and unsafe assertions, and includes both runtime tests and type-level checks for the exported types and error cases.

Frequently Asked Questions about typescript-expert

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

FAQPage Schema
How do I validate untrusted data boundaries in a TypeScript API?▼

To validate untrusted data boundaries in a TypeScript API, use Zod schemas to parse external inputs from unknown into typed data, enforcing runtime checks rather than relying solely on compile-time type safety.

What is the best way to prevent prototype pollution and XSS in TypeScript?▼

The best way to prevent prototype pollution and XSS in TypeScript is to enforce strict tsconfig practices, ban unsafe patterns like `any` and unchecked type assertions, and apply security-focused dependency hygiene rules.

How do I model complex application state using discriminated unions in TypeScript?▼

To model complex application state using discriminated unions in TypeScript, apply advanced type techniques like branded types, generics, and utility types to create safer interfaces and clearer error state modeling across your APIs.

Does TypeScript provide runtime type safety for external API inputs?▼

TypeScript does not provide runtime type safety for external API inputs, which can lead to security vulnerabilities and crashes; you must implement runtime validation with Zod schemas to secure untrusted data boundaries.

Why should I avoid `any` and unchecked type assertions in strict TypeScript projects?▼

You should avoid `any` and unchecked type assertions in strict TypeScript projects because they bypass compiler checks, creating security risks like injection and prototype pollution when handling external or untrusted data.

How do I test type contracts and error cases in a TypeScript module?▼

To test type contracts and error cases in a TypeScript module, use runtime tests alongside type-level checks like `expect-type` to ensure both behavior and type contracts remain correct and secure.