config-environments

Guide multi-environment configuration design with canonical env var names and startup validation.

4|1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/jcdendrite/claude-config --skill config-environments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: config-environments
Source: https://github.com/jcdendrite/claude-config/tree/main/claude/.claude/skills/config-environments
Command: npx skills add https://github.com/jcdendrite/claude-config --skill config-environments

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents configuration mistakes that happen when developers encode environment names into variable names or branch on environment at runtime, which can cause wrong credentials, leaks of production-shaped state, and brittle deployments.

Core Features & Use Cases

  • Canonical env var naming across environments: Use the same variable name everywhere (e.g., DATABASE_URL) while each environment’s config source supplies the correct value.
  • Stops credential selection branching: Avoid logic that picks _DEV/_PROD or _LIVE/_TEST secrets based on NODE_ENV or ENVIRONMENT; isolate credentials at provisioning time instead.
  • Fail-fast validation guidance: Treat missing or sensitive configuration as boot-time errors rather than sentinel-defaults that silently point at live systems.
  • Review checklist for env-aware code: Evaluate env-var naming, NODE_ENV branching, build-time vs runtime bundling behavior, and scattered env reads.

Quick Start

Review a proposed environment-variable scheme by checking for suffixed variable names and runtime credential selection, then rewrite it to use canonical names loaded per environment.

Frequently Asked Questions about config-environments

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

FAQPage Schema
How do I avoid environment-suffixed variable names when configuring dev, staging, and production?

Use canonical environment variable names like DATABASE_URL across all environments, letting each environment's config source supply the correct value instead of relying on suffixed names like DATABASE_URL_DEV or DATABASE_URL_PROD.

Why does runtime credential branching on NODE_ENV cause deployment errors?

Runtime credential branching on NODE_ENV causes deployment errors because logic that picks *_DEV or *_PROD secrets can select wrong credentials or leak production-shaped state. Isolate credentials at provisioning time instead to prevent brittle deployments.

What is the best way to validate missing environment variables during application startup?

The best way to validate missing environment variables is to centralize environment reads at startup with fail-fast validation, treating missing or sensitive configuration as boot-time errors rather than sentinel-defaults that silently point at live systems.

How do I audit environment access patterns for scattered env reads and build-time env bundling?

Audit environment access patterns by reviewing env-var naming for suffixes, checking for NODE_ENV branching, evaluating build-time versus runtime bundling behavior, and identifying scattered env reads to ensure credentials are isolated per environment.

Should I use different environment variable names for each deployment environment?

Do not use different environment variable names for each deployment environment. Use canonical variable names loaded by the config source everywhere, which prevents configuration mistakes and ensures each environment supplies its correct value.

Can I use sentinel default values for sensitive configuration variables?

Do not use sentinel default values for sensitive configuration variables. Treating missing configuration as boot-time errors prevents sentinel-defaults from silently pointing at live production systems and avoids credential leaks.