We've all been here. A new form shows up, you install React Hook Form, add Zod or Yup, and in ten minutes you have something that "works." The problem doesn't surface that day. It surfaces three months later, when the same VIN you validate in the create car form also has to be validated in edit, in import from Excel, and it turns out the rule —"17 characters, the last 5 numeric"— is written three times, each one slightly different, and none of them lives in a place you can point to and say "here is what a valid VIN is."

A typical form with a library looks roughly like this:

const schema = z.object({

vin: z.string().length(17, "The VIN must be 17 characters"),

miles: z.number().min(0, "Miles cannot be negative"),