/xcode-build-suite:xcode-build-orchestratorfrom xcode-build-suite
Orchestrates end-to-end Xcode build optimization: benchmarks, runs specialist analysis, prioritizes findings, requests approval, delegates fixes, and re-benchmarks. Use for full build audits or speeding up Xcode builds.
Ships in xcode-build-suite. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill as the recommend-first entrypoint for end-to-end Xcode build optimization work.
The orchestration is designed as two distinct phases separated by developer review.
Run this phase in agent mode because the agent needs to execute builds, run benchmark scripts, write benchmark artifacts, and generate the optimization report. However, treat Phase 1 as recommend-only: do not modify any project files, source files, packages, or build settings. The only files the agent creates during this phase are benchmark artifacts and the optimization plan inside .build-benchmark/.
.xcworkspace and .xcodeproj exist, prefer .xcodeproj unless the workspace contains sub-projects required for the build. Workspaces that reference external projects may fail if those projects are not checked out.xcode-build-benchmark to establish a baseline if no fresh benchmark exists. The benchmark script auto-detects COMPILATION_CACHING = YES and includes cached clean builds that measure the realistic developer experience (warm cache). If the build fails to compile, check git log for a recent buildable commit. When working in a worktree, cherry-picking a targeted build fix from a feature branch is acceptable to reach a buildable state. If SPM packages reference gitignored directories in their exclude: paths (e.g., __Snapshots__), create those directories before building -- worktrees do not contain gitignored content and xcodebuild -resolvePackageDependencies will crash otherwise.timing_summary_categories. If empty, the timing summary parser may have failed -- re-parse the raw logs or inspect them manually. If COMPILATION_CACHING is enabled, also verify the artifact includes cached_clean runs.
SwiftCompile, CompileC, SwiftEmitModule, or Planning Swift module dominate the timing summary and appear likely to be on the critical path, run diagnose_compilation.py to capture type-checking hotspots. If they are parallelized, still run diagnostics but label findings as "parallel efficiency improvements" rather than "build time improvements."generate_optimization_report.py and save it to .build-benchmark/optimization-plan.md. This report includes the build settings audit, timing analysis, prioritized recommendations, and an approval checklist.The developer reviews .build-benchmark/optimization-plan.md, checks the approval boxes for the recommendations they want implemented, and then triggers phase 2.
Run this phase in agent mode after the developer has reviewed and approved recommendations from the plan. Delegate all implementation work to xcode-build-fixer by reading its SKILL.md and applying its workflow.
CRITICAL: All verification MUST use a controlled A/B test. Comparing benchmarks from different workspace generations, different build-graph states, or different times of day produces unreliable results. The A/B protocol below eliminates these variables.
Both the baseline and optimized benchmarks must be run back-to-back in a single session using identical methodology:
Step A -- Baseline measurement:
git checkout Project.swift).tuist generate --no-open) so the baseline uses a freshly generated project — identical to what the optimized run will use.xcodebuild build, discard results) to settle Xcode's build graph and eliminate first-run artifacts like script-phase invalidation.--skip-warmup --no-cached-clean).Step B -- Optimized measurement: 5. Apply the approved changes to project files. 6. Regenerate the workspace again (same command as step 2). 7. Run 2 warmup builds to settle the build graph. 8. Benchmark with the same script and flags as step 4.
Step C -- Compare: 9. Compare median wall-clock times from both artifacts. Only claim an improvement if the optimized median falls outside the baseline's min-max range.
This protocol ensures both runs share the same environmental conditions (machine load, thermal state, OS caches) and the same workspace-generation method, making the comparison fair.
.build-benchmark/optimization-plan.md and identify the approved items from the approval checklist.xcode-build-fixer with the approved plan. The fixer applies each approved change and verifies compilation.ab-test-YYYY-MM-DD/baseline/ and ab-test-YYYY-MM-DD/optimized/).The goal is to reduce how long the developer waits for builds to finish.
PhaseScriptExecution, CompileAssetCatalog, CodeSign) accounts for a large fraction of wall-clock, that is the real bottleneck.Planning Swift module or SwiftEmitModule dominates incremental builds, the cause is likely invalidation or module size, not individual file compile speed.Prefer changes that are measurable, reversible, and low-risk.
Every recommendation presented to the developer must include one of these impact statements:
Never quote cumulative task-time savings as the headline impact. If a change reduces 5 seconds of parallel compile work but another equally long task still runs, the developer's wait time does not change.
Before implementing anything, present a short approval list that includes:
Wait for explicit developer approval.
After approval, delegate to xcode-build-fixer:
Lead with the wall-clock result in plain language, e.g.: "Your clean build now takes 82s (was 86s) -- 4s faster." Then include:
Generate a standalone markdown report at .build-benchmark/xcode-build-optimization-stakeholder-report.md suitable for import into Notion or Confluence. Include:
python3 .claude/skills/scripts/benchmark_builds.py \
--project App.xcodeproj \
--scheme MyApp \
--configuration Debug \
--destination "platform=iOS Simulator,name=iPhone 16" \
--output-dir .build-benchmark
For macOS apps use --destination "platform=macOS". For watchOS use --destination "platform=watchOS Simulator,name=Apple Watch Series 10". For tvOS use --destination "platform=tvOS Simulator,name=Apple TV". Omit --destination to use the scheme's default.
To measure real incremental builds (file-touched rebuild) instead of zero-change builds, add --touch-file path/to/SomeFile.swift.
python3 .claude/skills/scripts/diagnose_compilation.py \
--project App.xcodeproj \
--scheme MyApp \
--configuration Debug \
--destination "platform=iOS Simulator,name=iPhone 16" \
--threshold 100 \
--output-dir .build-benchmark
python3 .claude/skills/scripts/generate_optimization_report.py \
--benchmark .build-benchmark/<artifact>.json \
--project-path App.xcodeproj \
--diagnostics .build-benchmark/<diagnostics>.json \
--output .build-benchmark/optimization-plan.md
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub carloshpdoc/ios-workflow-claude --plugin xcode-build-suite6 skills in this plugin
/spm-build-analysisAnalyze Swift Package Manager dependencies, package plugins, module variants, and CI-oriented build overhead that slow Xcode builds. Use when a developer suspects packages, plugins, or dependency graph shape are hurting clean or incremental build performance, mentions SPM slowness, package resolution time, build plugin overhead, duplicate module builds from configuration drift, circular dependencies between modules, oversized modules needing splitting, or modularization best practices./xcode-build-benchmarkBenchmark Xcode clean and incremental builds with repeatable inputs, timing summaries, and timestamped `.build-benchmark/` artifacts. Use when a developer wants a baseline, wants to compare before and after changes, asks to measure build performance, mentions build times, build duration, how long builds take, or wants to know if builds got faster or slower./xcode-build-fixerImplement approved Xcode build optimization changes following best practices, then re-benchmark to verify improvement. Use when the developer has reviewed an optimization plan and approved specific changes, or when there is a clear list of build-setting or source-level fixes to apply and verify.