Xcode build baseline

From Xopoko/build-swift-apps · View interactive version

Xcode build baseline is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. Benchmark Xcode clean, cached-clean, zero-change, and incremental builds with fixed inputs, timing summaries, and `.build-benchmark/` artifacts.

How to use this skill

Skill file

Xcode Build Baseline

Before invoking Apple-only binaries, confirm the execution context is macOS. From Windows or Linux, run those steps in a Mac SSH project or through an already configured remote transport; do not retry missing Apple binaries locally.

Bundled commands use $PLUGIN_ROOT for the plugin root. Use the host's plugin-root variable when defined; otherwise set it to the absolute path of this plugin before running a helper from the app repository.

Measure before recommending build-time changes. Do not edit project files while benchmarking.

Rules

Inputs

Infer or ask for workspace/project, scheme, configuration, destination, simulator/device preference, custom DerivedData needs, and a representative Swift file for incremental touch tests.

Default Run

  1. Normalize the build command and record every cache-affecting flag.
  2. Run one untimed validation build, or use --skip-warmup if validation is already complete.
  3. Run 3 clean builds.
  4. Run 3 zero-change builds, or supply --touch-file path/to/SomeFile.swift to measure rebuilds after touching a source file. Run the helper with each input separately if you need both results.
  5. If COMPILATION_CACHE_ENABLE_CACHING = YES is detected, run 3 cached-clean builds using temporary DerivedData. Use --no-cached-clean to omit that phase.
  6. Preserve raw logs and the JSON artifact.

Preferred helper:

python3 "$PLUGIN_ROOT/shared/build-optimization/scripts/benchmark_builds.py" \
  --workspace App.xcworkspace \
  --scheme MyApp \
  --configuration Debug \
  --destination "platform=iOS Simulator,name=<latest available iPhone simulator>,OS=latest" \
  --output-dir .build-benchmark

If the helper is unavailable, run equivalent xcodebuild commands with -showBuildTimingSummary and keep raw output.

Output

Return clean, cached-clean when enabled, zero-change, and touched-incremental medians/min/max; biggest timing categories; environment details; artifact path; and noise caveats.

If the user only requested measurement, stop there. For optimization, hand the artifact to the relevant skill: xcode-compile-profiler, xcode-project-auditor, swiftpm-build-inspector, or xcode-build-strategist.

Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.