guide-swift-testing
Skill336 starsChanged 7 months agoMITView on GitHub
Swift Testing patterns — structs over classes, async confirmations, parameterized tests, exit tests, attachments, common agent mistakes. Use when writing, reviewing, or migrating Swift Testing code.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apple-asoSkill
- apple-docs-indexSkill
- backgroundtasksSkill
- combineSkill
- core-animationSkill
- corehapticsSkill
- eventkitSkill
- guide-macos-spm-packagingSkill
- guide-swift-concurrencySkill
- guide-swiftdataSkill
- guide-swiftui-chartsSkill
- guide-swiftui-performance-auditSkill
- healthkitSkill
- higSkill
- ios-devSkill
- ios-liquid-glassSkill
- mapkitSkill
- photosuiSkill
- storekitSkill
- swift-concurrencySkill
- swiftdataSkill
- swift-testingSkill
- swiftuiSkill
- tipkitSkill
- uikitSkill
- usernotificationsSkill
- widgetkitSkill
- xcuitestSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Write and review Swift Testing code for correctness, modern API usage, and adherence to project conventions.
- Distinctive: line 20
Do not rewrite existing XCTest to Swift Testing unless requested.
- Very specific: line 24
Ensure tests follow core conventions using references/core-rules.md.
- Very specific: line 26
Check async tests, confirmations, time limits, actor isolation, and networking mocks using references/async-tests.md.
- Very specific: line 27
Ensure new features like raw identifiers, exit tests, and attachments are used correctly using references/new-features.md.
- Very specific: line 28
If migrating from XCTest, follow references/migrating-from-xctest.md.
- Distinctive: line 30
If doing partial work, load only the relevant reference files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Guide Skill — This is an expert workflow/pattern guide, not API reference documentation. Originally from twostraws/Swift-Testing-Agent-Skill by Paul Hudson. MIT License.
Swift Testing Patterns
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.
Core Instructions
- Target Swift 6.2 or later, using modern Swift concurrency.
- Swift Testing does not support UI tests — XCTest must be used there.
- Do not rewrite existing XCTest to Swift Testing unless requested.
Review Process
- Ensure tests follow core conventions using
references/core-rules.md. - Validate structure, assertions, dependency injection, and best practices using
references/writing-better-tests.md. - Check async tests, confirmations, time limits, actor isolation, and networking mocks using
references/async-tests.md. - Ensure new features like raw identifiers, exit tests, and attachments are used correctly using
references/new-features.md. - If migrating from XCTest, follow
references/migrating-from-xctest.md.
If doing partial work, load only the relevant reference files.
References
| Topic | Reference |
Structs over classes, @Suite, parallel execution, withKnownIssue, tags | references/core-rules.md |
Test hygiene, structure, DI, #expect vs #require, Issue.record(), verification methods | references/writing-better-tests.md |
Serialized tests, confirmation(), time limits, actor isolation, mocking networking | references/async-tests.md |
| Raw identifiers, exit tests, attachments, test scoping traits, range-based confirmations | references/new-features.md |
| XCTest-to-Swift Testing conversion, assertion mappings, floating-point tolerance | references/migrating-from-xctest.md |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

