typescript-development

Enforce strict TypeScript type safety and Zod runtime validation.

1|Updated Feb 19, 2025
One-click install
npx skills add https://github.com/trystan2k/favoritable-old --skill typescript-development-trystan2k
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-development
Source: https://github.com/trystan2k/favoritable-old/tree/main/.agents/skills/typescript-development
Command: npx skills add https://github.com/trystan2k/favoritable-old --skill typescript-development-trystan2k

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the common pain points of writing inconsistent, unsafe TypeScript code that leads to hard-to-debug runtime errors, type mismatches, and unvalidated external data causing production issues.

Core Features & Use Cases

  • Strict Type Safety Enforcement: Guides type-first development, strict tsconfig setup, elimination of implicit any types, and use of patterns like branded types and discriminated unions to catch errors at compile time.
  • Runtime Validation with Zod: Provides standards for using Zod schemas as the source of truth for type inference and validating API responses, user input, and environment variables to prevent invalid data from causing runtime failures.
  • Use Case: When building a TypeScript backend API or React frontend, use this Skill to ensure consistent code quality, reduce debugging time, and prevent type-related bugs from reaching production.

Quick Start

Use the typescript-development skill to audit your TypeScript project for strict mode compliance, missing Zod validation on external data inputs, and inconsistent type patterns, then generate a prioritized list of fixes aligned with the skill's best practices.

Frequently Asked Questions about typescript-development

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

FAQPage Schema
How do I validate API responses and environment variables in TypeScript?

Validate API responses and environment variables in TypeScript by using Zod schemas as the single source of truth for type inference. This approach prevents invalid external data from causing runtime failures by enforcing strict runtime validation alongside compile-time type safety.

What's the best way to enforce strict type safety in a TypeScript project?

The best way to enforce strict type safety in a TypeScript project is by configuring a strict tsconfig setup and adopting type-first development. Eliminating implicit any types and applying patterns like branded types and discriminated unions catches errors at compile time.

Why does TypeScript runtime type mismatch happen with external data?

TypeScript runtime type mismatches happen with external data because standard TypeScript types are erased at runtime, leaving invalid API responses unchecked. Using Zod schemas for runtime validation ensures incoming data conforms to expected types before execution.

Can I use Zod validation for both Node.js backend and React frontend development?

Yes, you can use Zod validation for both Node.js backend and React frontend development. Applying Zod schemas across .ts and .tsx files ensures consistent code quality and type-safe handling of user input and API responses in both environments.

How do I audit my TypeScript codebase for missing runtime validation?

Audit your TypeScript codebase for missing runtime validation by checking all external data inputs against strict mode compliance. Identify areas lacking Zod schema validation and generate a prioritized list of fixes aligned with type-safety best practices.