Swiftpm build inspector

From Xopoko/build-swift-apps · View interactive version

Swiftpm build inspector is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. Diagnose SwiftPM graph overhead across dependencies, plugins, module variants, branch pins, macros, binary targets, and slow CI or local Xcode builds.

How to use this skill

Skill file

SwiftPM Build Inspector

Bundled commands use $PLUGIN_ROOT ($env:PLUGIN_ROOT in PowerShell; same path suffix) for the plugin root. Set it once: use the host's plugin-root variable when defined (Claude Code: PLUGIN_ROOT="$CLAUDE_PLUGIN_ROOT"), otherwise the absolute path of this plugin's root directory.

Gather evidence before recommending package changes. Do not edit manifests/dependencies without explicit approval.

Inspect

Before recommending a local package, prove it is in the project graph: check XCLocalSwiftPackageReference and XCSwiftPackageProductDependency in project.pbxproj. Ignore on-disk packages that are not linked.

For branch-pinned dependencies:

python3 "$PLUGIN_ROOT/skills/swiftpm-build-inspector/scripts/check_spm_pins.py" --project App.xcodeproj

Check whether a listed tag is a compatible SwiftPM version before recommending it. A commit revision is an option when determinism is needed and no suitable version exists. A failed tag lookup leaves availability unknown. Preserve intentional branch tracking.

Focus Areas

Modular SDK migrations do not automatically speed builds. Compare SwiftCompile, SwiftEmitModule, and ScanDependencies task counts and benchmark before recommending for performance; note when the benefit is import hygiene/API surface rather than wait time.

If the same module appears multiple times in timing output, investigate option/variant drift before source shaving.

Report

For each finding include evidence, affected package/plugin, clean vs incremental impact, CI impact, estimated wait-time impact, and approval requirement. If the bottleneck is not package-related, hand off to xcode-project-auditor or xcode-compile-profiler.

References:

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.