
Xcode Compilation Analyzer
Diagnose and improve Xcode incremental build times using Apple-documented timing, dependency, and module practices.
Overview
Xcode Compilation Analyzer is an agent skill most often used in Build (also Ship perf) that applies Apple-documented Xcode incremental build and module practices after timing measurement.
Install
npx skills add https://github.com/avdlee/xcode-build-optimization-agent-skill --skill xcode-compilation-analyzerWhat is this skill?
- Cites Apple guidance: measure with Build With Timing Summary or `xcodebuild -showBuildTimingSummary`
- Target dependency accuracy for correctness and parallel compilation
- Run script input/output declarations and `.xcfilelist` for skippable script phases
- Module maps via `DEFINES_MODULE`, consistent compile options, and smaller scoped modules vs monoliths
- Coding practices: framework-qualified imports, narrow bridging, explicit types, simpler expressions
Adoption & trust: 2.4k installs on skills.sh; 1.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Xcode project rebuilds too much on small edits and you lack a checklist tied to official build-efficiency guidance.
Who is it for?
Solo Swift/Obj-C app developers optimizing local and CI compile times on medium or large Xcode projects.
Skip if: Pure Flutter/React Native repos with no native Xcode graph, or teams that have not captured a build timing summary baseline yet.
When should I use this skill?
When Xcode incremental builds are slow, after adding run script phases, or when refactoring targets/modules and you need Apple-cited optimization steps.
What do I get? / Deliverables
You get prioritized build optimizations—timing baseline, dependency fixes, script I/O, and module scoping—grounded in cited Apple documentation.
- Build timing interpretation
- Prioritized optimization checklist mapped to Apple sources
- Concrete project-setting or code-structure recommendations
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Compilation analysis is anchored in Build because most fixes change targets, modules, and Swift/Obj-C structure in the Xcode project itself. Frontend is the shelf for iOS/macOS app source and Xcode target graph work—not server or agent-tooling integrations.
Where it fits
Split an overstuffed app target into framework modules after timing summary shows redundant recompilation.
Tighten CI macOS runners by fixing script phases that never declare outputs.
Standardize `xcodebuild -showBuildTimingSummary` in nightly builds to catch dependency regressions.
How it compares
Use as a structured Apple-aligned audit—not a generic “clean derived data” tip list without measurement.
Common Questions / FAQ
Who is xcode-compilation-analyzer for?
Indie and solo Apple-platform developers who ship with Xcode and want agent help interpreting build timing and module structure using Apple’s own docs.
When should I use xcode-compilation-analyzer?
In Build while refactoring targets and modules; in Ship perf before tightening CI; when incremental builds feel slower after adding scripts, frameworks, or bridging headers.
Is xcode-compilation-analyzer safe to install?
It is documentation-driven analysis; any suggested `xcodebuild` or project edits run on your machine—check the Security Audits panel on this page before granting shell or filesystem access.
SKILL.md
READMESKILL.md - Xcode Compilation Analyzer
# Build Optimization Sources This file stores the external sources that the README and skill docs should cite consistently. ## Apple: Improving the speed of incremental builds Source: - <https://developer.apple.com/documentation/xcode/improving-the-speed-of-incremental-builds> Key takeaways: - Measure first with `Build With Timing Summary` or `xcodebuild -showBuildTimingSummary`. - Accurate target dependencies improve correctness and parallelism. - Run scripts should declare inputs and outputs so Xcode can skip unnecessary work. - `.xcfilelist` files are appropriate when scripts have many inputs or outputs. - Custom frameworks and libraries benefit from module maps, typically by enabling `DEFINES_MODULE`. - Module reuse is strongest when related sources compile with consistent options. - Breaking monolithic targets into better-scoped modules can reduce unnecessary rebuilds. ## Apple: Improving build efficiency with good coding practices Source: - <https://developer.apple.com/documentation/xcode/improving-build-efficiency-with-good-coding-practices> Key takeaways: - Use framework-qualified imports when module maps are available. - Keep Objective-C bridging surfaces narrow. - Prefer explicit type information when inference becomes expensive. - Use explicit delegate protocols instead of overly generic delegate types. - Simplify complex expressions that are hard for the compiler to type-check. ## Apple: Building your project with explicit module dependencies Source: - <https://developer.apple.com/documentation/xcode/building-your-project-with-explicit-module-dependencies> Key takeaways: - Explicit module builds make module work visible in the build log and improve scheduling. - Repeated builds of the same module often point to avoidable module variants. - Inconsistent build options across targets can force duplicate module builds. - Timing summaries can reveal option drift that prevents module reuse. ## SwiftLee: Build performance analysis for speeding up Xcode builds Source: - <https://www.avanderlee.com/optimization/analysing-build-performance-xcode/> Key takeaways: - Clean and incremental builds should both be measured because they reveal different problems. - Build Timeline and Build Timing Summary are practical starting points for build optimization. - Build scripts often produce large incremental-build wins when guarded correctly. - `-warn-long-function-bodies` and `-warn-long-expression-type-checking` help surface compile hotspots. - Typical debug and release build setting mismatches are worth auditing, especially in older projects. ## Apple: Xcode Release Notes -- Compilation Caching Source: - Xcode Release Notes (149700201) Key takeaways: - Compilation caching is an opt-in feature for Swift and C-family languages. - It caches prior compilation results and reuses them when the same source inputs are recompiled. - Branch switching and clean builds benefit the most. - Can be enabled via the "Enable Compilation Caching" build setting or per-user project settings. ## Apple: Demystify explicitly built modules (WWDC24) Source: - <https://developer.apple.com/videos/play/wwdc2024/10171/> Key takeaways: - Explains how explicitly built modules divide compilation into scan, module build, and source compile stages. - Unrelated modules build in parallel, improving CPU utilization. - Module variant duplication is a key bottleneck -- uniform compiler options across targets prevent it. - The build log shows each module as a discrete task, making it easier to diagnose scheduling issues. ## Swift Compile-Time Best Practices Well-known Swift language patterns that reduce type-checker workload during compilation: - Mark classes `final` when they are not intended for subclassing. This eliminates dynamic dispatch overhead and allows the compiler to de-virtualize method calls. - Restrict access control to the narrowest useful scope (`private`, `fileprivate`). Fewer visible symbols reduce the compiler's search sp