swift-testing

swift-testing is a skill for Claude Code, Codex from bocato/swift-testing-agent-skill. It costs 124 tokens per session (2,309 once invoked), scanned A, original, MIT.

Expert guidance for Swift Testing, Apple's modern framework for writing tests in Swift. It covers test structure, test doubles such as mocks and stubs, integration tests, and snapshot tests.

In plain words
What is it for?
Use it when creating or migrating tests with @Test, #expect, #require, or @Suite, and when planning unit tests, integration tests, snapshots, fixtures, mocks, stubs, or spies.
Why use it?
It helps developers write tests that are easier to understand and less fragile, while choosing the right assertion and test-double approach.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or migrating tests with @Test, #expect, #require, or @Suite, and when planning unit tests, integration tests, snapshots, fixtures, mocks, stubs, or spies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bocato/swift-testing-agent-skill/swift-testing
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.

Any agent
npx skills add bocato/swift-testing-agent-skill --skill swift-testing
Clone the repo
git clone --depth 1 https://github.com/bocato/swift-testing-agent-skill

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin swift-testing — /plugin install swift-testing after adding the marketplace above.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/bocato/swift-testing-agent-skill/swift-testing/github.svg)](https://agentmods.dev/skills/bocato/swift-testing-agent-skill/swift-testing)
Your own site
<a href="https://agentmods.dev/skills/bocato/swift-testing-agent-skill/swift-testing"><img src="https://agentmods.dev/badge/skills/bocato/swift-testing-agent-skill/swift-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swift-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/bocato/swift-testing-agent-skill/swift-testing"><img src="https://agentmods.dev/badge/skills/bocato/swift-testing-agent-skill/swift-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00124 $0.02309
Opus 5.5 $0.00050 $0.00924
Sonnet 5.5 $0.00025 $0.00462
Haiku 4.5 $0.00012 $0.00231

Measured 3mo ago against content hash 81b4e5a051d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

swift-testing 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 3mo 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.

swift-testing/SKILL.md · 296 lines

How it starts

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

Swift Testing

Overview

This skill provides expert guidance on Swift Testing, covering the modern Swift Testing framework, test doubles (mocks, stubs, spies), fixtures, integration testing, snapshot testing, and migration from XCTest. Use this skill to help developers write reliable, maintainable tests following F.I.R.S.T. principles and Arrange-Act-Assert patterns.

Agent Behavior Contract (Follow These Rules)

  1. Use Swift Testing framework (@Test, #expect, #require, @Suite) for all new tests, not XCTest.
  2. Always structure tests with clear Arrange-Act-Assert phases.
  3. Follow F.I.R.S.T. principles: Fast, Isolated, Repeatable, Self-Validating, Timely.
  4. Use proper test double terminology per Martin Fowler's taxonomy (Dummy, Fake, Stub, Spy, SpyingStub, Mock).
  5. Place fixtures close to models with #if DEBUG, not in test targets.
  6. Place test doubles close to interfaces with #if DEBUG, not in test targets.
  7. Prefer state verification over behavior verification - simpler, less brittle tests.
  8. Use #expect for soft assertions (continue on failure) and #require for hard assertions (stop on failure).

Quick Decision Tree

When a developer needs testing guidance, follow this decision tree:

  1. Starting fresh with Swift Testing?

    • Read references/test-organization.md for suites, tags, traits
    • Read references/async-testing.md for async test patterns
  2. Need to create test data?

    • Read references/fixtures.md for fixture patterns and placement
    • Read references/test-doubles.md for mock/stub/spy patterns
  3. Testing multiple inputs?

    • Read references/parameterized-tests.md for parameterized testing
  4. Testing module interactions?

    • Read references/integration-testing.md for integration test patterns
  5. Testing UI for regressions?

    • Read references/snapshot-testing.md for snapshot testing setup
  6. Testing data structures or state?

    • Read references/dump-snapshot-testing.md for text-based snapshot testing

Read the full file on GitHub · 296 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. 3mo ago First seen · 296 lines · 124 tokens per session scan A 81b4e5a051d4

Subscribe to this mod's changes

swift-testing is a skill published in the GitHub repository bocato/swift-testing-agent-skill (80 stars, last pushed 10mo ago), licensed MIT. It adds 124 tokens to every session and 2,309 once invoked, about $0.0005 per session on Opus 5.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

swift-testing compared with skills from other repositories

swift-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
swift-testingbocato/swift-testing-agent-skillSkill8010mo agoMITA124Claude Code, Codex
swift-testing-expertAvdLee/Swift-Testing-Agent-SkillSkill4852mo agoMITA73Claude Code
ios-agent-skillNagarjuna2997/ios-agent-skillSkill44todayMITA167Claude Code
ios-builderNagarjuna2997/ios-agent-skillSkill44todayMITA53Claude Code, Codex
swift_expertApexIQ/skillsmithSkill58mo agoMITA20Claude Code, Codex
Swift PatternsAmariahAK/atlarix-skillsSkill02mo agoApache-2.0A2Claude Code, Codex
swift-testing-projacklandrin/OnlySwitchSkill6.1kyesterdayMITA34Codex