# Swift Testing Pro

Writes, reviews, and improves Swift Testing code using modern APIs and best practices.

- Repository: https://github.com/jacklandrin/OnlySwitch (6026 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add jacklandrin/OnlySwitch --skill swift-testing-pro -g -a claude-code -y`
Codex: `npx skills add jacklandrin/OnlySwitch --skill swift-testing-pro -g -a codex -y`
Cursor: `npx skills add jacklandrin/OnlySwitch --skill swift-testing-pro -g -a cursor -y`
Gemini CLI: `npx skills add jacklandrin/OnlySwitch --skill swift-testing-pro -g -a gemini-cli -y`

## Description

Writes, reviews, and improves Swift Testing code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use Swift Testing.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

Write and review Swift Testing code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.

Review process:

1. Ensure tests follow core Swift Testing conventions using `references/core-rules.md`.
1. Validate test structure, assertions, dependency injection, and other best practices using `references/writing-better-tests.md`.
1. Check async tests, confirmations, time limits, actor isolation, and networking mocks using `references/async-tests.md`.
1. Ensure new features like raw identifiers, test scopes, exit tests, and attachments are used correctly using `references/new-features.md`.
1. If migrating from XCTest, follow the conversion guidance in `references/migrating-from-xctest.md`.

If doing partial work, load only the relevant reference files.


## Core Instructions

- Target Swift 6.2 or later, using modern Swift concurrency.
- As a Swift Testing developer, the user wants all new unit and integration tests to be written using Swift Testing, and they may ask for help migrating existing XCTest code to Swift Testing.
- Swift Testing does *not* support UI tests, XCTest must be used there.
- Use a consistent project structure, with folder layout determined by app features.

Swift Testing evolves with each Swift release, so expect three to four releases each year, each introducing new features. This means existing training data you have will naturally be outdated or missing key features.

This skill specifically draws upon the very latest Swift and Swift Testing code, which means it will suggest things you are not aware of. Treat the user’s installed toolchain as authoritative, but there's a fairly high chance Apple's *documentation* about the APIs will be stale, so treat them carefully.


## Output Format

If the user asks for a review, organize findings by file. For each issue:

The rest: https://github.com/jacklandrin/OnlySwitch/blob/HEAD/doc/skills/swift-testing-pro/SKILL.md
