env-manager
БесплатноБез исполняемых скриптовНе проверенManage environment variables and secrets across development, staging, and production environments. Use when someone needs to audit env vars, sync secrets…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Environment Manager
Overview
This skill helps manage environment variables and secrets across multiple environments (development, staging, production). It detects missing variables, identifies mismatches, audits for exposed secrets, and helps safely rotate credentials without downtime.
Instructions
Auditing Environment Variables
Find all env var references in code. Match both dot access and bracket access, and both
process.envandprocess.env["NAME"]:grep -rhoE "process\.env(\.[A-Za-z_][A-Za-z0-9_]*|\[[\"'][A-Za-z_][A-Za-z0-9_]*[\"']\])" src/ \ --include="*.ts" --include="*.js" | grep -oE "[A-Za-z_][A-Za-z0-9_]*" | grep -vE "^(process|env)$" | sort -uFor Python, which covers
os.environ["X"],os.environ.get("X")andos.getenv("X"):grep -rhoE "os\.(environ(\.get)?|getenv)[\[(][\"'][A-Z_][A-Z0-9_]*[\"']" src/ --include="*.py" | \ grep -oE "[A-Z][A-Z0-9_]*" | sort -uBoth commands miss names built at runtime (
process.env[key]); check those by reading the code.Compare against what's defined:
# From .env.example or .env grep -v '^#' .env.example | grep '=' | cut -d'=' -f1 | sort -uReport:
- Variables referenced in code but missing from
.env.example→ ⚠️ undocumented - Variables in
.env.examplebut never referenced in code → ℹ️ possibly stale - Variables with no default and no validation → 🔴 app will crash if missing
- Variables referenced in code but missing from
Comparing Environments
Get variable lists from each environment:
- Local: Parse
.envor.env.local - CI/CD: Check platform config (GitHub Actions secrets, GitLab CI variables)
- Hosting: Check platform env vars (Vercel, Railway, Heroku config)
- Secrets manager: Query Doppler, AWS SSM, or Vault
- Local: Parse
Build a comparison matrix:
Variable | dev | staging | prod | Notes DATABASE_URL | ✓ | ✓ | ✓ | Different per env ✓ STRIPE_SECRET_KEY | ✓ | ✓ | ✗ | ⚠️ Missing in prod! REDIS_URL | ✗ | ✓ | ✓ | ℹ️ Not needed locally NEXT_PUBLIC_API_URL | ✓ | ✓ | ✓ | Verify values differFlag issues:
- Variable present in staging but missing in production → likely deployment bug
- Same secret value across dev and prod → security risk
- Public-prefixed variables with secret values → will be exposed to client
Secret Rotation
- Identify the secret to rotate (API key, database password, JWT secret)
- Check where it's used:
grep -rn "THE_VAR_NAME" . --include="*.ts" --include="*.js" --include="*.yml" --include="*.yaml" --include="Dockerfile" - Generate rotation plan:
- For API keys: Create new key → update all environments → verify → revoke old key
- For database passwords: Update password → update connection strings → restart services
- For JWT secrets: Implement dual-key validation → deploy → set new primary → remove old
- Verify no hardcoded values exist (should all reference env vars)
Setting Up a New Environment
- Start from
.env.exampleas the template - Categorize each variable:
- Shared config (feature flags, API URLs) → copy and adjust for the new env
- Secrets (API keys, passwords) → generate new ones, never copy from another env
- Infrastructure (database URLs, Redis URLs) → get from the new env's infra
- Validate the new environment against the list of required variables. Node 20.6+ loads a file with
--env-fileand needs no dependency:
Run this in CI before the deploy step. A schema validator such as envalid or zod gives the same check inside the app at startup.node --env-file=.env -e " const required = ['DATABASE_URL', 'STRIPE_SECRET_KEY', 'APP_BASE_URL']; const missing = required.filter(k => !process.env[k]); if (missing.length) { console.error('missing: ' + missing.join(', ')); process.exit(1); } console.log('all ' + required.length + ' required variables are set'); "
Examples
Example 1: Audit for Missing Variables
User prompt:
We keep getting "undefined" errors in staging. Can you audit our env vars?
Agent output:
Scanned src/ for environment variable references. Found 34 unique variables.
🔴 Missing from .env.example (undocumented):
OPENAI_API_KEY — referenced in src/lib/ai.ts:12
WEBHOOK_SECRET — referenced in src/api/webhooks.ts:8
RATE_LIMIT_MAX — referenced in src/middleware/rateLimit.ts:3
⚠️ Referenced but no validation/default:
SMTP_HOST — used in src/lib/email.ts:5, crashes if undefined
CACHE_TTL — used in src/lib/cache.ts:2, parseInt(undefined) = NaN
ℹ️ In .env.example but never referenced in code:
LEGACY_API_URL — possibly from a removed feature
DEBUG_MODE — no references found
Recommendation: Add the 3 undocumented vars to .env.example, add default
values for SMTP_H
Установить env-manager в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл env-manager?
Manage environment variables and secrets across development, staging, and production environments. Use when someone needs to audit env vars, sync secrets between environments, detect missing or mismatched variables, rotate credentials, or set up a new environment from an existing one. Trigger words: env vars, environment variables, secrets, .env file, dotenv, config management, secret rotation, missing variable, environment sync.
Как установить скилл env-manager?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл env-manager запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic