Agent skill · software engineering · secondsky

zod

TypeScript-first schema validation and type inference. Use for validating API requests/responses, form data, env vars, configs, defining type-safe schemas with runtime validation, transforming data, generating JSON Schema for OpenAPI/AI, or encountering missing validation errors, type inference issues, validation error handling problems. Zero dependencies, compact core (~5kb gzipped; zod/mini ~1.9kb).

Why this skill is useful

Provides domain-specific knowledge for TypeScript schema validation and type inference that the AI wouldn't reliably generate on its own.

What it needs

Requires bun, yarn installed locally. About 9k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

Zod: TypeScript-First Schema Validation Overview Zod is a TypeScript-first validation library that enables developers to define schemas for validating data at runtime while automatically inferring static TypeScript types. With zero dependencies and a compact core (~5kb gzipped; ~1.9kb for zod/mini), Zod provides immutable, composable validation with comprehensive error handling. Installation Requirements: TypeScript v5.5+ with "strict": true in tsconfig.json Zod 4.x (4.4.x recommended; z.codec() requires 4.1+) Important: This skill documents Zod 4.x features. The following APIs require Zod 4 and are NOT available in Zod 3.x: z.codec() - Bidirectional transformations z.iso.date(), z.iso.time(), z.iso.datetime(), z.iso.duration() - ISO format validators z.toJSONSchema() - JSON Schema generation z.treeifyError(), z.prettifyError(), z.flattenError() - New error formatting helpers .meta() - Enhanced metadata (Zod 3.x only has .describe()) Unified error parameter - Replaces message, invalidtypeerror, requirederror, errorMap .check() - Low-level multi-issue validation (composes check factories like z.minLength(3)) z.file(), z.json(), z.stringbool(), z.xor(), z.templateLiteral() - New schema types z.exactOptional(), .prefault(), .safeExtend(), z.fromJSONSchema() - New utilities For Zod 3.x compatibility or migration guidance, see https://zod.dev Import paths (all ship in the zod package): import { z } from "zod" — standard (v4 since 4.0) import { z } from "zod/v4" — pin for libraries supporting both v3 (3.25+) and v4 users import { z } from "zod/mini" — functional, tree-shakable API (~1.9kb; checks via .check(z.minLength(3))) import as core from "zod/v4/core" — low-level $-prefixed internals for library authors Migrating from Zod v3 to v4 Load references/migration-guide.md for complete v3 to v4 migration documentation. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/zod

View the source on GitHub

Browse the @skills marketplace