agentleFS
trac3r00trac3r00/agent-skills/skills/env-gate/SKILL.md

env-gate

Skill0 starsChanged 3 months agoMITView on GitHub

Prevents production crashes from environment variable drift. Compares a deployed .env against .env.example to find missing required keys, present-but-empty required keys, undeclared extra keys, and placeholder values left in the deployed file. Use before every deploy, in CI, or when onboarding a new environment — the #1 backend incident shape is "new key in the example never made it to prod".

  • Reads credentials

The file

Files
SKILL.md

Env Gate

The most common backend incident is boring: a new key lands in .env.example, the deploy goes out without it, and the crash surfaces in production logs. This gate runs in CI or pre-deploy and fails the build first.

Commands

python3 scripts/env_gate.py .env --example .env.example
python3 scripts/env_gate.py .env.production --example .env.example --json
python3 scripts/env_gate.py .env --example .env.example \
    --required-prefix DATABASE --required-prefix REDIS
python3 scripts/env_gate.py .env.local --example .env.example --ignore-extra

Semantics

ConditionMeaningExit
missingkey declared in example, absent in deployed1
empty_requiredkey present in deployed but with no value1
placeholderdeployed value still <change-me>-style1
extradeployed key the example no longer declares1 (suppress with --ignore-extra)
cleanall checks pass0
  • --required-prefix (repeatable): scope missing/empty checks to keys starting with the prefix (e.g. only DATABASE_* must be complete; optional debug keys may drift).
  • Placeholder values (<your-key>, ${VAR}, changeme, xxx) in the deployed file are flagged — a deployed placeholder is worse than a missing key because it fails silently at runtime.

Pairs with

secret-gate — env-gate asks "is the config complete?", secret-gate asks "did a credential leak into the wrong place?". Run both pre-deploy.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.