typescript_advanced

Implements TypeScript 5+ utility types, discriminated unions, and Zod schema validation patterns.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/jvsandhu/agentic-skills --skill typescript-advanced-jvsandhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript_advanced
Source: https://github.com/jvsandhu/agentic-skills/tree/main/skills/typescript_advanced
Command: npx skills add https://github.com/jvsandhu/agentic-skills --skill typescript-advanced-jvsandhu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires zod.

What problem does it solve? Writing type-safe TypeScript at scale requires mastering utility types, generics, and runtime validation, and this Skill provides structured guidance and workflows for applying these patterns correctly. ## Core Features & Use Cases - Utility Type Reference: Covers Partial, Required, Pick, Omit, Record, and ReturnType with concrete code examples. - Advanced Type Patterns: Demonstrates discriminated unions, template literal types, conditional types, and generic constraints. - Zod Integration: Shows how to define runtime schemas and derive static types with z.infer for end-to-end type safety. - Use Case: When refactoring a codebase to eliminate any types, follow the three-phase workflow to design schemas, implement type narrowing, and verify strict-mode compliance. ## Quick Start Ask the agent to review your TypeScript code and replace all any usages with strict types and Zod validation schemas.

Frequently Asked Questions about typescript_advanced

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

FAQPage Schema
How do I use TypeScript utility types like Pick and Omit?

Pick creates a type with selected properties, such as Pick<User, 'id' | 'name'>, while Omit excludes properties, like Omit<User, 'password'>. Both derive new types from existing interfaces without redefining fields.

How to validate TypeScript types at runtime with Zod?

Define a schema with z.object containing field validators, then derive the static type using z.infer<typeof Schema>. This gives runtime validation and compile-time types from a single source of truth.

Should I use interface or type in TypeScript?

Use interface for object structures since it supports declaration merging and extension. Use type aliases for unions, conditional types, and complex computed types that interfaces cannot express.

What is the difference between any and unknown in TypeScript?

unknown is the type-safe counterpart of any because it forces type narrowing before use. Replace any with unknown and narrow it using type guards like is or in operators.

When should I use discriminated unions in TypeScript?

Use discriminated unions when modeling mutually exclusive states, such as success and error results. A shared literal field like success: true | false lets the compiler narrow types automatically in conditionals.