Analyze Swift and mixed-language compilation hotspots to produce source-level optimization plans for faster build times.
- GitHub stars
- 1,272
- Files
- 5
- Last commit
- Sep 14, 2026
- License
- MIT
- Allowed tools
- —
What does the xcode-compilation-analyzer skill do?
xcode-compilation-analyzer analyzes Swift and mixed-language compilation hotspots to produce source-level optimization plans for faster build times.
Summary generated from the skill's SKILL.md.
About the xcode-compilation-analyzer skill
Optimizing Swift and mixed-language build performance is the primary function of this skill. It helps developers who are facing slow compilation, expensive clean-build phases, or long CompileSwiftSources tasks. By analyzing build timing summaries and Swift frontend diagnostics, the tool identifies specific hotspots that cause delays in the development cycle.
An agent should load this skill when a developer reports slow type-checking or long-running compilation tasks. It relies on artifacts like .build-benchmark files or raw timing-summary output to perform its work. The skill uses specific compiler flags such as -Xfrontend -debug-time-compilation and -Xfrontend -warn-long-function-bodies to gather data. It produces a ranked optimization plan that distinguishes between code-level changes and module-level adjustments.
Unlike general project configuration tools, this skill focuses on source-level bottlenecks. It differentiates between serial bottlenecks that affect wall-clock time and parallelized work that merely increases compiler workload. It provides specific recommendations for fixing complex expressions, oversized bridging headers, or monolithic SwiftUI body properties.
What an agent can do with it
- 1Analyze incremental build delaysDetermine if large modules or macro-heavy code are causing excessive SwiftEmitModule times during incremental builds.
- 2Prioritize build time improvementsRank optimization findings based on their actual impact on the developer's waiting time.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the xcode-compilation-analyzer skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the xcode-compilation-analyzer skill in Plugin
/plugin marketplace add AvdLee/Xcode-Build-Optimization-Agent-Skill /plugin install xcode-build-skills@xcode-build-skills
Install the xcode-compilation-analyzer skill in Claude Code
~/.claude/skills/xcode-compilation-analyzer/SKILL.md
$ npx degit AvdLee/Xcode-Build-Optimization-Agent-Skill/skills/xcode-compilation-analyzer ~/.claude/skills/xcode-compilation-analyzerInstall the xcode-compilation-analyzer skill in Claude Code (project)
.claude/skills/xcode-compilation-analyzer/SKILL.md
$ npx degit AvdLee/Xcode-Build-Optimization-Agent-Skill/skills/xcode-compilation-analyzer .claude/skills/xcode-compilation-analyzerInstall the xcode-compilation-analyzer skill in Codex
~/.agents/skills/xcode-compilation-analyzer/SKILL.md
$ npx degit AvdLee/Xcode-Build-Optimization-Agent-Skill/skills/xcode-compilation-analyzer ~/.agents/skills/xcode-compilation-analyzerInstall the xcode-compilation-analyzer skill in Gemini CLI
~/.gemini/skills/xcode-compilation-analyzer/SKILL.md
$ npx degit AvdLee/Xcode-Build-Optimization-Agent-Skill/skills/xcode-compilation-analyzer ~/.gemini/skills/xcode-compilation-analyzerInstall the xcode-compilation-analyzer skill in Claude.ai
npx degit AvdLee/Xcode-Build-Optimization-Agent-Skill/skills/xcode-compilation-analyzer xcode-compilation-analyzer && zip -r xcode-compilation-analyzer.zip xcode-compilation-analyzer # claude.ai → Customize → Skills → + → Create skill → Upload a skill → xcode-compilation-analyzer.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachableavdlee/xcode-build-optimization-agent-skill/skills/xcode-compilation-analyzer is public and reachablegithub.com/avdlee/xcode-build-optimization-agent-skill/tree/ ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-09-14github.com/avdlee/xcode-build-optimization-agent-skill/commi ↗Pass
- No download-and-run or credential theft in scripts1 script read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/avdlee/xcode-build-optimization-agent-skill/blob/ ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/avdlee/xcode-build-optimization-agent-skill/blob/ ↗Pass
SKILL.md
View on GitHubXcode Compilation Analyzer
Use this skill when compile time, not just general project configuration, looks like the bottleneck.
Core Rules
- Start from evidence, ideally a recent
.build-benchmark/artifact or raw timing-summary output. - Prefer analysis-only compiler flags over persistent project edits during investigation.
- Rank findings by expected wall-clock impact, not cumulative compile-time impact. When compile tasks are heavily parallelized (sum of compile categories >> wall-clock median), note that fixing individual hotspots may improve parallel efficiency without reducing build wait time.
- When the evidence points to parallelized work rather than serial bottlenecks, label recommendations as "Reduces compiler workload (parallel)" rather than "Reduces build time."
- Do not edit source or build settings without explicit developer approval.
What To Inspect
Build Timing Summaryoutput from clean and incremental builds- long-running
CompileSwiftSourcesor per-file compilation tasks SwiftEmitModuletime -- can reach 60s+ after a single-line change in large modules; if it dominates incremental builds, the module is likely too large or macro-heavyPlanning Swift moduletime -- if this category is disproportionately large in incremental builds (up to 30s per module), it signals unexpected input invalidation or macro-related rebuild cascading- ad hoc runs with:
-Xfrontend -warn-long-expression-type-checking=<ms>-Xfrontend -warn-long-function-bodies=<ms>
- deeper diagnostic flags for thorough investigation:
-Xfrontend -debug-time-compilation-- per-file compile times to rank the slowest files-Xfrontend -debug-time-function-bodies-- per-function compile times (unfiltered, complements the threshold-based warning flags)-Xswiftc -driver-time-compilation-- driver-level timing to isolate driver overhead-Xfrontend -stats-output-dir <path>-- detailed compiler statistics (JSON) per compilation unit for root-cause analysis
- mixed Swift and Objective-C surfaces that increase bridging work
Analysis Workflow
- Identify whether the main issue is broad compilation volume or a few extreme hotspots.
- Parse timing-summary categories and rank the biggest compile contributors.
- Run the diagnostics script to surface type-checking hotspots:
This produces a ranked list of functions and expressions that exceed the millisecond threshold. Use the diagnostics artifact alongside source inspection to focus on the most expensive files first.python3 scripts/diagnose_compilation.py \ --project App.xcodeproj \ --scheme MyApp \ --configuration Debug \ --destination "platform=iOS Simulator,name=iPhone 16" \ --threshold 100 \ --output-dir .build-benchmark - Map the evidence to a concrete recommendation list.
- Separate code-level suggestions from project-level or module-level suggestions.
Apple-Derived Checks
Look for these patterns first:
- missing explicit type information in expensive expressions
- complex chained or nested expressions that are hard to type-check
- delegate properties typed as
AnyObjectinstead of a concrete protocol - oversized Objective-C bridging headers or generated Swift-to-Objective-C surfaces
- header imports that skip framework qualification and miss module-cache reuse
- classes missing
finalthat are never subclassed - overly broad access control (
public/open) on internal-only symbols - monolithic SwiftUI
bodyproperties that should be decomposed into subviews - long method chains or closures without intermediate type annotations
Reporting Format
For each recommendation, include:
- observed evidence
- likely affected file or module
- expected wait-time impact (e.g. "Expected to reduce your clean build by ~2s" or "Reduces parallel compile work but unlikely to reduce build wait time")
- confidence
- whether approval is required before applying it
If the evidence points to project configuration instead of source, hand off to xcode-project-analyzer by reading its SKILL.md and applying its workflow to the same project context.
Preferred Tactics
- Suggest ad hoc flag injection through the build command before recommending persistent build-setting changes.
- Prefer narrowing giant view builders, closures, or result-builder expressions into smaller typed units.
- Recommend explicit imports and protocol typing when they reduce compiler search space.
- Call out when mixed-language boundaries are the real issue rather than Swift syntax alone.
Additional Resources
- For the detailed audit checklist, see references/code-compilation-checks.md
- For the shared recommendation structure, see references/recommendation-format.md
- For source citations, see references/build-optimization-sources.md
Files in this skill
5xcode-compilation-analyzer skill questions
How do I install the xcode-compilation-analyzer skill in Claude Code?
Run npx degit AvdLee/Xcode-Build-Optimization-Agent-Skill/skills/xcode-compilation-analyzer ~/.claude/skills/xcode-compilation-analyzer. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the xcode-compilation-analyzer skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What should I look for to improve Swift type-checking performance?
Look for missing explicit type information in expensive expressions, complex nested expressions, and monolithic SwiftUI body properties that need decomposition.
How does the analyzer distinguish between parallel and serial build bottlenecks?
It ranks findings by expected wall-clock impact and labels recommendations as 'Reduces compiler workload (parallel)' if the work is heavily parallelized rather than a serial bottleneck.