Overview
Audit macOS software installations and disk usage, output executable tiered cleanup recommendations, and perform low-risk cleanup after user confirmation. The process distinguishes application lists, caches, simulator data, and medium-risk application data to avoid deleting business data without confirmation.
When to use
Use this skill when the user has the following needs:
- Check
/Applications、~/Applications, Homebrew Formula, and Homebrew Cask installed software - Count space usage of software and common cache directories, and sort by size
- Clean up
~/Library/Caches、~/Library/Developer/CoreSimulatorand other low-risk directories - Provide disk space governance recommendations, and distinguish low-risk and medium-risk cleanup items
Do not use
This skill should not be used in the following scenarios:
- The user wants to uninstall a specific application, rather than perform a disk governance inventory
- The user requests direct deletion of a business data directory, but without explicit confirmation
- The task environment is not macOS, or the target path does not apply to the current system
Usage instructions
- First execute
scripts/report_sizes.sh, inventory software sources and major usage directories. - Based on the report, distinguish cleanup priorities:
- Priority 1: caches and simulator data, low risk by default.
- Priority 2: application business data directories, only list candidates, do not delete directly.
- Priority 3: small caches or logs with lower benefit.
- When outputting conclusions, must show directory categories, counts, total usage, and Top N large items.
- If priority 2 candidates need to be scanned, execute
scripts/list_priority2_candidates.sh [目标目录] [TopN]。 - Only after explicit user confirmation, execute
scripts/cleanup_priority1.shor equivalent cleanup actions. - After cleanup is complete, recalculate and output the comparison result of "before cleanup -> after cleanup -> space freed".
Standard process
盘点安装来源与空间占用
-> 识别高价值可清理目录
-> 给出分级建议
-> 等待用户确认
-> 执行低风险清理
-> 复核释放结果
Execute command
bash scripts/report_sizes.sh
bash scripts/list_priority2_candidates.sh ~/Library/Application\\ Support 20
bash scripts/cleanup_priority1.sh
Output requirements
- Clearly show the count and total usage of each type of path
- List Top N large items, to facilitate quick user decisions
- Any cleanup action must include a before-and-after cleanup comparison
- Without user confirmation, do not proactively delete priority 2 directories
Boundaries
- Do not use destructive git commands
- Do not delete application business data not confirmed by the user
- If the script fails, switch to a more reliable read-only investigation or minimal-scope cleanup method