- Created docs/00-meta/ for documentation meta files (11 files) - Created docs/archive/reports/ for reports (5 files) - Created docs/archive/issues/ for issue tracking (2 files) - Created docs/bridge/contracts/ for Solidity contracts (3 files) - Created docs/04-configuration/metamask/ for Metamask configs (3 files) - Created docs/scripts/ for documentation scripts (2 files) - Root directory now contains only 3 essential files (89.3% reduction) All recommended actions from docs directory review complete.
5.3 KiB
5.3 KiB
Root Directory Files Organization Guide
Date: 2026-01-06
Script: scripts/organize-root-files.sh
📋 Overview
This script organizes files in the project root directory by moving them to appropriate subdirectories based on file type and purpose.
🎯 Purpose
The root directory should contain only essential configuration files. This script moves:
- Log files →
logs/ - CSV inventory files →
reports/inventory/ - Shell scripts →
scripts/ - Python scripts →
scripts/ - JavaScript scripts →
scripts/ - HTML examples →
examples/ - JSON/Text reports →
reports/
🚀 Usage
Dry Run (Preview Changes)
./scripts/organize-root-files.sh
# or
./scripts/organize-root-files.sh --dry-run
This will show what files would be moved without actually moving them.
Execute (Actually Move Files)
./scripts/organize-root-files.sh --execute
This will actually move the files to their new locations.
📁 File Organization Rules
Log Files → logs/
- All
*.logfiles - Examples:
MARKDOWN_CLEANUP_EXECUTION.log,dependency_update_log_*.log
CSV Inventory Files → reports/inventory/
- All
container_inventory_*.csvfiles - Container inventory snapshots
Shell Scripts → scripts/
- All
*.shfiles from root - Examples:
INSTALL_TUNNEL.sh,fix-all-tunnels.sh
Python Scripts → scripts/
- All
*.pyfiles from root - Examples:
list_vms.py,list_vms_with_tunnels.py
JavaScript Scripts → scripts/
- All
*.jsfiles from root (exceptpackage.json,pnpm-lock.yaml,token-list.json) - Examples:
query-omada-devices.js,test-omada-connection.js
HTML Examples → examples/
- All
*.htmlfiles - Examples:
add-rpc-network.html,wallet-connect.html
JSON/Text Reports → reports/
CONTENT_INCONSISTENCIES.jsonMARKDOWN_ANALYSIS.jsonREFERENCE_FIXES_REPORT.jsonCONVERSION_SUMMARY.txt
✅ Files That Stay in Root
These files should NOT be moved (they're essential configuration):
README.md- Main project documentationPROJECT_STRUCTURE.md- Project structure documentationpackage.json- pnpm workspace configurationpnpm-workspace.yaml- Workspace definitionpnpm-lock.yaml- Dependency lock file.gitignore- Git ignore rules.gitmodules- Git submodules configurationclaude_desktop_config.json.example- Configuration templatetoken-list.json- Token list data file
📊 Expected Results
Before Organization
- Root directory: ~52 files
- Log files: 7+ files in root
- Scripts: 20+ files in root
- Reports: 4+ files in root
After Organization
- Root directory: ~8 essential files
- Log files: All in
logs/ - Scripts: All in
scripts/ - Reports: All in
reports/ - Examples: All in
examples/
🔍 Safety Features
- Dry Run Mode: Default mode shows what would happen without making changes
- Skip Existing: Won't overwrite files that already exist in destination
- Error Handling: Tracks errors and continues processing
- Logging: Creates detailed log file of all operations
- Directory Creation: Automatically creates destination directories
📝 Log File
The script creates a log file: ROOT_FILES_ORGANIZATION_YYYYMMDD_HHMMSS.log
This log contains:
- All file moves
- Warnings (skipped files)
- Errors (failed moves)
- Summary statistics
⚠️ Important Notes
- Backup First: Consider backing up important files before running
- Review Dry Run: Always review dry-run output before executing
- Git Status: Check git status after running to see changes
- Update References: Update any scripts/docs that reference moved files
🔄 After Running
After organizing files, you may need to:
- Update Script References: If other scripts reference moved files, update paths
- Update Documentation: Update docs that reference moved files
- Git Commit: Commit the organization changes
- Verify: Test that moved scripts still work from new locations
📊 Example Output
╔══════════════════════════════════════════════════════════╗
║ Root Directory Files Organization ║
╚══════════════════════════════════════════════════════════╝
=== Moving Log Files to logs/ ===
Would move: 138.log → logs/138.log (log file)
Would move: MARKDOWN_CLEANUP_EXECUTION.log → logs/MARKDOWN_CLEANUP_EXECUTION.log (log file)
...
=== Moving Shell Scripts to scripts/ ===
Would move: INSTALL_TUNNEL.sh → scripts/INSTALL_TUNNEL.sh (shell script)
...
Summary:
Files Moved: 0
Files Skipped: 0
Errors: 0
⚠️ DRY RUN MODE - No files were actually moved
To execute the moves, run:
./scripts/organize-root-files.sh --execute
✅ Verification
After running, verify the organization:
# Check root directory
find . -maxdepth 1 -type f ! -name ".*" | wc -l
# Check logs directory
ls logs/ | wc -l
# Check scripts directory
ls scripts/*.sh scripts/*.py scripts/*.js 2>/dev/null | wc -l
# Check reports directory
ls reports/*.json reports/*.txt 2>/dev/null | wc -l
Guide created: 2026-01-06