web-forms-zod-validation
Installation
SKILL.md
Zod Schema Validation Patterns
Quick Guide: A schema is declared once and the TypeScript type derived from it with
z.infer, so the rule and the type cannot drift.safeParsereturns a result object where invalid input is expected andparsethrows where it is a bug;refineandsuperRefinecarry rules the built-in checks cannot express, andtransformconverts during validation — which splitsz.inputfromz.output. On v4 the string formats moved to the top level (z.email(),z.url(),z.iso.*) and the v3 method chains are deprecated rather than removed;flatten(),format()andmerge()have replacements, and reference.md carries the full migration list.
Detailed Resources:
- examples/core.md — schema definition, safe parsing, error formatting, unions, composition, async refinements
- examples/transforms.md — transforms, coercion, pipe chains, query params
- examples/advanced-patterns.md — branded types,
.catch()fallbacks, readonly, recursive schemas - reference.md — decision trees, method lookup, worked anti-patterns, v4 migration guide