disk-cleanup
Skill0 starsChanged 18 days agoMITView on GitHub
macOS 开发机磁盘空间排查与清理。用户要求排查磁盘占用、释放空间或清理开发缓存时使用,覆盖 Xcode、模拟器、SwiftPM、Gradle 与 Android 开发环境。默认只读调查,清理限定在用户授权的具体范围;不用于卸载项目、删除用户资料或批量重置模拟器。
20 other projects use a version of this.
Adopted by
Most recently taken up by
- addisonk/skillstheir own version, first seen Nov 8, 2026
- DaraBoth/skilljmskilltheir own version, first seen Nov 8, 2026
- jars-demo/jars-skillstheir own version, first seen Nov 1, 2026
- pabloleonalcaide/development-skillstheir own version, first seen Nov 1, 2026
- TsinHzl/claude-code-configtheir own version, first seen Nov 1, 2026
- MakiDevelop/claude-skillstheir own version, first seen Nov 1, 2026
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.
MicrosoftSkillapi-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
GoogleSkilltdd
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
MicrosoftSkillrelease
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
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- glebis/claude-skills★ 410same name
- mtarcure/claude-vibe-squad★ 220same name
- MakiDevelop/claude-skills★ 3same name
- vndee/engineering-skills★ 3same name
- DaraBoth/skilljmskill★ 2same name
- TsinHzl/claude-code-config★ 2same name
- addisonk/skills★ 1same name
- CharlesLadera/claude-custom-skills★ 1same name
- foogunlana/skills★ 1same name
- galonge/free-claude-skills★ 1same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app-icon-studioSkill
- localize-app-store-screenshotsSkill
- macos-direct-distributionSkill
- macos-finder-extensionSkill
- mobbin-searchSkill
- smooth-alpha-edgesSkill
- stock-value-analysisSkill
- task-artifactsSkill
- write-ai-docSkill
- xcode-cloud-setupSkill
The file
Files
开发机磁盘清理
先确认实际占用,再识别可重建内容,最后按已有授权清理并测量真实回收量。目录名称不是删除依据,build、dist 和 artifacts 可能包含源码、签名配置、发布文件或必须保留的证据。
1. 只读调查
确认要检查的磁盘或目录。默认检查当前 Mac 的用户目录;用户指定外接磁盘时以该磁盘为准。记录对应文件系统的可用空间:
df -h "$HOME"
du -xhd 1 "$HOME/Library/Developer" 2>/dev/null | sort -hr | head -20
du -xhd 1 "$HOME/Documents" 2>/dev/null | sort -hr | head -20不存在的目录跳过,权限不足应记录;不为完成调查申请整盘访问权限。先查看一级占用,只对大目录继续下钻,避免反复扫描整个用户目录。
按环境检查常见占用:
具体开发工具位置与 DerivedData 归属读取方法见只读定位参考。仅在主目录调查需要进一步定位时读取。
| 位置 | 调查重点 | 清理边界 |
| Xcode DerivedData | 项目归属、运行中的 App、构建与索引任务 | 只清理已确认闲置且可重建的具体目录 |
| Xcode DeviceSupport | 调试符号与当前设备系统版本 | 明确下次连接可能重新下载或生成 |
| CoreSimulator、XCTestDevices | 设备状态、数据、快照和 APFS 克隆 | 用系统管理工具逐项处理;不整体删除设备根目录 |
| SwiftPM、Gradle 缓存 | 依赖重下载成本、活跃构建 | 只处理授权的缓存,不删除仓库和本地源码 |
| Android AVD | 模拟器定义、系统镜像、用户数据和快照 | 用户数据与快照不是普通缓存,重置必须另有明确授权 |
| 项目依赖与构建目录 | 版本跟踪、忽略规则、本地配置、发布文件 | 不凭名称统一删除,不运行全仓库清理命令 |
| Application Support、Containers | 应用数据库、账号、素材和用户资料 | 不能当作缓存处理 |
2. 制定具体清单
对每个候选记录绝对路径、测得大小、用途、可重建依据、活跃状态和删除影响。判断时:
- 核对版本管理中的已跟踪文件、未提交改动和被忽略的本地配置。保留
.git、.jj、工作区、原始素材、密钥和签名资料。 - 查询进程及打开文件;检查正在运行的 App 是否来自候选目录。状态不明确时保留,不终止无关进程。
- 将归档、安装包和验收证据单独列出;它们即使能重新生成,也不自动属于缓存。
- 报告候选大小与删除影响。APFS 克隆、快照和共享块会使
du与真实可回收空间不同,不承诺按目录大小等额回收。
3. 在授权范围内清理
仅当用户已授权清理相应候选时执行;已有明确授权可直接沿用,不重复确认。用户只要求“看看”时保持只读。新的数据重置、卸载或超出清单的删除须先说明并取得授权。
执行前重新检查路径、符号链接和进程状态,防止调查后目录用途已变化。优先使用环境提供的定向清理工具,并先检查其当前帮助与预览能力:
brew cleanup --dry-run
xcrun simctl list devices仅在已安装对应工具时运行。管理工具的清理范围也必须与授权清单一致;“不可用模拟器”仍可能有用户数据。不要全局终止构建进程,不使用通配符清空整个开发目录,不根据文本列表直接拼接删除命令。
没有可靠可重建依据、路径越界、仍被使用或操作范围不明时停止该项,继续处理独立且已确认的候选。报告跳过原因。
4. 验证结果
再次读取同一文件系统的可用空间,并检查已处理目录及应保留文件。列出实际处理路径、失败与跳过项、前后可用空间和观察到的差值。其他进程同时写入会影响差值,应注明测量边界。
迁移任务默认复制重要资料并保留源文件。不要将“只迁移重要文件”解释为允许删除旧电脑上的资料。
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
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.

