Skip to content
Development
Agent

swift-package-manager

Compare Swift Package Manager (SPM) and Tuist for a modular Xcode app: what each one describes, how they work together, and what Tuist adds to your builds either way.

From plugin
tuist
5.9k46 skills46 agents

Claude Code

$ npx -y skills add tuist/tuist --agent claude-code

Agent definition

swift-package-manager.md

Swift Package Manager vs Tuist: modularize with SPM or a Tuist project

Compare Swift Package Manager (SPM) and Tuist for a modular Xcode app: what each one describes, how they work together, and what Tuist adds to your builds either way.

What is Swift Package Manager?

[Swift Package Manager](https://github.com/swiftlang/swift-package-manager) is Swift's open-source package manager, licensed under Apache 2.0 with a Runtime Library Exception. It resolves and versions dependencies, builds packages on macOS, Linux, and [Windows](https://www.swift.org/install/windows/), and has been [integrated into Xcode](https://developer.apple.com/documentation/xcode/swift-packages) since Xcode 11, so apps can depend on packages. A package is described in Swift, in a `Package.swift` manifest that declares its targets, products, and dependencies. Beyond third-party dependencies, many teams split an app into [local packages](https://developer.apple.com/documentation/xcode/organizing-your-code-with-local-packages) and keep a thin Xcode project for the app target, its extensions, and their signing and build phases.

What is Tuist?

Tuist is build infrastructure for engineering teams and coding agents: a shared environment where developers, CI, and coding agents build and test. It is not a CI provider, a CI runner, or a coding agent. Many Apple developers first met Tuist through generated projects: you describe projects in Swift [manifests](/en/docs-markdown/guides/features/projects/manifests) such as `Project.swift`, and `tuist generate` produces the Xcode projects and workspace. Generation is one Tuist capability. The Xcode cache, build and test insights, and previews work with the Xcode project you already have.

Describing modules: Package.swift or Project.swift

This is where the tools overlap, and both use Swift. With local packages, each module is a package target in the vocabulary of packages: targets, products, and platforms. Xcode resolves the packages and builds them alongside the app's Xcode project, where app targets, extensions, schemes, and build phases still live.

A Tuist manifest uses Xcode's own vocabulary, so the whole app, including app targets, extensions, schemes, and build phases, is described in one place. Tuist [validates the dependency graph](/en/docs-markdown/guides/features/projects/dependencies) when it generates the project, rejecting cycles and invalid dependencies, and reuses conventions through [project description helpers](/en/docs-markdown/guides/features/projects/code-sharing). The explicit graph is also what the [module cache](/en/docs-markdown/guides/features/cache/module-cache) and [selective testing](/en/docs-markdown/guides/features/selective-testing) use to hash targets, which is the practical reason to describe the app in Tuist rather than only the choice of manifest.

Use both: SPM for dependencies

Tuist does not replace Swift Package Manager as a dependency manager; it uses it. There are two ways to [integrate packages](/en/docs-markdown/guides/features/projects/dependencies). With Tuist's XcodeProj-based integration, you declare third-party packages in `Tuist/Package.swift` and run `tuist install`, which resolves and fetches them with Swift Package Manager; Tuist then maps them to Xcode targets so they work with the module cache and selective testing. Tuist's integration is open source and can take longer to support new package features than Xcode's own. With Xcode's default integration, you list packages in the project's `packages` and Xcode resolves them, as it would in a project you maintain by hand. Build tool plugins need Xcode's default integration, even in a project that uses Tuist's for everything else.

The [Tuist Swift package registry](/en/docs-markdown/guides/features/package-registries/swift) speeds up package resolution whether packages are integrated by Tuist, by Xcode, or used from a standalone Swift package.

Keep your packages, add Tuist

| What you need | Tuist capability | With an Xcode project that uses Swift packages | | --- | --- | --- | | Stop recompiling code another machine already compiled | [Xcode cache](/en/docs-markdown/guides/features/cache/xcode-cache) shares Xcode's compilation outputs across developer machines, CI, and agents | Yes, with Xcode 26 or later | | See where build time goes and when it regressed | [Build insights](/en/docs-markdown/guides/features/build-insights) records every build's duration, steps, and cache results | Yes | | Find slow and flaky tests | [Test insights](/en/docs-markdown/guides/features/test-insights) and [flaky-test detection](/en/docs-markdown/guides/features/test-insights/flaky-tests) keep a shared test history | Yes | | Resolve packages faster | The [Swift package registry](/en/docs-markdown/guides/features/package-registries/swift) serves packages from Tuist's cache network | Yes | | Skip unchanged modules entirely | The [module cache](/en/docs-markdown/guides/features/cache/module-cache) replaces unchanged targets with prebuilt binaries | Requires a Tuist generated project | | Run only the tests a change affects | [Selective testing](/en/docs-markdown/guides/features/selective-testing) skips unchanged test targets | Requires a Tuist generated project |

To connect your existing project, follow the [existing Xcode project guide](/en/docs-markdown/guides/get-started/existing-xcode-project).

When to move modules into Tuist

Move when the module cache or selective testing would remove work your team repeats today, or when keeping the app's targets, schemes, and module conventions consistent across many packages has become a job of its own. The [Swift package migration guide](/en/docs-markdown/guides/features/projects/adoption/migrate/swift-package) shows how `Package.swift` targets map to a `Project.swift`, and you can [try Tuist on an existing package](/en/docs-markdown/guides/features/projects/adoption/swift-package) by generating an Xcode project from it without changing i

Read more
@tuist
Ships withtuist

Tuist is a build platform for engineering teams and their coding agents. It works with Xcode, Gradle, Bazel, Elixir, and Rust builds. Features vary by toolchain: Rust compilation caching is experimental, and Once support is in canary.

5.9k13 skills46 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
5.9k
Star history of tuist/tuist on GitHub, a chart by star-history.com

Other agents on tuist.

about

about

Agent

Tuist is build infrastructure for engineering teams and coding agents. Shared infrastructure connects building, testing, and…

@tuist@tuistInstall Agent
blog

blog

Agent

Engineering articles from Tuist on build infrastructure, developer workflows, and coding agents, with product updates and…

@tuist@tuistInstall Agent
brand

brand

Agent

Official Tuist logos and wordmarks for referring to Tuist in documentation, integrations, presentations, and press.

@tuist@tuistInstall Agent
bazel-vs-gradle

bazel-vs-gradle

Agent

Bazel and Gradle both build JVM, Android, and multi-language projects, and many organizations run both: Gradle for Android apps…

@tuist@tuistInstall Agent
bazel

bazel

Agent

Tuist brings Bazel-native depth to one productivity platform for organizations with diverse build systems. Its remote action…

@tuist@tuistInstall Agent
elixir

elixir

Agent

Tuist brings Mix- and ExUnit-native depth to one productivity platform for organizations with diverse build systems. The…

@tuist@tuistInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react6d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex6d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman7d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about swift-package-manager.

Which coding agents can use swift-package-manager?
swift-package-manager installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.