Swift Packages and Toolchain
Installs Swift, builds and tests Swift packages, and ships one static Linux binary from the command line.
Claude's review
7/10 Practical Swift toolchain guide covering swiftly, SwiftPM, Swift Testing and static Linux binaries with real gotchas.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Swift is Apple's compiled, memory-safe programming language, and its toolchain (swift build, swift test, swift run, Swift Package Manager) builds command-line tools and servers on Linux and macOS as well as apps. Use when someone asks to "install Swift on Linux", "create a Swift package", "add a dependency to Package.swift", "run Swift tests", "build a Swift CLI tool", "build a static Linux binary from Swift", or "pin a Swift version with swiftly". Covers swiftly, Package.swift, Swift Testing and XCTest, and the Static Linux SDK.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: swift
description: >-
Swift is Apple's compiled, memory-safe programming language, and its toolchain (swift build, swift test, swift run, Swift Package Manager) builds command-line tools and servers on Linux and macOS as well as apps. Use when someone asks to "install Swift on Linux", "create a Swift package", "add a dependency to Package.swift", "run Swift tests", "build a Swift CLI tool", "build a static Linux binary from Swift", or "pin a Swift version with swiftly". Covers swiftly, Package.swift, Swift Testing and XCTest, and the Static Linux SDK.
license: Apache-2.0
compatibility: "Linux (x86_64 or aarch64, Ubuntu 22.04/24.04 and other supported distros) or macOS 13+; about 1.1 GB for the toolchain; Swift 6.x"
metadata:
author: terminal-skills
version: "1.0.0"
category: development
tags: "swift, swiftpm, swiftly, command-line, linux"
repository: https://github.com/swiftlang/swift
---
# Swift — toolchain and Swift Package Manager for command-line and server code
## Overview
Swift is a compiled language with strong typing, value types and structured concurrency. Most people meet it through Xcode and iOS, but the same toolchain runs on Linux and macOS from the terminal, which is the part this skill covers: installing a toolchain, creating a package, resolving dependencies, building, testing, running and shipping a binary. The current stable release at the time of writing is Swift 6.4.2.
One command, `swift`, fronts everything: `swift package` manages the project, `swift build` compiles, `swift run` builds and runs an executable, `swift test` runs tests, and `swift sdk` installs cross-compilation SDKs. A project is a Swift package described by a `Package.swift` manifest, which is itself Swift code.
For SwiftUI views, performance audits and concurrency review of app code, use the existing skills `swiftui-ui-patterns`, `swiftui-performance-audit`, `swiftui-view-refactor`, `swiftui-liquid-glass` and `swift-concurrency-expert`. This skill is about the toolchain and SwiftPM.
## Instructions
### Install a toolchain with swiftly (Linux)
swiftly is the official toolchain manager. Download the archive for the machine's architecture, unpack it, and let it set itself up. Never pipe the download into a shell; each step is a separate command:
```bash
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz
tar zxf swiftly-$(uname -m).tar.gz
./swiftly init --quiet-shell-followup
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"
hash -r
swift --version
```
`swiftly init` installs itself, writes `env.sh`, edits the shell profile, and installs the latest stable toolchain (about 1 GB, signature verified by default). For automation use `swiftly init --assume-yes --no-modify-profile` (add `--skip-install` to install the toolchain separately). swiftly may print an `apt-get -y install ...` line for missing system packages (it named `gnupg2` and `libz3-dev` on Ubuntu 24.04); the agent cannot run that without root, so show it to the user.
...From TerminalSkills's repository, Apache-2.0 licence.
Related skills
-
Checked
Rust best practices
Writes and reviews idiomatic, maintainable Rust code and runs a checklist before handing it back to you.
7/101 credit -
Checked
Port code to Rust
Ports C, C++, Python, Go or JavaScript code into idiomatic Rust, with tests that prove it behaves the same.
8/101 credit -
Checked
Rust code review
Reviews Rust code for idiom, errors, safety and API design, with a ranked report and a fix for every finding.
7/101 credit -
Checked
Java Debugging Guide
Finds the cause of Java bugs and failing tests, and attaches a debugger safely in Maven, Gradle, Spring or Docker.
7/101 credit -
Checked
Python games with pygame
Builds and debugs 2D pygame games with a proper loop and delta time, so they run the same on any PC.
7/101 credit -
Checked
Go Benchmarking and Profiling
Writes Go benchmarks, profiles them with pprof and proves each speedup with benchstat before you claim it.
7/101 credit