Skip to content

Swift Testing guidance for @Test, #expect, #require, XCTest migration, async tests, and parameterized tests.

CCM score
47 of 100
skills.sh installs
215
GitHub stars
235
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the core Swift Testing model: #expect for soft checks, #require for hard preconditions, and optional unwrapping
  • Includes an XCTest-to-Swift-Testing assertion conversion table plus error, async, parameterized, confirmation, and tag patterns
  • Flags pitfalls such as accidental Cartesian products without zip, shared-state leaks, and parallel test conflicts needing .serialized
  • Designed for developers writing new Swift tests or migrating existing XCTest suites to the Swift Testing framework

Install

$ npx -y skills add johnrogers/claude-swift-engineering --skill swift-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Swift Testing Framework

Modern testing with Swift Testing framework. No XCTest.

Overview

Swift Testing replaces XCTest with a modern macro-based approach that's more concise, has better async support, and runs tests in parallel by default. The core principle: if you learned XCTest, unlearn it—Swift Testing works differently.

References

Core Concepts

Assertions

MacroUse Case
#expect(expression)Soft check — continues on failure. Use for most assertions.
#require(expression)Hard check — stops test on failure. Use for preconditions only.

Optional Unwrapping

let user = try #require(await fetchUser(id: "123"))
#expect(user.id == "123")

Test Structure

import Testing
@testable import YourModule

Details

Repository
github.com/johnrogers/claude-swift-engineering
Categories
Testing & QA, Mobile Apps
First seen
Jun 3, 2026

Questions

What does the swift-testing skill do?

The swift-testing skill guides an agent to write tests with the Swift Testing framework using @Test, #expect and #require. It also covers migrating from XCTest, implementing async tests, and parameterizing tests.

How do I install the swift-testing skill?

Run npx -y skills add johnrogers/claude-swift-engineering --skill swift-testing -y in your project. Once installed, the swift-testing skill lets your agent write Swift Testing suites that replace XCTest.

Where does swift-testing stand in the Testing & QA category?

swift-testing is listed in the Testing & QA category on Claude Marketplaces, next to tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. What sets it apart is its focus on Swift Testing specifically, including the XCTest-to-Swift-Testing assertion conversions.

Does swift-testing help with parallel or async Swift tests?

Yes, the swift-testing skill covers async test functions, confirmations for callbacks, and parameterized tests built with zip. It also warns about parallel test conflicts and shows when to use .serialized.

More from johnrogers/claude-swift-engineering

All 10

Similar to Swift Testing

More Testing & QA