swift-testing-expert
Expert guidance for Swift Testing: test structure, #expect/#require macros, traits and tags, parameterized tests, test plans, parallel execution, async waiting patterns, and XCTest migration. Use when writing new Swift tests, modernizing XCTest suites, debugging flaky tests, or improving test quality and maintainability in Apple-platform or Swift server projects.
Security Assessment
Detected risks:
About swift-testing-expert
The `swift-testing-expert` skill provides professional guidance for writing, reviewing, migrating, and debugging Swift tests using modern Swift Testing APIs. It addresses common challenges in Swift test development, including flaky tests, complex asynchronous patterns, and incremental migration from legacy XCTest suites. By emphasizing readable, maintainable, and robust tests, this skill helps developers ensure higher test quality while maintaining compatibility with Apple-platform and Swift server projects. It streamlines the testing workflow, allowing developers to focus on logic rather than boilerplate or fragile test structures.
Key features include guidance on using `#expect` and `#require` macros for assertions, leveraging traits and tags for test metadata, designing parameterized tests, managing parallel execution safely, handling async waiting patterns, and performing incremental XCTest migration. The skill also provides templates for triage within the first 60 seconds, a routing map for quickly finding reference documentation, and common pitfalls with actionable solutions. It enforces best practices such as importing `Testing` only in test targets, avoiding suite-level `@available` annotations, and promoting parameterization over repetitive test methods.
This skill is ideal for Swift developers, QA engineers, and software teams working on unit and integration tests for iOS, macOS, and server-side Swift applications. Use cases include writing new Swift tests, modernizing legacy XCTest suites, debugging flaky or nondeterministic failures, improving test maintainability and readability, and implementing efficient async test patterns. It is particularly useful for teams seeking to adopt a modern Swift Testing workflow while maintaining coexistence with existing XCTest infrastructure.
FAQ
Can I use this skill for UI testing?
While `swift-testing-expert` focuses on unit and integration tests, it recommends keeping XCTest for UI automation using `XCUIApplication`.
Which Swift and Xcode versions are supported?
The skill is designed to guide Swift tests across current Swift versions and Xcode releases; you should provide your version and platform targets during triage for precise guidance.
Does this skill handle async test patterns?
Yes, it provides guidance on async waiting patterns and continuation/await usage for complex asynchronous callbacks.
Can I migrate my existing XCTest suite incrementally?
Yes, the skill emphasizes incremental migration: first converting assertions, then organizing suites, and finally introducing parameterization and traits.
Are there any limitations on importing libraries?
Yes, `Testing` should only be imported in test targets and never in app, library, or binary targets.
All Files
11 filesInstall swift-testing-expert
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
avdlee/swift-testing-agent-skill