What problem does it solve?
Zod helps you prevent invalid data from entering your TypeScript app by enforcing schema validation at boundaries, producing actionable errors, and keeping types in sync with your runtime checks.
Core Features & Use Cases
- Schema definition best practices: Use the right primitives, constrain strings, prefer enums, and avoid over-permissive schemas that “accept almost anything.”
- Correct parsing and error handling: Use safeParse/safeParseAsync, validate early, collect all issues for better UX, and use parseAsync for async refinements.
- Type safety and maintainability: Use z.infer, distinguish z.input vs output for transforms, and apply branded types and strict TypeScript settings to prevent subtle type bugs.
Quick Start
Apply the zod skill rules to your API request schema so invalid inputs fail fast with clear field-level error messages.