
avdlee/xcode-build-optimization-agent-skill
6 skills17.3k installs7.1k starsGitHub
Install
npx skills add https://github.com/avdlee/xcode-build-optimization-agent-skillSkills in this repo
1Xcode Build OrchestratorXcode Build Orchestrator is the recommend-first entrypoint for end-to-end Xcode build optimization where wall-clock wait time is the primary success metric. Phase one Analyze runs in agent mode but is recommend-only: collect workspace or project, scheme, configuration, and destination context, then run xcode-build-benchmark for baseline medians including cached clean builds when COMPILATION_CACHE_ENABLE_CACHING is enabled. Verify benchmark artifacts have non-empty timing_summary_categories and flag high variance when min-max spread exceeds 20 percent of median. Run diagnose_compilation.py when SwiftCompile or emit module tasks likely block the critical path, and invoke specialist skills xcode-compilation-analyzer, xcode-project-analyzer, and spm-build-analysis as evidence dictates. Merge findings into a prioritized plan saved via generate_optimization_report.py to .build-benchmark/optimization-plan.md with approval checkboxes, then stop for developer review. Phase two Execute delegates approved items to xcode-build-fixer for atomic implementation and re-benchmarking. Prioritization ranks by likely wall-time savings, not cumulative parallel task reduction. Impact language must stat.3kinstalls2Xcode Build Fixerxcode-build-fixer implements approved Xcode build optimization changes and verifies them with structured benchmarks. Core rules require explicit developer approval, one logical fix at a time, re-benchmarking after each pass, and clear reporting of files touched and measured deltas. Fix categories span build settings in project.pbxproj such as DEBUG_INFORMATION_FORMAT dwarf, SWIFT_COMPILATION_MODE singlefile, COMPILATION_CACHE_ENABLE_CACHING, and EAGER_LINKING; script phase guards with input and output file lists; source-level Swift compilation fixes including explicit type annotations, final classes, and smaller SwiftUI bodies; and SPM restructuring to reduce module variants and pin dependencies. The workflow reads an approved plan from .build-benchmark/optimization-plan.md or explicit instructions, applies each change, runs xcodebuild build to confirm compilation, then re-benchmarks with benchmark_builds.py. Reporting emphasizes wall-clock medians for clean, cached clean, and incremental builds, distinguishes best-practice settings from speculative changes, and produces a structured execution report with Kept, Reverted, or Blocked statuses. Developers use it after xcode-build-orc.3kinstalls3Xcode Project Analyzerxcode-project-analyzer is an agent skill for project- and target-level Xcode build inefficiencies that source edits alone cannot fix. It reviews scheme build order, target dependencies, debug versus release settings against build settings best practices, run script phases, derived-data churn, parallelization opportunities, module-map readiness, and timing evidence such as Planning Swift module or ExtractAppIntentsMetadata phases. Recommendation-first workflow requires explicit approval before changing project files, schemes, or build settings and distinguishes debug-only pain from release-only pain. Apple-derived checks cover dependency order schemes, script input and output declarations, xcfilelist usage, DEFINES_MODULE alignment, and Task Backtraces on Xcode 16.4 plus for unexpected incremental invalidation. Typical wins include skipping debug-only scripts, adding dependency-analysis metadata, removing serial bottlenecks, splitting large asset catalogs, and flagging CocoaPods projects for SPM migration without Pods-specific tuning. Reporting requires evidence, scope, clean versus incremental impact, estimated benefit, and approval requirements per issue.2.9kinstalls4Xcode Compilation Analyzerxcode-compilation-analyzer is an agent skill for diagnosing slow Swift and mixed-language compilation using build timing summaries and Swift frontend diagnostics. It starts from evidence such as recent build-benchmark artifacts or raw timing-summary output, prefers analysis-only compiler flags over persistent project edits during investigation, and ranks findings by expected wall-clock impact rather than cumulative compile time when tasks run in parallel. The workflow inspects CompileSwiftSources tasks, SwiftEmitModule spikes after small edits, Planning Swift module invalidation, and ad hoc runs with warn-long-expression-type-checking and warn-long-function-bodies thresholds plus deeper debug-time-compilation and stats-output-dir flags. A diagnose_compilation.py script surfaces ranked type-checking hotspots alongside timing categories. Apple-derived checks cover missing explicit types, complex chained expressions, AnyObject delegate typing, oversized bridging headers, missing final classes, broad access control, monolithic SwiftUI body properties, and mixed Swift-Objective-C surfaces. Reporting requires observed evidence, affected files, expected wait-time impact, confidence, and.2.8kinstalls5Xcode Build Benchmarkxcode-build-benchmark is an agent skill for producing repeatable Xcode build baselines before optimization work begins. It collects workspace or project path, scheme, configuration, destination, and whether simulator or device numbers are needed, then normalizes xcodebuild flags that affect caching. The default workflow warms up once, runs three clean builds, optionally three cached clean builds when COMPILATION_CACHE_ENABLE_CACHING is YES, three zero-change builds to measure fixed overhead, and optional incremental builds after touching a representative Swift file via --touch-file. Results save medians, min, and max timings plus environment details into timestamped JSON under .build-benchmark using scripts/benchmark_builds.py when available. Worktree users must create missing SPM exclude directories such as __Snapshots__ before resolvePackageDependencies to avoid xcodebuild crashes. The skill forbids modifying project files during measurement and reports biggest timing-summary categories from -showBuildTimingSummary output. When users only want numbers, it stops after measurement; optimization handoffs route to sibling skills like xcode-compilation-analyzer or spm-build-analysis.2.8kinstalls6Spm Build AnalysisSPM Build Analysis is an Xcode optimization skill for when package structure, plugins, or dependency configuration likely hurt build performance. It treats analysis as evidence gathering first and forbids rewriting Package.swift without explicit approval. Inspect Package.swift, Package.resolved, local versus remote packages, build-tool plugins, binary targets, layering, and cycles plus timing logs showing package work. Before recommending local packages, verify XCLocalSwiftPackageReference and XCSwiftPackageProductDependency entries in project.pbxproj so unlinked Vendor folders are excluded. Branch-pinned dependencies scan via scripts/check_spm_pins.py for taggable versions or commit pins. Focus areas span plugin overhead, configuration drift forcing duplicate module builds, circular dependencies, oversized 200+ file modules, umbrella @_exported import chains, test targets depending on app targets, Swift macro rebuild cascades, swift-syntax universal builds, and multi-platform multiplication such as watchOS variants. Modular SDK migrations may increase SwiftCompile task counts, so benchmark before recommending speed gains. Findings report evidence, affected package, clean versus i.2.8kinstalls