env-drift
Skill0 starsChanged 5 months agoMITView on GitHub
Find environment-variable drift between code, .env files, .env.example, and platform config (vercel.json / netlify.toml). Use whenever a deploy fails with undefined env vars, the user mentions 'missing environment variable', 'works locally but env is undefined in prod', sets up a new deploy environment, onboards a teammate, or before any first deploy of a project. Runs fully offline — no API keys, no network, no credentials.
- Reads credentials
In this repository9 other files it gives its agents.
- bundle-weightSkill
- ci-workflow-doctorSkill
- cors-auditorSkill
- deploy-log-doctorSkill
- dns-cutoverSkill
- lockfile-doctorSkill
- migration-reversibilitySkill
- rollback-readinessSkill
- secret-preflightSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
After running: fix MISSING by adding the vars to the platform dashboard AND .env.example, and remind the user that platform env changes …
- Distinctive: line 28
All paths below are relative to this skill's directory (env-drift/).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
env-drift
Part of shipsafe — offline deploy-safety skills. Every script is stdlib-only Python 3.8+; nothing leaves the machine.
python3 scripts/env_drift.py <project_root> [--json]Reports four classes:
- MISSING — read in code, documented nowhere; a fresh deploy WILL fail on these. Highest priority.
- UNDOCUMENTED — in local .env but not .env.example; the deploy platform and teammates can't reproduce the environment.
- UNUSED — declared but never read; dead config or a typo'd name (a typo shows up as one UNUSED + one MISSING pair — point this out when you see it).
- CLIENT_LEAK — secret-named vars with NEXT_PUBLIC_/VITE_/etc. prefixes. These are bundled into public JavaScript. Treat as critical; the secret must be rotated and moved server-side.
- HARDCODED_URL —
http://localhost:*baked into code (test files exempt). Works in dev, dead in production; the fix is an env var or relative path. - SERVER_ENV_IN_CLIENT — non-public
process.env.Xread inside a'use client'component. In the browser it'sundefined(silent breakage), and renaming it to NEXT_PUBLIC_* is only acceptable when it is genuinely not a secret.
Detects references in JS/TS (process.env, import.meta.env), Python (os.environ, os.getenv), and Deno. Runtime-provided vars (NODE_ENV, VERCEL_URL...) are excluded automatically.
After running: fix MISSING by adding the vars to the platform dashboard AND .env.example, and remind the user that platform env changes require a redeploy to take effect.
Exit codes: 0 clean, 1 findings.
All paths below are relative to this skill's directory (env-drift/).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

