Files
aitbc/scripts/maintenance/cleanup-root-directory.sh
aitbc 3b8249d299 refactor: comprehensive scripts directory reorganization by functionality
Scripts Directory Reorganization - Complete:
 FUNCTIONAL ORGANIZATION: Scripts sorted into 8 logical categories
- github/: GitHub and Git operations (6 files)
- sync/: Synchronization and data replication (4 files)
- security/: Security and audit operations (2 files)
- monitoring/: System and service monitoring (6 files)
- maintenance/: System maintenance and cleanup (4 files)
- deployment/: Deployment and provisioning (11 files)
- testing/: Testing and quality assurance (13 files)
- utils/: Utility scripts and helpers (47 files)

 ROOT DIRECTORY CLEANED: Only README.md remains in scripts root
- scripts/README.md: Main documentation
- scripts/SCRIPTS_ORGANIZATION.md: Complete organization guide
- All functional scripts moved to appropriate subdirectories

 SCRIPTS CATEGORIZATION:
📁 GitHub Operations: PR resolution, repository management, Git workflows
📁 Synchronization: Bulk sync, fast sync, sync detection, SystemD sync
📁 Security: Security audits, monitoring, vulnerability scanning
📁 Monitoring: Health checks, log monitoring, network monitoring, production monitoring
📁 Maintenance: Cleanup operations, performance tuning, weekly maintenance
📁 Deployment: Release building, node provisioning, DAO deployment, production deployment
📁 Testing: E2E testing, workflow testing, QA cycles, service testing
📁 Utilities: System management, setup scripts, helpers, tools

 ORGANIZATION BENEFITS:
- Better Navigation: Scripts grouped by functionality
- Easier Maintenance: Related scripts grouped together
- Scalable Structure: Easy to add new scripts to appropriate categories
- Clear Documentation: Comprehensive organization guide with descriptions
- Improved Workflow: Quick access to relevant scripts by category

 DOCUMENTATION ENHANCED:
- SCRIPTS_ORGANIZATION.md: Complete directory structure and usage guide
- Quick Reference: Common script usage examples
- Script Descriptions: Purpose and functionality for each script
- Maintenance Guidelines: How to keep organization current

DIRECTORY STRUCTURE:
📁 scripts/
├── README.md (Main documentation)
├── SCRIPTS_ORGANIZATION.md (Organization guide)
├── github/ (6 files - GitHub operations)
├── sync/ (4 files - Synchronization)
├── security/ (2 files - Security)
├── monitoring/ (6 files - Monitoring)
├── maintenance/ (4 files - Maintenance)
├── deployment/ (11 files - Deployment)
├── testing/ (13 files - Testing)
├── utils/ (47 files - Utilities)
├── ci/ (existing - CI/CD)
├── deployment/ (existing - legacy deployment)
├── development/ (existing - Development tools)
├── monitoring/ (existing - Legacy monitoring)
├── services/ (existing - Service management)
├── testing/ (existing - Legacy testing)
├── utils/ (existing - Legacy utilities)
├── workflow/ (existing - Workflow automation)
└── workflow-openclaw/ (existing - OpenClaw workflows)

RESULT: Successfully reorganized 27 unorganized scripts into 8 functional categories, creating a clean, maintainable, and well-documented scripts directory structure with comprehensive organization guide.
2026-03-30 17:13:27 +02:00

84 lines
4.5 KiB
Bash
Executable File

#!/bin/bash
echo "=== AITBC Root Directory Cleanup ==="
echo "Organizing files before GitHub push..."
echo ""
# Create organized directories if they don't exist
mkdir -p temp/generated-files
mkdir -p temp/analysis-results
mkdir -p temp/workspace-files
mkdir -p temp/backup-files
echo "=== Moving Generated Files ==="
# Move generated analysis files
mv archive_results.json temp/generated-files/ 2>/dev/null || echo "archive_results.json not found"
mv cleanup_results.json temp/generated-files/ 2>/dev/null || echo "cleanup_results.json not found"
mv completed_files_scan.json temp/generated-files/ 2>/dev/null || echo "completed_files_scan.json not found"
mv comprehensive_final_report.json temp/generated-files/ 2>/dev/null || echo "comprehensive_final_report.json not found"
mv comprehensive_scan_results.json temp/generated-files/ 2>/dev/null || echo "comprehensive_scan_results.json not found"
mv content_analysis_results.json temp/generated-files/ 2>/dev/null || echo "content_analysis_results.json not found"
mv content_move_results.json temp/generated-files/ 2>/dev/null || echo "content_move_results.json not found"
mv documentation_conversion_final.json temp/generated-files/ 2>/dev/null || echo "documentation_conversion_final.json not found"
mv documentation_conversion_final_report.json temp/generated-files/ 2>/dev/null || echo "documentation_conversion_final_report.json not found"
mv documentation_status_check.json temp/generated-files/ 2>/dev/null || echo "documentation_status_check.json not found"
mv generated_documentation.json temp/generated-files/ 2>/dev/null || echo "generated_documentation.json not found"
mv specific_files_analysis.json temp/generated-files/ 2>/dev/null || echo "specific_files_analysis.json not found"
echo "=== Moving Genesis Files ==="
# Move genesis files to appropriate location
mv chain_enhanced_devnet.yaml data/ 2>/dev/null || echo "chain_enhanced_devnet.yaml not found"
mv genesis_ait_devnet.yaml data/ 2>/dev/null || echo "genesis_ait_devnet.yaml not found"
mv genesis_brother_chain_1773403269.yaml data/ 2>/dev/null || echo "genesis_brother_chain_1773403269.yaml not found"
mv genesis_enhanced_devnet.yaml data/ 2>/dev/null || echo "genesis_enhanced_devnet.yaml not found"
mv genesis_enhanced_local.yaml data/ 2>/dev/null || echo "genesis_enhanced_local.yaml not found"
mv genesis_enhanced_template.yaml data/ 2>/dev/null || echo "genesis_enhanced_template.yaml not found"
mv genesis_prod.yaml data/ 2>/dev/null || echo "genesis_prod.yaml not found"
mv test_multichain_genesis.yaml data/ 2>/dev/null || echo "test_multichain_genesis.yaml not found"
mv dummy.yaml data/ 2>/dev/null || echo "dummy.yaml not found"
echo "=== Moving Workspace Files ==="
# Move workspace files
mv workspace/* temp/workspace-files/ 2>/dev/null || echo "workspace files moved"
rmdir workspace 2>/dev/null || echo "workspace directory removed or not empty"
echo "=== Moving Backup Files ==="
# Move backup files
mv backup/* temp/backup-files/ 2>/dev/null || echo "backup files moved"
mv backups/* temp/backup-files/ 2>/dev/null || echo "backups files moved"
rmdir backup backups 2>/dev/null || echo "backup directories removed or not empty"
echo "=== Moving Temporary Files ==="
# Move temporary and log files
mv health temp/generated-files/ 2>/dev/null || echo "health file moved"
mv logs/* temp/generated-files/ 2>/dev/null || echo "log files moved"
rmdir logs 2>/dev/null || echo "logs directory removed or not empty"
echo "=== Moving Development Scripts ==="
# Move development scripts to dev/scripts if not already there
mv auto_review.py dev/scripts/ 2>/dev/null || echo "auto_review.py already in dev/scripts"
mv run_test.py dev/scripts/ 2>/dev/null || echo "run_test.py already in dev/scripts"
echo "=== Moving Virtual Environments ==="
# Move virtual environments to dev directory
mv agent-venv dev/ 2>/dev/null || echo "agent-venv already in dev"
mv ai-venv dev/ 2>/dev/null || echo "ai-venv already in dev"
mv concrete-env dev/ 2>/dev/null || echo "concrete-env already in dev"
echo "=== Moving Model Directories ==="
# Move models to appropriate location
mv models/* temp/backup-files/ 2>/dev/null || echo "models files moved"
rmdir models 2>/dev/null || echo "models directory removed or not empty"
echo "=== Cleanup Complete ==="
echo ""
echo "Files organized into:"
echo "- temp/generated-files/ (analysis results, generated JSON files)"
echo "- temp/workspace-files/ (workspace contents)"
echo "- temp/backup-files/ (backup and model files)"
echo "- data/ (genesis files)"
echo "- dev/ (virtual environments and scripts)"
echo ""
echo "Root directory is now clean and organized for GitHub push!"