gen-envlisted
Install: claude install-skill aiskillstore/marketplace
# gen-env Skill
Generate or review a `gen-env` command that enables running **multiple isolated instances** of a project on localhost simultaneously (e.g., multiple worktrees, feature branches, or versions).
## The Problem
Without isolation, multiple instances of the same project:
- Fight for hardcoded ports (3000, 5432, 8080)
- Share Docker volumes → data corruption
- Share browser cookies/localStorage → auth confusion
- Have ambiguous container names → can't tell which is which
- Risk catastrophic cleanup → `docker down -v` nukes everything
## The Solution: Instance Identity
Everything flows from a **workspace name**:
```
name = "feature-x"
↓
┌─────────────────────────────────────────────────────┐
│ COMPOSE_PROJECT_NAME = localnet-feature-x │
│ DOCKER_NETWORK = localnet-feature-x │
│ VOLUME_PREFIX = localnet-feature-x │
│ CONTAINER_PREFIX = localnet-feature-x- │
│ TILT_HOST = feature-x.localhost │
│ Ports = dynamically allocated │
│ URLs = derived from host + ports │
└─────────────────────────────────────────────────────┘
```
## Isolation Dimensions
### 1. Port Isolation
Each instance gets unique ports from ephemeral range (49152-65535).
### 2. Data Isolation
Docker Compose project name controls volume naming:
- Instance A: `localnet-main_postgres_data`
- Instance B: `localnet-feature-x_postgres_data`
No cross-contamination. Independent dat