Version: 1.0
Status: ✅ Complete - Ready for Implementation
Last Updated: 2025-10-02
UnVibe is a CLI utility that intelligently cleans up repositories after intense vibe coding sessions, with special focus on monorepo environments where AI-assisted development often results in files being created in wrong locations.
- 🎯 AI-Powered File Distribution - Intelligently move root files to correct sub-repositories
- 🧹 Script Classification - Identify and organize utility, build, and critical scripts
- 📁 Folder Structure Enforcement - Create standardized
scripts/anddocuments/folders - ✅ Build Validation - Ensure operations don't break builds
- 🔒 Safety First - All operations backed up and reversible
All detailed specifications are located in the specs/ directory:
System architecture, component structure, data flow, and high-level design.
Key Topics: Module architecture • Data structures • Working directory structure • Technology stack
Git repository detection, monorepo analysis, and boundary enforcement.
Key Topics: Multi-repo detection • Technology identification • Boundary validation • Monorepo tools
Intelligent file allocation using AI and heuristic analysis.
Key Topics: Three-tier allocation • AI content analysis • Conflict resolution • Subdirectory placement
AI provider integration, API key management, and graceful degradation.
Key Topics: Anthropic/OpenAI integration • API key security • Response caching • Recommendation system
Script categorization, staleness detection, and action determination.
Key Topics: Classification algorithm • AI-generated detection • Reference analysis • Staleness thresholds
Build validation, critical path detection, and safety mechanisms.
Key Topics: Technology validators • Auto-restore • Critical paths • Safety guards
Command-line interface, user interactions, and output formatting.
Key Topics: Command structure • Contextual help • Interactive prompts • Progress indicators
Comprehensive backup and restore system with safety guarantees.
Key Topics: Backup manifests • Restore options • Safety guarantees • Backup management
Start with specs/00-ARCHITECTURE.md to understand the system design.
Read specifications in order based on implementation phases:
- Phase 2: Git Detection (Week 3)
- Phase 3: AI Integration (Week 4)
- Phase 4: Distribution (Weeks 5-6)
- Phase 5: Classification (Week 7)
Follow the 16-week roadmap outlined in specs/README.md.
Critical: All implementations MUST follow the safety requirements in each specification:
- All deletions backed up (non-negotiable)
- Git boundaries strictly enforced
- Protected files never touched
- 100% reversibility guaranteed
All operations are backed up and reversible. Git boundaries are strictly enforced. Protected files are never touched.
AI is strongly recommended but not required. System works with heuristics if AI unavailable.
Contextual help guides users. Interactive mode provides control. Clear reasoning for all decisions.
Pre/post validation ensures builds work. Auto-restore if problems detected.
| Metric | Target |
|---|---|
| Test Coverage | 85%+ overall, 100% for safety features |
| AI Accuracy | >90% with AI, >65% with heuristics |
| Scan Performance | 1000+ files in <10 seconds |
| Reversibility | 100% of operations |
| Data Loss | Zero tolerance |
- Node.js 18+ - Runtime
- Commander.js - CLI framework
- simple-git - Git operations
- fs-extra - File operations
- @anthropic-ai/sdk - Claude integration
- openai - GPT-4 integration
- chalk - Colors
- ora - Spinners
- inquirer - Prompts
- cli-table3 - Tables
- Vitest - Test framework
- c8 - Coverage
Phase 1-2: Foundation & Git Detection (Weeks 1-3)
Phase 3: AI Integration (Week 4)
Phase 4: Distribution Engine (Weeks 5-6)
Phase 5: Classification (Week 7)
Phase 6: Folder Enforcement (Week 8)
Phase 7: Backup System (Week 9)
Phase 8: Build Validation (Week 10)
Phase 9-11: CLI & Modes (Weeks 11-13)
Phase 12: Testing & Refinement (Weeks 14-16)
// .unvibe/config/rules.js
module.exports = {
distribution: {
enabled: true,
explicitPatterns: {
'api-*': './api',
'web-*': './web'
},
highConfidence: 0.85,
lowConfidence: 0.60
},
scripts: {
forceUtility: ['temp-*', 'debug-*'],
forceCritical: ['deploy.sh', 'init.sh'],
stalenessThreshold: {
fresh: 7,
aging: 30,
stale: 60
}
},
ai: {
enabled: true,
provider: 'anthropic',
useForDistribution: true,
cacheResults: true,
cacheDuration: 86400
}
};# Get contextual help and status
devibe
# Set up AI (strongly recommended)
devibe config set-api-key
# Scan repository
devibe scan
# Distribute root files to sub-repos
devibe distribute
# Create cleanup plan
devibe plan
# Execute operations
devibe execute
# Full auto-cleanup (with AI)
devibe yolo
# Restore from backup
devibe restore --last- ALL deletions MUST be backed up - No exceptions, even in YOLO mode
- Git boundaries MUST be respected - Never move files between sub-repos
- Protected files MUST never be touched - System configs, credentials, etc.
- ALL operations MUST be reversible - Via restore command
- Build integrity MUST be validated - With auto-restore on failure
- ✅ 100% accurate monorepo detection
- ✅ >90% file allocation accuracy with AI
- ✅ Zero data loss
- ✅ 100% reversibility
- ✅ Builds work after cleanup
- Plugin system for custom rules
- Web dashboard for plan review
- GitHub Action integration
- Analytics and reporting
❌ Code refactoring or optimization
❌ Git operations (commit, push, merge)
❌ Dependency management
❌ Code formatting or linting
❌ Security scanning
❌ File content modification
- ✅ Specifications Complete - All specs written and reviewed
- 🔄 Setup Development - Initialize project structure
- ⏳ Begin Implementation - Start with Phase 1 (Foundation)
- ⏳ Iterative Development - Follow 16-week roadmap
- ⏳ Testing - Maintain 85%+ coverage
- ⏳ Beta Testing - Real-world validation
- ⏳ Release v1.0 - NPM publication
devibe/
├── REQUIREMENTS.md # Original requirements (source of truth)
├── SPECIFICATIONS.md # This summary document
├── specs/ # Detailed technical specifications
│ ├── README.md # Specs overview and roadmap
│ ├── 00-ARCHITECTURE.md # System architecture
│ ├── 01-GIT-DETECTION.md # Git and monorepo detection
│ ├── 02-ROOT-FILE-DISTRIBUTION.md # File allocation
│ ├── 03-AI-INTEGRATION.md # AI providers and caching
│ ├── 04-SCRIPT-CLASSIFICATION.md # Script categorization
│ ├── 05-BUILD-VALIDATION-SAFETY.md # Build validation
│ ├── 06-CLI-INTERFACE.md # CLI and UX
│ └── 07-BACKUP-RESTORE.md # Backup system
└── src/ # (To be created during implementation)
- Check specs first - Detailed answers in feature specifications
- Review architecture - System-wide patterns in 00-ARCHITECTURE.md
- Consult requirements - Original context in REQUIREMENTS.md
- Ask questions - Open issues for specification clarifications
- Each spec has a "Testing" section with test scenarios
- Code examples provided throughout specifications
- TypeScript interfaces defined for all data structures
- Error handling patterns documented
| Document | Lines | Completeness | Review Status |
|---|---|---|---|
| 00-ARCHITECTURE | ~1200 | 100% | ✅ Ready |
| 01-GIT-DETECTION | ~1000 | 100% | ✅ Ready |
| 02-ROOT-FILE-DISTRIBUTION | ~1200 | 100% | ✅ Ready |
| 03-AI-INTEGRATION | ~800 | 100% | ✅ Ready |
| 04-SCRIPT-CLASSIFICATION | ~900 | 100% | ✅ Ready |
| 05-BUILD-VALIDATION-SAFETY | ~700 | 100% | ✅ Ready |
| 06-CLI-INTERFACE | ~800 | 100% | ✅ Ready |
| 07-BACKUP-RESTORE | ~900 | 100% | ✅ Ready |
| Total | ~7500 | 100% | ✅ Ready |
Document Owner: Development Team
Review Cycle: After each implementation phase
Status: Living Documents - Update as needed during development
🎉 Specifications Complete - Ready to Build!