analyze-build
Skill0 starsChanged 23 days agoMITView on GitHub
Analyze an Xcode build log (.txt or .xcactivitylog export) and produce a build optimization report — slowest compilations, build-setting audit, script-phase and SwiftLint audit, cache invalidation causes, and ranked quick wins as an xcconfig snippet. Use when the user shares an Xcode build log, asks why their build is slow, or wants to speed up Xcode builds.
In this repository10 other files it gives its agents.
- agentic-auditSkill
- claude-code-assessorSkill
- ios-docc-writerSkill
- maestro-flow-writerSkill
- mindful-acceptanceSkill
- pr-diff-mermaidSkill
- pr-html-reportSkill
- pr-to-automation-planSkill
- session-retroSkill
- wwdc-adoption-advisorSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
If no path was provided, ask: "Please provide the path to your Xcode build log (.txt or .xcactivitylog exported from Xcode's Report …
- Distinctive: line 26
Before deep analysis, read the first 100 lines to determine:
- Distinctive: line 31
If it's a pre-build only log, inform the user:
- Distinctive: line 79
After reading the full log, produce the report with these sections:
- Distinctive: line 101
Run before compilation (blocking)
- Distinctive: line 102
Run on too many targets
- Distinctive: line 117
Always include these checks regardless of what's in the log:
- Distinctive: line 135
If specific slow files were found, provide the Swift Other Flags to add temporarily to find exact bottleneck expressions:
- Very specific: line 143
After presenting the analysis to the user, offer to save it as a markdown file at Docs/BuildOptimisation-<date>.md in the current project …
- Distinctive: line 147
After the report, ask:
- Distinctive: line 150
If yes, find the relevant xcconfig files using Glob, read them, and apply the recommended settings.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Analyze Xcode Build Log
Analyze the Xcode build log provided as an argument (or ask the user for the path if none given) and produce a comprehensive build optimization report.
Instructions
The user has provided a build log path: $ARGUMENTS
If no path was provided, ask: "Please provide the path to your Xcode build log (.txt or .xcactivitylog exported from Xcode's Report Navigator)."
Once you have the path, follow these steps:
Step 1 — Identify log type
Before deep analysis, read the first 100 lines to determine:
- Is this a pre-build only log (contains only env vars and SwiftLint output, no
CompileSwiftlines)? - Is this a full build log (contains
CompileSwift,Ld,GenerateDSYMFile,CodeSignlines)? - Is this an incremental or clean build (look for "stale file removal" lines)?
If it's a pre-build only log, inform the user:
This log only captures the pre-build phase. For a complete analysis including per-file compile times, please do: Product → Clean Build Folder (⇧⌘K), build, then in Report Navigator (⌘9) right-click → Save Build Log with "All Messages".
Proceed with whatever data is available.
Step 2 — Read the full log
The file may be very large (200–500KB). Read it in chunks of 300 lines at a time from start to finish. You MUST read all chunks — do not stop early. The most important data (compile timings, link times) is in the middle and later sections.
While reading, track:
Build metadata:
- Total build time (look for "Build succeeded" line with duration, or start/end timestamps)
- Build configuration (Debug/Release/Staging, simulator vs device)
- Xcode version
- Number of targets
Cache invalidation:
- Count of "Remove stale file" lines → if > 1000, this is a full cache invalidation
- Any pre-action scripts listed that could be touching source files
Build phases (in order):
PhaseScriptExecution— script name, targetSwiftLintruns — count them, which targets, how many filesCompileSwift— collect all, note file name and log-line gap to next entryCompileC/CompileObjC— sameLd— linker invocations, flags usedGenerateDSYMFile— which targets, log-line sizeCodeSign— count of signing operationsCompileAssetCatalog— asset compilation
Warnings and errors:
- Any
warning:orerror:lines - Script phases with no declared outputs ("will be run during every build")
- Missing folders or files
- Deprecated flags or rules
Build settings of interest (from env var block at start):
ENABLE_CODE_COVERAGEDEBUG_INFORMATION_FORMATEAGER_LINKINGCOMPILATION_CACHE_ENABLE_CACHINGSWIFT_COMPILATION_MODEFUSE_BUILD_SCRIPT_PHASESEAGER_COMPILATION_ALLOW_SCRIPTS
Step 3 — Analyse findings
After reading the full log, produce the report with these sections:
A. Build Overview
- Total time, configuration, clean vs incremental
- Number of targets, source files compiled
- Whether build cache was used (incremental) or fully invalidated
B. Critical Issues (blockers / major slowdowns)
List issues that are causing the most waste, in priority order.
C. Top 20 Slowest Compilations
Separate Swift and ObjC tables. Use log-line gap as proxy for compile time (larger gap = slower). Note: if -Xfrontend -debug-time-compilation is in the flags, use actual timings instead.
D. Build Setting Audit
Table of key settings found vs recommended values for a development build:
| Setting | Current Value | Recommended | Impact |
E. Script Phase Audit
List all PhaseScriptExecution entries. Flag any that:
- Have no declared outputs (forced re-run every build)
- Run before compilation (blocking)
- Run on too many targets
F. SwiftLint Audit (if present)
- Total invocations
- Total files linted
- Any error-level violations (these may block the build)
- Deprecated rules
- Over-linting (same files covered by multiple invocations)
G. Recommendations Table
Ranked by estimated impact × ease:
| # | Fix | File/Setting | Est. Saving | Effort (Low/Med/High) |
Always include these checks regardless of what's in the log:
ENABLE_CODE_COVERAGE— should beNOfor dev builds (adds instrumentation to every compile)DEBUG_INFORMATION_FORMAT— should bedwarfnotdwarf-with-dsymfor simulator dev (eliminates dsymutil)EAGER_LINKING— should beYES(overlaps link with late-stage compile)COMPILATION_CACHE_ENABLE_CACHING— should beYES(Xcode 15+ module cache)- Cache invalidation root cause — if stale file count > 1000, flag this as #1 priority
- Script phases with no declared outputs
- SwiftLint scope and invocation count
- Third-party heavy modules that could be pre-built XCFrameworks
H. Quick Wins
List all Low effort recommendations as a ready-to-apply xcconfig snippet:
// <Configuration>.xcconfig additions
SETTING = VALUEI. Diagnostic Commands
If specific slow files were found, provide the Swift Other Flags to add temporarily to find exact bottleneck expressions:
-Xfrontend -warn-long-function-bodies=200
-Xfrontend -warn-long-expression-type-checking=200Step 4 — Save report
After presenting the analysis to the user, offer to save it as a markdown file at Docs/BuildOptimisation-<date>.md in the current project directory.
Step 5 — Offer to apply fixes
After the report, ask:
Would you like me to apply the quick-win build setting changes now? I can update the xcconfig files directly.
If yes, find the relevant xcconfig files using Glob, read them, and apply the recommended settings.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

