/cc-arsenal:env-setup [scan|validate|sync] [--check-secrets]from cc-arsenal
Scans a codebase for environment variable usage to generate or sync .env.example, validate .env completeness, and detect leaked secrets in .env or git history.
Ships in cc-arsenal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Scan the codebase for environment variable usage, generate or update .env.example, validate .env completeness, and detect leaked secrets.
Only report variables that are actually found in the code:
.env.example before writing: preserve existing entries, only add/update what changed..env.example must only contain placeholder values (e.g., your_api_key_here)..gitignore: actually read the file before claiming .env is ignored.file:line only. Never print, quote, or write the actual value into chat output, a report file, or anywhere else: the scan's job is to locate leaks, not to create a second one.Grep for environment variable usage matching the project's actual language/framework: see references/scan-patterns.md for the ready-to-run pattern per language (Node/TS, Python, Ruby, Rust, Java/Kotlin, Docker Compose, client-exposed prefixes). Only run the pattern(s) for stacks present in the repo.
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: see the service prefix table in
references/scan-patterns.md for the standard groupings (Database, Cache, Auth, OAuth,
Stripe, AWS, Email, App config, Client vars).
Classify each variable:
NEXT_PUBLIC_*, VITE_*; flag if it 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:
# =============================================================================
# Database
# =============================================================================
DATABASE_URL=postgresql://user:password@localhost:5432/app_development
JWT_SECRET=your_jwt_secret_here # openssl rand -hex 32
Full section-header style and rules (preserve existing entries, only add what's missing,
never a real value), see references/env-example-template.md, load it when writing the
actual file.
validate subcommand or .env exists)Read .env by key name only, never with Read or cat (they print values): grep -nE '^(export )?[A-Za-z_][A-Za-z0-9_]*=' .env | cut -d= -f1, and grep -nE '=\s*$' .env | cut -d= -f1 for empty values. 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 .gitignore.grep -E "^\.env" .gitignore 2>/dev/null
Warn clearly if .env is NOT in .gitignore.
--check-secrets)Scan .env, git history and source for secrets. Every command below emits only variable names and file:line, never a value. Do not swap in a plain grep (or Read) that prints matching lines.
Requires gitleaks (brew install gitleaks); if command -v gitleaks finds nothing, skip to the grep checks.
gitleaks detect --source=. --redact --no-banner -v
Grep checks, which also work without gitleaks:
# Secret-looking assignments in .env: line:NAME
grep -inE "(password|secret|api_key|private_key|token|auth_key)[A-Za-z0-9_]*\s*=\s*['\"]?[A-Za-z0-9+/_.=-]{16,}" .env 2>/dev/null | cut -d= -f1
# Known key formats hardcoded in files: file:line
grep -rnIE "(AKIA[0-9A-Z]{16}|sk_live_[A-Za-z0-9]+|xox[abp]-[A-Za-z0-9-]+|gh[pousr]_[A-Za-z0-9]{36})" . --exclude-dir=.git --exclude-dir=node_modules 2>/dev/null | cut -d: -f1,2
# Commits that added .env to history
git log --all --full-history --diff-filter=A --format=%h -- .env 2>/dev/null
# Secret-looking names that appeared in .env history
git log --all --full-history -p --format= -- .env 2>/dev/null | grep -iE "^\+.*(password|secret|key)\s*=" | cut -d= -f1 | sort -u
The character class includes _, -, . alongside base64's +/=: most real key formats
(sk_live_..., xoxb-..., AKIA...) contain underscores or hyphens, and a base64-only class
silently misses them.
Report each hit as a commit + file:line reference plus the variable name (e.g. .env:12 STRIPE_SECRET_KEY),
never paste the matched value itself into the report.
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=. --redact --no-banner -vscan (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| Note | Detail |
|---|---|
| Never include real secrets | .env.example holds only placeholder values |
| Never echo a found secret's value | report variable name + file:line only, whether the finding goes to chat or a report file |
| Client-exposed vars | NEXT_PUBLIC_*, VITE_* are bundled into the frontend; flag if their name suggests a secret |
.env must be gitignored | verify and warn if not |
| Historical leaks matter | even if .env is gitignored now, it may have been committed in the past |
| Stale variables | unused entries in .env can be security risks; document and remove them |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mgiovani/ai-arsenal --plugin cc-arsenalOther plugins' skills for the same job
52 skills in this plugin
/agent-browserHeadless browser automation CLI optimized for AI agents: drives a real browser via accessibility-tree snapshots and @e1-style refs for ~93% less context than raw DOM tools. Use whenever a task needs to interact with a live web page: click, fill forms, log in, extract text or data, take screenshots, test a running web app, or scrape a site. Triggers on 'automate the browser', 'fill this form', 'click the button', 'take a screenshot of the page', 'log into', 'scrape this site', 'test my web app', 'headless browser'. Not for Playwright test-suite authoring or CDP/service-worker work needing the full JS API: use Playwright directly. Not for driving the user's own already-open, logged-in Chrome tab: use claude-in-chrome for that./anything-to-skillTurns a docs site, local folder, PDF or book, YouTube video, playlist or channel, or a topic into a source-grounded, token-efficient agent skill (hub SKILL.md, sectioned references, INDEX, evals), and can compact it into a lean expert skill. Use for "make a skill from these docs", "turn this channel into a skill". Not for a skill from your own description (use create-skill), improving one (use improve-skill) or finding third-party skills (use find-skills)./ci-generateGenerate a production-ready CI/CD pipeline config (GitHub Actions, GitLab CI, CircleCI, or Jenkins) by discovering the project's actual stack, test/build commands, and dependencies. Use when setting up CI for a new project, adding a missing workflow file, or asked to create/generate a pipeline, workflow, or `.gitlab-ci.yml`/`Jenkinsfile`. Not for writing a Dockerfile itself (see docker-init), this only wires CI stages around one. Not for running existing CI checks locally (use ci-local), this skill only authors the pipeline file itself.