Cleanup Vibes Command
Transforms messy, vibecoded projects into clean, structured, deployment-ready codebases. Ideal for solo developers or teams inheriting prototype code that needs professional-grade refactoring before production.
Command
/cleanup-vibes
Description
Refactors vibecoded or prototype-quality projects into clean, structured, production-ready codebases. Analyzes the entire project for common vibescode anti-patterns and systematically fixes them.
Behavior
-
Scan Phase ā Analyze the project structure and identify:
- Inconsistent naming conventions (files, variables, functions)
- Missing or incorrect TypeScript types (excessive
any, missing interfaces) - Dead imports and unused dependencies
- Hardcoded values that should be environment variables
- Missing error handling and edge cases
- Copy-pasted code that should be abstracted
- Console.log statements left in production code
- Inline styles that should be extracted
- Missing input validation
-
Plan Phase ā Generate a structured remediation plan:
## Cleanup Plan - [ ] Extract hardcoded values to .env / config - [ ] Add TypeScript interfaces for all data shapes - [ ] Create shared utility functions for repeated logic - [ ] Add error boundaries and try/catch blocks - [ ] Normalize file and folder naming - [ ] Remove dead code and unused imports - [ ] Add input validation layer -
Execute Phase ā Apply fixes file-by-file:
- Create a git branch
cleanup/vibes-refactorbefore making changes - Fix one category at a time (naming, then types, then error handling, etc.)
- Run linter/formatter after each category
- Commit after each category with descriptive message
- Create a git branch
-
Verify Phase ā Validate nothing broke:
- Run existing tests (if any)
- Run TypeScript compiler with
--noEmit - Run linter
- Verify the app builds successfully
Output Format
## Cleanup Report ### Files Modified: 23 ### Issues Fixed: 47 | Category | Count | Examples | |----------|-------|----------| | Hardcoded values | 8 | API URLs, magic numbers | | Missing types | 12 | Request handlers, API responses | | Dead code | 6 | Unused imports, commented blocks | | Error handling | 9 | Unhandled promises, missing try/catch | | Code duplication | 5 | Extracted to shared utils | | Naming issues | 7 | Normalized to camelCase/PascalCase | ### Breaking Changes: None ### New Dependencies: None
Rules
- ALWAYS create a git branch before making changes
- NEVER delete functionality ā only restructure and improve
- Preserve all existing behavior exactly
- If tests exist, they must still pass after cleanup
- Ask before renaming exported functions/components that may be used externally
- Do not add new dependencies unless absolutely necessary
Examples
# Run on entire project /cleanup-vibes # Run on specific directory /cleanup-vibes src/components # Dry run ā show plan without executing /cleanup-vibes --dry-run
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.