env-config

Set up type-safe environment configuration with Zod for Next.js applications.

3|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/mattwoodco/skills --skill env-config-mattwoodco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-config
Source: https://github.com/mattwoodco/skills/tree/main/skills/env-config
Command: npx skills add https://github.com/mattwoodco/skills --skill env-config-mattwoodco

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the setup of environment variables, ensuring type safety and providing sensible defaults for local development, preventing common configuration errors.

Core Features & Use Cases

  • Type-Safe Validation: Uses Zod to validate environment variables at build time, catching errors early.
  • Local Defaults: Generates a .env.local.example file with defaults for Docker services, simplifying local setup.
  • Reconciliation: Merges .env.local.example with existing .env.local files, preserving secrets while adding missing defaults.
  • Use Case: When starting a new project, use this skill to establish a robust and validated environment configuration system that works seamlessly from local development to production.

Quick Start

Run the provided script to reconcile your local environment variables against the example defaults.

Frequently Asked Questions about env-config

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate environment variables in a Next.js application?

Validate environment variables in Next.js using Zod and @t3-oss/env-nextjs to define schemas for server and client variables. This catches configuration errors at build time before they reach production.

What is the best way to manage type-safe environment configuration for Docker and Next.js?

Type-safe environment configuration for Docker and Next.js is managed by generating a `.env.local.example` file with sensible local defaults, then reconciling it with `.env.local` to add missing variables without overwriting existing secrets.

How do I set up local development defaults for environment variables without losing secrets?

Set up local development defaults by merging an `.env.local.example` template with your existing `.env.local` file. This reconciliation preserves your current secrets while automatically injecting any missing default variables.

Can I use Zod for environment variable validation in a Next.js project?

Yes, you can use Zod for environment variable validation in Next.js projects. It validates server and client variables at build time, ensuring secure and validated environment variable management across development and production.

Why am I getting missing environment variable errors during local Next.js development?

Missing environment variable errors occur during local Next.js development when `.env.local` lacks required values. Reconciling it against a generated `.env.local.example` file injects missing defaults to prevent these errors.

Does @t3-oss/env-nextjs support separating server and client environment variables?

Yes, @t3-oss/env-nextjs supports separating server and client environment variables. It uses Zod schemas to manage and validate both server-side and client-side variables securely within your Next.js application.