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.