[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74AM27B7X3SSBVGBGZ3F9PN":3,"skill-same:01M74AM27B7X3SSBVGBGZ3F9PN":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":13,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M74AM27B7X3SSBVGBGZ3F9PN","audit-env-variables",null,"Analyze environment variables in JavaScript\u002FTypeScript 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.","aicreator350\u002FaurionOFFICIELLE","aicreator350","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F217751428?v=4","01M731QVHB22WCM6PDX5VFN1RV","01M731QVJ0TAD058M1SW9MY548",0,"MIT","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002F_archive\u002Fskills-batch2\u002Faudit-env-variables\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: audit-env-variables\ndescription: Analyze environment variables in JavaScript\u002FTypeScript 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.\nargument-hint: \"[output-path] [--cleanup]\"\nallowed-tools: [Read, Grep, Glob, Bash, Write, Edit, AskUserQuestion]\n---\n\n\u003Cobjective>\nPerform a comprehensive audit of environment variables in a JS\u002FTS project:\n\n1. **Discovery** - Find all env files and code references\n2. **Usage Analysis** - Identify which variables are used vs unused\n3. **Service Detection** - Recognize services (Stripe, AWS, Supabase, etc.) and their permission implications\n4. **Code Path Mapping** - Document where each variable is used in the codebase\n5. **Report Generation** - Output a structured markdown document\n6. **Cleanup** (optional) - Safely remove unused variables with user confirmation\n7. **Regression Prevention** - Validate no regressions via build\u002Ftest validation with automatic rollback\n\u003C\u002Fobjective>\n\n\u003Cquick_start>\n**Audit only (default):**\n1. Scan for `.env*` files in project root\n2. Grep codebase for `process.env.`, `import.meta.env.`, and destructured env patterns\n3. Cross-reference declared vs used variables\n4. Identify services by naming patterns and categorize permissions\n5. Generate markdown report using the template\n\n**With cleanup (`--cleanup` flag):**\n6. Check for dynamic access patterns that might hide usage\n7. Present unused variables and get user confirmation\n8. Create backups, remove confirmed variables\n9. Run build\u002Ftests to detect regressions\n10. Auto-rollback if regressions detected\n\u003C\u002Fquick_start>\n\n\u003Cprocess>\n## Step 1: Discover Environment Files\n\nFind all env-related files:\n```bash\nfind . -maxdepth 2 -name \".env*\" -o -name \"env.d.ts\" | grep -v node_modules\n```\n\nCommon files:\n- `.env` - Local development\n- `.env.local` - Local overrides\n- `.env.development` \u002F `.env.production` - Environment-specific\n- `.env.example` - Template for required variables\n\n## Step 2: Extract Declared Variables\n\nParse each env file for variable declarations:\n```\nGrep pattern: ^[A-Z][A-Z0-9_]+=\n```\n\nBuild a list of all declared variables with their source file.\n\n## Step 3: Find Code References\n\nSearch for environment variable usage patterns:\n\n**Direct access:**\n```\nprocess.env.VARIABLE_NAME\nimport.meta.env.VARIABLE_NAME\nprocess.env[\"VARIABLE_NAME\"]\n```\n\n**Destructured patterns:**\n```javascript\nconst { API_KEY, DATABASE_URL } = process.env\n```\n\n**Framework-specific:**\n```javascript\n\u002F\u002F Next.js public vars\nNEXT_PUBLIC_*\n\n\u002F\u002F Vite\nVITE_*\n```\n\nUse Grep tool with patterns:\n```\nprocess\\.env\\.([A-Z][A-Z0-9_]+)\nimport\\.meta\\.env\\.([A-Z][A-Z0-9_]+)\n```\n\n## Step 4: Cross-Reference Usage\n\nFor each declared variable:\n- **Used**: Found in code references\n- **Unused**: Declared but no code references found\n- **Undeclared**: Referenced in code but not in any env file\n\nFlag potential issues:\n- Unused variables (cleanup candidates)\n- Undeclared variables (missing from .env.example)\n- Variables only in .env but not .env.example (documentation gap)\n\n## Step 5: Detect Services and Infer Permissions\n\nMatch variable names against known service patterns. See references\u002Fservice-patterns.md for the complete list.\n\n**Categories:**\n- **Database** - Connection strings, credentials\n- **Authentication** - JWT secrets, OAuth credentials\n- **Payment** - Stripe, payment processor keys\n- **Cloud Services** - AWS, GCP, Azure credentials\n- **Third-party APIs** - Various service integrations\n- **Feature Flags** - Toggle configurations\n- **Application Config** - URLs, ports, modes\n\n**Permission levels:**\n- **Critical** - Full account access, billing, admin operations\n- **High** - Read\u002Fwrite access to user data\n- **Medium** - Limited API access, specific operations\n- **Low** - Public keys, non-sensitive configuration\n\n## Step 6: Map Code Paths\n\nFor each used variable, document:\n- File path where it's used\n- Function\u002Fcomponent context\n- Purpose (inferred from surrounding code)\n\nExample:\n```\nSTRIPE_SECRET_KEY\n├── src\u002Flib\u002Fstripe.ts:15 - Stripe client initialization\n├── src\u002Fapi\u002Fwebhooks\u002Fstripe.ts:8 - Webhook signature verification\n└── src\u002Fapi\u002Fcheckout\u002Froute.ts:23 - Create checkout session\n```\n\n## Step 7: Generate Report\n\nUse the template in templates\u002Fenv-audit-report.md to generate the final document.\n\nOutput to: `ENV_AUDIT.md` in project root (or user-specified location)\n\n## Step 8: Cleanup Unused Variables (Optional)\n\n**Trigger:** User passes `--cleanup` flag or explicitly requests cleanup after reviewing the audit report.\n\n### 8.1 Present Cleanup Candidates\n\nDisplay unused variables with context:\n```\nUNUSED VARIABLES (candidates for removal):\n\n1. OLD_API_KEY (.env, .env.local)\n   - Last modified: [file date]\n   - No code references found\n\n2. DEPRECATED_SERVICE_URL (.env)\n   - Last modified: [file date]\n   - No code references found\n```\n\n### 8.2 Dynamic Access Check\n\nBefore confirming removal, search for dynamic access patterns that grep may have missed:\n\n```javascript\n\u002F\u002F These patterns indicate variables might be used dynamically:\nprocess.env[variableName]        \u002F\u002F Dynamic key access\nprocess.env[`${prefix}_KEY`]     \u002F\u002F Template literal access\nObject.keys(process.env)         \u002F\u002F Iteration over all env vars\n{ ...process.env }               \u002F\u002F Spread operator\n```\n\nUse Grep with patterns:\n```\nprocess\\.env\\[\nObject\\.keys\\(process\\.env\\)\nObject\\.entries\\(process\\.env\\)\n\\.\\.\\.process\\.env\n```\n\n**If dynamic access patterns found:** Flag affected variables for manual review and warn user.\n\n### 8.3 User Confirmation\n\nUse AskUserQuestion to confirm each removal:\n\n```\nThe following variables appear unused. Select which to remove:\n\n[ ] OLD_API_KEY - Remove from .env, .env.local\n[ ] DEPRECATED_SERVICE_URL - Remove from .env\n[ ] Skip cleanup\n\n⚠️ Variables will be backed up before removal.\n```\n\n**Safety rules:**\n- NEVER auto-delete without explicit user confirmation\n- NEVER remove variables from `.env.example` (it serves as documentation)\n- Create backup before any modifications\n\n### 8.4 Create Backups\n\nBefore modifying any file:\n```bash\n# Create timestamped backup directory\nmkdir -p .env-backups\u002F$(date +%Y%m%d_%H%M%S)\n\n# Backup each env file being modified\ncp .env .env-backups\u002F$(date +%Y%m%d_%H%M%S)\u002F.env.backup\ncp .env.local .env-backups\u002F$(date +%Y%m%d_%H%M%S)\u002F.env.local.backup\n```\n\n### 8.5 Remove Confirmed Variables\n\nFor each confirmed variable:\n1. Use Edit tool to remove the line from each env file\n2. Preserve comments associated with the variable (line immediately above if it starts with #)\n3. Log the removal\n\n### 8.6 Document Cleanup\n\nAppend cleanup summary to ENV_AUDIT.md:\n```markdown\n## Cleanup Log\n\n**Date:** [timestamp]\n**Backup Location:** .env-backups\u002F[timestamp]\u002F\n\n### Removed Variables\n| Variable | Removed From | Reason |\n|----------|--------------|--------|\n| OLD_API_KEY | .env, .env.local | Unused - no code references |\n\n### Preserved (Manual Review Required)\n| Variable | Reason |\n|----------|--------|\n| DYNAMIC_VAR | Dynamic access pattern detected |\n```\n\n## Step 9: Regression Prevention\n\n**Purpose:** Validate that removing unused variables doesn't break the application.\n\n### 9.1 Pre-Cleanup Baseline\n\nBefore removing any variables, capture baseline state:\n\n```bash\n# Check if project builds successfully\nnpm run build 2>&1 | tee .env-backups\u002Fpre-cleanup-build.log\necho $? > .env-backups\u002Fpre-cleanup-build-status\n\n# Run tests if available\nnpm test 2>&1 | tee .env-backups\u002Fpre-cleanup-test.log\necho $? > .env-backups\u002Fpre-cleanup-test-status\n```\n\nStore exit codes:\n- `0` = Success (baseline is green)\n- Non-zero = Already failing (warn user but proceed if they confirm)\n\n### 9.2 Dynamic Access Detection\n\nSearch for patterns that indicate runtime env var access:\n\n**High-risk patterns (require manual review):**\n```javascript\n\u002F\u002F Config objects that spread env\nconst config = { ...process.env }\n\n\u002F\u002F Dynamic key construction\nconst key = `${SERVICE}_API_KEY`\nprocess.env[key]\n\n\u002F\u002F Iteration patterns\nObject.entries(process.env).filter(([k]) => k.startsWith('FEATURE_'))\n\n\u002F\u002F External config loaders\nrequire('dotenv').config({ path: customPath })\n```\n\n**Detection commands:**\n```\nGrep: process\\.env\\[(?!['\"][A-Z])\nGrep: Object\\.(keys|values|entries)\\(process\\.env\\)\nGrep: \\.\\.\\.process\\.env\nGrep: dotenv.*config\n```\n\n**If detected:** List affected files and require explicit user acknowledgment before proceeding.\n\n### 9.3 Post-Cleanup Validation\n\nAfter removing variables, run validation:\n\n```bash\n# Verify build still succeeds\nnpm run build 2>&1 | tee .env-backups\u002Fpost-cleanup-build.log\nPOST_BUILD_STATUS=$?\n\n# Verify tests still pass\nnpm test 2>&1 | tee .env-backups\u002Fpost-cleanup-test.log\nPOST_TEST_STATUS=$?\n```\n\n### 9.4 Regression Detection\n\nCompare pre and post states:\n\n| Check | Pre-Cleanup | Post-Cleanup | Status |\n|-------|-------------|--------------|--------|\n| Build | ✅ Pass | ✅ Pass | OK |\n| Tests | ✅ Pass | ✅ Pass | OK |\n\n**If regression detected:**\n1. Immediately alert user\n2. Offer automatic rollback:\n   ```\n   ⚠️ REGRESSION DETECTED\n\n   Build\u002Ftests failed after removing variables.\n\n   Options:\n   1. Rollback all changes (restore from backup)\n   2. Rollback specific variables\n   3. Investigate failure (show diff)\n   4. Proceed anyway (not recommended)\n   ```\n\n### 9.5 Automatic Rollback\n\nIf user requests rollback:\n```bash\n# Restore from backup\ncp .env-backups\u002F[timestamp]\u002F.env.backup .env\ncp .env-backups\u002F[timestamp]\u002F.env.local.backup .env.local\n\n# Verify restoration\nnpm run build && npm test\n```\n\n### 9.6 Git Integration (Optional)\n\nIf in a git repository, offer branch-based cleanup:\n\n```bash\n# Create cleanup branch\ngit checkout -b env-cleanup\u002F$(date +%Y%m%d)\n\n# After cleanup, changes can be reviewed via PR\ngit add .env .env.local\ngit commit -m \"chore: remove unused environment variables\n\nRemoved:\n- OLD_API_KEY (unused)\n- DEPRECATED_SERVICE_URL (unused)\n\nBackup: .env-backups\u002F[timestamp]\u002F\"\n```\n\n**Benefits:**\n- Easy rollback via `git checkout -`\n- Changes visible in PR review\n- CI\u002FCD will validate before merge\n\u003C\u002Fprocess>\n\n\u003Creference_index>\n**Service Patterns:** references\u002Fservice-patterns.md - Known services and their variable naming conventions\n\u003C\u002Freference_index>\n\n\u003Csuccess_criteria>\n**Audit is complete when:**\n- [ ] All .env files discovered and parsed\n- [ ] All code references found\n- [ ] Variables categorized as used\u002Funused\u002Fundeclared\n- [ ] Services detected and permission levels assigned\n- [ ] Code paths documented for each variable\n- [ ] Markdown report generated with all sections\n- [ ] Report saved to specified location\n\n**Cleanup is complete when (if --cleanup requested):**\n- [ ] Dynamic access patterns checked\n- [ ] User confirmed variables to remove\n- [ ] Backups created in .env-backups\u002F\n- [ ] Variables removed from env files (not .env.example)\n- [ ] Cleanup log appended to report\n\n**Regression prevention is complete when:**\n- [ ] Pre-cleanup build\u002Ftest baseline captured\n- [ ] Post-cleanup validation run\n- [ ] No regressions detected OR rollback performed\n- [ ] Git branch created (if opted in)\n\u003C\u002Fsuccess_criteria>\n","\u003Cobjective>\nPerform a comprehensive audit of environment variables in a JS\u002FTS project:\n\n1. **Discovery** - Find all env files and code references\n2. **Usage Analysis** - Identify which variables are used vs unused\n3. **Service Detection** - Recognize services (Stripe, AWS, Supabase, etc.) and their permission implications\n4. **Code Path Mapping** - Document where each variable is used in the codebase\n5. **Report Generation** - Output a structured markdown document\n6. **Cleanup** (optional) - Safely remove unused variables with user confirmation\n7. **Regression Prevention** - Validate no regressions via build\u002Ftest validation with automatic rollback\n\u003C\u002Fobjective>\n\n\u003Cquick_start>\n**Audit only (default):**\n1. Scan for `.env*` files in project root\n2. Grep codebase for `process.env.`, `import.meta.env.`, and destructured env patterns\n3. Cross-reference declared vs used variables\n4. Identify services by naming patterns and categorize permissions\n5. Generate markdown report using the template\n\n**With cleanup (`--cleanup` flag):**\n6. Check for dynamic access patterns that might hide usage\n7. Present unused variables and get user confirmation\n8. Create backups, remove confirmed variables\n9. Run build\u002Ftests to detect regressions\n10. Auto-rollback if regressions detected\n\u003C\u002Fquick_start>\n\n\u003Cprocess>\n## Step 1: Discover Environment Files\n\nFind all env-related files:\n```bash\nfind . -maxdepth 2 -name \".env*\" -o -name \"env.d.ts\" | grep -v node_modules\n```\n\nCommon files:\n- `.env` - Local development\n- `.env.local` - Local overrides\n- `.env.development` \u002F `.env.production` - Environment-specific\n- `.env.example` - Template for required variables\n\n## Step 2: Extract Declared Variables\n\nParse each env file for variable declarations:\n```\nGrep pattern: ^[A-Z][A-Z0-9_]+=\n```\n\nBuild a list of all declared variables with their source file.\n\n## Step 3: Find Code References\n\nSearch for environment variable usage patterns:\n\n**Direct access:**\n```\nprocess.env.VARIABLE_NAME\nimport.meta.env.VARIABLE_NAME\nprocess.env[\"VARIABLE_NAME\"]\n```\n\n**Destructured patterns:**\n```javascript\nconst { API_KEY, DATABASE_URL } = process.env\n```\n\n**Framework-specific:**\n```javascript\n\u002F\u002F Next.js public vars\nNEXT_PUBLIC_*\n\n\u002F\u002F Vite\nVITE_*\n```\n\nUse Grep tool with patterns:\n```\nprocess\\.env\\.([A-Z][A-Z0-9_]+)\nimport\\.meta\\.env\\.([A-Z][A-Z0-9_]+)\n```\n\n## Step 4: Cross-Reference Usage\n\nFor each declared variable:\n- **Used**: Found in code references\n- **Unused**: Declared but no code references found\n- **Undeclared**: Referenced in code but not in any env file\n\nFlag potential issues:\n- Unused variables (cleanup candidates)\n- Undeclared variables (missing from .env.example)\n- Variables only in .env but not .env.example (documentation gap)\n\n## Step 5: Detect Services and Infer Permissions\n\nMatch variable names against known service patterns. See references\u002Fservice-patterns.md for the complete list.\n\n**Categories:**\n- **Database** - Connection strings, credentials\n- **Authentication** - JWT secrets, OAuth credentials\n- **Payment** - Stripe, payment processor keys\n- **Cloud Services** - AWS, GCP, Azure credentials\n- **Third-party APIs** - Various service integrations\n- **Feature Flags** - Toggle configurations\n- **Application Config** - URLs, ports, modes\n\n**Permission levels:**\n- **Critical** - Full account access, billing, admin operations\n- **High** - Read\u002Fwrite access to user data\n- **Medium** - Limited API access, specific operations\n- **Low** - Public keys, non-sensitive configuration\n\n## Step 6: Map Code Paths\n\nFor each used variable, document:\n- File path where it's used\n- Function\u002Fcomponent context\n- Purpose (inferred from surrounding code)\n\nExample:\n```\nSTRIPE_SECRET_KEY\n├── src\u002Flib\u002Fstripe.ts:15 - Stripe client initialization\n├── src\u002Fapi\u002Fwebhooks\u002Fstripe.ts:8 - Webhook signature verification\n└── src\u002Fapi\u002Fcheckout\u002Froute.ts:23 - Create checkout session\n```\n\n## Step 7: Generate Report\n\nUse the template in templates\u002Fenv-audit-report.md to generate the final document.\n\nOutput to: `ENV_AUDIT.md` in project root (or user-specified location)\n\n## Step 8: Cleanup Unused Variables (Optional)\n\n**Trigger:** User passes `--cleanup` flag or explicitly requests cleanup after reviewing the audit report.\n\n### 8.1 Present Cleanup Candidates\n\nDisplay unused variables with context:\n```\nUNUSED VARIABLES (candidates for removal):\n\n1. OLD_API_KEY (.env, .env.local)\n   - Last modified: [file date]\n   - No code references found\n\n2. DEPRECATED_SERVICE_URL (.env)\n   - Last modified: [file date]\n   - No code references found\n```\n\n### 8.2 Dynamic Access Check\n\nBefore confirming removal, search for dynamic access patterns that grep may have missed:\n\n```javascript\n\u002F\u002F These patterns indicate variables might be used dynamically:\nprocess.env[variableName]        \u002F\u002F Dynamic key access\nprocess.env[`${prefix}_KEY`]     \u002F\u002F Template literal access\nObject.keys(process.env)         \u002F\u002F Iteration over all env vars\n{ ...process.env }               \u002F\u002F Spread operator\n```\n\nUse Grep with patterns:\n```\nprocess\\.env\\[\nObject\\.keys\\(process\\.env\\)\nObject\\.entries\\(process\\.env\\)\n\\.\\.\\.process\\.env\n```\n\n**If dynamic access patterns found:** Flag affected variables for manual review and warn user.\n\n### 8.3 User Confirmation\n\nUse AskUserQuestion to confirm each removal:\n\n```\nThe following variables appear unused. Select which to remove:\n\n[ ] OLD_API_KEY - Remove from .env, .env.local\n[ ] DEPRECATED_SERVICE_URL - Remove from .env\n[ ] Skip cleanup\n\n⚠️ Variables will be backed up before removal.\n```\n\n**Safety rules:**\n- NEVER auto-delete without explicit user confirmation\n- NEVER remove variables from `.env.example` (it serves as documentation)\n- Create backup before any modifications\n\n### 8.4 Create Backups\n\nBefore modifying any file:\n```bash\n# Create timestamped backup directory\nmkdir -p .env-backups\u002F$(date +%Y%m%d_%H%M%S)\n\n# Backup each env file being modified\ncp .env .env-backups\u002F$(date +%Y%m%d_%H%M%S)\u002F.env.backup\ncp .env.local .env-backups\u002F$(date +%Y%m%d_%H%M%S)\u002F.env.local.backup\n```\n\n### 8.5 Remove Confirmed Variables\n\nFor each confirmed variable:\n1. Use Edit tool to remove the line from each env file\n2. Preserve comments associated with the variable (line immediately above if it starts with #)\n3. Log the removal\n\n### 8.6 Document Cleanup\n\nAppend cleanup summary to ENV_AUDIT.md:\n```markdown\n## Cleanup Log\n\n**Date:** [timestamp]\n**Backup Location:** .env-backups\u002F[timestamp]\u002F\n\n### Removed Variables\n| Variable | Removed From | Reason |\n|----------|--------------|--------|\n| OLD_API_KEY | .env, .env.local | Unused - no code references |\n\n### Preserved (Manual Review Required)\n| Variable | Reason |\n|----------|--------|\n| DYNAMIC_VAR | Dynamic access pattern detected |\n```\n\n## Step 9: Regression Prevention\n\n**Purpose:** Validate that removing unused variables doesn't break the application.\n\n### 9.1 Pre-Cleanup Baseline\n\nBefore removing any variables, capture baseline state:\n\n```bash\n# Check if project builds successfully\nnpm run build 2>&1 | tee .env-backups\u002Fpre-cleanup-build.log\necho $? > .env-backups\u002Fpre-cleanup-build-status\n\n# Run tests if available\nnpm test 2>&1 | tee .env-backups\u002Fpre-cleanup-test.log\necho $? > .env-backups\u002Fpre-cleanup-test-status\n```\n\nStore exit codes:\n- `0` = Success (baseline is green)\n- Non-zero = Already failing (warn user but proceed if they confirm)\n\n### 9.2 Dynamic Access Detection\n\nSearch for patterns that indicate runtime env var access:\n\n**High-risk patterns (require manual review):**\n```javascript\n\u002F\u002F Config objects that spread env\nconst config = { ...process.env }\n\n\u002F\u002F Dynamic key construction\nconst key = `${SERVICE}_API_KEY`\nprocess.env[key]\n\n\u002F\u002F Iteration patterns\nObject.entries(process.env).filter(([k]) => k.startsWith('FEATURE_'))\n\n\u002F\u002F External config loaders\nrequire('dotenv').config({ path: customPath })\n```\n\n**Detection commands:**\n```\nGrep: process\\.env\\[(?!['\"][A-Z])\nGrep: Object\\.(keys|values|entries)\\(process\\.env\\)\nGrep: \\.\\.\\.process\\.env\nGrep: dotenv.*config\n```\n\n**If detected:** List affected files and require explicit user acknowledgment before proceeding.\n\n### 9.3 Post-Cleanup Validation\n\nAfter removing variables, run validation:\n\n```bash\n# Verify build still succeeds\nnpm run build 2>&1 | tee .env-backups\u002Fpost-cleanup-build.log\nPOST_BUILD_STATUS=$?\n\n# Verify tests still pass\nnpm test 2>&1 | tee .env-backups\u002Fpost-cleanup-test.log\nPOST_TEST_STATUS=$?\n```\n\n### 9.4 Regression Detection\n\nCompare pre and post states:\n\n| Check | Pre-Cleanup | Post-Cleanup | Status |\n|-------|-------------|--------------|--------|\n| Build | ✅ Pass | ✅ Pass | OK |\n| Tests | ✅ Pass | ✅ Pass | OK |\n\n**If regression detected:**\n1. Immediately alert user\n2. Offer automatic rollback:\n   ```\n   ⚠️ REGRESSION DETECTED\n\n   Build\u002Ftests failed after removing variables.\n\n   Options:\n   1. Rollback all changes (restore from backup)\n   2. Rollback specific variables\n   3. Investigate failure (show diff)\n   4. Proceed anyway (not recommended)\n   ```\n\n### 9.5 Automatic Rollback\n\nIf user requests rollback:\n```bash\n# Restore from backup\ncp .env-backups\u002F[timestamp]\u002F.env.backup .env\ncp .env-backups\u002F[timestamp]\u002F.env.local.backup .env.local\n\n# Verify restoration\nnpm run build && npm test\n```\n\n### 9.6 Git Integration (Optional)\n\nIf in a git repository, offer branch-based cleanup:\n\n```bash\n# Create cleanup branch\ngit checkout -b env-cleanup\u002F$(date +%Y%m%d)\n\n# After cleanup, changes can be reviewed via PR\ngit add .env .env.local\ngit commit -m \"chore: remove unused environment variables\n\nRemoved:\n- OLD_API_KEY (unused)\n- DEPRECATED_SERVICE_URL (unused)\n\nBackup: .env-backups\u002F[timestamp]\u002F\"\n```\n\n**Benefits:**\n- Easy rollback via `git checkout -`\n- Changes visible in PR review\n- CI\u002FCD will validate before merge\n\u003C\u002Fprocess>\n\n\u003Creference_index>\n**Service Patterns:** references\u002Fservice-patterns.md - Known services and their variable naming conventions\n\u003C\u002Freference_index>\n\n\u003Csuccess_criteria>\n**Audit is complete when:**\n- [ ] All .env files discovered and parsed\n- [ ] All code references found\n- [ ] Variables categorized as used\u002Funused\u002Fundeclared\n- [ ] Services detected and permission levels assigned\n- [ ] Code paths documented for each variable\n- [ ] Markdown report generated with all sections\n- [ ] Report saved to specified location\n\n**Cleanup is complete when (if --cleanup requested):**\n- [ ] Dynamic access patterns checked\n- [ ] User confirmed variables to remove\n- [ ] Backups created in .env-backups\u002F\n- [ ] Variables removed from env files (not .env.example)\n- [ ] Cleanup log appended to report\n\n**Regression prevention is complete when:**\n- [ ] Pre-cleanup build\u002Ftest baseline captured\n- [ ] Post-cleanup validation run\n- [ ] No regressions detected OR rollback performed\n- [ ] Git branch created (if opted in)\n\u003C\u002Fsuccess_criteria>\n",{"name":5,"description":7,"allowed-tools":23,"argument-hint":31},[24,25,26,27,28,29,30],"Read","Grep","Glob","Bash","Write","Edit","AskUserQuestion","[output-path] [--cleanup]","main","5593cf3c72898ea9fc67225d452fe38f866ba6dd",".claude\u002F_archive\u002Fskills-batch2\u002Faudit-env-variables","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE","https:\u002F\u002Fgithub.com\u002Faicreator350","2026-05-18 03:39:30",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add aicreator350\u002FaurionOFFICIELLE --skill audit-env-variables",{"tool":44,"command":45},"bunx","bunx skills add aicreator350\u002FaurionOFFICIELLE --skill audit-env-variables",{"tool":47,"command":48},"pnpm","pnpm dlx skills add aicreator350\u002FaurionOFFICIELLE --skill audit-env-variables","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002F_archive\u002Fskills-batch2\u002Faudit-env-variables\u002FSKILL.md",true,[52,58],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fservice-patterns.md","REFERENCE","参考文档",7625,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002F_archive\u002Fskills-batch2\u002Faudit-env-variables\u002Freferences\u002Fservice-patterns.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"templates\u002Fenv-audit-report.md",3270,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002F_archive\u002Fskills-batch2\u002Faudit-env-variables\u002Ftemplates\u002Fenv-audit-report.md",[63,72,79,86,93,100],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":68,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M74CAJWR9WB6DX1HF2V461Y0","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M74CAFWC2H75GJ81B39C9RSW","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M74CA9N2HTGCKJ93AE9NQMHA","vercel-react-view-transitions","Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-view-transitions\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M74CA364D4EVDXZZQRVK1Z73","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M74C9YQZX1GVS18V0AYCYPZE","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M74C9SEYD6F764Q1JACZX3A6","vercel-cli-with-tokens","Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. \"deploy to vercel\", \"set up vercel\", \"add environment variables to vercel\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-cli-with-tokens\u002FSKILL.md",[],[]]