env-vars

Guides safe modification of environment variables across a pnpm monorepo's web, worker, and database layers.

Updated Dec 21, 2025
One-click install
npx skills add https://github.com/Angael/veles --skill env-vars-angael
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-vars
Source: https://github.com/Angael/veles/tree/main/.agents/skills/env-vars
Command: npx skills add https://github.com/Angael/veles --skill env-vars-angael

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Changing an environment variable in a monorepo touches many files—.env.example, type declarations, server validation, Dockerfiles, and Compose wiring—and missing one causes silent build or runtime failures. This Skill enforces a complete, end-to-end review path so every variable change stays consistent across all delivery surfaces. ## Core Features & Use Cases - Context Classification: Distinguishes client (VITE_* / import.meta.env), web server (getServerEnv()), worker (process.env), and database tooling variables, with rules for each. - Required Change Review Checklist: A 10-step inspection path covering .env.example, env.d.ts, env.server.ts, Vite config, Dockerfiles, compose.yaml, and Drizzle configs. - Production Build Invariant: Ensures client variables traverse the full build-time chain from Compose build args through Dockerfile ARG/ENV into Vite's import.meta.env. - Use Case: When adding a new public API URL for the web app, the Skill walks you through declaring its type, adding the Docker build argument, wiring Compose, and verifying the SSR module doesn't throw on a missing value. ## Quick Start Ask the assistant to add or rename an environment variable in the Veles monorepo and follow the guided review of every affected file.

Frequently Asked Questions about env-vars

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

FAQPage Schema
How do I add a new environment variable to a Vite and TanStack Start app?

Add a VITE_ prefixed variable to .env.example, declare its type in ImportMetaEnv within env.d.ts, add a Dockerfile builder-stage ARG and ENV, and wire it through compose.yaml web.build.args so Vite compiles it into the client bundle.

What is the difference between VITE_ variables and server environment variables?

VITE_ variables are public build-time values compiled into browser assets via import.meta.env, while server variables are runtime secrets accessed through getServerEnv() validation. Secrets must never use the VITE_ prefix or be passed as Docker build arguments.

Why is my Vite environment variable undefined in the production build?

Runtime environment settings are too late for values compiled by Vite. The variable must traverse the full chain: Compose web.build.args, Dockerfile ARG, builder-stage ENV, then import.meta.env at build time.

Can I access process.env directly in web application code?

Direct process.env access is reserved for bootstrap concerns like NODE_ENV. Feature code should use getServerEnv() from env.server.ts, which validates and normalizes runtime configuration with typed access.

How do I verify environment variable changes before deploying?

Build the web app with the production environment including missing-value cases, exercise the SSR entry so module initialization is verified, run docker compose config --quiet, then run pnpm lint and pnpm check:fix.