environment-variables

Manage and validate environment variables with t3-env and Zod schemas.

4|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/kvnwolf/devtools --skill environment-variables-kvnwolf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: environment-variables
Source: https://github.com/kvnwolf/devtools/tree/main/plugins/base/skills/environment-variables
Command: npx skills add https://github.com/kvnwolf/devtools --skill environment-variables-kvnwolf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @t3-oss/env-core, zod, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the management and validation of environment variables, ensuring consistency and preventing errors across different environments.

Core Features & Use Cases

  • Centralized Management: Define and manage all environment variables in a single location (src/lib/env.ts).
  • Type Safety & Validation: Uses Zod to enforce schemas and validate variable types, catching errors early.
  • Client/Server Separation: Clearly distinguishes between variables exposed to the client and those kept server-side.
  • Use Case: When developing a new feature that requires an API key, use this Skill to add the key securely to .env.local, define its schema in src/lib/env.ts, and ensure it's correctly validated before deployment.

Quick Start

Add a new server-only environment variable named STRIPE_SECRET_KEY with a string type.

Frequently Asked Questions about environment-variables

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

FAQPage Schema
How do I validate environment variables with Zod in a TypeScript application?

You can validate environment variables with Zod by defining schemas that enforce variable types and catch errors early during runtime. This Skill uses t3-env to centralize management and secure sensitive configuration across development and production environments.

How do I separate client and server environment variables securely?

To separate client and server environment variables securely, define them in distinct schemas within a central configuration file. This approach uses t3-env to clearly distinguish variables exposed to the client from those kept server-side, preventing sensitive data leaks.

What is the best way to manage type-safe environment variables across different environments?

The best way to manage type-safe environment variables is using t3-env and Zod to define shared, client, and server variables. This validates types at runtime and ensures configuration consistency across development and production environments.

Does t3-env work with Zod to provide runtime validation for application configuration?

Yes, t3-env works with Zod to provide runtime validation for application configuration. By defining Zod schemas, the integration enforces type safety and validates variable types before deployment, catching configuration errors early.

How do I add a new server-only API key to my environment variables?

To add a new server-only API key, store it securely in your local environment file, then define its string schema in the centralized configuration file. Zod validates the key before deployment, ensuring it remains server-side and correctly typed.

Why do I need runtime validation for environment variables instead of just type definitions?

You need runtime validation for environment variables because type definitions alone do not check actual values at execution. Using Zod schemas catches invalid or missing configurations early, preventing runtime errors and ensuring secure handling across environments.