swift-testing-expert

swift-testing-expert is a skill for Claude Code from AvdLee/Swift-Testing-Agent-Skill. It costs 73 tokens per session (1,014 once invoked), scanned A, original, MIT.

Guidance for Swift Testing, Apple's framework for writing tests in Swift. It explains test structure, assertions such as #expect and #require, labels, repeated inputs, test plans, asynchronous tests, parallel execution, and gradual XCTest migration.

In plain words
What is it for?
Use it to write or review Swift unit and integration tests, debug flaky tests, organise test metadata, test multiple inputs, and modernise existing XCTest suites.
Why use it?
It helps make tests easier to read and diagnose while reducing problems caused by shared state, asynchronous work, or inconsistent migration from XCTest.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swift-testing-expert plugin — 1 skill shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/avdlee/swift-testing-agent-skill/swift-testing-expert
Any agent
npx skills add AvdLee/Swift-Testing-Agent-Skill --skill swift-testing-expert
Clone the repo
git clone --depth 1 https://github.com/AvdLee/Swift-Testing-Agent-Skill

Made for: Claude Code.

Or install swift-testing-expert, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swift-testing-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/avdlee/swift-testing-agent-skill/swift-testing-expert.svg)](https://agentmods.dev/skills/avdlee/swift-testing-agent-skill/swift-testing-expert)
Your own site
<a href="https://agentmods.dev/skills/avdlee/swift-testing-agent-skill/swift-testing-expert"><img src="https://agentmods.dev/badge/skills/avdlee/swift-testing-agent-skill/swift-testing-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,014 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.01014
Opus 5 $0.00036 $0.00507
Sonnet 5 $0.00015 $0.00203
Haiku 4.5 $0.00007 $0.00101

Measured 6d ago against content hash d039eb55cfba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

swift-testing-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

swift-testing-expert/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Swift Testing

Overview

Use this skill to write, review, migrate, and debug Swift tests with modern Swift Testing APIs. Prioritize readable tests, robust parallel execution, clear diagnostics, and incremental migration from XCTest where needed.

Agent behavior contract (follow these rules)

  1. Prefer Swift Testing for Swift unit and integration tests, but keep XCTest for UI automation (XCUIApplication), performance metrics (XCTMetric), and Objective-C-only test code.
  2. Treat #expect as the default assertion and use #require when subsequent lines depend on a prerequisite value.
  3. Default to parallel-safe guidance. If tests are not isolated, first propose fixing shared state before applying .serialized.
  4. Prefer traits for behavior and metadata (.enabled, .disabled, .timeLimit, .bug, tags) over naming conventions or ad-hoc comments.
  5. Recommend parameterized tests when multiple tests share logic and differ only in input values.
  6. Use @available on test functions for OS-gated behavior instead of runtime #available checks inside test bodies; never annotate suite types with @available.
  7. Keep migration advice incremental: convert assertions first, then organize suites, then introduce parameterization/traits.
  8. Only import Testing in test targets, never in app/library/binary targets.

First 60 seconds (triage template)

  • Clarify the goal: new tests, migration, flaky failures, performance, CI filtering, or async waiting.
  • Collect minimal facts:
    • Xcode/Swift version and platform targets
    • Whether tests currently use XCTest, Swift Testing, or both
    • Whether failures are deterministic or flaky
    • Whether tests access shared resources (database, files, network, global state)
  • Branch quickly:
    • repetitive tests -> parameterized tests
    • noisy or flaky failures -> known issue handling and test isolation
    • migration questions -> XCTest mapping and coexistence strategy
    • async callback complexity -> continuation/await patterns

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 80 lines · 73 tokens per session scan A d039eb55cfba

Subscribe to this mod's changes

swift-testing-expert is a skill published in the GitHub repository AvdLee/Swift-Testing-Agent-Skill (446 stars, last pushed 29d ago), licensed MIT. It adds 73 tokens to every session and 1,014 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

swift-testing

Expert guidance on Swift Testing best practices, patterns, and implementation. Use when developers mention: (1) Swift Testing, @Test, #expect, #require, or @Suite, (2) "use Swift Testing" or "modern testing patterns", (3) test doubles, mocks, stubs, spies, or fixtures, (4) unit tests, integration tests, or snapshot…

bocato/swift-testing-agent-skill · 124 tokens

test

Run all TMDb unit tests (Swift Testing, the TMDb test plan). Use after code changes and before a PR to verify unit tests pass — delegates the run to the tooling-runner agent (Haiku) and returns total/passed/failed counts plus each failure as Suite/test with file:line. For the live-API suite, use /integration-test.

adamayoung/TMDb · 76 tokens

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.

jacklandrin/OnlySwitch · 34 tokens

swift-concurrency

Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendable, data races, thread safety, or concurrency-related compiler and linter warnings.

AvdLee/Swift-Concurrency-Agent-Skill · 56 tokens

swift

Swift development: concurrency patterns, async/await, actors, testing with XCTest and Swift Testing framework.

notque/vexjoy-agent · 22 tokens

add-ktnip-ksp-tests

Adds tests for the ktnip KSP processor. Use when adding tests for a new collector, testing processor behavior with new annotations, or verifying KSP code generation for the telegram-bot library.

vendelieu/telegram-bot · 48 tokens