Env Validation
Env validation is the step where, on startup, your app checks that every environment variable it needs is actually defined and has a plausible value, and exits loudly if not. Without it, a missing env often causes a cryptic runtime error deep inside a handler hours later. You'll see something like `TypeError: Cannot read properties of undefined` and waste an hour chasing it before realizing you forgot to set `DATABASE_URL` in production. AI-generated code almost always reads envs with `process.env.FOO` directly and hopes for the best. The fix is a single schema file at your app's entry point. In TypeScript, Zod is the go-to: you define what envs exist, what type they should be (URL, number, one of these literal strings), and call `.parse(process.env)` once. If anything is missing or wrong, the app refuses to start and prints a message that names the exact variable. Bonus: the parsed object is typed, so the rest of your code stops seeing `string | undefined` everywhere. Env validation lives in our checklist under ship-readiness/high because a five-minute change turns a whole category of 2 AM incidents into startup-time crashes you fix before deploying.