disk-cleaner

Original🇨🇳 Chinese
Translated
1 scripts

Smart Disk Cleaner for Mac, a user-friendly wrapper based on Mole (https://github.com/tw93/Mole)

5installs
Added on

NPX Install

npx skill4agent add crazynomad/skills disk-cleaner

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

Disk Cleaner - Smart Disk Cleaner for Mac

A user-friendly wrapper based on Mole (https://github.com/tw93/Mole), responsible for installation, execution, explanation, validation, guidance, statistics, and sharing.

Description

Disk Cleaner is an enhanced wrapper for the Mole cleaning tool developed by tw93. It provides a more user-friendly Chinese interface, categorized reports, three-tier cleaning strategies (Air/Pro/Max), complete CSV lists, whitelist configuration, and a beautiful achievement page after cleaning (including cost-saving calculations and fun statistics).

When to Use

Use this skill when users:
  • Say their hard drive is full, disk space is insufficient, or storage is low
  • Want to clear Mac cache or temporary files
  • Ask how to free up disk space
  • Mention the Mole tool

Features

  • 🔍 Environment Detection: Automatically detects Homebrew and Mole installation status
  • 📦 Auto-installation: Supports one-click installation of missing dependencies
  • 📊 Categorized Reports: Displays cleanable items by category, distinguishing between safe/cautious
  • 🧭 Three-Tier Strategies: Air (Most Safe)/Pro (Recommended)/Max (Maximize)
  • 📋 CSV List: Generates complete file list, saved to desktop
  • ⚙️ Whitelist Configuration: Preset templates + custom path protection
  • 🎉 Achievement Page: Shows cost-saving calculations, fun statistics, and shareable content after cleaning
  • 🔒 Safety Protection: Displays protected items, supports confirmation mechanism

Usage

Environment Check

bash
python scripts/mole_cleaner.py --check

Preview Cleanable Content

bash
python scripts/mole_cleaner.py --preview          # Terminal text report
python scripts/mole_cleaner.py --preview --html   # HTML report (auto-opens browser)
python scripts/mole_cleaner.py --preview --csv    # Complete CSV list (saved to desktop)
python scripts/mole_cleaner.py --preview --json   # JSON format output

Execute Cleaning (Three Tiers)

bash
python scripts/mole_cleaner.py --clean --tier air --confirm   # Air: Most safe
python scripts/mole_cleaner.py --clean --tier pro --confirm   # Pro: Recommended
python scripts/mole_cleaner.py --clean --tier max --confirm   # Max: Maximize
python scripts/mole_cleaner.py --clean --confirm              # Default full cleaning

Whitelist Configuration

bash
python scripts/mole_cleaner.py --whitelist --show                    # View current whitelist
python scripts/mole_cleaner.py --whitelist --preset office           # Add white-collar office preset
python scripts/mole_cleaner.py --whitelist --preset developer        # Add developer preset
python scripts/mole_cleaner.py --whitelist --add ~/Documents/重要项目  # Add custom path

Check Disk Status

bash
python scripts/mole_cleaner.py --status

Show Achievement Page (Test)

bash
python scripts/mole_cleaner.py --show-achievement

Workflow (Claude Interaction Flow)

1. Environment Detection and Installation

First check if Mole is installed:
bash
python scripts/mole_cleaner.py --check
If not installed, guide the user to install or use
--auto-install
.

2. Preview Scan

Run preview to get analysis report:
bash
python scripts/mole_cleaner.py --preview

3. Show Options to User

Based on preview results, present cleaning solutions to the user:
Please select the solution you want to execute:

1. 🌬️ Air - Most safe, only clears browser and logs     → X.XX GB
2. ⚡ Pro - Recommended, balances safety and space          → X.XX GB
3. 🚀 Max - Maximize hard drive space release            → X.XX GB
4. 📋 View complete list first - Generate CSV detailed list
5. ⚙️ Configure whitelist - Protect specific paths

4. Process User Selection

Select 1-3 (Air/Pro/Max):
bash
# Execute after confirmation
python scripts/mole_cleaner.py --clean --tier air --confirm   # Or pro/max
Select 4 (CSV List):
bash
python scripts/mole_cleaner.py --preview --csv
Inform the user the file has been saved to desktop and opened automatically.
Select 5 (Whitelist Configuration): Show preset options:
  • office
    : White-collar office - Protects .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf, etc.
  • developer
    : Developer - Protects code and configuration files
  • media
    : Media creation - Protects video, audio, image projects
bash
python scripts/mole_cleaner.py --whitelist --preset office
# Or add custom path
python scripts/mole_cleaner.py --whitelist --add ~/Documents/重要项目

5. Cleaning Completed

Automatically generates an achievement page after cleaning, including:
  • Released space size
  • Cost-saving calculation (based on SSD price)
  • Fun equivalents (equivalent to how many photos/songs)
  • Random compliments from tw93
  • GitHub link for easy Star

Safety Features

  • Preview First: Only previews by default, requires
    --confirm
    to execute cleaning
  • Tiered Strategies: Air/Pro/Max allow users to choose based on risk preference
  • Whitelist Protection: Supports preset templates and custom paths
  • Protection List: Displays Mole's whitelist protected items
  • Log Recording: All operations are saved to
    ~/.config/mole-cleaner/logs/

Tier Definitions

TierCleaning ScopeRisk Level
🌬️ AirBrowser cache, system logsLow risk
⚡ ProAir + user application cache, package manager cache, trashMedium risk
🚀 MaxAll cleanable itemsHigher risk

Whitelist Presets

PresetProtected Content
officeOffice documents (.doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf, .pages, .numbers, .key)
developerCode and configuration (.py, .js, .ts, .go, .rs, .java, .swift, .json, .yaml, .toml)
mediaMedia projects (.psd, .ai, .sketch, .fig, .aep, .prproj, .fcpx, .mov, .mp4)

Dependencies

  • macOS
  • Homebrew
  • Mole (
    brew install tw93/tap/mole
    )
  • Python:
    pip install jinja2

Output Structure

~/.config/mole-cleaner/
├── logs/                    # Operation logs
├── reports/                 # HTML reports
└── achievements/            # Achievement pages

~/Desktop/
└── mole-clean-list-YYYYMMDD-HHMMSS.csv  # Complete CSV list

Credits