Complete macOS system maintenance that replaces CleanMyMac, Tencent Lemon, Pearcleaner. Four modules: (1) deep app uninstall with 30+ location residual scan, (2) startup/login item audit with service identification, (3) disk cleanup with 3-tier safety classification, (4) system health check. Use when: uninstall app, remove app completely, clean Mac, startup items, login items, launch agents, disk space, free storage, cache cleanup, large files, system maintenance, 卸载, 清理, 启动项, 磁盘, 缓存, 系统维护.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Complete macOS system maintenance that replaces CleanMyMac, Tencent Lemon, Pearcleaner. Four modules: (1) deep app uninstall with 30+ location residual scan, (2) startup/login item audit with service identification, (3) disk cleanup with 3-tier safety classification, (4) system health check. Use when: uninstall app, remove app completely, clean Mac, startup items, login items, launch agents, disk space, free storage, cache cleanup, large files, system maintenance, 卸载, 清理, 启动项, 磁盘, 缓存, 系统维护.
A professional-grade macOS maintenance toolkit invoked via natural language or /macsweep.
Replaces GUI tools (CleanMyMac, Tencent Lemon, Pearcleaner) with contextual intelligence —
identifies what each file and service actually is, explains impact before acting.
Key metrics: Scans 30+ Library subdirectories (GUI tools check 5-8). Identifies services
by inspecting actual binary contents. Manages BTM database directly. Zero runtime overhead.
Safety Principles
Never delete without confirmation — present targets with sizes, then ask
Scan before act — always run analysis before any destructive operation
Trash over rm — prefer osascript -e 'tell app "Finder" to move POSIX file "/path" to trash'; only use rm for system-level files that can't go to Trash
Measure before and after — record df -h / baseline, compare after cleanup
Explain impact — every deletion recommendation includes "what happens if deleted"
Respect sudo boundary — present sudo commands for user to execute, never auto-sudo
Verify after cleanup — re-scan to confirm all targets removed
Conservative default — when uncertain about a file's purpose, keep it and explain
Absolute Prohibitions
NEVER rm -rf on /, ~, or any broad wildcard without explicit paths
NEVER delete SSH keys, GPG keys, .env files, keychains, credentials, or shell configs
NEVER touch /System, /usr, /bin, /sbin, /Library/Apple
NEVER delete .git directories without explicit per-repo confirmation
NEVER auto-execute docker system prune -a — list items individually first
NEVER skip the scan/analysis step
NEVER auto-run sudo commands — present them for user to execute
Routing
Parse $ARGUMENTS to select module:
Input Pattern
Module
uninstall <name> or 卸载 <name>
Module 1: App Uninstaller
startup or 启动项
Module 2: Startup Manager
cleanup or 清理
Module 3: Disk Cleanup
health or 健康 or 检查
Module 4: System Health
(empty or ambiguous)
Show module menu, ask user to choose
Module 1: Complete App Uninstaller
The most thorough app removal available on macOS — scans 30+ Library subdirectories,
manages launch services, and cleans BTM ghost entries.
Step 1: Identify
# Find the appls /Applications/ ~/Applications/ 2>/dev/null | grep -i "<name>"# Extract bundle ID
mdls -name kMDItemCFBundleIdentifier "/Applications/<App>.app"# Note: also check app's Info.plist for additional identifiers
Store: APP_NAME, BUNDLE_ID, APP_PATH
Step 2: Check if Homebrew-managed
brew list --cask | grep -i "<name>"
If found, prefer brew uninstall --cask <name> — it handles basic cleanup.
Step 3: Kill processes
pgrep -fi"<app-name>"# If running, ask user to quit. Only force-kill with confirmation:
pkill -fi"<app-name>"
Step 4: Unload launch services
# Scan for related services
launchctl list | grep -i "<bundle-id-or-name>"ls ~/Library/LaunchAgents/ | grep -i "<bundle-id-or-name>"ls /Library/LaunchAgents/ 2>/dev/null | grep -i "<bundle-id-or-name>"ls /Library/LaunchDaemons/ 2>/dev/null | grep -i "<bundle-id-or-name>"
For each match:
User agents: launchctl bootout gui/$(id -u) <plist-path> then rm <plist>
System agents/daemons: present sudo launchctl bootout system <plist-path> and sudo rm <plist> for user
Step 5: Remove app bundle
Homebrew: brew uninstall --cask <name>
Manual: sudo rm -rf "/Applications/<App>.app" (present to user)
Step 6: Deep residual scan
Scan ALL locations listed in references/residual_locations.md using the bundled script:
Complete visibility into every auto-starting process — identifies what each service does,
whether its parent app still exists, and whether it's necessary.
Read references/cleanup_targets.md for safety classifications. Present 3 tiers:
SAFE — system caches, old logs, crash reports, Trash, saved app state
LOW RISK — old downloads, Xcode DerivedData, Homebrew cache, package manager caches
MEDIUM RISK — Docker images/volumes, iOS device support, AI model caches
Each row: Category | Path | Size | Impact If Deleted
Step 4: Execute
SAFE tier: batch confirm ("Delete all SAFE items? Y/N")
LOW RISK tier: confirm each category
MEDIUM RISK tier: confirm each item individually with impact warning
Use Trash where possible. Use brew cleanup for Homebrew. Use specific docker image rm
for Docker (never blind docker system prune -a).
Step 5: Report
Before: XX.X GB available
After: XX.X GB available
Freed: XX.X GB
Items cleaned: XX | Items skipped: XX
Module 4: System Health Check
Diagnose system issues that accumulate over time.
Check 1: Orphaned app data
Cross-reference installed apps (/Applications/) with ~/Library/Application Support/,
~/Library/Caches/, ~/Library/Preferences/ to find data from uninstalled apps.
Check 2: Broken launch services
Reuse the audit script (which uses PlistBuddy for reliable path extraction):