Cleanup Guide
Smart cleanup utility for migrated projects. Remove legacy files and maintain a clean RAPIDS-optimized structure.
π Overview
rapids-clean
removes old project files and documentation after migrating to RAPIDS framework. It helps you maintain a clean, RAPIDS-optimized project structure.
β° When to Use
π Usage
# After migrating your project
cd your-project/
rapids-migrate
# Then clean up old files
rapids-clean
π§Ή What Gets Cleaned
Legacy Documentation
β’ README.old.md
β’ CONTRIBUTING.old.md
β’ docs/old/**
β’ docs/legacy/**
Environment Files
β’ .env.local
β’ .env.production
β’ .env.development
β’ .env.example
Build Artifacts
β’ .next/ - Next.js build cache
β’ dist/ - Build output (regenerated on build)
β’ build/ - Build output
β’ __pycache__/ - Python cache
β’ *.pyc - Python bytecode
β’ .pytest_cache/ - Pytest cache
Replaced Helper Scripts
β’ scripts/setup.sh
β’ scripts/init.sh
β’ scripts/bootstrap.sh
β’ bin/setup
β’ bin/init
Old CI/CD Configs
β’ .travis.yml
β’ .circleci/
β’ azure-pipelines.yml
Migration Artifacts
β’ .claude.backup/ - Backup created during migration
π‘οΈ Safety Features
Pre-Cleanup Verification
β’ Checks if RAPIDS has been initialized (.claude/ and CLAUDE.md exist)
β’ Will not run on non-RAPIDS projects
β’ Shows preview of items to be removed before cleaning
Cleanup Log
All removed items are logged to .rapids-cleanup.log
with:
β’ Timestamp
β’ Item path
β’ Reason for removal
β’ Size freed
β’ Success/failure status
Size Reporting
Shows total disk space that will be freed before cleanup
πΊ Output Example
β‘ RAPIDS Clean Found 12 items to clean up: π .env.local - Use .env only (per CLAUDE.md) (1.2 KB) π .env.production - Use .env only (per CLAUDE.md) (980 B) π .next/ - Next.js build cache (45.3 MB) π __pycache__/ - Python cache (2.1 MB) π scripts/setup.sh - Replaced by RAPIDS migration (3.4 KB) π .claude.backup - Migration backup (15.2 KB) ... and 6 more items Total space to free: 47.7 MB β‘ Starting cleanup in 2 seconds... (Log will be saved to .rapids-cleanup.log)
π‘ Philosophy
β Non-Destructive
π Workflow
βββββββββββββββββββ β Existing Projectβ ββββββββββ¬βββββββββ β βΌ βββββββββββββββββββ β rapids-migrate β β Sets up RAPIDS ββββββββββ¬βββββββββ β βΌ βββββββββββββββββββ β rapids-clean β β Removes old files ββββββββββ¬βββββββββ β βΌ βββββββββββββββββββ β Clean RAPIDS β β Project β βββββββββββββββββββ
β FAQ
Q: Can I run rapids-clean multiple times?
A: Yes. It's idempotent - subsequent runs will find nothing to clean.
Q: What if I need a file that was removed?
A: Check .rapids-cleanup.log for the complete list. Most removed files are regenerated on build or replaced by RAPIDS patterns.
Q: Does it remove node_modules/?
A: No. Package dependencies are never removed. Use npm/yarn/pnpm prune for that.
Q: What about my custom scripts?
A: Only common setup/init scripts are removed. Custom build or utility scripts are preserved.