CClaude Code Catalog
All Skills

Env Variable Safety Check

DocumentationBeginner

Compares environment variables referenced in code against .env files to find missing, unused, and security-risk variables. Also auto-generates a .env.example file.

Trigger/env-check
FrequencyPre-deploy

Lead dev onboarding a new team member? Run /env-check to auto-generate .env.example and cut onboarding time

Production deploy owner? Quickly verify no required environment variables are missing before deploy

Environment VariablesSecurity.envConfiguration

How It Works

Run /env-check -> scan codebase
Phase 1: 3 checks in parallel
ref-scan
Scan code references
env-read
Read .env files
secret-detect
Detect security risks
Cross-reference + generate .env.example
Env variable audit report + .env.example

Skill Code

# Environment Variable Checker Skill ## Trigger: /env-check When invoked: 1. Scan codebase for env references: - process.env.* (Node.js) - os.environ.get() (Python) - env() (PHP/Laravel) 2. Read existing .env files: - .env, .env.local, .env.production - Compare against code references 3. Security check: - Values that look like real secrets in .env.example - .env in .gitignore? - Hardcoded secrets in code? 4. Output format: --- ## 🔐 Environment Variable Report ### Missing (referenced but not in .env) | Variable | Used In | Required | |----------|---------|----------| | [VAR] | `file:line` | ✅ Yes | ### Unused (in .env but not referenced) | Variable | Recommendation | |----------|---------------| | [VAR] | Safe to remove | ### Security Warnings - ⚠️ [issue description] ### Generated .env.example ``` # Database DATABASE_URL=postgresql://user:pass@localhost:5432/db # Auth JWT_SECRET=your-secret-here ``` ---

Copy and paste into your CLAUDE.md to start using immediately.

How Env Variable Safety Check Works

Env Checker scans your codebase for environment variable references, cross-checks them against your .env files and .env.example, detects missing variables, unused definitions, and potential security issues like committed secrets.

When to Use Env Variable Safety Check

Critical before deployments when environment mismatches cause cryptic runtime errors — it catches the 'works on my machine' problems caused by missing or misconfigured environment variables across environments.

Key Strengths

  • Detects missing environment variables before deployment
  • Identifies unused .env entries that add confusion
  • Warns about potential security issues with exposed secrets
  • Cross-references all .env files for consistency

Popular in Other Categories