# swift-testing-expert

> Claude/Codex skill by [@avdlee](https://omgskills.com/library/avdlee/index.md) · 443 stars · Updated 2026-08-07

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.

Tags: agent-skills, swift, swift-testing

## Install

```sh
git clone https://github.com/AvdLee/Swift-Testing-Agent-Skill /tmp/Swift-Testing-Agent-Skill && ln -s /tmp/Swift-Testing-Agent-Skill/swift-testing-expert ~/.claude/skills/swift-testing-expert
```

## From README

Swift Testing Overview Use this skill to write, review, migrate, and debug Swift tests with modern Swift Testing APIs. Prioritize readable tests, robust parallel execution, clear diagnostics, and incremental migration from XCTest where needed. Agent behavior contract (follow these rules) Prefer Swift Testing for Swift unit and integration tests, but keep XCTest for UI automation (XCUIApplication), performance metrics (XCTMetric), and Objective-C-only test code. Treat \#expect as the default assertion and use \#require when subsequent lines depend on a prerequisite value. Default to parallel-safe guidance. If tests are not isolated, first propose fixing shared state before applying .serialized. Prefer traits for behavior and metadata (.enabled, .disabled, .timeLimit, .bug, tags) over naming conventions or ad-hoc comments. Recommend parameterized tests when multiple tests share logic and differ only in input values.

## Links

- HTML page: https://omgskills.com/skills/avdlee/swift-testing-agent-skill/swift-testing-expert/
- GitHub: https://github.com/AvdLee/Swift-Testing-Agent-Skill
- Author: [@avdlee](https://omgskills.com/library/avdlee/index.md)

## More skills by this author

- [swiftui-expert-skill](https://omgskills.com/skills/avdlee/swiftui-agent-skill/swiftui-expert-skill/index.md) — Used when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including state management and...
   - [@avdlee](https://omgskills.com/library/avdlee/index.md) · 3.5k stars
- [update-swiftui-apis](https://omgskills.com/skills/avdlee/swiftui-agent-skill/update-swiftui-apis/index.md) — Scan Apple's SwiftUI documentation for deprecated APIs and update the SwiftUI Expert Skill with modern replacements.
   - [@avdlee](https://omgskills.com/library/avdlee/index.md) · 3.5k stars
- [swift-concurrency](https://omgskills.com/skills/avdlee/swift-concurrency-agent-skill/swift-concurrency/index.md) — Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when...
   - [@avdlee](https://omgskills.com/library/avdlee/index.md) · 1.6k stars
