env-config

Centralize environment variable access through dedicated server and web config modules.

11|2|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/recca0120/code-quest --skill env-config-recca0120
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-config
Source: https://github.com/recca0120/code-quest/tree/main/.claude/skills/env-config
Command: npx skills add https://github.com/recca0120/code-quest --skill env-config-recca0120

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents scattered, error-prone environment variable reads by forcing all configuration access through dedicated config modules, reducing misconfiguration and inconsistent defaults across server and client.

Core Features & Use Cases

  • Centralized env access: Enforces using apps/server/src/config.ts (server) and apps/web/src/config.ts (client) rather than direct process.env / import.meta.env usage.
  • Clear defaults and conventions: Documents how to add new variables with sensible defaults, appropriate client-side VITE_ prefixes, and placement in .env.example files.
  • Operational guidance for dev/runtime: Standardizes Node 20+ --env-file usage for loading env in development and points to existing tests for key parsing logic.
  • Use case: When adding a new feature flag or datastore driver, update the correct config module and .env.example, ensuring both the runtime and client exposure rules are followed.

Quick Start

Add the new environment variable to the appropriate config module in apps/server/src/config.ts or apps/web/src/config.ts, then document it in the matching .env.example file according to whether it is server-only or client-exposed with a VITE_ prefix.

Frequently Asked Questions about env-config

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

FAQPage Schema
How do I centralize environment variables in a Node.js full-stack app?

To centralize environment variables, route all configuration access through dedicated config modules like `apps/server/src/config.ts` and `apps/web/src/config.ts` instead of direct `process.env` calls. This enforces safe consistency and eliminates scattered defaults across your application.

What's the best way to manage Vite client-side environment variable prefixes?

Managing Vite client-side prefixes requires documenting variables with the `VITE_` prefix in your web config module and `.env.example` file. This ensures proper client exposure rules are followed when adding new feature flags or settings.

How do I load .env files for local development in Node 20?

Loading .env files for local development in Node 20 uses the `--env-file` flag to inject environment variables at runtime. Standardize this operational guidance to ensure consistent dev environment loading across your server and web client.

Why should I avoid direct process.env reads in my full-stack application?

Avoiding direct `process.env` reads prevents scattered, error-prone configuration access that leads to misconfiguration and inconsistent defaults. Forcing imports from centralized config modules ensures safe consistency across server and client environments.

Can I use environment variables to configure raw store drivers in Vite?

Configuring raw store drivers in Vite involves adding the driver configuration to the appropriate server or web config module. You must document the new variables in `.env.example` while following the `VITE_` prefix rules for any client-exposed settings.

When do I need to update .env.example files for environment variable configuration?

You need to update `.env.example` files whenever adding or modifying configuration for the server or web client. Document new variables according to whether they are server-only or client-exposed with a `VITE_` prefix to maintain configuration consistency.