greglas75/zuvo/env-audit
Claude Code and agent skill by greglas75/zuvo
- community
Checking that the SKILL.md file is still in the repository.
Environment variable and configuration audit. 8 dimensions (ENV1-ENV8): variable completeness, unused vars, startup validation, secret exposure, environment parity, type safety, default values, and documentation. Supports Node.js (.env/process.env), Python (os.environ/settings), and framework-specific patterns (Vite import.meta.env, Next.js NEXT_PUBLIC_). Switches: zuvo:env-audit full | [path] | --secrets-only | --parity
Install
npx vskill@latest install greglas75/zuvo/env-auditSKILL.md
The same SKILL.md was published earlier as greglas75/zuvo/env-audit.
zuvo:env-audit
Audit environment variable management for completeness, safety, and consistency across development, staging, and production environments. Single-pass execution.
When to use: After adding new env vars, before production deploy, when debugging config-related incidents, onboarding new environments, periodic check. When NOT to use: Secret scanning in source code (/security-audit), CI pipeline config (zuvo:ci-audit), infrastructure (/security-audit).
Mandatory File Loading
Read every file below before starting. Print the checklist.
If any file is MISSING, STOP. Do not proceed from memory.
Argument Parsing
| Token | Behavior | |
|---|---|---|
_(empty)_ or full | All 8 dimensions, scope = project root | |
[path] | Scope to a directory (monorepo package, module) | |
--secrets-only | ENV4 only -- focus on secret exposure | |
--parity | ENV5 only -- compare environment configurations |
Safety Gates
GATE 1 -- Read-Only
This audit is read-only. The only write target is zuvo/audits/.
FORBIDDEN:
- Modifying any
.env, config, or source file - Creating or deleting environment variables
- Accessing external secret managers (analyze config references only)
GATE 2 -- PII and Secret Censorship
When including env var values in the report:
- Replace actual values with
*** - Show only variable names, never values
- Exception:
.env.exampleplaceholder values can be shown as-is
MANDATORY TOOL CALLS — Env Audit Validity Gate
INVALID if any tool below is skipped. "DEFERRED", "N/A", "--secrets-only" NOT valid reasons.
| Tool | Trigger | Skip allowed? | |
|---|---|---|---|
scan_secrets | Always | NO — KEY: ENV4 secret exposure | |
search_text | Always | NO — process.env / os.environ / import.meta.env scan | |
search_patterns | Always | NO — ENV2/ENV3/ENV6 anti-patterns | |
find_references | Always | NO — ENV2 unused detection | |
audit_scan | Always | NO — compound check |
Forbidden: scan_secrets: skipped, codesift: unavailable (when deferred), retrospective: skipped — all REJECTED.
POSTAMBLE: report on disk → retro appended → ~/.zuvo/append-runlog exit 0. Every ENV finding needs path/to/file.ext:LINE (verify-audit gate).
Use the deterministic preload helper FIRST. Run ~/.zuvo/compute-preload env-audit "$PWD". Copy [CodeSift matching trace] verbatim, issue printed ToolSearch(query="select:..."). Math gate enforced.
Phase 0: Detect and Scope
0.1 Target Resolution
Set TARGET_ROOT from arguments. All subsequent commands use this path.
0.2 Stack Detection
Detect which env access patterns to search for:
| Signal | Stack | Access Pattern | |
|---|---|---|---|
package.json | Node.js | process.env.VAR, process.env['VAR'] | |
vite.config.* | Vite | import.meta.env.VITE_VAR | |
next.config.* | Next.js | process.env.NEXT_PUBLIC_VAR (client-safe) | |
requirements.txt, pyproject.toml | Python | os.environ['VAR'], os.getenv('VAR'), os.environ.get('VAR') | |
wrangler.toml | Cloudflare Workers | env.VAR (binding) | |
docker-compose.* | Docker Compose | environment: / env_file: directives |
0.3 Variable Name Extraction
Build a comprehensive inventory by scanning code for all env access patterns detected in 0.2. Collect unique variable names (not values).
0.4 Inventory
Cross-reference all sources:
- Variables defined in
.env*files (names only) - Variables accessed in code (from extraction)
- Variables in Docker Compose, CI config, or cloud deployment files
Print:
Phase 1: Dimension Analysis (ENV1-ENV8)
Single-pass inline execution. No sub-agents required.
ENV1: Variable Completeness -- Weight 15, Max 15, Critical Gate
Are all required env vars defined and documented?
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Code vs example coverage | All used vars listed in .env.example | Var used in code but missing from .env.example | CRITICAL | |
| Required vars guarded | Startup fails fast on missing required var | App starts, crashes later when var accessed | CRITICAL | |
| .env.example exists | Yes, with all vars and placeholder values | No .env.example at all | HIGH | |
| Stale vars | No vars in .env.example that are unused in code | Accumulated dead config | MEDIUM |
Detection approach: Compare the set of variables found in code against the set defined in .env.example. Report both directions: used-but-undocumented and documented-but-unused.
Critical gate: no .env.example OR multiple critical vars undocumented → triggers FAIL. The gate fires on that FINDING; an ENV1 score of 0 also fires it but is not required.
ENV2: Unused Variables -- Weight 5, Max 5
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Defined but never used | All defined vars referenced in code | Stale vars accumulate | MEDIUM | |
| Dead config sections | Removed features cleaned up | Config references removed features | LOW |
Detection approach: Check each var in .env.example against code access patterns. A var referenced only in comments or documentation counts as unused.
ENV3: Startup Validation -- Weight 15, Max 15, Critical Gate
Does the app fail fast on missing or invalid configuration?
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Schema validation | Zod/Joi/Pydantic/envalid validates all vars at startup | No validation, raw access everywhere | CRITICAL | |
| Fail-fast behavior | App throws before serving requests on missing var | Starts, breaks when var first accessed | CRITICAL | |
| Type coercion | Parsed and validated (parseInt, Number, schema) | Port used as string in numeric context | HIGH |
What to search for:
- Validation libraries:
z.object,Joi.object,BaseSettings,envalid,
envsafe, convict, cleanEnv, ConfigModule, @IsString
- Fail-fast patterns:
throwwith env/config message,process.exiton
missing env
- Raw usage:
process.env.VARwithout validation wrapper - NestJS:
ConfigModule.forRoot()withvalidationSchema
Critical gate: no validation anywhere → triggers FAIL. The gate fires on that FINDING; an ENV3 score of 0 also fires it but is not required.
ENV4: Secret Exposure -- Weight 15, Max 15, Critical Gate
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| .env in .gitignore | .env and .env.local listed in .gitignore | .env committed to repository | CRITICAL | |
| Client-side exposure | Only NEXT_PUBLIC_/VITE_ vars are non-sensitive | API keys in NEXT_PUBLIC_* variables | CRITICAL | |
| Hardcoded secrets | Secrets only in env vars or secret manager | API keys hardcoded in config files | CRITICAL | |
| Docker image leakage | .env listed in .dockerignore | .env copied into Docker image | HIGH | |
| Git history | No .env files in git history | Past .env commits (secrets may still be in history) | HIGH |
Detection approach:
- Check
.gitignorefor.envpatterns git ls-filesfor committed.envfiles- Search for
NEXT_PUBLIC_*KEY,NEXT_PUBLIC_*SECRET,VITE_*KEYetc. - Search for hardcoded secrets:
(api_key|secret|password|token)\s*[:=]\s*['"][^'"{}$]
excluding test/mock/example files
- Check
.dockerignorefor.env
Critical gate: secrets committed or API keys in client-side vars → triggers FAIL. The gate fires on that FINDING; an ENV4 score of 0 also fires it but is not required.
ENV5: Environment Parity -- Weight 10, Max 10
Are dev/staging/production environments consistent?
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Same var set across envs | All environments define the same variables | Prod has vars dev lacks | HIGH | |
| Docker Compose alignment | docker-compose env matches app config | Docker sets vars not in .env.example | MEDIUM | |
| Feature flag documentation | Feature flags documented per environment | Undocumented per-env behavior | MEDIUM |
Detection approach: Compare variable sets across all .env* files found at the target root. Check Docker Compose environment: sections against the .env.example inventory.
ENV6: Type Safety -- Weight 8, Max 8
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Central config module | Typed config with validated accessors | Raw process.env.X scattered across 50+ files | HIGH | |
| Boolean parsing | === 'true' or schema-parsed | if (process.env.FLAG) (any string is truthy) | HIGH | |
| Number parsing | parseInt with NaN check or schema | Port used as string | MEDIUM | |
| Access centralization | < 3 files access process.env directly | 20+ files with raw env access | MEDIUM |
Detection approach: Count per-file occurrences of raw env access. Search for boolean truthy gotchas (if (process.env.VAR)). Check for number conversion patterns.
ENV7: Default Values -- Weight 7, Max 7
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Dev-friendly defaults | PORT ?? 3000 for local development | App crashes without complete .env | MEDIUM | |
| No secret defaults | Secret vars always required, no fallback | JWT_SECRET ?? 'default-secret' | CRITICAL | |
| Documented defaults | .env.example shows which vars have defaults | Developer cannot tell required vs optional | LOW |
Detection approach:
- Search for
??and||operators after env access (Node.js) - Search for
os.getenv('VAR', 'default')patterns (Python) - Flag any default on SECRET/KEY/PASSWORD/TOKEN variables
ENV8: Documentation -- Weight 5, Max 5
| Check | Good | Bad | Severity | |
|---|---|---|---|---|
| Inline comments | Each var in .env.example has a comment explaining purpose | Bare variable names only | MEDIUM | |
| Required vs optional | Marked with # Required / # Optional (default: 3000) | No indication which vars are needed | MEDIUM | |
| Setup instructions | README covers env setup | New developer has to guess | LOW |
Phase 2: Scoring
Score = sum / 80 x 100
Critical gates — any ONE of these findings triggers FAIL, whatever the numeric score:
| Gate | Fires on | |
|---|---|---|
| ENV1 | no .env.example, OR multiple critical vars undocumented | |
| ENV3 | no startup validation anywhere | |
| ENV4 | any secret committed to the repo, OR an API key in a client-side (NEXT_PUBLIC_/VITE_) var, OR a hardcoded secret |
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/env-audit/SKILL.md
Popularity
- Repository stars
- 8
- 7-day trend score
- 11
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/greglas75/zuvo/env-audit)