env-drift-checklisted
Install: claude install-skill sriptcollector/toolbay-skills
# 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