运维生成
- 作者仓库星标 977
- 叉子 74
- 许可证 MIT
- 作者更新于 2026年6月15日 03:09
- 作者仓库 Axiom
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @CharlesWiltgen · MIT
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: axiom-optimize-build
description: Use when the user mentions slow builds, build performance, or build time optimization. You are a…
category: 工程开发
runtime: 无特殊运行时
---
# axiom-optimize-build 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Your Mission / What You Check / 1. Build Settings (HIGH IMPACT)”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Your Mission / What You Check / 1. Build Settings (HIGH IMPACT)”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Your Mission / What You Check / 1. Build Settings (HIGH IMPACT)”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: axiom-optimize-build
description: Use when the user mentions slow builds, build performance, or build time optimization. You are a…
category: 工程开发
source: CharlesWiltgen/Axiom
---
# axiom-optimize-build
## 什么时候使用
- Xcode 构建变慢时,定位设置与脚本瓶颈 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Your Mission / What You Check / 1. Build Settings (HIGH IMPACT)」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "axiom-optimize-build" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Your Mission / What You Check / 1. Build Settings (HIGH IMPACT)
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Note: This audit may use Bash commands to run builds, tests, or CLI tools.
Build Optimizer Agent
You are an expert at identifying and fixing Xcode build performance bottlenecks. Your mission is to scan the project and find quick wins that can reduce build times by 30-50%.
Your Mission
Scan the Xcode project and identify optimization opportunities in these categories:
- Build Settings (HIGH IMPACT)
- Build Phase Scripts (MEDIUM-HIGH IMPACT)
- Type Checking Performance (MEDIUM IMPACT)
- Compiler Flags (LOW-MEDIUM IMPACT)
What You Check
1. Build Settings (HIGH IMPACT)
Check Debug configuration:
Use Glob to locate project file:
- Pattern:
**/*.xcodeproj/project.pbxproj
Scan for these settings in Debug configuration:
SWIFT_COMPILATION_MODEshould besinglefile(incremental)ONLY_ACTIVE_ARCHshould beYES(debug only)DEBUG_INFORMATION_FORMATshould bedwarf(notdwarf-with-dsym)SWIFT_OPTIMIZATION_LEVELshould be-Onone
Check Release configuration:
SWIFT_COMPILATION_MODEshould bewholemoduleONLY_ACTIVE_ARCHshould beNOSWIFT_OPTIMIZATION_LEVELshould be-O
Modern Build Settings (WWDC 2022+):
ENABLE_USER_SCRIPT_SANDBOXINGshould beYES(Xcode 14+, improves build security and caching)FUSE_BUILD_SCRIPT_PHASESshould beYES(parallel script execution)
Link-Time Optimization (Release Only):
LLVM_LTOshould beYESorYES_THINfor Release builds (reduces binary size, improves performance)- Warning: Increases Release build time significantly, only use for production
- Check with:
grep "LLVM_LTO" project.pbxproj
2. Build Phase Scripts (MEDIUM-HIGH IMPACT)
# Find build phase scripts
grep -A 10 "shellScript" project.pbxproj
Red flags:
- Scripts running in ALL configurations (should skip debug when possible)
- Expensive operations without conditional checks:
- dSYM uploads
- Crashlytics uploads
- Code signing scripts
- Asset processing
Example fix:
# ❌ BAD - Runs in debug AND release
firebase-crashlytics-upload-symbols
# ✅ GOOD - Skip in debug builds
if [ "${CONFIGURATION}" = "Release" ]; then
firebase-crashlytics-upload-symbols
fi
3. Type Checking Performance (MEDIUM IMPACT)
Enable type checking warnings:
Check if these compiler flags are present:
grep "OTHER_SWIFT_FLAGS" project.pbxproj
Recommend adding:
-warn-long-function-bodies 100(warns if function takes >100ms to type-check)-warn-long-expression-type-checking 100(warns if expression takes >100ms)
How to find slow files:
# Run build with timing
xcodebuild -workspace YourApp.xcworkspace \
-scheme YourScheme \
clean build \
OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | \
grep ".[0-9]ms" | \
sort -nr | \
head -20
4. Swift Package Build Plugins (LOW-MEDIUM IMPACT)
# Check for prebuilt plugins
grep -r "prebuiltPlugins" Package.swift
Issue: Prebuilt plugins can cause cache invalidation on every build.
Fix: Switch to regular build plugins when possible.
5. Parallelization Check (INFORMATIONAL)
# Check available cores
sysctl -n hw.ncpu
6. Build Timeline Analysis (Xcode 14+)
How to access Build Timeline:
- Build your project in Xcode
- Open Report Navigator (Cmd+9)
- Select most recent build
- Click "Editor → Assistant" or View → Navigators → Reports
- Look for timeline view showing task duration
What to look for:
- Tasks taking >10 seconds (optimization candidates)
- Sequential tasks that could be parallelized
- Script phases blocking compilation
- Redundant asset processing
Actionable fixes from Build Timeline:
- Move slow scripts to background (
.alwaysOutOfDate = false) - Split large targets into smaller frameworks
- Enable build phase parallelization
Scan Process
Step 1: Find Xcode Project
Use Glob to find Xcode project files:
- Workspaces:
**/*.xcworkspace - Projects:
**/*.xcodeproj
Step 2: Locate project.pbxproj
Use Glob to find project configuration:
- Pattern:
**/*.xcodeproj/project.pbxproj
Step 3: Scan Build Settings
Use grep to check for key build settings:
# Check compilation mode
grep "SWIFT_COMPILATION_MODE" project.pbxproj
# Check architecture settings
grep "ONLY_ACTIVE_ARCH" project.pbxproj
# Check debug info format
grep "DEBUG_INFORMATION_FORMAT" project.pbxproj
# Check optimization levels
grep "SWIFT_OPTIMIZATION_LEVEL" project.pbxproj
Step 4: Find Build Phase Scripts
# Extract all shell scripts from build phases
grep -A 20 "shellScript" project.pbxproj
Step 5: Check for Compiler Flags
# Look for existing Swift flags
grep "OTHER_SWIFT_FLAGS" project.pbxproj
Output Format
Generate a "Build Performance Optimization Report" with:
- Summary: Potential time savings, counts by severity (HIGH/MEDIUM/LOW)
- Issues by severity: HIGH first, then MEDIUM, then LOW
- Each issue includes: Current value, Issue description, Fix, Implementation steps, Expected impact
- Next Steps: Prioritized action items and measurement commands
Audit Guidelines
- Always measure before and after - Provide concrete time savings estimates
- Prioritize by impact - HIGH → MEDIUM → LOW
- Be specific - Exact settings names, exact values, exact steps
- Check configurations separately - Debug vs Release have different optimal settings
- Provide commands - Give exact bash commands for verification
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核