skills/env-detection/SKILL.md
Detect required environment variables from source code, config files, and .env examples. Use when preparing for deployment, checking for missing env vars, or when the user asks about required environment configuration.
npx skillsauth add nixopus/agent env-detectionInstall 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.
Identify all environment variables an application needs before deployment. Missing env vars are the most common cause of deployment failures.
.env.example / .env.sample / .env.templatePrimary source. Read the file and extract every variable name and any inline comments describing its purpose.
DATABASE_URL=postgresql://user:pass@localhost:5432/db
REDIS_URL=redis://localhost:6379
API_KEY=your-api-key-here
SECRET_KEY=change-me
Use grep across the repo root for these patterns:
| Pattern | Language |
|---------|----------|
| process.env.VAR_NAME | Node.js |
| Deno.env.get("VAR_NAME") | Deno |
| os.environ["VAR_NAME"] or os.getenv("VAR_NAME") | Python |
| os.Getenv("VAR_NAME") | Go |
| ENV["VAR_NAME"] or ENV.fetch("VAR_NAME") | Ruby |
| env::var("VAR_NAME") | Rust |
| System.getenv("VAR_NAME") | Java |
| @Value("${VAR_NAME}") | Spring |
| File | What to look for |
|------|-----------------|
| next.config.js / next.config.mjs | env: block, NEXT_PUBLIC_* prefixed vars |
| nuxt.config.ts | runtimeConfig block |
| vite.config.ts | define block, VITE_* prefixed vars |
| docker-compose.yml | environment: sections |
| Dockerfile | ENV and ARG directives |
| settings.py (Django) | os.environ calls |
| config/*.yml (Rails) | <%= ENV["VAR"] %> patterns |
Check dependency manifests for services that typically require connection URLs:
| Dependency | Expected env var |
|-----------|-----------------|
| pg / sequelize / prisma / typeorm | DATABASE_URL |
| mongoose / mongodb | MONGODB_URI |
| ioredis / redis | REDIS_URL |
| @aws-sdk/* | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION |
| stripe | STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET |
| @sendgrid/mail | SENDGRID_API_KEY |
| nodemailer | SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS |
| @auth0/* / next-auth | AUTH_SECRET, AUTH_URL, provider-specific keys |
Classify each detected variable:
| Category | Examples | Required for deploy? |
|----------|---------|---------------------|
| Infrastructure | DATABASE_URL, REDIS_URL, PORT | Yes |
| Secrets | API_KEY, SECRET_KEY, JWT_SECRET | Yes |
| Service URLs | NEXT_PUBLIC_API_URL, WEBHOOK_URL | Yes (but values differ per environment) |
| Build-time | NEXT_PUBLIC_*, VITE_* | Yes (must be set during build) |
| Optional/Debug | LOG_LEVEL, DEBUG, NODE_ENV | No (has sensible defaults) |
This distinction matters for Dockerfiles:
ARG in Dockerfile, passed via --build-arg or args: in compose. Includes NEXT_PUBLIC_*, VITE_*, and any var used during npm run build.ENV in Dockerfile or environment: in compose. Includes DATABASE_URL, PORT, API keys.After detection, report:
.env.example, source code, framework config)PORT=3000, NODE_ENV=production)ARG directivespre-deploy-checklist — Uses env detection results to validate deployment readinessdockerfile-generation — Build-time env vars identified here need ARG directives in the Dockerfiletools
Compressed catalog of all Nixopus API operations for the nixopus_api() tool
development
Deploy static file sites — Caddy/nginx serving, Staticfile config, and Dockerfile patterns. Use when deploying a static HTML site with no server-side runtime, or when index.html or a Staticfile is detected at the project root.
devops
Deploy shell script applications — interpreter detection, setup scripts, and Dockerfile patterns. Use when deploying a shell script project, or when start.sh is detected.
development
Self-healing loop for failed deployments — diagnose, fix, redeploy up to 3 attempts, then escalate or rollback. Load when a deployment fails or build errors occur.