Manage environment variables for project configuration
Scans codebase to detect environment variables and generates secure .env files with placeholders.
/plugin marketplace add vanman2024/dev-lifecycle-marketplace/plugin install foundation@dev-lifecycle-marketplace<action> [key] [value]šØ EXECUTION NOTICE FOR CLAUDE
When you invoke this command via SlashCommand, the system returns THESE INSTRUCTIONS below.
YOU are the executor. This is NOT an autonomous subprocess.
Immediately after SlashCommand returns, start executing Phase 0, then Phase 1, etc.
See @CLAUDE.md section "SlashCommand Execution - YOU Are The Executor" for detailed explanation.
CRITICAL: All generated files must follow security rules:
@docs/security/SECURITY-RULES.md
Key requirements:
your_service_key_here.env files with .gitignore.env.example with placeholders onlyArguments: $ARGUMENTS
Goal: Scan codebase to detect ALL environment variables used, generate .env file, and manage environment configuration
Core Principles:
This command has access to foundation plugin skills:
To use a skill: !{skill skill-name}
Goal: Understand what the user wants to do
Actions:
Goal: Check requirements before execution
Actions:
Goal: Delegate complex logic to specialized agent
Actions:
Task(
description="Manage environment variables", subagent_type="foundation:env-vars-manager", prompt="You are the env-vars-manager agent.
**Action**: $ARGUMENTS
**Context**:
- Current directory: $(pwd)
- .env exists: yes/no
- Doppler status: installed/not-installed
**Instructions**:
For 'scan' action:
- Detect environment variables from ALL sources (priority order):
1. specs/*.md files (analyze service requirements)
2. package.json/requirements.txt dependencies (detect SDKs)
3. Code scans (search for process.env.*, os.getenv patterns)
- Merge and deduplicate results
- Display detection report WITHOUT creating files
- Show: services detected, required variables, detection sources
- Suggest: 'Run /foundation:env-vars generate to create files'
For 'generate' action:
- Use scan results to generate .env with placeholders
- Format with service sections and comments
- Create .env.example (same structure, safe to commit)
- Ensure .env in .gitignore
- Report: files created, variable count, services detected
For 'setup-multi-env' action:
- Ask for project name and environments (dev, staging, prod)
- Generate .env.{environment} files for each
- Include environment-specific placeholders
- Create Doppler project setup guide
- Report: files created for each environment
For 'add' action:
- Validate key format (UPPERCASE_SNAKE_CASE)
- Add/update variable in .env
- Never log the value
- Report: 'Added {key} to .env'
For 'remove' action:
- Remove variable from .env
- Report: 'Removed {key} from .env'
For 'list' action:
- Display all variables with masked values
- Show KEY=*** for sensitive keys
- Report count and file location
For 'check' action:
- Compare .env against codebase requirements
- Report missing variables (with usage locations)
- Report unused variables (cleanup candidates)
- Suggest fixes
For 'sync-from-doppler' action:
- Parse environment from arguments (default: dev)
- Download: doppler secrets download --config $ENV --no-file --format env > .env
- Report: variables synced, environment, backup location
For 'sync-to-doppler' action:
- Parse .env file
- Upload each variable: doppler secrets set KEY=value --config $ENV
- Report: variables uploaded, environment
**Deliverable**: Execution results with clear status messages
"
)
Goal: Report results and next steps
Actions: