Files
leo-claude-mktplace/plugins/ops-deploy-pipeline/skills/env-management.md
lmiranda 2d51df7a42 feat(marketplace): command consolidation + 8 new plugins (v8.1.0 → v9.0.0) [BREAKING]
Phase 1b: Rename all ~94 commands across 12 plugins to /<noun> <action>
sub-command pattern. Git-flow consolidated from 8→5 commands (commit
variants absorbed into --push/--merge/--sync flags). Dispatch files,
name: frontmatter, and cross-reference updates for all plugins.

Phase 2: Design documents for 8 new plugins in docs/designs/.

Phase 3: Scaffold 8 new plugins — saas-api-platform, saas-db-migrate,
saas-react-platform, saas-test-pilot, data-seed, ops-release-manager,
ops-deploy-pipeline, debug-mcp. Each with plugin.json, commands, agents,
skills, README, and claude-md-integration. Marketplace grows from 12→20.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 14:52:11 -05:00

2.3 KiB

Environment Management Skill

Patterns for managing environment variables across deployment stages.

File Naming Convention

File Purpose Git Tracked
.env.example Template with placeholder values Yes
.env Local development defaults No
.env.development Development-specific overrides No
.env.staging Staging environment values No
.env.production Production secrets and config No

.env.example Format

Document every variable with comments:

# Application Settings
APP_NAME=myapp
APP_PORT=8080
APP_DEBUG=false

# Database Configuration
# PostgreSQL connection string
DATABASE_URL=postgresql://user:password@db:5432/myapp
DATABASE_POOL_SIZE=5

# Redis Configuration
REDIS_URL=redis://redis:6379/0

# External Services
# Generate at: https://example.com/api-keys
API_KEY=your-api-key-here
API_SECRET=your-secret-here

Secret Handling Rules

  1. Never commit secrets to version control
  2. .env.production and .env.staging MUST be in .gitignore
  3. Use placeholder values in .env.example: your-api-key-here, changeme, <required>
  4. For shared team secrets, use a secrets manager or encrypted vault
  5. Document where to obtain each secret in comments

Docker Compose Integration

Single env_file

env_file:
  - .env

Multi-environment

env_file:
  - .env
  - .env.${DEPLOY_ENV:-development}

Variable Interpolation

Docker Compose supports ${VAR:-default} syntax:

services:
  app:
    image: myapp:${APP_VERSION:-latest}
    ports:
      - "${APP_PORT:-8080}:8080"

Environment Diff Checking

When comparing environments, check for:

  1. Missing variables - Present in .env.example but absent in target
  2. Extra variables - Present in target but not in .env.example (may be stale)
  3. Placeholder values - Production still has changeme or your-*-here
  4. Identical secrets - Same password used in dev and prod (security risk)

Validation Checklist

  • All docker-compose ${VAR} references have corresponding entries
  • No secrets in .env.example
  • .gitignore excludes .env.production and .env.staging
  • Production variables have real values (no placeholders)
  • Database URLs point to correct hosts per environment
  • Debug flags are false in production