Spm build analysis

From gabrielmoreira/agent-skills-mirror · View interactive version

Spm build analysis is an AI agent skill from the GitHub repository gabrielmoreira/agent-skills-mirror. Analyze Swift Package Manager dependencies, package plugins, module variants, and CI-oriented build overhead that slow Xcode builds. Use when a developer suspects packages, plugins, or dependency graph shape are hurting clean or incremental build performance, mentions SPM slowness, package resolutio

How to use this skill

Skill file

SPM Build Analysis

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

Core Rules

What To Inspect

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.

When recommending version pins for branch-tracked dependencies:

```bash

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.

Focus Areas

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:

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:

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

Additional Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.