[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7397X2MNPSKX7CXFYFXDATD":3,"skill-same:01M7397X2MNPSKX7CXFYFXDATD":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M7397X2MNPSKX7CXFYFXDATD","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.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\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":24,"argument-hint":32},[25,26,27,28,29,30,31],"Read","Grep","Glob","Bash","Write","Edit","AskUserQuestion","[output-path] [--cleanup]","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Faudit-env-variables",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill audit-env-variables",{"tool":49,"command":50},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill audit-env-variables",{"tool":52,"command":53},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill audit-env-variables","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Faudit-env-variables\u002FSKILL.md",true,[],[58,66,73,81,89,97],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":77,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]