This walks you through Apple's modern Swift Testing framework with the `@Test`, `#expect`, and `#require` macros instead of XCTest. It's opinionated about test structure (Arrange-Act-Assert), test double terminology (following Martin Fowler's taxonomy, not the community's loose "mock" usage), and where to put fixtures and doubles (close to models and interfaces with `#if DEBUG`, not in test targets). The decision tree is genuinely helpful for routing you to the right reference, whether you need parameterized tests, snapshot testing, or async patterns. If you're migrating from XCTest or trying to write less brittle integration tests, this gives you practical patterns worth following.

skills.sh installs
287
GitHub stars
80
last updated
Jun 3, 2026

Install

$ npx -y skills add bocato/swift-testing-agent-skill --skill swift-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Swift Testing

Overview

This skill provides expert guidance on Swift Testing, covering the modern Swift Testing framework, test doubles (mocks, stubs, spies), fixtures, integration testing, snapshot testing, and migration from XCTest. Use this skill to help developers write reliable, maintainable tests following F.I.R.S.T. principles and Arrange-Act-Assert patterns.

Agent Behavior Contract (Follow These Rules)

  1. Use Swift Testing framework (@Test, #expect, #require, @Suite) for all new tests, not XCTest.
  2. Always structure tests with clear Arrange-Act-Assert phases.
  3. Follow F.I.R.S.T. principles: Fast, Isolated, Repeatable, Self-Validating, Timely.
  4. Use proper test double terminology per Martin Fowler's taxonomy (Dummy, Fake, Stub, Spy, SpyingStub, Mock).
  5. Place fixtures close to models with #if DEBUG, not in test targets.
  6. Place test doubles close to interfaces with #if DEBUG, not in test targets.
  7. Prefer state verification over behavior verification - simpler, less brittle tests.
  8. Use #expect for soft assertions (continue on failure) and #require for hard assertions (stop on failure).

Quick Decision Tree

Sponsors

Details

Repository
github.com/bocato/swift-testing-agent-skill
Categories
Testing & QA, AI & Agent Building, Mobile Development
First seen
Jun 3, 2026
1sickn33 avatartdd-workflows-tdd-refactorsickn33/antigravity-awesome-skillstdd workflows tdd refactor281skills.sh installs
2everyinc avatartest-browsereveryinc/compound-engineering-pluginRun browser tests on pages affected by current PR or branch239skills.sh installs
3sickn33 avatartdd-workflows-tdd-redsickn33/antigravity-awesome-skillstdd workflows tdd red238skills.sh installs
4sickn33 avatarweb3-testingsickn33/antigravity-awesome-skillsweb3 testing229skills.sh installs
5cap-go avatarcapacitor-testingcap-go/capacitor-skillscapacitor testing216skills.sh installs
6marcelorodrigo avatarspring-boot-testingmarcelorodrigo/agent-skillsExpert Spring Boot 4 testing specialist that selects the best Spring Boot testing techniques for your situation with Junit 6 and AssertJ.215skills.sh installs