Swift Testing Agent Skill: Write high quality tests with AI
Article Summary
Antoine van der Lee from SwiftLee just open-sourced an Agent Skill that teaches AI to write Swift tests the right way. No more serialized tags killing your test performance.
After watching AI agents butcher Swift Testing implementations with unnecessary @MainActor attributes and serialization, van der Lee converted all his Swift Testing articles and Apple's best practices into a comprehensive agent skill. He used it to refactor RocketSim's entire test suite, making it faster and more stable.
Key Takeaways
- Agent skill covers fundamentals, async testing, parallelization, and XCTest migration
- Eliminates common AI mistakes like unnecessary serialized tags that slow tests
- Van der Lee refactored RocketSim tests in phases: migrate, parallelize, analyze flakiness
- Skill includes performance defaults for speed, determinism, and preventing flaky tests
- Part of open source collection with SwiftUI, Concurrency, and Core Data skills
The Swift Testing Agent Skill trains AI to write high quality, fast, parallel tests by encoding Apple's best practices and real world expertise into reusable agent knowledge.
About This Article
AI agents writing Swift tests kept making mistakes. They'd add unnecessary serialized tags and @MainActor attributes that broke test parallelization. Antoine van der Lee had to manually fix these patterns across multiple codebases.
Van der Lee took his Swift Testing articles and Apple's WWDC documentation, then built an Agent Skill from them. It has 9 reference modules covering fundamentals, async testing, parallelization, and XCTest migration. Agents can now reference these during code generation.
When applied to RocketSim's test suite, the skill helped with migration, parallelization rewrites, and flakiness analysis. Tests now run mostly in parallel and are more stable. Over time, skills created by domain experts like this add up to real productivity gains.