Comprehensive, ultra-safe production cleanup for JavaScript/TypeScript projects with advanced dependency, security, and code quality analysis.
🤖➡️🧹 Turn your AI assistant into a code janitor! This markdown guide teaches any AI coding assistant to automatically detect and fix mock data, fake APIs, console logs, unused dependencies, security issues, and other artifacts left behind in AI-generated code.
🛡️ Enterprise-grade safety - Never deletes files, requires approval for all changes, report-only by default
- Drop this file into your project root
- Ask your AI assistant: "run vibe cleanup"
- Choose cleanup mode: Auto-fix, interactive checklist, or detailed report
- Review results and address critical issues before production
Perfect for cleaning up AI-generated code from ChatGPT, Claude, Copilot, and other AI coding assistants!
- Mock Data:
mockData,fakeUsers,sampleStudents,MOCK_API_RESPONSE - Debug Code:
debuggerstatements, debug files in production - Hardcoded Secrets: API keys, passwords, tokens in source code
- Security Vulnerabilities:
eval(),innerHTMLwith user input - Environment Leaks: Accidentally committed
.envfiles
- Unused Dependencies: Large packages consuming bundle size (via depcheck)
- Development Configs: DEBUG=true, localhost URLs in production
- Console Statements:
console.log,console.debug(user choice: comment out or delete) - Hardcoded Fake Values: test@example.com, John Doe, password123, 555-0123
- Missing Error Handling: Critical paths without try-catch
- UI/UX Issues: Unused components, duplicate styling, inconsistent design tokens
- Code Quality: High complexity functions, overengineered patterns
- Configuration Issues: Build configs with dev-only settings
- Performance Issues: Inefficient loops, unnecessary re-renders
- Dead Code: Unused functions, unreachable code paths
- AI Patterns: Overly verbose comments, generic variable names
- Style Issues: Excessive
!important, inline styles - Accessibility: Missing alt text, aria labels (basic checks)
- Report-only by default - Shows issues but makes NO changes unless explicitly requested
- Never deletes files - Only comments out problematic code with clear prefixes
- Ultra-conservative detection - Multiple indicators required before flagging issues
- Whitelist protection - Never touches framework files, tests, configs, or generated code
- User approval required - For every single change, even adding comments
- Mandatory dry run - Always shows what would change before doing anything
- Rollback instructions - Provides undo steps for any changes made
- Fixed console.log cleanup - No more broken
console.lopartial replacements - User choice for console logs - Comment out OR delete based on your preference
✅ Universal Compatibility - Works with any JavaScript/TypeScript project
✅ Smart Auto-Detection - Automatically detects CommonJS vs ES modules
✅ Comprehensive Coverage - 8 major audit areas including dependencies, security, UI/UX
✅ Dependencies Analysis - Integrated depcheck for unused package detection
✅ Security Scanning - Hardcoded secrets and vulnerability pattern detection
✅ UI/UX Cleanup - Unused components and duplicate styling analysis
✅ Code Quality Analysis - Deep analysis of complexity and overengineering
✅ Interactive Cleanup - Choose your preferred cleanup approach
✅ Progress Tracking - Real-time checklist updates as tasks complete
✅ Ultra-Safe Auto-Fixes - Comments out code instead of deleting
✅ AI-Powered - Works with any AI coding assistant
✅ Enterprise Ready - Conservative enough for production codebases
🔍 VIBE CLEANUP AUDIT COMPLETE
📊 Found 3,247 issues across 1,284 files:
🔴 CRITICAL: 23 issues (Mock data, hardcoded secrets, insecure patterns)
🟠 HIGH: 89 issues (Unused dependencies, dev configs, missing error handling)
🟡 MEDIUM: 2,891 issues (Console logs, duplicate styles, code complexity)
🔵 LOW: 244 issues (TODOs, AI patterns, unused assets)
🔍 **Comprehensive Audit Coverage:**
✅ Dependencies (depcheck integration)
✅ UI/UX Components & Styling
✅ Security & Secrets Scanning
✅ Code Quality Deep Analysis
✅ Configuration Review
✅ Mock Data & AI Patterns
🚨 IMMEDIATE ACTION REQUIRED: 112 critical/high issues
⚠️ RECOMMENDED CLEANUP: 2,891 medium issues
💡 NICE TO HAVE: 244 low priority issues
Would you like me to:
1. 📄 Show detailed report ONLY (RECOMMENDED - no changes made)
2. 📋 Create interactive cleanup checklist (review each change)
3. 🔧 Auto-fix console logs with options (ultra-conservative, 5 max)
4. ❌ Cancel cleanup
⚠️ SAFETY NOTICE: Option 1 is recommended for first-time users
🛡️ All changes require your explicit approval
[If you choose console.log cleanup, you'll be asked:]
🔧 Console.log cleanup preference:
A. 💬 Comment out (safer - can be restored later)
B. 🗑️ Delete entirely (cleaner - permanent removal)
C. ❓ Ask for each console.log individually
- Enterprise Codebases - Ultra-safe cleanup for production applications
- React Applications - Clean up components, unused imports, duplicate styles
- Vue.js Projects - Remove placeholder content and optimize component structure
- Node.js APIs - Fix mock endpoints, unused dependencies, security issues
- TypeScript Codebases - Clean up overengineered types and dead code
- Security Audits - Detect hardcoded secrets and vulnerability patterns
- Performance Optimization - Find unused dependencies and inefficient code
- Any AI-Generated Code - Works with output from any coding assistant
Found a pattern we're missing? Have ideas for better detection? PRs welcome!
MIT License - Use it anywhere, modify as needed!
Made with ❤️ for developers working with AI coding assistants