What problem does it solve?
Zod schemas are frequently misused or inconsistently applied across TypeScript codebases, causing runtime crashes, security gaps, duplicate validation logic, and poor developer UX. This Skill provides a concise, machine-actionable checklist and concrete refactors to make validation safe, consistent, and maintainable.
Core Features & Use Cases
- Schema hardening: apply primitive correctness, string constraints, enums, branded IDs, and strict object modes to prevent silent data corruption.
- Parsing best practices: recommend safeParse/safeParseAsync, parseAsync for async refinements, and coercion patterns for form/query inputs.
- Composition & DX: derive variants with pick/omit/partial, prefer discriminated unions for tagged types, and use z.lazy(), pipe(), and preprocess() where appropriate.
- Error handling & UX: surface all validation issues, attach precise paths, provide user-friendly messages, and centralize defaults/fallbacks.
- Performance & maintainability: cache schemas, avoid creating schemas in hot paths, and suggest zod-mini for bundle-sensitive frontends.
Quick Start
Review the repository's Zod schemas and produce corrected schema definitions, a prioritized list of detected rule violations, and concise code-level fixes.