# Spm build analysis

> Spm build analysis is an open-source agent skill for developer tools. Finds Swift Package Manager and module graph issues slowing Xcode builds. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/carloshpdoc/ios-workflow-claude/tree/main/plugins/xcode-build-suite/skills/spm-build-analysis
- **Repository:** https://github.com/carloshpdoc/ios-workflow-claude
- **GitHub stars:** 7
- **License:** Apache-2.0
- **Skill name:** spm-build-analysis
- **Collection:** https://github.com/carloshpdoc/ios-workflow-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill guides an agent through diagnosing why an Xcode project builds slowly because of its Swift Package Manager setup. It covers package manifests and resolved versions, local versus remote packages, build plugins, binary targets, and how the dependency graph shape affects clean and incremental builds. The agent is told to gather evidence first, separate package-graph problems from project-setting problems, and avoid rewriting manifests or dependency sources without approval.

The workflow includes checking the Xcode project file to confirm that a local package is actually linked to a target before recommending changes to it, and a helper script that scans branch-pinned dependencies for available tags so the agent can suggest version or commit pins. It also looks for module-level problems such as circular dependencies, oversized modules, umbrella re-exports, duplicate module variants caused by differing build options, and macro-driven rebuild cascades. Findings are reported with evidence, affected package, clean and incremental impact, CI impact, estimated gain and approval requirement.

The skill expects access to the project's Package.swift, Package.resolved and project.pbxproj files, plus build logs or timing summaries where available. It requires Python 3 and git to run the pin-check script, and it points to reference checklists and a handoff to other Xcode analysis skills when the bottleneck lies outside packages.

## When your agent uses it

> 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 resolution time, build plugin overhead, duplicate module builds from configuration drift, circular dependencies between modules, oversized modules needing splitting, or modularization best practices.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/carloshpdoc/ios-workflow-claude/tree/HEAD/plugins/xcode-build-suite/skills/spm-build-analysis)
- [License: Apache-2.0](https://github.com/carloshpdoc/ios-workflow-claude/tree/HEAD/plugins/xcode-build-suite/skills/spm-build-analysis)

## Features

- **Package graph analysis:** Reviews manifests, resolved versions and how local and remote packages shape downstream rebuild work.
- **Linked package verification:** Confirms a local package is referenced by a target before it is included in recommendations.
- **Branch pin scanning:** Runs a helper script to find branch-tracked dependencies that have tags available for pinning.
- **Module dependency checks:** Looks for cycles, layering violations, oversized modules and hidden re-export chains.
- **Build variant detection:** Spots duplicate module builds caused by configuration drift or macro-driven rebuild cascades.
- **Structured reporting:** Presents each finding with evidence, build impact, CI impact and approval requirements.

## Good for

- Why are my clean Xcode builds so slow after adding Swift packages?
- Find circular dependencies between my Swift modules.
- Check whether my branch-tracked SPM dependencies should be pinned to tags or commits.
- Identify oversized modules that cause too many files to rebuild.
- Review whether a build plugin is adding overhead to local or CI builds.

## Install

### Claude Code

This skill ships in the `xcode-build-suite` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add carloshpdoc/ios-workflow-claude
/plugin install xcode-build-suite@carloshpdoc-plugins
```

Or copy only this skill to `~/.claude/skills/spm-build-analysis`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/carloshpdoc/ios-workflow-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/spm-build-analysis &&
cp -R "$tmp/plugins/xcode-build-suite/skills/spm-build-analysis" ~/.claude/skills/spm-build-analysis &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/spm-build-analysis` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/spm-build-analysis` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/carloshpdoc/ios-workflow-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/spm-build-analysis &&
cp -R "$tmp/plugins/xcode-build-suite/skills/spm-build-analysis" ~/.agents/skills/spm-build-analysis &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/spm-build-analysis` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/spm-build-analysis` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/carloshpdoc/ios-workflow-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/spm-build-analysis &&
cp -R "$tmp/plugins/xcode-build-suite/skills/spm-build-analysis" ~/.cursor/skills/spm-build-analysis &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/spm-build-analysis` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/carloshpdoc/ios-workflow-claude.git --path plugins/xcode-build-suite/skills/spm-build-analysis
```

Or copy the folder to `~/.gemini/skills/spm-build-analysis` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/spm-build-analysis`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/carloshpdoc/ios-workflow-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/spm-build-analysis &&
cp -R "$tmp/plugins/xcode-build-suite/skills/spm-build-analysis" ~/.copilot/skills/spm-build-analysis &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/spm-build-analysis` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/carloshpdoc/ios-workflow-claude.git
```

Then copy `ios-workflow-claude/plugins/xcode-build-suite/skills/spm-build-analysis` into your agent's skills folder as `spm-build-analysis`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does the skill change my Package.swift files automatically?

No. It is instructed not to rewrite package manifests or dependency sources without explicit approval.

### What does the pin-check script need?

Run with python3 against your .xcodeproj; it uses git ls-remote --tags to check each branch-pinned package for tags.

### Will Spm build analysis recommend a local package that is not used by the project?

No. It first checks project.pbxproj to confirm the package is referenced and its product linked to a target.

### When does Spm build analysis hand off to another skill?

If the main cause is not package-related, it points to the xcode-project-analyzer or xcode-compilation-analyzer skill.

### How do I install Spm build analysis in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/spm-build-analysis to use it in all your projects, or to .claude/skills/spm-build-analysis in one project. Or install the xcode-build-suite plugin, which includes it: /plugin marketplace add carloshpdoc/ios-workflow-claude, then /plugin install xcode-build-suite@carloshpdoc-plugins.

### Does Spm build analysis run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Spm build analysis?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Spm build analysis?

The closest alternatives to Spm build analysis are Xcode project analyzer, Axiom resolve spm, Xcode compilation analyzer, Axiom optimize build and Improve architecture.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Xcode project analyzer](https://ai-powered.com/skills/xcode-project-analyzer): Xcode project analyzer is an open-source agent skill for developer tools.
- [Axiom resolve spm](https://ai-powered.com/skills/axiom-resolve-spm): Axiom resolve spm is an open-source agent skill for developer tools.
- [Xcode compilation analyzer](https://ai-powered.com/skills/xcode-compilation-analyzer): Xcode compilation analyzer is an open-source agent skill for developer tools.
- [Axiom optimize build](https://ai-powered.com/skills/axiom-optimize-build): Axiom optimize build is an open-source agent skill for developer tools.
- [Improve architecture](https://ai-powered.com/skills/improve-architecture): Improve architecture is an open-source agent skill for developer tools.
- [Axiom fix build](https://ai-powered.com/skills/axiom-fix-build): Axiom fix build is an open-source agent skill for developer tools.
- [Xcode build fixer](https://ai-powered.com/skills/xcode-build-fixer): Xcode build fixer is an open-source agent skill for developer tools.
- [Axiom build](https://ai-powered.com/skills/axiom-build-charleswiltgen-2): Axiom build is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/spm-build-analysis
