compare-bundles
它能做什么
这项技能比较在 Tuist 中记录的两个应用包,例如两个分支的构建,查看体积和内容的变化。适合关注下载和安装体积的应用开发者。
适用场景
- ✓当应用的下载或安装体积增长,你想知道原因时。
- ✓当你想查看两个包之间新增或删除了哪些构件的时候。
- ✓当你想要一份体积比较报告,并附带精简应用的建议的时候。
技能链接
https://github.com/tuist/tuist/blob/main/skills/skills/compare-bundles/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请比较我功能分支上的最新包和主分支,并告诉我是什么让应用变大了。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会找到这两个包,比较其体积和元数据,然后列出发生变化的构件,并建议可以在哪些地方减小体积。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Compare Bundles
Quick Start
You'll typically receive two bundle identifiers. Follow these steps:
- Run
tuist bundle list --jsonto find bundles on each branch. - Run
tuist bundle show <bundle-id> --jsonfor both base and head bundles. - Compare artifact trees with
tuist bundle artifact list <bundle-id> --json. - Compare install size, download size, and other metadata.
- Summarize size changes with actionable recommendations.
Step 1: Resolve Bundles
If base/head are bundle IDs or dashboard URLs
Fetch each directly:
tuist bundle show <base-id> --json
tuist bundle show <head-id> --json
If base/head are branch names
List recent bundles on each branch and pick the latest:
tuist bundle list --git-branch <base-branch> --json
tuist bundle list --git-branch <head-branch> --json
Then fetch full details with tuist bundle show <id> --json.
Defaults
- If no base is provided, use the project's default branch (usually
main). - If no head is provided, detect the current git branch.
Step 2: Compare Artifact Trees
After fetching both bundles with tuist bundle show <id> --json, compare the individual artifacts:
tuist bundle artifact list <base-id> --json
tuist bundle artifact list <head-id> --json
Match artifacts by name across both bundles. Look for:
- New artifacts added in the head bundle (potential size contributors)
- Removed artifacts (explain size decreases)
- Size changes in existing artifacts
Step 3: Compare Top-Level Metrics
After fetching both bundles, compare:
| Metric | What to check |
|---|---|
install_size |
Flag if head is >5% larger |
download_size |
Flag if head is >5% larger |
version |
Note version changes |
supported_platforms |
Note platform changes |
app_bundle_id |
Should match between base and head |
Compute deltas:
- Install size delta:
head_install_size - base_install_size - Download size delta:
head_download_size - base_download_size - Percentage change:
delta / base_size * 100
Step 4: Analyze Size Changes
If size increased significantly (>5%):
- Check if
versionchanged, which might explain expected size growth. - Check if
supported_platformschanged (adding a platform increases size). - Look at the
artifactsfield in the bundle details for individual artifact sizes.
Common causes of size increases:
- New frameworks or libraries added
- Asset catalogs grew (new images, videos)
- Unoptimized resources (large PNGs instead of compressed formats)
- Debug symbols included in release builds
- New localizations added
Common causes of size decreases:
- Removed unused frameworks
- Optimized assets
- Tree shaking or dead code elimination improvements
- Moved functionality to on-demand resources
Summary Format
Produce a summary with:
- Overall verdict: Size increased, decreased, or stable.
- Install size: Absolute and percentage change.
- Download size: Absolute and percentage change.
- Version: Note if version changed.
- Platforms: Note any platform changes.
- Recommendations: Actionable next steps for size regressions.
Example:
Bundle Comparison: base (v2.1.0 on main) vs head (v2.2.0 on feature-x)
Install Size: 45.2 MB -> 52.8 MB (+16.8%) -- REGRESSION
Download Size: 28.1 MB -> 32.4 MB (+15.3%) -- REGRESSION
Version: 2.1.0 -> 2.2.0
Platforms: iOS, macOS (unchanged)
The install size increased by 7.6 MB. This is a significant increase
that may affect user download and storage experience.
Recommendations:
- Review new frameworks or assets added in this version
- Check for uncompressed resources or oversized image assets
- Consider using asset compression or on-demand resources
- Run `xcrun bitcode_strip` analysis to check for unnecessary bitcode
Done Checklist
- Resolved both base and head bundles
- Compared artifact trees using
tuist bundle artifact list - Compared install and download sizes
- Analyzed root causes of size changes
- Provided actionable recommendations
常见问题
我需要 Tuist 吗?
需要。它通过 Tuist 命令行工具读取包数据。
它比较哪些体积?
它比较安装体积和下载体积,以及其他元数据。
它能匹配不同包中的文件吗?
能。它按名称匹配构件,以找出新增和删除的文件。
详情
作者的原始描述
Compares two app bundles to identify size changes, new or removed artifacts, and platform differences. Can be invoked with bundle IDs, dashboard URLs, or branch names.
repo: tuist/tuist
热度
- GitHub 星标
- 5.9k
- 排名
- #14538
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
analyze-selective-testing
5.9k帮你的智能体检查 Xcode 选择性测试跳过未改动测试目标的效果,并找出两次运行之间跳过情况变化的原因。
compare-builds
5.9k帮你的智能体比较两次 Xcode 构建,找出变慢的构建、缓存使用的变化和新出现的问题。
compare-cache-runs
5.9k帮你的智能体比较两次缓存运行,找出缓存命中率的变化,并解释缓存失效的原因。
compare-generations
5.9k帮你的智能体比较两次 Tuist 项目生成运行,找出缓存命中的变化以及缓存失效的原因。