Get the FREE Ultimate OpenClaw Setup Guide →

ln-733-env-configurator

Scanned
npx machina-cli add skill levnikolaevich/claude-code-skills/ln-733-env-configurator --openclaw
Files (1)
SKILL.md
5.3 KB

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

ln-733-env-configurator

Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-730-devops-setup

Configures environment variables for development and production environments.


Purpose & Scope

Creates environment configuration files:

  • Does: Generate .env files, update .gitignore for secrets protection
  • Does NOT: Store secrets, manage external secrets managers, configure CI/CD secrets

Inputs

InputSourceDescription
Project NameDirectory nameUsed for database/service naming
Backend PortStack-dependent5000 (.NET), 8000 (Python)
Frontend PortDefault3000
Database PortDefault5432
Detected VarsCode analysisEnvironment variables found in code

Outputs

FilePurposeTemplate
.env.exampleDocumented templateenv_example.template
.env.developmentLocal development defaultsenv_development.template
.env.productionProduction placeholdersenv_production.template
.gitignore (append)Secrets protectiongitignore_secrets.template

Workflow

Phase 1: Environment Discovery

Scan project for existing environment usage:

  • Check for existing .env files
  • Search code for process.env, os.environ, Configuration[]
  • Identify which variables are secrets vs configuration

Output: List of required environment variables with types

Phase 2: Variable Classification

Classify discovered variables:

CategoryExamplesTreatment
DatabaseDATABASE_URL, POSTGRES_*Auto-generate with project name
API ConfigAPI_PORT, LOG_LEVELUse detected or defaults
SecurityJWT_SECRET, API_KEYPlaceholder with warning
ExternalREDIS_URL, SMTP_*Comment out as optional

Phase 3: Template Generation

Generate environment files from templates:

  1. Apply variable substitution
  2. Include all discovered variables
  3. Add comments for undocumented variables

Phase 4: Gitignore Update

Append secrets protection to .gitignore:

  1. Read existing .gitignore (if exists)
  2. Check if secrets patterns already present
  3. Append missing patterns from template
  4. Preserve existing entries

Generated File Structure

.env.example

Documented template with all variables:

  • Section headers (Database, Backend, Frontend, Security, External)
  • Descriptive comments for each variable
  • Safe placeholder values (never real secrets)
  • Optional variables commented out

.env.development

Ready-to-use development configuration:

  • Pre-filled values that work with docker-compose
  • Development-only secrets (clearly marked)
  • Debug-level logging enabled

.env.production

Production placeholder file:

  • ${VARIABLE} syntax for deployment substitution
  • Comments indicating required secrets
  • Production-appropriate defaults (Warning log level)

Security Best Practices

PracticeImplementation
No real secretsPlaceholder values only in templates
Gitignore protectionAll .env files except .env.example
Development warningsMark dev secrets as insecure
Production guidanceComments about secrets manager usage
Key rotation reminderNote about regular secret rotation

Security Notes

Generated files include these security reminders:

  1. Never commit real secrets - .gitignore prevents accidental commits
  2. Use secrets manager - GitHub Secrets, AWS Secrets Manager for production
  3. Rotate secrets regularly - Especially JWT secrets
  4. Strong JWT secrets - Minimum 256 bits (32 bytes)
  5. Restrict CORS - Only allow necessary origins in production

Quality Criteria

Generated files must:

  • .env.example contains all required variables
  • No real secrets or passwords in any file
  • .gitignore updated with secrets patterns
  • .env.development works with docker-compose
  • .env.production uses placeholder syntax

Critical Notes

  1. Template-based: Use templates from references/. Do NOT hardcode file contents.
  2. Idempotent: Check file existence. Append to .gitignore, don't overwrite.
  3. No Real Secrets: Never generate files with actual passwords or API keys.
  4. Development Safety: Development defaults should work out-of-box with docker-compose.

Reference Files

FilePurpose
env_example.templateDocumented .env template
env_development.templateDevelopment defaults
env_production.templateProduction placeholders
gitignore_secrets.template.gitignore additions

Version: 1.1.0 Last Updated: 2026-01-10

Source

git clone https://github.com/levnikolaevich/claude-code-skills/blob/master/ln-733-env-configurator/SKILL.mdView on GitHub

Overview

ln-733-env-configurator automates environment setup for development and production. It scans the codebase for env usage, classifies variables into Database, API Config, Security, and External categories, and generates .env templates. It also updates .gitignore to protect secrets and explicitly does not store secrets or manage external secret managers.

How This Skill Works

The tool discovers environment usage across the project, then generates template files and applies variable substitutions for discovered vars. It produces .env.example, .env.development, and .env.production, and appends secret patterns to .gitignore using a dedicated template. It does not retrieve or store actual secrets, keeping them out of the repo.

When to Use It

  • Bootstrapping a new project and wiring up standard environment templates for development and production.
  • Adding environment variable discovery to an existing repo to surface required vars.
  • Preparing production-ready placeholders and gitignore rules before deployment.
  • Enforcing secrets protection by updating or creating a .gitignore with standard patterns.
  • Synchronizing env config across a multi-service or monorepo to ensure consistency.

Quick Start

  1. Step 1: Run the skill from the repo root to begin discovery.
  2. Step 2: Review the generated .env.example and .env.* files; adjust placeholders if needed.
  3. Step 3: Commit the changes and push to your repo; ensure secrets remain protected in .gitignore.

Best Practices

  • Never store real secrets in templates; use placeholders.
  • Verify .gitignore updates actually cover all env files.
  • Review undocumented variables and add clear comments in templates.
  • Keep default values aligned with your docker-compose or deployment environment.
  • Rotate secrets regularly and document where to configure them in your prod setup.

Example Use Cases

  • Node/Express API with React frontend using .env.* files and a shared/ config.
  • Python Flask app with DATABASE_URL and API keys surfaced from code.
  • .NET Core microservices relying on DATABASE_URL, API_PORT, and JWT_SECRET placeholders.
  • Monorepo with multiple services sharing env vars via a central .env.* strategy.
  • Docker Compose-based deployment using env templates for development and production.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers