Environment Variable Setup Guide
Set up environment variables properly across development, staging, and production
Set up environment variable management for my [FRAMEWORK] project.
**Services I use:** [LIST — e.g., "PostgreSQL, Stripe, SendGrid, AWS S3, OpenAI"]
**Deployment:** [WHERE — e.g., "Vercel", "AWS", "Railway"]
Generate:
1. **.env.example** — every variable with a description comment and dummy value
2. **Validation schema** — runtime validation that fails fast on missing vars (use zod)
3. **Type-safe access** — a typed env config object (not raw process.env everywhere)
4. **.gitignore rules** — ensure no secrets leak
5. **Setup guide** — step-by-step for a new developer to get all keys
```typescript
// Example of what I want:
import { env } from '@/lib/env';
env.DATABASE_URL // string (validated at startup)
env.STRIPE_SECRET // string (validated at startup)
```
For each variable:
- Name, description, where to get it
- Is it required or optional?
- Different values per environment (dev/staging/prod)?
- Client-safe (NEXT_PUBLIC_) or server-only?
Include a warning system that logs which optional vars are missing at startup without crashing.How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More DevOps Prompts
Related devops templates from the vault
Kubernetes Pod Autoscaling Config
Use this prompt to kubernetes pod autoscaling config with AI assistance
GitOps Disaster Recovery Playbook
PROCreate a complete disaster recovery playbook for a GitOps-managed infrastructure with RTO and RPO targets
Terraform Infrastructure Module
Use this prompt to terraform infrastructure module with AI assistance
Observability Stack Setup
Set up comprehensive observability with logging, metrics, and tracing
You Might Also Like
Prompts from other categories that share similar tags
Hardcoded Values to Configuration
Use this prompt to hardcoded values to configuration with AI assistance
Secure Environment Variable Management
Use this prompt to secure environment variable management with AI assistance
Environment Variable Missing Debugger
Use this prompt to environment variable missing debugger with AI assistance
Security Audit Checklist Generator
Generate a security audit checklist tailored to your specific tech stack
Keep Exploring the Vault