mgiovani/ai-arsenal / skills/env-setup
env-setup
VerifiedScans a codebase for environment variable usage to generate or sync .env.example, validate .env completeness against what the code actually reads, and detect leaked secrets in .env or git history. Use for "/env-setup", "update .env.example", "sync .env.example with the codebase", "check if .env has everything it needs", "is .env in .gitignore", or "scan for leaked secrets in .env". Not a full security audit (use review-security for OWASP-level scanning) and not a generic secret-rotation or CI-secrets-injection tool.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.3 KB |
| evals/evals.json | config | 3.6 KB |
| evals/trigger-eval.json | config | 2.0 KB |
| references/env-example-template.md | markdown | 1.7 KB |
| references/scan-patterns.md | markdown | 2.3 KB |
references/scan-patterns.md
View on GitHub# Scan patterns and variable categories
## Per-language scan patterns
Every pattern uses `-o`, so a line's hardcoded default (e.g. `os.getenv("KEY", "sk_live_...")`) is never printed; keep `-o` on the first grep when adapting them. Run only the pattern(s) matching the project's detected stack (check for `package.json`, `requirements.txt`/`pyproject.toml`, `Gemfile`, `Cargo.toml`, `pom.xml`/`build.gradle`).
Node.js / TypeScript:
```bash
grep -rhoE "process\.env\.[A-Z_][A-Z0-9_]*" --include="*.ts" --include="*.js" --include="*.mjs" . \
| grep -oE "process\.env\.[A-Z_][A-Z0-9_]*" | sort -u
```
Python:
```bash
grep -rhoE 'os\.environ\[["'"'"'][A-Z_][A-Z0-9_]*|os\.getenv\(["'"'"'][A-Z_][A-Z0-9_]*' \
--include="*.py" . | grep -oE '[A-Z_][A-Z0-9_]*$' | sort -u
```
Ruby:
```bash
grep -rhoE 'ENV\[["'"'"'][A-Z_][A-Z0-9_]*["'"'"']\]' --include="*.rb" . \
| grep -oE 'ENV\["[^"]*"\]' | grep -oE '"[^"]+"' | tr -d '"' | sort -u
```
Rust:
```bash
grep -rhoE 'env::var\("[A-Z_][A-Z0-9_]*"\)' --include="*.rs" . \
| grep -oE '"[A-Z_][A-Z0-9_]*"' | tr -d '"' | sort -u
```
Java / Kotlin:
```bash
grep -rhoE 'System\.getenv\("[A-Z_][A-Z0-9_]*"\)' --include="*.java" --include="*.kt" . \
| grep -oE '"[A-Z_][A-Z0-9_]*"' | tr -d '"' | sort -u
```
Framework-specific prefixes (scan for these in config files):
- `NEXT_PUBLIC_*`: Next.js client-exposed variables
- `VITE_*`: Vite client-exposed variables
- `REACT_APP_*`: Create React App client-exposed variables
- `NUXT_PUBLIC_*`: Nuxt.js public variables
Docker Compose:
```bash
grep -rhoE "^\s+- [A-Z_][A-Z0-9_]*=" docker-compose.yml docker-compose.*.yml 2>/dev/null \
| grep -oE "[A-Z_][A-Z0-9_]*=" | tr -d "=" | sort -u
```
## Service prefix groups
Group discovered variables by prefix/service for reporting and for `.env.example` section headers:
```
Database: DATABASE_URL, DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD
Cache: REDIS_URL, REDIS_HOST, REDIS_PORT
Auth: JWT_SECRET, AUTH_SECRET, NEXTAUTH_SECRET, SESSION_SECRET
OAuth: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID
Stripe: STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET
AWS: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, S3_BUCKET
Email: SMTP_HOST, SMTP_PORT, SENDGRID_API_KEY, RESEND_API_KEY
App config: NODE_ENV, PORT, BASE_URL, APP_URL
Client vars: NEXT_PUBLIC_*, VITE_*, REACT_APP_*
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |