swift-testing-expert

Write, review, and migrate Swift tests using modern Swift Testing APIs with parallel execution and clear diagnostics. Covers test structure, #expect / #require macros, traits, tags, parameterized tests, and async waiting patterns for readable, maintainable tests Guides incremental XCTest migration while preserving UI automation and performance-metric tests that require XCTest Prioritizes parallel-safe test design; recommends fixing shared state before applying .serialized isolation Includes flaky-test debugging, test-plan filtering by tags, and known-issue handling to reduce noise and improve CI signal

INSTALLATION
npx skills add https://github.com/avdlee/swift-testing-agent-skill --skill swift-testing-expert
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

$29

  • Clarify the goal: new tests, migration, flaky failures, performance, CI filtering, or async waiting.
  • Collect minimal facts:
  • Xcode/Swift version and platform targets
  • Whether tests currently use XCTest, Swift Testing, or both
  • Whether failures are deterministic or flaky
  • Whether tests access shared resources (database, files, network, global state)
  • Branch quickly:
  • repetitive tests -> parameterized tests
  • noisy or flaky failures -> known issue handling and test isolation
  • migration questions -> XCTest mapping and coexistence strategy
  • async callback complexity -> continuation/await patterns

Routing map (read the right reference fast)

  • Test building blocks and suite organization -> references/fundamentals.md
  • #expect, #require, and throw expectations -> references/expectations.md
  • Traits, tags, and Xcode test-plan filtering -> references/traits-and-tags.md
  • Parameterized test design and combinatorics -> references/parameterized-testing.md
  • Default parallel execution, .serialized, isolation strategy -> references/parallelization-and-isolation.md
  • Test speed, determinism, and flakiness prevention -> references/performance-and-best-practices.md
  • Async waiting and callback bridging -> references/async-testing-and-waiting.md
  • XCTest coexistence and migration workflow -> references/migration-from-xctest.md
  • Test navigator/report workflows and diagnostics -> references/xcode-workflows.md
  • Index and quick navigation -> references/_index.md

Common pitfalls -> next best move

  • Repetitive testFooCaseA/testFooCaseB/... methods -> replace with one parameterized @Test(arguments:).
  • Failing optional preconditions hidden in later assertions -> try #require(...) then assert on unwrapped value.
  • Flaky integration tests on shared database -> isolate dependencies or in-memory repositories; use .serialized only as a transition step.
  • Disabled tests that silently rot -> prefer withKnownIssue for temporary known failures to preserve signal.
  • Unclear failure values for complex types -> conform type to CustomTestStringConvertible for focused test diagnostics.
  • Test-plan include/exclude by names -> use tags and tag-based filters instead.

Verification checklist

  • Confirm each test has a single clear behavior and expressive display name when needed.
  • Confirm prerequisites use #require where failure should stop the test.
  • Confirm repeated logic is parameterized instead of duplicated.
  • Confirm tests are parallel-safe or intentionally serialized with rationale.
  • Confirm async code is awaited and callback APIs are bridged safely.
  • Confirm migration keeps unsupported XCTest-only scenarios on XCTest.

References

  • references/_index.md
  • references/fundamentals.md
  • references/expectations.md
  • references/traits-and-tags.md
  • references/parameterized-testing.md
  • references/parallelization-and-isolation.md
  • references/performance-and-best-practices.md
  • references/async-testing-and-waiting.md
  • references/migration-from-xctest.md
  • references/xcode-workflows.md
BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card