xcode-build-fixer
Skill191 starsChanged 46 days agoMITView on GitHub
Apply approved Xcode build optimization changes following best practices, then re-benchmark to verify improvement. Use when a developer has an approved optimization plan from xcode-build-orchestrator, wants to apply specific build fixes, needs help implementing build setting changes, script phase guards, source-level compilation fixes, or SPM restructuring that was recommended by an analysis skill.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- uinaf/slopwakeword for word, first seen Nov 3, 2026
Other versions1 project uses a version of this.
Word for word · 1
- uinaf/slopwake★ 0100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- app-resizabilitySkill
- ios-app-intentsSkill
- ios-debugger-agentSkill
- ios-ettrace-performanceSkill
- ios-memgraph-leaksSkill
- spm-build-analysisSkill
- swiftui-expert-skillSkill
- swiftui-liquid-glassSkill
- swiftui-performance-auditSkill
- swiftui-specialistSkill
- swiftui-ui-patternsSkill
- swiftui-view-refactorSkill
- swiftui-whats-new-27Skill
- xcode-build-benchmarkSkill
- xcode-build-orchestratorSkill
- xcode-compilation-analyzerSkill
- xcode-project-analyzerSkill
- homeclawSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 16 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to implement approved build optimization changes and verify them with a benchmark.
- Distinctive: line 12
Only apply changes that have explicit developer approval.
- Distinctive: line 16
If a change produces no improvement or causes a regression, flag it immediately.
- Distinctive: line 25
When working from an optimization plan, read the approval checklist and implement only the checked items.
- Very specific: line 41
When editing project.pbxproj, locate the correct buildSettings block by matching the target name and configuration name.
- Distinctive: line 49
Add input and output file declarations so Xcode can skip unchanged scripts.
- Very specific: line 50
Add configuration guards: [[ "$CONFIGURATION" != "Release" ]] && exit 0 for release-only scripts.
- Distinctive: line 60
Add explicit type annotations to complex expressions.
- Distinctive: line 66
Add explicit return types to closures passed to generic functions.
- Very specific: line 77
Remove unnecessary @_exported import usage.
- Distinctive: line 81
Before applying version pin changes:
- Very specific: line 83
Run git ls-remote --tags <url> to confirm tags exist.
- Very specific: line 84
Verify the pinned version resolves successfully with xcodebuild -resolvePackageDependencies before proceeding.
- Distinctive: line 88
Read the approved optimization plan or developer instruction.
- Very specific: line 91
Verify the change compiles: run a quick xcodebuild build to confirm no errors were introduced.
- Distinctive: line 92
After all approved changes are applied, re-benchmark using the same inputs from the original baseline:
- Distinctive: line 105
Not every slower number is a true regression.
- Distinctive: line 132
When reporting on these settings, use language like: "Applied recommended build setting.
- Distinctive: line 138
If the cumulative pass shows wall-clock regression across all measured build types (standard clean, cached clean, and incremental are all …
- Distinctive: line 159
If cumulative task metrics improved but wall-clock did not, say plainly: "Compiler workload decreased but build wait time did not improve.
- Very specific: line 161
If a fix produced no measurable wall-time improvement, note No measurable wall-time improvement and suggest whether to keep (e.g.
- Distinctive: line 169
After the optimization pass is complete, produce a structured execution report.
- Distinctive: line 208
If during implementation you discover issues outside this skill's scope:
≈ “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
Xcode Build Fixer
Use this skill to implement approved build optimization changes and verify them with a benchmark.
Core Rules
- Only apply changes that have explicit developer approval.
- Apply one logical fix at a time so changes are reviewable and reversible.
- Re-benchmark after applying changes to verify improvement.
- Report exactly what changed, which files were touched, and the measured delta.
- If a change produces no improvement or causes a regression, flag it immediately.
Inputs
The fixer expects one of:
- An approved optimization plan at
.build-benchmark/optimization-plan.mdwith checked approval boxes. - An explicit developer instruction describing the fix to apply (e.g., "set
DEBUG_INFORMATION_FORMATtodwarffor Debug").
When working from an optimization plan, read the approval checklist and implement only the checked items.
Fix Categories
Build Settings
Change project.pbxproj values to match the recommendations in build-settings-best-practices.md.
Typical fixes:
- Set
DEBUG_INFORMATION_FORMAT = dwarffor Debug - Set
SWIFT_COMPILATION_MODE = singlefilefor Debug - Enable
COMPILATION_CACHE_ENABLE_CACHING = YES - Enable
EAGER_LINKING = YESfor Debug - Align cross-target settings to eliminate module variants
When editing project.pbxproj, locate the correct buildSettings block by matching the target name and configuration name. Verify the change with xcodebuild -showBuildSettings after applying.
Script Phases
Fix run script phases that waste time during incremental or debug builds.
Typical fixes:
- Add input and output file declarations so Xcode can skip unchanged scripts.
- Add configuration guards:
[[ "$CONFIGURATION" != "Release" ]] && exit 0for release-only scripts. - Move input/output lists into
.xcfilelistfiles when the list is long. - Enable
Based on dependency analysiswhen inputs and outputs are declared.
Source-Level Compilation Fixes
Apply code changes that reduce type-checker and compiler overhead. See references/fix-patterns.md for before/after patterns.
Typical fixes:
- Add explicit type annotations to complex expressions.
- Break long chained or nested expressions into intermediate typed variables.
- Mark classes
finalwhen they are not subclassed. - Tighten access control (
private/fileprivate) for internal-only symbols. - Extract monolithic SwiftUI
bodyproperties into smaller composed subviews. - Replace deeply nested result-builder code with separate typed helpers.
- Add explicit return types to closures passed to generic functions.
SPM Restructuring
Restructure Swift packages to improve build parallelism and reduce rebuild scope.
Typical fixes:
- Move shared types to a lower-layer module to eliminate circular or upward dependencies.
- Split oversized modules (200+ files) by feature area.
- Extract protocol definitions into lightweight interface modules.
- Remove unnecessary
@_exported importusage. - Align build options across targets that import the same packages to prevent module variant duplication.
- Pin branch-tracked dependencies to tagged versions or commit hashes for deterministic resolution.
Before applying version pin changes:
- Run
git ls-remote --tags <url>to confirm tags exist. If the upstream has no tags, pin to a specific revision hash instead. - Verify the pinned version resolves successfully with
xcodebuild -resolvePackageDependenciesbefore proceeding.
Execution Workflow
- Read the approved optimization plan or developer instruction.
- For each approved item, identify the exact files and locations to change.
- Apply the change.
- Verify the change compiles: run a quick
xcodebuild buildto confirm no errors were introduced. - After all approved changes are applied, re-benchmark using the same inputs from the original baseline:
python3 scripts/benchmark_builds.py \ --project App.xcodeproj \ --scheme MyApp \ --configuration Debug \ --destination "platform=iOS Simulator,name=iPhone 16" \ --output-dir .build-benchmark - Compare post-change medians to the baseline and report deltas.
Evaluating Regressions
Not every slower number is a true regression. The fixer must evaluate the full picture before recommending a revert.
Compilation caching trade-off
A change like COMPILATION_CACHE_ENABLE_CACHING = YES may make a standard clean build slightly slower (cache population overhead) while making cached clean builds significantly faster. Since cached clean builds reflect the realistic developer workflow (branch switching, pulling changes, Clean Build Folder with a warm cache), a slower standard clean build paired with a faster cached clean build is a net improvement, not a regression. The same logic applies to any change where the first-time cost is higher but subsequent builds benefit.
Compare all build types
Evaluate standard clean, cached clean (when available), and incremental builds together. A change is only a clear regression if it makes the metrics that matter to the developer's daily workflow worse. If only the cold-start clean build is slower but the developer rarely does truly cold builds, that may be acceptable.
Per-change vs. cumulative
A single change that regresses on its own may still be worth keeping if it enables a larger cumulative improvement (e.g., enabling compilation caching makes one build type slower but unlocks cache benefits for everything else).
Best-practice settings are not revert candidates
Some build settings are Apple's recommended modern defaults. These should be applied and kept regardless of whether the immediate benchmark shows a measurable improvement. They are not speculative optimizations -- they align the project with Apple's toolchain direction and will compound in value over future Xcode releases. The fixer must never recommend reverting these settings based on a single benchmark result.
Best-practice settings that should always be kept once applied:
COMPILATION_CACHE_ENABLE_CACHING = YES-- Apple is actively investing in this; the cache improves with each Xcode release and compounds across real workflowsEAGER_LINKING = YES(Debug) -- allows the linker to overlap with compilationSWIFT_USE_INTEGRATED_DRIVER = YES-- eliminates inter-process scheduling overheadDEBUG_INFORMATION_FORMAT = dwarf(Debug) -- avoids unnecessary dSYM generationSWIFT_COMPILATION_MODE = singlefile(Debug) -- incremental recompilationONLY_ACTIVE_ARCH = YES(Debug) -- no reason to build all architectures locally
When reporting on these settings, use language like: "Applied recommended build setting. No immediate benchmark improvement measured, but this aligns with Apple's recommended configuration and positions the project for future Xcode improvements."
When to recommend revert (speculative changes only)
For changes that are not best-practice settings (e.g., source refactors, linkage experiments, script phase modifications, dependency restructuring):
- If the cumulative pass shows wall-clock regression across all measured build types (standard clean, cached clean, and incremental are all slower), recommend reverting all speculative changes unless the developer explicitly asks to keep specific items for non-performance reasons.
- For each individual speculative change: if it shows no median improvement and no cached/incremental benefit either, flag it with
Recommend revertand the measured delta. - Distinguish between "outlier reduction only" (improved worst-case but not median) and "median improvement" (improved typical developer wait).
- When a change trades off one build type for another (e.g., slower standard clean but faster cached clean), present both numbers clearly and let the developer decide. Frame it as: "Standard clean builds are X.Xs slower, but cached clean builds (the realistic daily workflow) are Y.Ys faster."
Reporting
Lead with the wall-clock result in plain language:
"Your clean build now takes X.Xs (was Y.Ys) -- Z.Zs faster." "Your incremental build now takes X.Xs (was Y.Ys) -- Z.Zs faster."
Then include:
- Post-change clean build wall-clock median
- Post-change incremental build wall-clock median
- Absolute and percentage wall-clock deltas for both
- Confidence notes if benchmark noise is high
- List of files modified per fix
- Any deviations from the original recommendation
If cumulative task metrics improved but wall-clock did not, say plainly: "Compiler workload decreased but build wait time did not improve. This is expected when Xcode runs these tasks in parallel with other equally long work."
If a fix produced no measurable wall-time improvement, note No measurable wall-time improvement and suggest whether to keep (e.g. for code quality) or revert.
For changes valuable for non-benchmark reasons (deterministic package resolution, branch-switch caching), label them: "No wait-time improvement expected from this change. The benefit is [deterministic builds / faster branch switching / reduced CI cost]."
Note: COMPILATION_CACHE_ENABLE_CACHING has been measured at 5-14% faster clean builds across tested projects (87 to 1,991 Swift files). The benefit compounds in real developer workflows where the cache persists between builds -- branch switching, pulling changes, and CI with persistent DerivedData. The benchmark script auto-detects this setting and runs a cached clean phase for validation.
Execution Report
After the optimization pass is complete, produce a structured execution report. This gives the developer a clear summary of what was attempted, what worked, and what the final state is.
Structure:
## Execution Report
### Baseline
- Clean build median: X.Xs
- Cached clean build median: X.Xs (if applicable)
- Incremental build median: X.Xs
### Changes Applied
| # | Change | Actionability | Measured Result | Status |
|---|--------|---------------|-----------------|--------|
| 1 | Description | repo-local | Clean: X.Xs→Y.Ys, Incr: X.Xs→Y.Ys | Kept / Reverted / Blocked |
| 2 | ... | ... | ... | ... |
### Final Cumulative Result
- Clean build median: X.Xs (was Y.Ys) -- Z.Zs faster/slower
- Cached clean build median: X.Xs (was Y.Ys) -- Z.Zs faster/slower
- Incremental build median: X.Xs (was Y.Ys) -- Z.Zs faster/slower
- **Net result:** Faster / Slower / Unchanged
### Blocked or Non-Actionable Findings
- Finding: reason it could not be addressed from the repoStatus values:
Kept-- Change improved or maintained build times and was kept.Kept (best practice)-- Change is a recommended build setting; kept regardless of immediate benchmark result.Reverted-- Change regressed build times and was reverted.Blocked-- Change could not be applied due to project structure, Xcode behavior, or external constraints.No improvement-- Change compiled but showed no measurable wall-time benefit. Include whether it was kept (for non-performance reasons) or reverted.
Escalation
If during implementation you discover issues outside this skill's scope:
- Project-level analysis gaps: hand off to
xcode-project-analyzer - Compilation hotspot analysis: hand off to
xcode-compilation-analyzer - Package graph issues: hand off to
spm-build-analysis
Additional Resources
- For concrete before/after fix patterns, see references/fix-patterns.md
- For build settings best practices, see references/build-settings-best-practices.md
- For the recommendation format, see references/recommendation-format.md
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.

