Skip to content

stulogy/vibe-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

🧹 VIBE Cleanup - The AI Coder's Janitor

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.

⚠️ ULTRA-SAFE MODE

🛡️ Enterprise-grade safety - Never deletes files, requires approval for all changes, report-only by default

🚀 Quick Start

  1. Drop this file into your project root
  2. Ask your AI assistant: "run vibe cleanup"
  3. Choose cleanup mode: Auto-fix, interactive checklist, or detailed report
  4. Review results and address critical issues before production

Perfect for cleaning up AI-generated code from ChatGPT, Claude, Copilot, and other AI coding assistants!

🎯 Comprehensive Audit Coverage

🔴 Critical Issues

  • Mock Data: mockData, fakeUsers, sampleStudents, MOCK_API_RESPONSE
  • Debug Code: debugger statements, debug files in production
  • Hardcoded Secrets: API keys, passwords, tokens in source code
  • Security Vulnerabilities: eval(), innerHTML with user input
  • Environment Leaks: Accidentally committed .env files

🟠 High Priority

  • 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

🟡 Medium Priority

  • 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

🔵 Low Priority

  • 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)

🛡️ Ultra-Safe Enterprise Mode

  • 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.lo partial replacements
  • User choice for console logs - Comment out OR delete based on your preference

🔧 Enhanced Features

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

📊 Example Output

🔍 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

🎯 Perfect For

  • 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

🤝 Contributing

Found a pattern we're missing? Have ideas for better detection? PRs welcome!

📄 License

MIT License - Use it anywhere, modify as needed!


Made with ❤️ for developers working with AI coding assistants

About

The Vibe Coder's Janitor! AI-powered cleanup tool that automatically detects and fixes telltale signs of AI-generated code: mock data, placeholder values, duplicate functions, and overengineered patterns. Just drop this markdown in your project and ask your AI assistant to "run vibe cleanup". Don't forget to say "Please".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors