env-audit
Skill1 starsChanged 8 months agoMITView on GitHub
Audit environment variables across all projects — detect missing secrets, compare code references against deployed config, and identify which env vars each context requires.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- greglas75/zuvotheir own version, first seen Oct 16, 2026
- latuconsinafr/claude-code-configtheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- greglas75/zuvo★ 7same name
- latuconsinafr/claude-code-config★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- algorithmic-artSkill
- audit-componentsSkill
- canvas-designSkill
- cascade-orchestrationSkill
- consultSkill
- data-reconciliationSkill
- debug-collaborateSkill
- deep-root-causeSkill
- deploy-allSkill
- design-reverse-engineerSkill
- design-showcaseSkill
- docxSkill
- evolveSkill
- frontend-designSkill
- full-stack-buildSkill
- full-stack-traceSkill
- gh-repo-reconSkill
- grill-meSkill
- handoffSkill
- html-slidesSkill
- insightSkill
- internal-commsSkill
- isolation-testSkill
- mcp-builderSkill
- model-selectionSkill
- pdfSkill
- persistent-issueSkill
- pre-merge-reviewSkill
- premise-auditSkill
- propagate-featureSkill
- regression-bisectSkill
- research-gateSkill
- review-implSkill
- schema-checkSkill
- session-notesSkill
- skill-auditSkill
- skill-creatorSkill
- slack-gif-creatorSkill
- start-daySkill
- temporal-forensicsSkill
- theme-factorySkill
- throwaway-scriptSkill
- triage-ideasSkill
- verify-completeSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- wisdomSkill
- worker-buildSkill
- worktree-guardSkill
- write-planSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
All agents are read-only (no code modifications), so isolation: "worktree" is not required.
- Very specific: line 103
If invoked with a specific project name (e.g., /env-audit project-a), only audit that one context instead of all projects.
- Distinctive: line 107
When using Cloudflare Access JWT verification, each Access Application has its own AUD (audience) value.
- Distinctive: line 109
Keep AUD values documented per-app:
- Very specific: line 117
Verify by inspecting the CF Access redirect URL — the kid= param in the redirect URL encodes the AUD.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Environment Variable Audit
Scan all projects for env var references, cross-reference against deployed secrets and config bindings, and report gaps.
Contexts
Your project may run across multiple environments:
| Context | Runtime | Env Var Source | Detection Pattern |
| Cloudflare Pages | V8 isolate | context.env.* (secrets + bindings) | functions/api/*.js accessing env.* |
| Cloudflare Workers | V8 isolate | env.* (secrets + wrangler vars) | workers/*/src/*.js accessing env.* |
| Node.js Backend | Node.js | process.env.* from .env | server/*.js accessing process.env |
| Local Scripts | Node.js | process.env.* | scripts/**/*.js accessing process.env |
Agent Teams Architecture
Phase 1 — Parallel Discovery (model: "opus"):
+-- Pages Scanner -----> grep projects' functions/ + wrangler pages secret list
+-- Workers Scanner ---> grep workers/ + wrangler secret list per worker + read wrangler.toml bindings
+-- Backend Scanner ---> grep backend/ for process.env + check .env var names
+-- Scripts Scanner ---> grep scripts/ for process.env
Phase 2 — Cross-Reference (main agent):
Compile agents' results -> matrix per project
Flag: MISSING, UNUSED, DEV-ONLY, PROD-ONLY
Phase 3 — Actionable Output (main agent):
Generate fix commands for each issue foundAll agents are read-only (no code modifications), so isolation: "worktree" is not required. Each agent uses model: "opus" for dispatch.
Step 1 — Discover code references (via parallel agents)
Dispatch agents simultaneously (model: "opus"), one per context:
Agent: Pages Scanner
Enumerate the Pages projects from the repo (git ls-files '*/functions/**' | cut -d/ -f1 | sort -u), never from a hardcoded list: hardcoded lists go stale and silently omit newer projects. Then grep each project's functions/ directory for env var access patterns and run wrangler pages secret list per Cloudflare project. A project that deploys to production only has no dev target; skip its dev call, or you will get an error or a false DEV-ONLY finding.
A functions/-only grep misses env reads in shared modules that those functions import. Resolve each project's relative import/require graph into the shared directory (transitively through re-exports) and grep those files too, or a reachable shared read is reported as absent.
# Grep for env var references
grep -rn "env\.\([A-Z_]\+\)" project-a/functions/ project-b/functions/ --include="*.js" -oh | sort -u
# List secrets for each project (names only, no values)
npx wrangler pages secret list --project-name=your-project-a-dev 2>&1
npx wrangler pages secret list --project-name=your-project-a 2>&1
# ... repeat for each projectAgent: Workers Scanner
Enumerate workers from the repo (git ls-files 'workers/*/wrangler.toml'), not a hardcoded list. Derive each worker's scan root from the main line in its wrangler.toml rather than assuming src/ (a root-level index.js otherwise scans as zero references), and glob both *.js and *.mjs. Run wrangler secret list from each worker directory, and read each wrangler.toml for [vars], KV, D1, R2, [ai], [[services]] and [[durable_objects.bindings]]. Missing service and Durable Object bindings makes bound dependencies look unbound.
Agent: Backend Scanner
Grep backend code for process.env references and check .env file var names. With dotenvx, values are encrypted but key names are plaintext, so grep -oE '^[A-Z][A-Z_0-9]*=' .env lists names without any decryption key; only reading a value needs one.
Agent: Scripts Scanner
Grep scripts for process.env references.
Step 2 — Cross-reference and report
Main agent compiles results into a matrix per project. Workers have no dev/prod split (one deployment), so give them a single Secret column instead of a Dev/Prod pair; the same goes for any production-only Pages project:
## Project A (dev / prod)
| Variable | Code References | Dev Secret | Prod Secret | Config |
|----------|----------------|------------|-------------|--------|
| API_TOKEN | handler.js:3 | ✅ | ✅ | — |
| NEW_VAR | newfile.js:10 | ❌ MISSING | ❌ MISSING | — |
| CACHE | handler.js:8 | — | — | ✅ binding |Flag these issues:
- ❌ MISSING: Code references a var that isn't in deployed secrets or bindings
- ⚠️ UNUSED: Secret exists but no code references it (may be stale)
- ⚠️ DEV-ONLY: Secret set on dev but missing from prod (deploy risk); Pages only
- ⚠️ PROD-ONLY: Secret set on prod but missing from dev (can't test); Pages only
- ✅ OK: Code reference matches deployed secret/binding
Step 3 — Actionable output
For each issue found, output the fix command:
# Missing secret — set it:
npx wrangler pages secret put NEW_VAR --project-name=your-project-dev
# Stale secret — consider removing:
npx wrangler pages secret delete UNUSED_VAR --project-name=your-project-devQuick Mode
If invoked with a specific project name (e.g., /env-audit project-a), only audit that one context instead of all projects.
CF Access AUD Pattern
When using Cloudflare Access JWT verification, each Access Application has its own AUD (audience) value. Different apps must use their respective AUD values — using the wrong AUD causes silent JWT verification failures (generic 401, not a clear error).
Keep AUD values documented per-app:
| App | .env Key |
|-----|----------|
| App A | CF_ACCESS_AUD_APP_A |
| App B | CF_ACCESS_AUD_APP_B |Verify by inspecting the CF Access redirect URL — the kid= param in the redirect URL encodes the AUD. Storing the raw AUD hash in your encrypted .env as a named key per-app is the safe pattern.
Gotchas
wrangler pages secret listshows names only, not values — safe to run- Workers use
wrangler secret list(nopageskeyword) — must run from worker directory - Some env vars are accessed dynamically (e.g.,
env[key]) — won't be caught by static grep - KV/D1/R2 bindings come from config, not secrets — check both
- Encrypted
.envfiles need their decryption key to inspect — check your secrets manager wrangler secret putbreaks deployments: Secret changes create a new deployment using an older/incomplete code bundle. ALWAYS followwrangler secret putwith a full redeploy (Pages:wrangler pages deploy dist; Workers:wrangler deploy) from the project dir. Without this, API code silently reverts to a stale version
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

