skills/swift_package_manager/SKILL.md
Swift Package Manager (SPM) for dependency management, package creation, and modular code organization.
npx skillsauth add swiftzilla/skills swift_package_managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill covers Swift Package Manager for managing dependencies, creating reusable packages, and organizing code into modular components.
Swift Package Manager (SPM) is Apple's official tool for distributing and managing Swift code. It handles dependency resolution, building, and packaging with a simple declarative format.
// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "MyLibrary",
platforms: [.iOS(.v15), .macOS(.v12)],
products: [
.library(
name: "MyLibrary",
targets: ["MyLibrary"]
),
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.8.0"),
],
targets: [
.target(
name: "MyLibrary",
dependencies: [
.product(name: "Alamofire", package: "Alamofire")
]
),
.testTarget(
name: "MyLibraryTests",
dependencies: ["MyLibrary"]
),
]
)
// Version ranges
.package(url: "...", from: "1.0.0") // >= 1.0.0, < 2.0.0
.package(url: "...", .upToNextMajor(from: "1.0.0"))
.package(url: "...", .upToNextMinor(from: "1.0.0"))
.package(url: "...", .exact("1.0.0"))
.package(url: "...", branch: "main")
.package(url: "...", revision: "abc123")
// Local packages
.package(path: "../LocalPackage")
# Initialize new package
swift package init --type library
swift package init --type executable
# Resolve dependencies
swift package resolve
# Update dependencies
swift package update
# Build
swift build
# Test
swift test
# Generate Xcode project
swift package generate-xcodeproj
MyPackage/
├── Package.swift # Package manifest
├── Sources/
│ └── MyLibrary/
│ └── MyLibrary.swift
├── Tests/
│ └── MyLibraryTests/
│ └── MyLibraryTests.swift
└── README.md
Visit https://swiftzilla.dev for comprehensive Swift Package Manager documentation.
tools
Use this skill when you need expert Swift/iOS architectural guidance, semantic codebase analysis, or PR impact reviews. It provides a senior mentor layer for Swift (SwiftUI, UIKit, Combine, Concurrency) and a semantic engine to query local code context. Trigger this skill to: 1. Validate architectural patterns before implementation using 'ask'. 2. Find and map local code dependencies using 'context'. 3. Analyze the risk and blast radius of a PR using 'review'. 4. Generate system overviews for onboarding using 'onboard'. 5. Troubleshoot runtime crashes with semantic LLDB tools using 'debug'. Activate even if specific keywords are missing but the intent is improving Swift code quality or understanding project structure.
development
Swift Testing framework for unit tests, integration tests, and async testing with modern syntax.
development
SwiftUI framework concepts including property wrappers, state management, and reactive UI patterns.
development
Swift style guidelines covering naming conventions, code organization, and best practices for writing idiomatic Swift code.