StarModel invitation
← Back to skills
extension
Category: Productivity & OfficeAPI key requirement unconfirmed

磁盘清理

磁盘清理skill

personAuthor: dline666hubModelScope

Disk Cleanup

Check disk space usage and identify files that can be safely deleted to free up space.

When to Use This Skill

Use this skill when the user:

  • Says their disk is full or running out of space
  • Asks to clean up or free up disk space
  • Wants to know what's taking up space on their drive
  • Says "c盘不够用了", "磁盘满了", "清理磁盘", "disk full", "disk cleanup"

How It Works

Step 1: Check Overall Disk Usage

df -h /c/

Report the total size, used space, available space, and usage percentage.

Step 2: Scan Common Space-Consuming Directories

Check these directories in parallel (use the Bash tool):

User caches and temps:

  • AppData/Local/Temp — temporary files
  • AppData/Local/npm-cache — npm cache
  • AppData/Local/pip — pip cache
  • .cache — user cache directory

Development tools:

  • AppData/Local/JetBrains — JetBrains IDE caches (check each version)
  • AppData/Local/Google/Chrome — Chrome browser cache
  • AppData/Local/Microsoft/Edge — Edge browser cache
  • .vscode — VS Code extensions and cache
  • .conda — Conda environments
  • .rustup / .cargo — Rust toolchain
  • .nuget — NuGet packages

Applications:

  • AppData/Local/Programs — installed programs
  • AppData/Local/Docker — Docker data

Downloads:

  • Downloads — list largest files with ls -lhS

System:

  • Windows/SoftwareDistribution/Download — Windows Update cache
  • $Recycle.Bin — Recycle Bin

Use du -sh <path> for each directory. Set timeout to 30000ms for large directories.

Step 3: Deep Scan Large Directories

For any directory over 1GB, break it down further:

du -sh <path>/*/ 2>/dev/null | sort -rh | head -10

Step 4: List Largest Files in Downloads

ls -lhS ~/Downloads/ 2>/dev/null | head -20

Step 5: Present Report

Format the results as a clear report with:

  1. Current status — total, used, free space with percentage
  2. Safe to clean — caches, temps, old versions (with sizes)
  3. Consider cleaning — browser caches, large downloads, unused tools
  4. Actionable table — numbered list with directory, size, and recommendation

Step 6: Offer to Clean

Ask the user which items to clean. For each selected item:

Temp files:

rm -rf /c/Users/keepz/AppData/Local/Temp/*

Old JetBrains caches (keep latest version only):

rm -rf /c/Users/keepz/AppData/Local/JetBrains/<old-version>/

npm cache:

npm cache clean --force

pip cache:

pip cache purge

Windows Update cache:

# Run as admin if possible
rm -rf /c/Windows/SoftwareDistribution/Download/*

Browser cache (Edge/Chrome):

  • Instruct user to clear via browser settings (cannot safely delete while browser is running)

Step 7: Verify Results

After cleanup, run df -h /c/ again and report how much space was freed.

Important Notes

  • Always check if a JetBrains version is still in use before deleting (keep the latest version)
  • Never delete AppData/Local itself, only specific caches inside it
  • Some Temp files may be in use — partial cleanup is normal
  • For browser caches, recommend clearing via browser settings rather than deleting files directly
  • Always show the user what will be deleted before executing
  • Use timeout: 60000 for large directory scans

<!-- OB-S:YGQkqjteL-hPZLtzgYBBVQ -->