env-config
Skill0 starsChanged 3 days agoMITView on GitHub
Environment configuration for Node.js backends - typed validation of process.env with zod at startup (fail fast, no default secrets, coerced numbers and booleans), one config module, .env hygiene (.gitignore, node --env-file, production secrets from the platform) and a checker that compares .env.example with what the code actually reads (process.env.X, destructuring, import.meta.env, configService.get, zod/envalid schema keys, Prisma env()). It reports undocumented and unused variables, real-looking secrets in .env.example, hard-coded secret fallbacks, required variables missing from .env, .env files not git-ignored and missing validation - never printing values. Use when the user adds or audits config, sees "undefined" config at runtime, onboards a developer, writes .env.example, or asks how to manage environment variables and secrets in Node.js.
- Reads credentials
5 other projects use a version of this.
Adopted by
Most recently taken up by
- AnyOrgName/php-skillstheir own version, first seen Nov 8, 2026
- mrhlaingbwardev/agentic-hacking-skillstheir own version, first seen Nov 8, 2026
- jars-demo/jars-skillstheir own version, first seen Oct 25, 2026
- roborracle/agent-workflow-kittheir own version, first seen Aug 11, 2026
- AutumnsGrove/ClaudeSkillstheir own version, first seen Oct 26, 2025
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- mrhlaingbwardev/agentic-hacking-skills★ 347same name
- AutumnsGrove/ClaudeSkills★ 30same name
- AnyOrgName/php-skills★ 4same name
- jars-demo/jars-skills★ 0same name
- roborracle/agent-workflow-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 repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-performanceSkill
- background-jobsSkill
- error-handling-patternsSkill
- logging-and-tracingSkill
- node-deploySkill
- node-security-reviewSkill
- package-json-auditSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
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 13
Every variable the code reads is documented, validated once at startup and typed.
- Distinctive: line 52
Fix drift: Add undocumented variables to the example (empty = required, value = local default, comment with the format).
- Distinctive: line 59
Verify: run the checker again (expect no medium+), start the app with a variable removed and confirm it exits with a clear message naming …
“Common” is measured: kept by at least 6 in 10 of the 5 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
Environment config
Every variable the code reads is documented, validated once at startup and typed; secrets never have defaults and never live in git.
Paths below are relative to this skill's folder (in Claude Code: ${CLAUDE_SKILL_DIR}).
When to use
- "Check my .env.example", "which env vars does this app need?"
- Config is
undefinedin production, a deploy fails because a variable is missing - Adding zod/envalid validation, centralising
process.envaccess - Onboarding: generating a complete
.env.example
When not to use
- Secrets hard-coded in source (not env):
node-security-review(secret.hardcoded) - Docker/systemd/PM2 environment wiring:
node-deploy - Front-end-only env (Vite/Next public vars) beyond the basics
Workflow
- Find the files. Example file (
.env.example,.env.sample), local.env,.gitignore, any existing config module (src/config*,env.ts). - Inventory what the code reads.
python3 scripts/env_check.py . --list - Compare (read-only; values are never printed).
Exit 1 = findings at or abovepython3 scripts/env_check.py . # uses ./.env.example and ./.gitignore python3 scripts/env_check.py src --example .env.example --gitignore .gitignore python3 scripts/env_check.py . --env .env --json # also check the local .env python3 scripts/env_check.py . --allow RENDER_GIT_COMMIT # platform-provided variable--fail-on(defaultmedium). - Handle urgent findings first.
env.file_not_ignored/env.example_secret: fix.gitignorenow. If the file was ever committed or pushed (git log --all -- .env), tell the user to rotate every secret in it. Do not print or copy the values.env.default_secret: remove the fallback; required secrets fail at startup.
- Fix drift. Add undocumented variables to the example (empty = required, value = local default, comment with the format); delete or explain unused ones.
- Centralise and validate (show the diff first): adapt assets/env.ts,
import it as early as possible (
src/server.tsfirst line or via the config module), replaceprocess.env.Xreads withenv.X. Use assets/.env.example as the layout template. Rules and alternatives (envalid, NestJS ConfigModule,@fastify/env,node --env-file) in references/env-hygiene.md. - Verify: run the checker again (expect no medium+), start the app with a variable removed and confirm it exits with a clear message naming the variable.
Output
env check: api - 1 high, 4 medium, 2 low
HIGH .env is not git-ignored -> added '.env*' + '!.env.example'; was it ever committed? (git log --all -- .env)
MED JWT_SECRET falls back to a literal in src/auth.ts:3 -> required in env.ts (min 32 chars)
MED undocumented: SMTP_HOST, FEATURE_1..5 -> added to .env.example (diff below)
LOW unused: OLD_FEATURE_FLAG -> removed
LOW no validation -> src/config/env.ts added; 14 process.env reads replaced
Startup with DATABASE_URL unset:
Invalid environment configuration:
DATABASE_URL: RequiredDoes 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.

