Skip to content
Back to search

swift-testing-agent-skill

MarketplaceWorks with Claude CodeGitHub

An agent skill focused entirely on Swift Testing, helping you write better tests, migrate from XCTest, improve test architecture, and adopt modern Swift testing patterns with confidence.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/avdlee-swift-testing-agent-skill/badge.svg)](/listings/avdlee-swift-testing-agent-skill)

HTML

<a href="/listings/avdlee-swift-testing-agent-skill"><img src="/api/listings/avdlee-swift-testing-agent-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 50 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "swift-testing-agent-skill",
  4. "version": "1.2.0",
  5. "owner": {
  6. "name": "Antoine van der Lee",
  7. "email": "contact@avanderlee.com"
  8. },
  9. "metadata": {
  10. "description": "Expert Swift Testing guidance for modern test architecture, diagnostics, parameterization, tags, and pragmatic XCTest migration."
  11. },
  12. "plugins": [
  13. {
  14. "name": "swift-testing-expert",
  15. "description": "Expert Swift Testing guidance for #expect/#require macros, traits and tags, parameterized tests, async testing patterns, parallel execution, and XCTest migration workflows.",
  16. "repository": "https://github.com/AvdLee/Swift-Testing-Agent-Skill",
  17. "version": "1.2.0",
  18. "author": {
  19. "name": "Antoine van der Lee",
  20. "email": "contact@avanderlee.com"
  21. },
  22. "license": "MIT",
  23. "category": "development",
  24. "keywords": [
  25. "swift",
  26. "swift-testing",
  27. "xctest",
  28. "testing",
  29. "unit-testing",
  30. "parameterized-tests",
  31. "traits",
  32. "tags",
  33. "parallel-testing",
  34. "async-await",
  35. "xcode",
  36. "ios",
  37. "macos",
  38. "apple"
  39. ],
  40. "tags": [
  41. "swift",
  42. "swift-testing",
  43. "testing",
  44. "xctest",
  45. "apple-platforms"
  46. ],
  47. "source": "./"
  48. }
  49. ]
  50. }
README.md · README · 181 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Swift Testing Agent Skill
  2. Expert guidance for any AI coding tool that supports the [Agent Skills open format](https://agentskills.io/home) - modern Swift Testing APIs, XCTest migration, parameterized tests, traits/tags, async testing, and parallel execution patterns.
  3. This repository distills practical Swift Testing best practices into actionable, concise references for agents and code review workflows.
  4. ## Who this is for
  5. - Teams adopting Swift Testing who want quick, correct defaults
  6. - Developers migrating existing XCTest suites incrementally
  7. - Anyone debugging flaky tests, parallel test behavior, or async test reliability
  8. ## See also my other skills:
  9. - [SwiftUI Expert](https://github.com/AvdLee/SwiftUI-Agent-Skill)
  10. - [Swift Concurrency Expert](https://github.com/AvdLee/Swift-Concurrency-Agent-Skill)
  11. - [Core Data Expert](https://github.com/AvdLee/Core-Data-Agent-Skill)
  12. ## How to Use This Skill
  13. ### Option A: Using skills.sh (recommended)
  14. Install this skill with a single command:
  15. ```bash
  16. npx skills add https://github.com/avdlee/swift-testing-agent-skill --skill swift-testing-expert
  17. ```
  18. For more information, visit the [skills.sh platform page](https://skills.sh/avdlee/swift-testing-agent-skill/swift-testing-expert).
  19. Then use the skill in your AI agent, for example:
  20. > Use the swift testing skill and review this test target for migration opportunities and flaky parallel behavior.
  21. ### Option B: Claude Code Plugin
  22. #### Personal Usage
  23. To install this Skill for your personal use in Claude Code:
  24. 1. Add the marketplace:
  25. ```bash
  26. /plugin marketplace add AvdLee/Swift-Testing-Agent-Skill
  27. ```
  28. 2. Install the Skill:
  29. ```bash
  30. /plugin install swift-testing-expert@swift-testing-agent-skill
  31. ```
  32. #### Updating After a Release
  33. If Claude Code still shows an older version after a new GitHub release, refresh the marketplace before reinstalling or updating the Skill:
  34. ```bash
  35. /plugin marketplace update swift-testing-agent-skill
  36. ```
  37. Claude Code reads available plugin versions from your local marketplace copy, so updating the marketplace is what pulls the latest `.claude-plugin/marketplace.json`.
  38. #### Project Configuration
  39. To automatically provide this Skill to everyone working in a repository, configure the repository's `.claude/settings.json`:
  40. ```json
  41. {
  42. "enabledPlugins": {
  43. "swift-testing-expert@swift-testing-agent-skill": true
  44. },
  45. "extraKnownMarketplaces": {
  46. "swift-testing-agent-skill": {
  47. "source": {
  48. "source": "github",
  49. "repo": "AvdLee/Swift-Testing-Agent-Skill"
  50. }
  51. }
  52. }
  53. }
  54. ```
  55. When team members open the project, Claude Code will prompt them to install the Skill.
  56. ### Option C: Manual install
  57. 1) **Clone** this repository.
  58. 2) **Install or symlink** the `swift-testing-expert/` folder following your tool's official skills installation docs (see links below).
  59. 3) **Use your AI tool** as usual and ask it to use the "swift-testing-expert" skill for Swift Testing tasks.
  60. #### Where to Save Skills
  61. Follow your tool's official documentation, here are a few popular ones:
  62. - **Codex:** [Where to save skills](https://developers.openai.com/codex/skills/#where-to-save-skills)
  63. - **Claude:** [Using Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview#using-skills)
  64. - **Cursor:** [Enabling Skills](https://cursor.com/docs/context/skills#enabling-skills)
  65. **How to verify**:
  66. Your agent should reference the routing/playbook in `swift-testing-expert/SKILL.md` and jump into the relevant file in `swift-testing-expert/references/`.
  67. ## What This Skill Offers
  68. This skill gives your AI coding tool practical Swift Testing guidance. It can:
  69. ### Guide Your Test Architecture Decisions
  70. - Choose when to use suites, traits, tags, and display names
  71. - Convert repetitive tests into parameterized tests with clean argument design
  72. - Apply parallel-safe patterns and know when `.serialized` is a temporary compromise
  73. - Set up tag-driven test plan filtering and report analysis workflows
  74. ### Write Better Swift Tests
  75. - Use `#expect` effectively with rich diagnostics
  76. - Use `#require` for prerequisite flow and safer unwrapping
  77. - Model thrown-error expectations clearly
  78. - Improve output readability with test-specific descriptions
  79. ### Migrate from XCTest Pragmatically
  80. - Coexist Swift Testing and XCTest in one target during migration
  81. - Map common `XCTAssert*` patterns to Swift Testing macros
  82. - Keep XCTest where still required (`XCUIApplication`, `XCTMetric`, Objective-C tests)
  83. - Convert duplicated XCTest methods into parameterized Swift Testing coverage
  84. ### Improve Reliability and Performance
  85. - Remove hidden inter-test dependencies surfaced by randomized, parallel execution
  86. - Stabilize server-side tests with repository isolation and in-memory implementations
  87. - Bridge callback APIs to async/await for deterministic tests
  88. - Reduce CI noise with known-issue handling and actionable trait metadata
  89. ## What Makes This Skill Different
  90. **Source-grounded**: Built from SwiftLee's complete Swift Testing article set plus WWDC 2024 sessions "Meet Swift Testing" and "Go further with Swift Testing."
  91. **Non-Opinionated**: Focuses on test correctness, readability, and maintainability without forcing a project architecture.
  92. **Modern-first**: Prioritizes Swift Testing primitives, parallel defaults, and macro-based diagnostics over legacy assertion styles.
  93. **Practical and concise**: Emphasizes playbooks and decision points teams actually use during migrations and ongoing test maintenance.
  94. ## Skill Structure
  95. <!-- references-structure:start -->
  96. ```text
  97. swift-testing-expert/
  98. SKILL.md
  99. references/
  100. _index.md
  101. async-testing-and-waiting.md - Async waiting, continuations, and callback-event testing
  102. expectations.md - #expect, #require, throw checks, and known issues
  103. fundamentals.md - @Test, suites, structure, and naming patterns
  104. migration-from-xctest.md - Incremental XCTest coexistence and migration strategy
  105. parallelization-and-isolation.md - Parallel defaults, randomized order, and .serialized usage
  106. parameterized-testing.md - Single/multi-argument tests, zip pairing, and scaling
  107. performance-and-best-practices.md - High-signal testing defaults for speed, determinism, and flakiness prevention
  108. traits-and-tags.md - Traits, tags, conditions, bug links, and test-plan filtering
  109. xcode-workflows.md - Test navigator/report workflows and diagnostics practices
  110. ```
  111. <!-- references-structure:end -->
  112. ## Resources
  113. This skill is based on:
  114. - **[Swift Testing category on SwiftLee](https://www.avanderlee.com/category/swift-testing/)** - complete article set on modern Swift Testing patterns
  115. - **[WWDC 2024-10179: Meet Swift Testing transcript](https://devimages-cdn.apple.com/wwdc-services/transcripts/individual/wwdc2024/wwdc2024-10179/eng_7a6b3a31be5f/wwdc2024-10179-transcript-eng.json)** - foundational APIs and migration context
  116. - **[WWDC 2024-10195: Go further with Swift Testing transcript](https://devimages-cdn.apple.com/wwdc-services/transcripts/individual/wwdc2024/wwdc2024-10195/eng_2c5849b0d379/wwdc2024-10195-transcript-eng.json)** - advanced workflows for tags, test plans, and parallelism
  117. - **[Defining test functions (Apple Developer Documentation)](https://developer.apple.com/documentation/testing/definingtests)** - canonical guidance on declaring and customizing tests
  118. - **[Organizing test functions with suite types (Apple Developer Documentation)](https://developer.apple.com/documentation/testing/organizingtests)** - suite behavior, inheritance, and initializer/availability constraints
  119. - **[Migrating a test from XCTest (Apple Developer Documentation)](https://developer.apple.com/documentation/testing/migratingfromxctest)** - official migration mappings and async/testing semantics
  120. ## Contributing
  121. Contributions are welcome! This repository follows the [Agent Skills open format](https://agentskills.io/home), which has specific structural requirements.
  122. **We strongly recommend using AI assistance for contributions:**
  123. - Use the [skill-creator skill](https://github.com/anthropics/skills/tree/main/skills/skill-creator) to ensure proper formatting
  124. - This helps maintain the Agent Skills format and ensures your contribution works correctly with AI agents
  125. **Please read [CONTRIBUTING.md](CONTRIBUTING.md) for:**
  126. - How to update `SKILL.md` and references safely
  127. - Agent Skills format requirements
  128. - Quality standards and review criteria
  129. - Pull request process
  130. ## About the Author
  131. Created by [Antoine van der Lee](https://www.avanderlee.com). This skill distills Swift Testing guidance from SwiftLee articles and WWDC material into an implementation-oriented playbook for AI assistants.
  132. ## License
  133. This skill is open-source and available under the MIT License. See [LICENSE](LICENSE) for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.