bigcommerce-api
BigCommerce API expert for building integrations, apps, headless storefronts, and automations. Full lifecycle - REST APIs, GraphQL Storefront, webhooks,…
Analyze environment variables in JavaScript/TypeScript projects. Identifies unused variables, infers permission scopes, detects specific services (Stripe, AWS, Supabase), and documents code paths. Includes optional cleanup of unused variables with regression detection. Use when
$ npx -y skills add qdhenry/Claude-Command-Suite --skill audit-env-variables --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/audit-env-variablesContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyze environment variables in JavaScript/TypeScript projects. Identifies unused variables, infers permission scopes, detects specific services (Stripe, AWS, Supabase), and documents code paths. Includes optional cleanup of unused variables with regression detection. Use when
name: audit-env-variables description: Analyze environment variables in JavaScript/TypeScript projects. Identifies unused variables, infers permission scopes, detects specific services (Stripe, AWS, Supabase), and documents code paths. Includes optional cleanup of unused variables with regression detection. Use when auditing .env files, reviewing security, or documenting project configuration. argument-hint: "[output-path] [--cleanup]" allowed-tools: [Read, Grep, Glob, Bash, Write, Edit, AskUserQuestion]
<objective> Perform a comprehensive audit of environment variables in a JS/TS project:
1. **Discovery** - Find all env files and code references 2. **Usage Analysis** - Identify which variables are used vs unused 3. **Service Detection** - Recognize services (Stripe, AWS, Supabase, etc.) and their permission implications 4. **Code Path Mapping** - Document where each variable is used in the codebase 5. **Report Generation** - Output a structured markdown document 6. **Cleanup** (optional) - Safely remove unused variables with user confirmation 7. **Regression Prevention** - Validate no regressions via build/test validation with automatic rollback </objective>
<quick_start> **Audit only (default):** 1. Scan for `.env*` files in project root 2. Grep codebase for `process.env.`, `import.meta.env.`, and destructured env patterns 3. Cross-reference declared vs used variables 4. Identify services by naming patterns and categorize permissions 5. Generate markdown report using the template
**With cleanup (`--cleanup` flag):** 6. Check for dynamic access patterns that might hide usage 7. Present unused variables and get user confirmation 8. Create backups, remove confirmed variables 9. Run build/tests to detect regressions 10. Auto-rollback if regressions detected </quick_start>
<process>
Find all env-related files:
find . -maxdepth 2 -name ".env*" -o -name "env.d.ts" | grep -v node_modules
Common files:
Parse each env file for variable declarations:
Grep pattern: ^[A-Z][A-Z0-9_]+=
Build a list of all declared variables with their source file.
Search for environment variable usage patterns:
**Direct access:**
process.env.VARIABLE_NAME import.meta.env.VARIABLE_NAME process.env["VARIABLE_NAME"]
**Destructured patterns:**
const { API_KEY, DATABASE_URL } = process.env**Framework-specific:**
// Next.js public vars NEXT_PUBLIC_* // Vite VITE_*
Use Grep tool with patterns:
process\.env\.([A-Z][A-Z0-9_]+) import\.meta\.env\.([A-Z][A-Z0-9_]+)
For each declared variable:
Flag potential issues:
Match variable names against known service patterns. See references/service-patterns.md for the complete list.
**Categories:**
**Permission levels:**
For each used variable, document:
Example:
STRIPE_SECRET_KEY ├── src/lib/stripe.ts:15 - Stripe client initialization ├── src/api/webhooks/stripe.ts:8 - Webhook signature verification └── src/api/checkout/route.ts:23 - Create checkout session
Use the template in templates/env-audit-report.md to generate the final document.
Output to: `ENV_AUDIT.md` in project root (or user-specified location)
**Trigger:** User passes `--cleanup` flag or explicitly requests cleanup after reviewing the audit report.
Display unused variables with context:
UNUSED VARIABLES (candidates for removal): 1. OLD_API_KEY (.env, .env.local) - Last modified: [file date] - No code references found 2. DEPRECATED_SERVICE_URL (.env) - Last modified: [file date] - No code references found
Before confirming removal, search for dynamic access patterns that grep may have missed:
// These patterns indicate variables might be used dynamically:
process.env[variableName] // Dynamic key access
process.env[`${prefix}_KEY`] // Template literal access
Object.keys(process.env) // Iteration over all env vars
{ ...process.env } // Spread operatorUse Grep with patterns:
process\.env\[ Object\.keys\(process\.env\) Object\.entries\(process\.env\) \.\.\.process\.env
**If dynamic access patterns found:** Flag affected variables for manual review and warn user.
Use AskUserQuestion to confirm each removal:
The following variables appear unused. Select which to remove: [ ] OLD_API_KEY - Remove from .env, .env.local [ ] DEPRECATED_SERVICE_URL - Remove from .env [ ] Skip cleanup ⚠️ Variables will be backed up before rem
A comprehensive development toolkit designed following Anthropic's Claude Code Best Practices for AI-assisted software development.
Repo: qdhenry/Claude-Command-Suite
BigCommerce API expert for building integrations, apps, headless storefronts, and automations. Full lifecycle - REST APIs, GraphQL Storefront, webhooks,…
Comprehensive Cloudflare account management for deploying Workers, KV Storage, R2, Pages, DNS, and Routes. Use when deploying cloudflare services, managing…
Transcribes audio/video files using ElevenLabs Scribe v2 API. Use when transcribing audio files, generating transcripts, or converting speech to text.
Extracts frames and timestamped audio segments from video files (GIF, MP4, MOV) at configurable intervals and stores them in a directory with a manifest file.…
Chokidar-based file watcher that triggers `claude -p` on changes. Useful for automated AI reactions to file changes — design sync, code validation, config…
1. [Installation & TypeScript Setup](#installation--typescript-setup) 2. [Core Concepts](#core-concepts) 3. [Tweens](#tweens) 4. [Timelines](#timelines) 5.…