axiom-codex/skills/axiom-optimize-build/SKILL.md
Use when the user mentions slow builds, build performance, or build time optimization.
npx skillsauth add charleswiltgen/axiom axiom-optimize-buildInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Note: This audit may use Bash commands to run builds, tests, or CLI tools.
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%.
Scan the Xcode project and identify optimization opportunities in these categories:
For each finding, provide:
Check Debug configuration:
Use Glob to locate project file:
**/*.xcodeproj/project.pbxprojScan for these settings in Debug configuration:
SWIFT_COMPILATION_MODE should be singlefile (incremental)ONLY_ACTIVE_ARCH should be YES (debug only)DEBUG_INFORMATION_FORMAT should be dwarf (not dwarf-with-dsym)SWIFT_OPTIMIZATION_LEVEL should be -OnoneCheck Release configuration:
SWIFT_COMPILATION_MODE should be wholemoduleONLY_ACTIVE_ARCH should be NOSWIFT_OPTIMIZATION_LEVEL should be -OModern Build Settings (WWDC 2022+):
ENABLE_USER_SCRIPT_SANDBOXING should be YES (Xcode 14+, improves build security and caching)FUSE_BUILD_SCRIPT_PHASES should be YES (parallel script execution)Link-Time Optimization (Release Only):
LLVM_LTO should be YES or YES_THIN for Release builds (reduces binary size, improves performance)grep "LLVM_LTO" project.pbxproj# Find build phase scripts
grep -A 10 "shellScript" project.pbxproj
Red flags:
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
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
# 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.
# Check available cores
sysctl -n hw.ncpu
Recommend setting "Build Active Architecture Only" to YES for debug to maximize parallelization.
How to access Build Timeline:
What to look for:
Actionable fixes from Build Timeline:
.alwaysOutOfDate = false)Use Glob to find Xcode project files:
**/*.xcworkspace**/*.xcodeprojUse Glob to find project configuration:
**/*.xcodeproj/project.pbxprojUse 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
# Extract all shell scripts from build phases
grep -A 20 "shellScript" project.pbxproj
# Look for existing Swift flags
grep "OTHER_SWIFT_FLAGS" project.pbxproj
Generate a "Build Performance Optimization Report" with:
development
Use when building ANY watchOS app — app structure, independent apps, Watch Connectivity, Smart Stack widgets, complications, controls, RelevanceKit, background tasks, ClockKit migration.
development
Use when working with HealthKit, WorkoutKit, health data, workouts, or fitness features on iOS or watchOS. Covers permissions, queries, background delivery, custom workouts, multidevice coordination.
development
Use when building, fixing, or improving ANY SwiftUI UI — views, navigation, layout, animations, performance, architecture, gestures, debugging, iOS 26 features.
content-media
Use when working with camera, photos, audio, haptics, ShazamKit, or Now Playing. Covers AVCaptureSession, PHPicker, PhotosPicker, AVFoundation, Core Haptics, audio recognition, MediaPlayer, CarPlay, MusicKit.