home / skills / andrelandgraf / fullstackrecipes / env-management
This skill provides type-safe environment variable management with Zod validation, Vercel workflow integration, and prebuild checks for reliable deployments.
npx playbooks add skill andrelandgraf/fullstackrecipes --skill env-managementReview the files below or copy the command above to add this skill to your agents.
---
name: env-management
description: Complete environment variable management with type-safe validation, Vercel dev workflow, and prebuild validation.
---
# Environment Variable Management
Complete environment variable management with type-safe validation, Vercel dev workflow, and prebuild validation.
## Cookbook - Complete These Recipes in Order
### Type-Safe Environment Configuration
Type-safe environment variable validation using Zod with a Drizzle-like schema API. Supports server/public fields, feature flags, either-or constraints, and client-side protection.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/config-schema-setup
```
### Environment Variable Management with Vercel
Manage environment variables across Vercel environments. Sync with Vercel CLI, handle local overrides, and load env vars in scripts.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/env-workflow-vercel
```
### Build-Time Environment Variable Validation
Validate environment variables on server start and before builds. Catch missing or invalid variables early with clear error messages.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/env-validation
```
This skill provides complete environment variable management for TypeScript full-stack apps, combining type-safe validation, a Vercel-friendly development workflow, and prebuild validation. It bundles production-ready patterns and step-by-step recipes to ensure environment configuration is safe, predictable, and easy to operate across local, CI, and Vercel environments.
It uses a Zod-based, Drizzle-like schema API to declare typed environment shapes, including server-only, public, and feature-flag fields, and either-or constraints. The skill includes tooling to sync and manage variables with the Vercel CLI, load local overrides during development, and run validation at server start and before builds to surface missing or invalid values with clear errors.
How does this prevent secrets from leaking to the client?
The schema explicitly marks variables as server-only or public. Only fields marked public are exposed to client bundles, and tooling enforces that server-only values are never included in client-side builds.
Can I run validation during CI and local dev?
Yes. Validation runs at server start and can be added as a prebuild step in CI. Local development can use safe .env overrides while still validating against the canonical schema.