claude-code-framework/essential/skills/emergency/env-validator/SKILL.md
Validates .env files for missing variables, incorrect formats, exposed secrets, and configuration errors. Use when user says "check my .env", "environment variables missing", "config error", or mentions problems with environment setup.
npx skillsauth add tokenized2027/claude-initilization-v7 env-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Checks .env files for common issues and security problems.
Common required variables for Next.js:
NEXT_PUBLIC_API_URL=
DATABASE_URL=
API_KEY=
Common required variables for Flask:
FLASK_APP=
DATABASE_URL=
SECRET_KEY=
How to check:
# List all env vars
cat .env.local
# Check for specific var
grep "DATABASE_URL" .env.local
Security scan:
# Check for common secret patterns
grep -E "(password|secret|key|token)" .env.local
# Verify .env.local is in .gitignore
cat .gitignore | grep .env.local
If exposed:
# Remove from git history
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch .env.local" \
--prune-empty --tag-name-filter cat -- --all
# Rotate all secrets immediately
URL format:
# Database URL
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
# API URL (must start with http:// or https://)
NEXT_PUBLIC_API_URL=http://localhost:3000
Boolean format:
# Use lowercase true/false
DEBUG=true
# Not: DEBUG=True or DEBUG=1
Common issue:
# Bad - has trailing space
API_KEY=abc123
# Good
API_KEY=abc123
Fix:
# Remove trailing spaces
sed -i 's/[[:space:]]*$//' .env.local
Check ports:
# Ports should be 1-65535
PORT=3000 # Valid
PORT=70000 # Invalid (too high)
Check:
# Verify file exists
ls -la .env.local
# Check file is readable
cat .env.local
# Restart dev server
npm run dev
Next.js:
# Browser-accessible vars need NEXT_PUBLIC_ prefix
NEXT_PUBLIC_API_URL=http://localhost:3000 # ✅ Works in browser
API_SECRET=abc123 # ✅ Server-side only
Next.js uses:
.env.local (local development, ignored by git).env.development (development defaults).env.production (production defaults).env (all environments)Check you're editing the right one:
ls -la .env*
#!/bin/bash
# Save as: scripts/validate-env.sh
echo "🔍 Validating .env.local..."
# Check file exists
if [ ! -f .env.local ]; then
echo "❌ .env.local not found"
exit 1
fi
# Check for exposed secrets
if grep -q "SECRET_KEY=" .env.local; then
echo "✅ SECRET_KEY present"
else
echo "⚠️ SECRET_KEY missing"
fi
# Check for trailing spaces
if grep -q "[[:space:]]$" .env.local; then
echo "⚠️ Trailing spaces detected"
fi
# Check .gitignore
if grep -q ".env.local" .gitignore; then
echo "✅ .env.local in .gitignore"
else
echo "❌ .env.local NOT in .gitignore - ADD IT NOW"
fi
echo "✅ Validation complete"
✅ Use for: Checking .env files, finding missing vars, security scans ❌ Don't use for: Production secrets management, complex config architecture
development
Methodical debugging using reproducible steps, instrumentation, and root-cause analysis. Use when something is broken and you don't know why. Triggers on "bug", "broken", "not working", "error", "fails intermittently", "regression", "unexpected behavior".
development
Optimize prompts for Claude Code agents, API calls, and multi-agent orchestration. Use when writing system prompts, agent instructions, or refining LLM interactions. Triggers on "improve prompt", "write a prompt", "agent instructions", "system prompt", "prompt not working", "LLM output quality".
tools
Structured ideation and design review before any creative or constructive work. Use before building features, components, architecture, dashboards, or automation workflows. Triggers on "plan this", "design this", "brainstorm", "think through", "what should we build", "how should I approach".
testing
Generates test files for components and functions with setup, basic tests, and mocks. Use when user says "add tests", "create test", "test this component", or mentions testing.