Environment Validator
Description
Validate environment configuration for completeness and security. Output to `.claude/audits/ENV_REPORT.md`.
Installation
claude install-skill https://github.com/undeadlist/claude-code-agents README
name: env-validator description: Environment configuration validator. Compares .env.example vs .env, checks for secrets. tools: Read, Grep, Glob, Bash model: inherit
Environment Validator
Validate environment configuration for completeness and security. Output to `.claude/audits/ENV_REPORT.md`.
Check
**Completeness**
- undefined
**Security**
- undefined
**Environment Consistency**
- undefined
**Format & Values**
- undefined
Commands
# Compare .env.example vs .env
comm -23 <(grep -oE "^[A-Z_]+=" .env.example | sort) <(grep -oE "^[A-Z_]+=" .env | sort) 2>/dev/null
# Find undocumented vars
comm -13 <(grep -oE "^[A-Z_]+=" .env.example | sort) <(grep -oE "^[A-Z_]+=" .env | sort) 2>/dev/null
# Check for secrets in code
grep -rn "API_KEY\|SECRET\|PASSWORD\|TOKEN" src --include="*.ts" --include="*.tsx" | grep -v "process.env"
# Find empty vars
grep -E "^[A-Z_]+=\s*$" .env 2>/dev/null
# Check for localhost in supposedly prod vars
grep -i "localhost\|127.0.0.1" .env 2>/dev/null
# Find hardcoded secrets
grep -rn "sk_live\|pk_live\|ghp_\|gho_\|Bearer " src --include="*.ts"
Output
# Environment Report
## Status: [VALID / INVALID]
| Check | Status | Details |
|-------|--------|---------|
| Completeness | PASS/FAIL | X missing vars |
| Security | PASS/FAIL | X exposed secrets |
| Format | PASS/WARN | X format issues |
## Missing Variables
Variables in `.env.example` but not in `.env`:
| Variable | Required | Description |
|----------|----------|-------------|
| `DATABASE_URL` | Yes | PostgreSQL connection string |
| `STRIPE_SECRET_KEY` | Yes | Stripe API key |
| `SENDGRID_API_KEY` | No | Email service (optional) |
**Action:** Add these to your `.env` file
## Security Issues
### ENV-001: Secret Exposed in Code
**Severity:** Critical
**File:** `src/lib/stripe.ts:5`
**Issue:** Hardcoded API key
```typescript
const stripe = new Stripe('sk_live_xxx...'); // EXPOSED
**Fix:** Use `process.env.STRIPE_SECRET_KEY`
ENV-002: Secret in Client Bundle
**Severity:** Critical **File:** `src/app/page.tsx:12` **Issue:** Server secret accessible to client
const apiKey = process.env.API_SECRET; // Not NEXT_PUBLIC_ but still exposed
**Fix:** Only access secrets in server components/API routes
ENV-003: .env Committed to Git
**Severity:** High **File:** `.env` **Issue:** Found .env in git history **Fix:**
- undefined
Related Agents
Accessibility Audit
| You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive tec... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Security community wcag-audit-patterns
| Comprehensive guide to auditing web content against WCAG 2.2 guidelines with actionable remediation... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Security community Deps Audit
| You are a dependency security expert specializing in vulnerability scanning, license compliance, and... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Security community Security Hardening
| Implement comprehensive security hardening with defense-in-depth strategy through coordinated multi-... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Security community Security Dependencies
| You are a security expert specializing in dependency vulnerability analysis, SBOM generation, and su... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Security community Security Sast
| Static Application Security Testing (SAST) for comprehensive code vulnerability detection across mul... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Security community Related Skills
Defense in Depth
Implement multi-layered testing and security best practices.
SecLists Official Repository
[OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/)
Threat Hunting with Sigma Rules
Use Sigma detection rules to hunt for threats and analyze security events