← ClaudeAtlas

env-drift-checklisted

Compare the environment variables your code actually reads against what is declared and what is set where it deploys, catching the missing key that only fails in production and the silent fallback that hides it. Use before a deploy, when onboarding to a repo, after adding a config value, or when something works locally and not in production.
sriptcollector/toolbay-skills-claude-code-skill-pack · ★ 0 · Code & Development · score 72
Install: claude install-skill sriptcollector/toolbay-skills-claude-code-skill-pack
# Env Drift Check ## Install Save this file as `~/.claude/skills/env-drift-check/SKILL.md`, or `.claude/skills/env-drift-check/SKILL.md` to scope it to one repo. Claude Code auto-discovers it. Invoke with `/env-drift-check` or by asking "am I missing any environment variables in production?". ## Why this exists "Works locally, breaks in production" is usually one missing environment variable, and it is usually found by a customer. Three things make it hard to see. `.env.example` drifts the moment someone adds a key without updating it. A variable read in one obscure file looks the same as one read everywhere. And worst, a `?? "default"` turns a missing key into wrong behaviour instead of a crash, so nothing errors and the feature is just quietly off: emails do not send, payments run against a test key, the rate limiter falls back to per-process and stops limiting. The last category is the dangerous one. A crash gets fixed in ten minutes. A silent fallback runs for a month. ## Step 1 — Find every variable the code actually reads The source of truth is the code, not the example file. ``` rg -o "process\.env\.([A-Z_][A-Z0-9_]*)" -r '$1' --no-filename | sort -u rg -o "process\.env\[['\"]([^'\"]+)['\"]\]" -r '$1' --no-filename | sort -u rg -o "(?:os\.environ(?:\.get)?[\[(]|getenv\()['\"]([A-Z_][A-Z0-9_]*)" -r '$1' --no-filename | sort -u rg -o "(?:Deno\.env\.get|import\.meta\.env)\.?\(?['\"]?([A-Z_][A-Z0-9_]*)" -r '$1' --no-filename | sort -u ``` Union them. This set is