Swift Testing Pro
Writes, reviews, and improves Swift Testing code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use Swift Testing.
- Type
- Skill
- Repository
- twostraws/Swift-Testing-Agent-Skill
- GitHub stars
- 439
- License
- MIT
- Repo last updated
- May 17, 2026
- Source file
- swift-testing-pro/SKILL.md
What Swift Testing Pro is
Swift Testing Pro is a skill published in the twostraws/Swift-Testing-Agent-Skill repository on GitHub, which has about 439 stars. The repository describes itself as: “Swift Testing agent skill for Claude Code, Codex, and other AI tools.”
A skill is a folder with a SKILL.md file: frontmatter with a name and a description, followed by instructions Claude follows. Claude loads a skill automatically when a task matches its description, and you can also run it directly with a slash and its name.
Skills work in Claude Code and in Claude Cowork, which makes Swift Testing Pro a portable way to give Claude the same method everywhere.
How to install Swift Testing Pro
Claude Code
- Download the swift-testing-pro folder from the repository.
- Save it as ~/.claude/skills/<skill-name>/SKILL.md for all projects, or .claude/skills/<skill-name>/SKILL.md for one project.
- Claude loads it automatically when a task matches; you can also run it with / and its name.
Claude Cowork
- Zip the skill folder so SKILL.md sits at the top level of the folder.
- Open Customize → Skills, click +, then upload the ZIP.
- Start a task that matches the description, or call it by name with /.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from swift-testing-pro/SKILL.md, shared under the repository's MIT license. Read the full file on GitHub.
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:
- Ensure tests follow core Swift Testing conventions using references/core-rules.md.
- Validate test structure, assertions, dependency injection, and other 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, test scopes, exit tests, and attachments are used correctly using references/new-features.md.
- 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:
- State the file and relevant line(s).
- Name the rule being violated.
- Show a brief before/after code fix.
Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
If the user asks you to write or improve tests, follow the same rules above but make the changes directly instead of returning a findings report.
Example output:
UserTests.swift
Line 5: Use struct, not class, for test suites.
// Before
class UserTests: XCTestCase {
// After
struct UserTests {Line 12: Use #expect instead of XCTAssertEqual.
// Before
XCTAssertEqual(user.name, "Taylor")
// After
#expect(user.name == "Taylor")Line 30: Use #require for preconditions, not #expect.
// Before
#expect(users.isEmpty == false)
let first = users.first!
// After
let first = try #require(users.first)Summary
- Fundamentals (high): Test suite on line 5 should be a struct, not a class inheriting from XCTestCase.
- Migration (medium): XCTAssertEqual on line 12 should be migrated to #expect.
- Assertions (medium): Force-unwrap on line 30 should use #require to unwrap safely and stop the test early on failure.
End of example.
References
- references/core-rules.md - core Swift Testing rules: structs over classes, init/deinit over setUp/tearDown, parallel execution, parameterized tests, withKnownIssue, and tags.
- references/writing-better-tests.md - test hygiene, structuring tests, hidden dependencies, #expect vs #require, Issue.record(), #expect(throws:), and verification methods.
- references/async-tests.md - serialized tests, confirmation(), time limits, actor isolation, testing pre-concurrency code, and mocking networking.
- references/new-features.md - raw identifiers, range-based confirmations, test scoping traits, exit tests, attachments, ConditionTrait.evaluate(), and the updated #expect(throws:) return value.
- references/migrating-from-xctest.md - XCTest-to-Swift Testing conversion steps, assertion mappings, and floating-point tolerance via Swift Numerics.
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Swift Testing Pro?
Swift Testing Pro is a skill for Claude Code and Claude Cowork from the twostraws/Swift-Testing-Agent-Skill repository on GitHub. Writes, reviews, and improves Swift Testing code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use Swift Testing.
How do I install Swift Testing Pro in Claude Code?
Download the swift-testing-pro folder from the repository. Save it as ~/.claude/skills/<skill-name>/SKILL.md for all projects, or .claude/skills/<skill-name>/SKILL.md for one project. Claude loads it automatically when a task matches; you can also run it with / and its name.
Can I use Swift Testing Pro in Claude Cowork?
Zip the skill folder so SKILL.md sits at the top level of the folder. Open Customize → Skills, click +, then upload the ZIP. Start a task that matches the description, or call it by name with /.
Is Swift Testing Pro safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- 1password Credential Lookup This skill should be used when agents need to log into websites, retrieve passwords, or access credentials. CRITICAL - always use… Skill · aiskillstore/marketplace
- Output Build Workflow Implement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an existing plan, or after output-plan-workflow has produced a plan and the user is ready to build. Skill · growthxai/output
- Deep Research Execute autonomous multi-step research using Google Gemini Deep Research Agent. Use for: market analysis, competitive landscaping, literature reviews, technical research, due diligence. Takes 2-10 minutes but produces detailed, cited reports. Costs $2-5 per task. Skill · sanjay3290/ai-skills
- 001 Commands Inventory Use when you need to generate a checklist document with embedded commands inventory, following the embedded template exactly and producing… Skill · jabrena/plinth
- Add New Entry Workflow and tools for adding new entries from temp.md to the section files. Includes legend format, section reference, code tools, and… Skill · kimtth/azure-openai-llm-notes
- Shortfilm Prompt Generate cinematic AI shortfilm prompts (works with Seedance 2.0, Xiaoyunque, Sora, Kling, Jimeng, Veo) using the 5-stage structure from… Skill · jnMetaCode/ai-shortfilm-prompts
- Answer Reviewer Questions For each reviewer question on a PR, recall implementation reasoning and compose a raw answer. Use when the user asks to "answer reviewer… Skill · tobihagemann/turbo
- Lineage Skill Distills course, book, and long-form learning materials into source-grounded AI agent skills. Use when the user wants to convert videos… Skill · JuneYaooo/lineage-skill