Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
avdlee avatar

Spm Build Analysis

  • 2.8k installs
  • 1.2k repo stars
  • Updated April 15, 2026
  • avdlee/xcode-build-optimization-agent-skill

spm-build-analysis is an Xcode skill that audits Swift Package Manager dependencies, plugins, and module variants slowing clean and incremental builds.

About

SPM 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.

  • Evidence-first SPM audit without rewriting manifests without explicit approval.
  • Verifies local packages are actually linked via pbxproj references before recommending.
  • Covers plugin overhead, macro cascades, swift-syntax builds, and multi-platform multiplication.
  • Flags oversized modules, circular deps, umbrella @_exported imports, and test-target coupling.
  • Modular SDK migrations require before/after SwiftCompile benchmarks; speed gains are not automatic.

Spm Build Analysis by the numbers

  • 2,809 all-time installs (skills.sh)
  • +63 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #62 of 1,048 Mobile Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

spm-build-analysis capabilities & compatibility

Capabilities
package.swift and package.resolved graph inspect · local package linkage verification via pbxproj r · branch pin tag scanning via check_spm_pins.py he · plugin, macro cascade, and multi platform build · structured findings with clean, incremental, and
Use cases
devops · ci cd · debugging
Platforms
macOS
From the docs

What spm-build-analysis says it does

Treat package analysis as evidence gathering first, not a mandate to replace dependencies
SKILL.md
npx skills add https://github.com/avdlee/xcode-build-optimization-agent-skill --skill spm-build-analysis

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.8k
repo stars1.2k
Security audit2 / 3 scanners passed
Last updatedApril 15, 2026
Repositoryavdlee/xcode-build-optimization-agent-skill

Why are my Xcode builds slow when Swift packages, plugins, or SPM graph shape seem to be the bottleneck?

Analyze Swift Package Manager graphs, plugins, module variants, and CI overhead that slow Xcode clean and incremental builds.

Who is it for?

iOS developers investigating SPM slowness, package resolution time, plugin overhead, or duplicate module builds from configuration drift.

Skip if: Skip when the primary bottleneck is project settings unrelated to packages; hand off to xcode-project-analyzer instead.

When should I use this skill?

User mentions SPM slowness, package plugins, circular module dependencies, swift-syntax overhead, or modular SDK migration build impact.

What you get

Evidence-backed findings per package with clean versus incremental impact, CI notes, estimated impact, and approval requirements.

  • package impact findings with evidence
  • pin recommendations for branch-tracked deps

By the numbers

  • [object Object]
  • [object Object]

Files

SKILL.mdMarkdownGitHub ↗

SPM Build Analysis

Use this skill when package structure, plugins, or dependency configuration are likely contributing to slow Xcode builds.

Core Rules

  • Treat package analysis as evidence gathering first, not a mandate to replace dependencies.
  • Separate package-graph issues from project-setting issues.
  • Do not rewrite package manifests or dependency sources without explicit approval.

What To Inspect

  • Package.swift and Package.resolved
  • local packages vs remote packages
  • package plugin and build-tool usage
  • binary target footprint
  • dependency layering, repeated imports, and potential cycles
  • build logs or timing summaries that show package-related work

Verification Before Recommending

Before including any local package in a recommendation, verify that it is actually part of the project's dependency graph. A Vendor/ directory may contain packages that are not linked to any target.

  • Check project.pbxproj for XCLocalSwiftPackageReference entries that reference the package path.
  • Check XCSwiftPackageProductDependency entries to confirm the package's product is linked to at least one target.
  • If a local package exists on disk but is not referenced in the project, do not include it in build-time recommendations.

When recommending version pins for branch-tracked dependencies:

  • Use the helper script to scan all branch-pinned dependencies at once:
  python3 scripts/check_spm_pins.py --project App.xcodeproj

This checks git ls-remote --tags for each branch-pinned package and reports which have tags available for pinning.

  • If no tags exist, recommend pinning to a specific commit revision hash for determinism instead.
  • Note which packages are branch-pinned because the upstream simply has no tags, versus packages that have tags but are intentionally tracking a branch.

Focus Areas

  • package graph shape and how much work changes trigger downstream
  • plugin overhead during local development and CI
  • checkout or fetch cost signals that show up in clean environments
  • configuration drift that forces duplicate module builds
  • risks from package targets that use different macros or options while sharing dependencies
  • dependency direction violations (features depending on each other instead of shared lower layers)
  • circular dependencies between modules (extract shared contracts into a protocol module)
  • oversized modules (200+ files) that widen incremental rebuild scope
  • umbrella modules using @_exported import that create hidden dependency chains
  • missing interface/implementation separation that blocks build parallelism
  • test targets depending on the app target instead of the module under test
  • Swift macro rebuild cascading: heavy use of Swift macros (e.g., TCA, swift-syntax-based libraries) can cause a trivial source change to cascade into near-full rebuilds because macro expansion invalidates downstream modules
  • swift-syntax building universally (all architectures) when no prebuilt binary is available, adding significant clean-build overhead
  • multi-platform build multiplication: adding a secondary platform target (e.g., watchOS) can cause shared SPM packages to build multiple times (e.g., iOS arm64, iOS x86_64, watchOS arm64), multiplying SwiftCompile, SwiftEmitModule, and ScanDependencies tasks

Modular SDK Migration Caveat

Migrating a dependency from a monolithic target to a modular multi-target SDK (e.g., replacing one umbrella library with separate Core, RUM, Logs, Trace modules) does not automatically reduce build time. Modular targets increase the number of SwiftCompile, SwiftEmitModule, and ScanDependencies tasks because each target must be compiled, scanned, and emit its module independently. The build-time trade-off depends on the project's parallelism headroom and how many of the modular targets are actually needed.

When considering a modular SDK migration:

  • Compare the total SwiftCompile task count before and after.
  • Benchmark both configurations before recommending the migration for build speed.
  • If the motivation is API surface reduction (importing only what you use), note that build time may stay flat or increase while import hygiene improves.
  • Only recommend modular SDK migration for build speed when the project currently compiles large portions of the monolithic SDK that it does not use, and the modular alternative lets it skip those unused portions entirely.

Explicit Module Dependency Angle

When the same module appears multiple times in timing output, investigate whether different package or target options are forcing extra module variants. Uniform options often matter more than shaving a small amount of source code.

Reporting Format

For each finding, include:

  • evidence
  • affected package or plugin
  • likely clean-build vs incremental-build impact
  • CI impact if relevant
  • estimated impact
  • approval requirement

If the main problem is not package-related, hand off to `xcode-project-analyzer` or `xcode-compilation-analyzer` by reading the target skill's SKILL.md and applying its workflow to the same project context.

Additional Resources

  • For the detailed audit checklist, see references/spm-analysis-checks.md
  • For the shared recommendation structure, see references/recommendation-format.md
  • For source citations, see references/build-optimization-sources.md

Related skills

How it compares

Pair spm-build-analysis with xcode-build-benchmark when you need both Apple-guided remediation and persisted before/after timing artifacts.

FAQ

Will the skill rewrite my Package.swift?

No. It gathers evidence first and does not rewrite manifests or dependency sources without explicit approval.

How do I verify a local Vendor package matters?

Check project.pbxproj for XCLocalSwiftPackageReference and XCSwiftPackageProductDependency linking the product to a target.

Does modular SDK migration always speed up builds?

No. More modular targets can increase SwiftCompile tasks; benchmark both configurations before recommending migration for speed.

Is Spm Build Analysis safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Mobile Developmentdevopstesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.