swift-testing-expert

swift-testing-expert is a skill for Claude Code, Codex from patrickserrano/lacquer. It costs 73 tokens per session (1,046 once invoked), scanned A, a copy of swift-testing-expert, MIT.

An expert guide for writing, reviewing, modernizing, and debugging tests with Apple's Swift Testing framework. It covers assertions, test organization, tags, parameterized tests, parallel execution, asynchronous waiting, and moving tests from XCTest.

In plain words
What is it for?
Use it to write unit and integration tests, migrate XCTest assertions, test asynchronous code, organize test plans, handle shared state, and investigate flaky tests.
Why use it?
It helps make Swift tests clearer, safer to run in parallel, and easier to diagnose when they fail. It also explains which cases should remain in XCTest, such as user-interface automation and certain performance tests.

Skill for Claude CodeCodex

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

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/patrickserrano/lacquer/swift-testing-expert
Any agent
npx skills add patrickserrano/lacquer --skill swift-testing-expert
Clone the repo
git clone --depth 1 https://github.com/patrickserrano/lacquer

Made for: Claude Code, Codex.

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/patrickserrano/lacquer/swift-testing-expert.svg)](https://agentmods.dev/skills/patrickserrano/lacquer/swift-testing-expert)
Your own site
<a href="https://agentmods.dev/skills/patrickserrano/lacquer/swift-testing-expert"><img src="https://agentmods.dev/badge/skills/patrickserrano/lacquer/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,046 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod 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.01046
Opus 5 $0.00036 $0.00523
Sonnet 5 $0.00015 $0.00209
Haiku 4.5 $0.00007 $0.00105

Measured 2d ago against content hash ab8826c62b61, 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 2d 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

This is a copy

92% identical to swift-testing-expert — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

profiles/ios/skills/swift-testing-expert/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 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 · 82 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. 2d ago First seen · 82 lines · 73 tokens per session scan A ab8826c62b61

Subscribe to this mod's changes

swift-testing-expert is a skill published in the GitHub repository patrickserrano/lacquer (3 stars, last pushed yesterday), licensed MIT. It adds 73 tokens to every session and 1,046 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to swift-testing-expert, differing in 2 lines, and is treated as a copy.

Related

Other skills, from other repositories