agentleFS
MakiDevelopMakiDevelop/claude-skills/skills/disk-cleanup/SKILL.md

disk-cleanup

Skill3 starsChanged 8 months agoMITView on GitHub

macOS 磁碟清理。掃描大目錄、分類可刪/可搬/需確認、Docker/Xcode 清理。當用戶說「清磁碟」「磁碟空間不夠」「disk cleanup」時使用。

  • Reads credentials

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use api-design, tdd and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 4 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

Files
SKILL.md

macOS 磁碟清理

一鍵掃描磁碟用量,分類建議,協助清理空間。

流程

Step 1:總覽

同時執行:

df -h /
diskutil apfs list | grep -E "Capacity In Use|Capacity Not Allocated" | head -2

分別報告 df 與 APFS 容量及觀測時間;Finder 可能含可清除空間,不將不同定義混成同一個數字。

Step 2:掃描大目錄

du -sh ~/Documents ~/Downloads ~/Movies ~/GitHub ~/GitLab ~/Projects ~/.cache ~/Library/Caches ~/Library/Developer ~/Library/Containers 2>/dev/null | sort -rh

對 > 5GB 的目錄進一步展開子目錄。

Step 3:分類

將找到的項目分成三類,用表格呈現:

類別說明需確認
可評估重建cache、.venv、node_modules、DerivedData、pycache、.ruff_cache確認用途與重建成本;只提供清單
可搬到外接大型模型、VM、DMG、影片、舊專案列出後問用戶
需確認不確定用途的大目錄問用戶

Step 4:Docker 清理

docker system df

若有可回收空間,建議 docker system prune(需用戶確認)。

Step 5:Xcode 清理

檢查:

xcrun simctl runtime list                    # Simulator runtimes
ls ~/Library/Developer/Xcode/iOS\ DeviceSupport/   # DeviceSupport
du -sh ~/Library/Developer/Xcode/DerivedData        # DerivedData
du -sh /Library/Developer/CoreSimulator             # CoreSimulator 總量

列出候選舊版本與相依專案;不得假設最新兩版足夠。只提供操作草案,由用戶自行清理。

Step 6:Python venvs

掃描所有 .venv 和 virtualenvs:

find "$HOME" -maxdepth 4 -type d \( -name ".venv" -o -name "venv" \) -prune 2>/dev/null

Step 7:Time Machine 本機快照

tmutil listlocalsnapshots /

列出快照日期與用量資訊;數量本身不是刪除理由,不自動清除備份。

Step 8:結果報告

## 磁碟清理報告

**清理前**: APFS free {X}GB
**可回收空間**:
- 候選重建項目(未刪除): {X}GB
- 可搬到外接: {X}GB
- Docker: {X}GB
- Xcode: {X}GB

### 建議操作(需你確認):
1. ...
2. ...

注意

  • 本 skill 僅掃描與提出建議,不執行刪除、prune、跨磁碟搬移或快照清理。危險命令只提供草案,由用戶自行執行。
  • 不要刪 .env、credentials、SSH key 等敏感檔案
  • 掃描不應超過 60 秒
  • 此 skill 僅適用 macOS

Quality Gates

  • 掃描限於用戶指定位置;避免跨磁碟與全家目錄無界掃描。
  • 權限錯誤、未掃描範圍與逾時明確標記。
  • 可回收為估計值;沒有執行操作就不宣稱已釋放空間。
  • 不執行任何刪除命令,也不因 allowed-tools pattern 而推定已獲破壞性操作授權。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.