ワンクリックで
env-setup
Scan codebase for environment variables, generate .env.example, validate .env completeness, and detect leaked secrets.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scan codebase for environment variables, generate .env.example, validate .env completeness, and detect leaked secrets.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Headless browser automation CLI optimized for AI agents. Uses snapshot + refs system for 93% less context overhead vs Playwright. Purpose-built for web testing, form automation, screenshots, and data extraction.
Manage a gitflow branching workflow — starting and finishing feature, release, and hotfix branches; cutting versioned releases with changelog generation; coordinating emergency hotfixes directly to production; and keeping long-lived branches in sync. Activates when users mention gitflow, feature/release/hotfix branches, cutting a release, branching strategy, promoting an integration branch to production, tagging a version, or rolling back a live release. Also reaches for it when the user says "ship it", "promote dev to main", or "we need to hotfix prod" without naming gitflow. Skip for general git mechanics (commit messages, merge conflicts, interactive rebase, git education) or CI-failure debugging unrelated to a release.
Fixes a bug through test-driven debugging — reproduces it with a failing test, locates the root cause with evidence (file:line), then applies the smallest fix that resolves it without refactoring unrelated code. Use when the user wants to fix a bug, debug an issue, resolve an error, or investigate a failing test. Not for building new functionality (use implement-feature) or restructuring working code with no bug involved (use refactor).
Implements a new feature end-to-end as a senior staff engineer would — discovers project conventions, researches current best practices, drafts a plan for approval, then builds it with parallel subagents that reuse existing code, skip speculative abstractions, and verify with tests before completion. Use when the user wants to implement, build, add, or ship new functionality (a feature, endpoint, component, module, or integration) — not for fixing an existing bug (use fix-bug) or restructuring code that already works (use refactor).
Restructures existing code without changing its behavior — maps callers and test coverage, adds characterization tests where coverage is thin, then applies the change in small steps verified against the full test suite after each one. Use when the user wants to refactor, extract a method or class, simplify logic, reduce duplication, improve naming, restructure modules, or pay down technical debt in code that already works. Not for adding new functionality (use implement-feature) or fixing broken behavior (use fix-bug).
Runs a comprehensive multi-agent code review of a PR, commit, or the whole codebase across six dimensions (correctness, performance, code style, test coverage, error handling, and simplicity/over-engineering) and returns a severity-ranked report with file:line findings and fix suggestions. Use when the user wants a thorough code review, asks to review a PR or diff, or wants over-engineered code flagged for simplification. Analysis only, identifying issues without modifying code, committing, or running tests. Not for a security-focused audit (use review-security) or a visual/UX design critique (use review-design).
| name | env-setup |
| description | Scan codebase for environment variables, generate .env.example, validate .env completeness, and detect leaked secrets. |
| metadata | {"author":"mgiovani","version":"1.0.0","source":"https://github.com/mgiovani/skills"} |
| disable-model-invocation | true |
| argument-hint | [scan|validate|sync] [--check-secrets] |
| allowed-tools | ["Read","Write","Edit","Grep","Glob","Bash(git *)","AskUserQuestion"] |
Cross-Platform AI Agent Skill This skill works with any AI agent platform that supports the skills.sh standard.
Scan the codebase for environment variable usage, generate or update .env.example, validate .env completeness, and detect leaked secrets.
CRITICAL: Only report variables that are actually found in the code:
.env.example must only contain placeholder values (e.g., your_api_key_here).env is ignoredGrep for environment variable patterns per language/framework:
Node.js / TypeScript:
grep -rE "process\.env\.([A-Z_][A-Z0-9_]*)" --include="*.ts" --include="*.js" --include="*.mjs" -h . \
| grep -oE "process\.env\.[A-Z_][A-Z0-9_]*" | sort -u
Python:
grep -rE 'os\.environ\[["'"'"']([A-Z_][A-Z0-9_]*)["'"'"']\]|os\.getenv\(["'"'"']([A-Z_][A-Z0-9_]*)["'"'"']' \
--include="*.py" -h . | grep -oE '[A-Z_][A-Z0-9_]+' | sort -u
Ruby:
grep -rE 'ENV\[["'"'"']([A-Z_][A-Z0-9_]*)["'"'"']\]' --include="*.rb" -h . \
| grep -oE 'ENV\["[^"]*"\]' | grep -oE '"[^"]+"' | tr -d '"' | sort -u
Rust:
grep -rE 'env::var\("([A-Z_][A-Z0-9_]*)"\)' --include="*.rs" -h . \
| grep -oE '"[A-Z_][A-Z0-9_]*"' | tr -d '"' | sort -u
Java / Kotlin:
grep -rE 'System\.getenv\("([A-Z_][A-Z0-9_]*)"\)' --include="*.java" --include="*.kt" -h . \
| grep -oE '"[A-Z_][A-Z0-9_]*"' | tr -d '"' | sort -u
Framework-specific prefixes (scan for these in config files):
NEXT_PUBLIC_* — Next.js client-exposed variablesVITE_* — Vite client-exposed variablesREACT_APP_* — Create React App client-exposed variablesNUXT_PUBLIC_* — Nuxt.js public variablesDocker Compose:
grep -rE "^\s+- [A-Z_][A-Z0-9_]*=" docker-compose.yml docker-compose.*.yml 2>/dev/null \
| grep -oE "[A-Z_][A-Z0-9_]*=" | tr -d "=" | sort -u
Also scan:
.env.example (existing entries to preserve)config/ directory for config files referencing env varsnext.config.js, vite.config.ts, etc.)Group discovered variables by prefix/service:
Database: DATABASE_URL, DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD
Cache: REDIS_URL, REDIS_HOST, REDIS_PORT
Auth: JWT_SECRET, AUTH_SECRET, NEXTAUTH_SECRET, SESSION_SECRET
OAuth: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID
Stripe: STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET
AWS: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, S3_BUCKET
Email: SMTP_HOST, SMTP_PORT, SENDGRID_API_KEY, RESEND_API_KEY
App config: NODE_ENV, PORT, BASE_URL, APP_URL
Client vars: NEXT_PUBLIC_*, VITE_*, REACT_APP_*
Classify each variable:
NEXT_PUBLIC_*, VITE_* — flag if contains secrets)Read existing .env.example (if it exists):
# Variables in code but NOT in .env.example (missing)
# Variables in .env.example but NOT in code (undocumented/stale)
# Variables in both (up to date)
Report:
.env.example).env.example but no longer used)For scan or sync operations:
Generate .env.example with:
Example output format:
# =============================================================================
# Database
# =============================================================================
DATABASE_URL=postgresql://user:password@localhost:5432/app_development
DB_HOST=localhost
DB_PORT=5432
# =============================================================================
# Authentication
# =============================================================================
# Generate with: openssl rand -hex 32
JWT_SECRET=your_jwt_secret_here
NEXTAUTH_SECRET=your_nextauth_secret_here
# =============================================================================
# Stripe (https://dashboard.stripe.com/apikeys)
# =============================================================================
STRIPE_SECRET_KEY=sk_test_your_key_here
STRIPE_PUBLISHABLE_KEY=pk_test_your_key_here
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
# =============================================================================
# App Config
# =============================================================================
NODE_ENV=development
PORT=3000
BASE_URL=http://localhost:3000
Rules:
.env — only placeholders.env.examplevalidate subcommand or .env exists)Read .env and check:
VAR= with no value is suspicious for required vars.env but not found in codebase scan.gitignore check: Verify .env (and .env.local) are in .gitignoregrep -E "^\.env" .gitignore 2>/dev/null
Warn clearly if .env is NOT in .gitignore.
--check-secrets)Scan .env for high-entropy strings and known secret patterns:
# Check for common secret patterns
grep -iE "(password|secret|api_key|private_key|token|auth_key)\s*=\s*['\"]?[a-zA-Z0-9+/]{20,}" .env 2>/dev/null
Check git history for leaked secrets:
git log --all --full-history --diff-filter=A -p -- .env 2>/dev/null | grep -iE "(password|secret|key)\s*=" | head -20
Flag client-exposed secrets:
NEXT_PUBLIC_*, VITE_*, REACT_APP_* variablesRecommend pre-commit tools:
detect-secrets (Python): pip install detect-secrets && detect-secrets scan > .secrets.baselinegitleaks: gitleaks detect --source=.scan (default): Scan codebase, generate/update .env.examplevalidate: Validate .env against discovered variablessync: Sync .env.example to match current codebase (add missing, mark stale)--check-secrets: Enable secret detection in .env and git history.env.example — only placeholder valuesNEXT_PUBLIC_*, VITE_*) are bundled into the frontend — never put secrets there.env must be gitignored — always verify and warn if not.env is gitignored now, it may have been committed in the past.env can be security risks — document and remove unused ones# Scan codebase and generate .env.example
/env-setup
# Scan with explicit subcommand
/env-setup scan
# Validate existing .env completeness
/env-setup validate
# Sync .env.example with current codebase
/env-setup sync
# Full scan + secret detection
/env-setup scan --check-secrets