swift-package-manager

Guide Swift package creation and management with Swift Package Manager.

4|1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill swift-package-manager-autisticaf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-package-manager
Source: https://github.com/AutisticAF/claude-code-apple-dev-plugin/tree/main/skills/swift-package-manager
Command: npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill swift-package-manager-autisticaf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, actionable patterns and guidance for structuring Swift projects using Swift Package Manager so teams can avoid fragile manifests, tangled dependencies, and slow iterative builds.

Core Features & Use Cases

  • Package.swift anatomy and best practices for products, targets, platforms, and resources.
  • Guidance for single-package libraries, executable tools, and multi-module app layouts with explicit dependency edges.
  • Dependency rules and versioning strategies including semantic ranges, exact pins, branches, and revisions.
  • Local package modularization for Xcode projects and workflows for binary targets, XCFramework distribution, and package collections/registries.
  • Build tool and command plugin patterns, conditional compilation in manifests, and testing target configuration with resources.

Quick Start

Use the swift-package-manager skill to create a new library package named MyLibrary targeting iOS v17, add the swift-log dependency from 1.5.0, and scaffold SharedModels and Networking targets.

Frequently Asked Questions about swift-package-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a multi-module Swift app architecture using local packages?

Create a new Swift package by defining products, targets, platforms, and resources in the package.swift manifest while specifying the swift tools version. Following these package manifest syntax best practices prevents fragile manifests and ensures stable dependency resolution.

What is the best way to manage Swift package dependencies using semantic versioning?

Manage Swift package dependencies by applying semantic version rules, utilizing exact pins, branches, or revisions within the manifest. Utilizing semantic version ranges ensures compatibility while preventing unexpected breaking changes from upstream package updates.

Can I use Swift Package Manager to distribute XCFramework binary targets?

Yes, Swift Package Manager supports binary targets for XCFramework distribution. You can configure package collections and registries while adhering to checksum conventions to securely distribute pre-built XCFramework binaries across your Swift projects.

How do command plugins and build tool plugins work in a Swift package manifest?

Command plugins and build tool plugins operate by defining capability patterns within the package manifest syntax to execute custom scripts during the build process. They allow conditional compilation and automate repetitive build tool workflows directly in SPM.

Why does my Swift package testing workflow fail to locate resources?

Swift package testing workflows fail to locate resources when testing targets are not explicitly configured with resource handling rules in the manifest. You must declare resource paths in the package.swift file to ensure the test target correctly bundles and accesses them.