Skip to content
env-file-generator logo

Environment File Generator

env-file-generator

Generate properly structured .env environment files with common variables, documentation comments, and secure placeholder patterns. Triggers on "create .env file", "generate environment variables", "env file for", "dotenv template".

SKILL.md

Full skill instructions

Environment File Generator

Generate properly structured .env files with documented variables, secure placeholders, and environment-specific configurations.

Output Requirements

File Output: .env, .env.example, .env.local, .env.production Naming Convention: .env.{environment} for specific environments Format: KEY=value pairs, one per line

When Invoked

Immediately generate a complete .env.example file (safe to commit) with placeholder values and documentation. Note which values need real secrets.

Env File Syntax Rules

Basic Format

# Comment explaining the variable
VARIABLE_NAME=value

Conventions

  • SCREAMING_SNAKE_CASE for variable names
  • No spaces around =
  • Quote values with spaces: APP_NAME="My Application"
  • No quotes needed for simple values: PORT=3000
  • Comments with # at start of line
  • Group related variables with blank lines and section headers

Value Types

# Strings (quote if contains spaces or special chars)
APP_NAME="My App Name"
SIMPLE_STRING=myvalue

# Numbers (no quotes needed)
PORT=3000
TIMEOUT=30

# Booleans (lowercase strings)
DEBUG=true
ENABLE_FEATURE=false

# URLs (quote recommended)
DATABASE_URL="postgresql://user:pass@localhost:5432/​db"
API_ENDPOINT="https://api.example.com/​v1"

# Secrets (use placeholder in .env.example)
API_KEY=your_api_key_here
SECRET_KEY=generate_a_secure_key_here

Standard Templates

Web Application (Node.js/​React)

# ===========================================
# Application Configuration
# ===========================================

# Application
NODE_ENV=development
APP_NAME="My Application"
APP_URL=http://localhost:3000
PORT=3000

# Debug & Logging
DEBUG=true
LOG_LEVEL=debug

# ===========================================
# Database Configuration
# ===========================================

# PostgreSQL
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/​myapp_dev"
DB_HOST=localhost
DB_PORT=5432
DB_NAME=myapp_dev
DB_USER=postgres
DB_PASSWORD=postgres

# Connection Pool
DB_POOL_MIN=2
DB_POOL_MAX=10

# ===========================================
# Redis / Cache
# ===========================================

REDIS_URL="redis://localhost:6379"
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=

CACHE_TTL=3600

# ===========================================
# Authentication
# ===========================================

# JWT
JWT_SECRET=your_jwt_secret_here_min_32_chars
JWT_EXPIRES_IN=7d
JWT_REFRESH_EXPIRES_IN=30d

# Session
SESSION_SECRET=your_session_secret_here

# ===========================================
# External Services
# ===========================================

# AWS
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
AWS_S3_BUCKET=my-app-bucket

# Email (SMTP)
SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=587
SMTP_USER=your_smtp_user
SMTP_PASSWORD=your_smtp_password
EMAIL_FROM="[email protected]"

# ===========================================
# Third-Party APIs
# ===========================================

# Stripe
STRIPE_PUBLIC_KEY=pk_test_xxxxxxxxxxxx
STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxx
STRIPE_WEBHOOK_SECRET=whsec_xxxxxxxxxxxx

# OAuth Providers
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

# ===========================================
# Feature Flags
# ===========================================

FEATURE_NEW_UI=false
FEATURE_BETA_FEATURES=false

Python/​Django Application

# ===========================================
# Django Configuration
# ===========================================

# Core Settings
SECRET_KEY=your-secret-key-here-make-it-long
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1

# Application
DJANGO_SETTINGS_MODULE=config.settings.development
WSGI_APPLICATION=config.wsgi.application

# ===========================================
# Database
# ===========================================

DATABASE_URL="postgres://postgres:postgres@localhost:5432/​django_dev"

# Or individual settings
DB_ENGINE=django.db.backends.postgresql
DB_NAME=django_dev
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432

# ===========================================
# Cache & Sessions
# ===========================================

REDIS_URL="redis://localhost:6379/​0"
CACHE_BACKEND=django.core.cache.backends.redis.RedisCache

SESSION_ENGINE=django.contrib.sessions.backends.cache

# ===========================================
# Email
# ===========================================

EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.mailtrap.io
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your_username
EMAIL_HOST_PASSWORD=your_password
DEFAULT_FROM_EMAIL="[email protected]"

# ===========================================
# Static & Media Files
# ===========================================

STATIC_URL=/​static/
MEDIA_URL=/​media/

# AWS S3 (for production)
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_STORAGE_BUCKET_NAME=my-bucket
AWS_S3_REGION_NAME=us-east-1

# ===========================================
# Security
# ===========================================

CORS_ALLOWED_ORIGINS="http://localhost:3000,http://127.0.0.1:3000"
CSRF_TRUSTED_ORIGINS="http://localhost:3000"

# ===========================================
# Celery
# ===========================================

CELERY_BROKER_URL="redis://localhost:6379/​1"
CELERY_RESULT_BACKEND="redis://localhost:6379/​2"

Docker / Microservices

# ===========================================
# Container Configuration
# ===========================================

# Docker
COMPOSE_PROJECT_NAME=myproject
DOCKER_BUILDKIT=1

# Registry
REGISTRY_URL=ghcr.io
IMAGE_TAG=latest

# ===========================================
# Service Ports
# ===========================================

API_PORT=8080
WEB_PORT=3000
DB_PORT=5432
REDIS_PORT=6379
RABBITMQ_PORT=5672
RABBITMQ_MANAGEMENT_PORT=15672

# ===========================================
# Service Configuration
# ===========================================

# API Service
API_HOST=0.0.0.0
API_WORKERS=4
API_TIMEOUT=30

# Database
POSTGRES_DB=appdb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres_password_here

# Redis
REDIS_PASSWORD=

# RabbitMQ
RABBITMQ_DEFAULT_USER=rabbit
RABBITMQ_DEFAULT_PASS=rabbit_password_here

# ===========================================
# Observability
# ===========================================

# Logging
LOG_LEVEL=info
LOG_FORMAT=json

# Metrics
PROMETHEUS_PORT=9090
GRAFANA_PORT=3001

# Tracing
JAEGER_AGENT_HOST=jaeger
JAEGER_AGENT_PORT=6831

Security Guidelines

In .env.example (safe to commit)

# Use placeholder values that are clearly not real
API_KEY=your_api_key_here
SECRET_KEY=replace_with_secure_random_string
DATABASE_PASSWORD=change_this_password

Never Commit

# Real secrets - add to .gitignore
.env
.env.local
.env.*.local

Secret Generation Notes

Include comments for generating secrets:

# Generate with: openssl rand -hex 32
JWT_SECRET=your_secret_here

# Generate with: python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
DJANGO_SECRET_KEY=your_secret_here

Validation Checklist

Before outputting, verify:

  • All variable names are SCREAMING_SNAKE_CASE
  • No real secrets in .env.example
  • Placeholder values are obvious (contain "your_", "_here", etc.)
  • Related variables are grouped with section headers
  • Comments explain non-obvious variables
  • URLs are properly quoted
  • Boolean values are lowercase strings

Example Invocations

Prompt: "Create .env.example for a Next.js app with Prisma and Stripe" Output: Complete .env.example with database, auth, and Stripe sections.

Prompt: "Generate env file for Django REST API" Output: Complete .env.example with Django-specific settings and security config.

Prompt: "Environment variables for docker-compose microservices setup" Output: Complete .env with service ports, database credentials, and container config.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View