env-doctor
Skill1 starsChanged 6 days agoMITView on GitHub
Check a project's environment variables against its code — variables the code reads that .env.example doesn't document, stale keys nothing reads, keys unset in .env/.env.local (undefined at runtime), secrets exposed to the browser through VITE_/NEXT_PUBLIC_/REACT_APP_-style prefixes, real-looking keys inside .env.example, and .env files committed to git or missing from .gitignore. Never prints values. Use for "works on my machine" bugs, onboarding a repo, before open-sourcing or deploying, or when a variable is undefined.
- Reads credentials
9 other projects use a version of this.
Adopted by
Most recently taken up by
- adithyanraj03/dsh-skills-packtheir own version, first seen Nov 15, 2026
- linxule/carreltheir own version, first seen Nov 8, 2026
- venhdev/skillstheir own version, first seen Nov 1, 2026
- sharklandy/claude-code-starter-kittheir own version, first seen Oct 20, 2026
- unreadlogs/node-agent-skillstheir own version, first seen Oct 13, 2026
- abigayleh/claude-workflow-plugintheir own version, first seen Sep 27, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- taxueseek/session-digger★ 34same name
- tellmefrankie/ai-investment-skills★ 14same name
- unreadlogs/node-agent-skills★ 4same name
- linxule/carrel★ 2same name
- venhdev/skills★ 1same name
- abigayleh/claude-workflow-plugin★ 0same name
- adithyanraj03/dsh-skills-pack★ 0same name
- angelgabrieljacintohuayllasco/clipboard-skills★ 0same name
- sharklandy/claude-code-starter-kit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- bash-checkpointSkill
- brave-cdpSkill
- cf-backupSkill
- cf-pages-deploySkill
- claude-md-doctorSkill
- claude-safety-auditSkill
- claude-sandboxSkill
- claude-token-auditSkill
- cws-extension-checkSkill
- event-recap-videoSkill
- freelance-proposalSkill
- gif-makerSkill
- itch-html5-packageSkill
- link-preview-checkSkill
- mcp-auditSkill
- package-guardSkill
- pwa-checkSkill
- read-guardSkill
- readme-upgradeSkill
- release-notesSkill
- secret-commit-guardSkill
- session-handoffSkill
- site-qaSkill
- thumbnail-makerSkill
- visual-diffSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
After --fix-example, give each new key a placeholder and a one-line comment saying where to get it.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
env-doctor
scripts/env-doctor.mjs is zero-dependency Node 22+ and read-only unless --fix-example.
node env-doctor.mjs [project-dir]
node env-doctor.mjs . --fix-example # append missing keys (empty) to .env.example, backup keptIt finds variable reads in JS/TS (process.env.X, process.env["X"], destructuring, import.meta.env.X, Deno.env.get, Bun.env), Python (os.environ[...], .get, os.getenv), Ruby, Go, PHP, Rust, and ${X} in shell scripts, Dockerfiles and docker-compose. In Cloudflare Workers projects (a wrangler.toml/json/jsonc or .dev.vars) it also reads env.X and treats .dev.vars as the local env file, ignoring names the wrangler config declares as bindings or [vars]. It skips node_modules, build output and virtualenvs, and ignores standard runtime variables (NODE_ENV, PORT, HOME, CI…).
| Severity | Finding |
| high | a secret-named variable with a browser-exposed prefix (VITE_SUPABASE_SERVICE_ROLE_KEY, NEXT_PUBLIC_STRIPE_SECRET): it ships in the JS bundle. Publishable/anon/site keys are allowed |
| high | a real-looking key or credentialed URL in .env.example (localhost/user:pass placeholders are fine) |
| high | .env / .env.local committed to git, or present in git history |
| medium | variables used in code but missing from .env.example, or no example file at all |
| medium | variables used in code but not set in any local env file; an env file not in .gitignore |
| low | example keys no code reads (or that only a framework config reads); keys set but empty |
Acting on it
- Browser-exposed secret: move the call server-side (API route, edge function), drop the public prefix, and rotate the key, because it's already in every shipped bundle.
- Committed
.env:git rm --cached .env, add it to.gitignore, rotate everything in it. History keeps the old values. - After
--fix-example, give each new key a placeholder and a one-line comment saying where to get it.
Limits
Static scan: dynamic names (process.env[name]) and variables read only by tools or framework config files (e.g. DATABASE_URL read by Prisma's schema) aren't seen, which is why "stale" is only low severity. Hosted env (Vercel/Cloudflare dashboards) isn't checked.
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.

