← ClaudeAtlas

padosoft-environment-gatinglisted

Use this skill whenever a branch behaves differently depending on the environment — debug output, error detail, a profiler or diagnostic endpoint, a permissive security header, a seed, an auth mock, a provider in test mode, a destructive command guard, a feature flag keyed on the deployment. Also when the user reports that a development behaviour appeared on the live site, that stack traces or query dumps are visible to users, that a staging box behaves like a laptop, or that an environment check did not match. It replaces the two-valued check with the three answers that actually exist, and picks the default from what the branch does. Do not use it for CI workflow configuration, for secret management, or for choosing a deployment topology.
padosoft/skills · ★ 1 · AI & Automation · score 80
Install: claude install-skill padosoft/skills
# Environment gating An environment check is a **string comparison with a value somebody typed into a file**. It is exact, it is unvalidated, and when it does not match, nothing goes wrong — the development branch simply lights up on the live site, doing exactly what it was asked to do. **The rule: the answers are three, not two — and the branch decides which default is safe.** --- ## 1. Why the two-valued check fails ```text APP_ENV = "Production" → is_production("production") false APP_ENV = "production " → false (a trailing space, invisible in the file) APP_ENV = "prod" → false APP_ENV = "prod-eu-1" → false APP_ENV = "produzione" → false ``` Every one of those is a live deployment answering *no, I am not production*. Downstream: error pages with credentials in them, a profiler recording session cookies, diagnostic endpoints open, orders sent to a provider in test mode. No exception, no alert — the code did what it was told. The real incidence is not one call site. It is **dozens**, spread over the codebase, all written the same way by people copying the line above. ## 2. The three answers "I am in production" and "I am not in production" are **not** each other's negation, because there is a third case: **the name is unknown** — a typo, a new deployment nobody added to the list. Treating it as either of the first two is the whole defect. So: two separate questions, each answering *yes* only when it is certain. | Predica