modernize-tests

modernize-tests is a skill for Claude Code, Codex from aduermael/herm. It costs 19 tokens per session (2,289 once invoked), scanned A, original, MIT.

A guide for updating Swift test code from XCTest to Swift Testing, Apple’s newer testing framework, where the existing tests can be migrated. It also covers improving tests that already use Swift Testing.

In plain words
What is it for?
Use it when converting an existing Swift test suite or reorganising Swift Testing tests. It does not apply to writing new tests from scratch or migrating user-interface tests built with XCUI.
Why use it?
Older XCTest code uses different imports, test structures, and APIs from Swift Testing. The guide helps change those parts while accounting for dependencies such as Foundation.

Skill for Claude CodeCodex

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

Good fit Use it when converting an existing Swift test suite or reorganising Swift Testing tests. It does not apply to writing new tests from scratch or migrating user-interface tests built with XCUI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aduermael/herm/modernize-tests
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 aduermael/herm --skill modernize-tests
Clone the repo
git clone --depth 1 https://github.com/aduermael/herm

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 modernize-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/aduermael/herm/modernize-tests.svg)](https://agentmods.dev/skills/aduermael/herm/modernize-tests)
Your own site
<a href="https://agentmods.dev/skills/aduermael/herm/modernize-tests"><img src="https://agentmods.dev/badge/skills/aduermael/herm/modernize-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,289 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00019 $0.02289
Opus 5 $0.00010 $0.01144
Sonnet 5 $0.00004 $0.00458
Haiku 4.5 $0.00002 $0.00229

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

Security

Grade A, and why

modernize-tests 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 8d 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

1 near-identical copy found in the catalogue:

skills/modernize-tests/SKILL.md · 246 lines

How it starts

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

Modernize Tests

Apply when: user asks to modernize, update, migrate, supercharge, or convert their tests. XCTest should be migrated to Swift Testing when possible, existing Swift Testing tests should be evaluated to see if they could be better structured adopting newer features.

Do not apply when: user asks to write new tests from scratch (without existing XCTest code), user asks about XCTest features only, user only asks about test results or test running, user is asking to update tests to cover new functionality rather than updating the tests themselves, user is debugging test failures without mentioning migration, user has UI automation tests using XCUI* APIs (these cannot be migrated to Swift Testing).

Migration Reference

Imports

Replace import XCTest with import Testing. A file can import both if it contains mixed test content during incremental migration.

When removing import XCTest, check whether the file uses Foundation types (URL, CharacterSet, ProcessInfo, Data, etc.). XCTest re-exports Foundation, so add import Foundation if needed.

Test Classes to Suites

Remove XCTestCase inheritance. Prefer struct over class:

  • final class FoodTruckTests: XCTestCase { ... } -> struct FoodTruckTests { ... }

setUp/tearDown to init/deinit

Replace override func setUp() with init() (can be async throws). Replace override func tearDown() with deinit. If deinit is needed, use actor or final class instead of struct (since structs have no deinit). Change stored properties to not use implicitly-unwrapped optional types, and move their initial assignment from setUp to either be initialized inline or, if the initialization is complex, in an initializer.

struct MyTests {
    var fixture = Fixture()
    mutating func `Fixture behaves as expected`() {
        #expect(fixture.doSomething())
    }
}

Avoid pulling instance variables into function bodies; this can cause noise. Swift Testing reinvokes the initializer fresh before each test runs. If the test mutates an instance variable with value semantics, you may need to mark the test function mutating.

Read the full file on GitHub · 246 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. 8d ago First seen · 246 lines · 19 tokens per session scan A e032fbfc964b

Subscribe to this mod's changes

modernize-tests is a skill published in the GitHub repository aduermael/herm (232 stars, last pushed 26d ago), licensed MIT. It adds 19 tokens to every session and 2,289 once invoked, about $0.0001 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-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

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

notque/vexjoy-agent · 22 tokens

swift-testing-expert

Expert guidance for Swift Testing: test structure, #expect/#require macros, traits and tags, parameterized tests, test plans, parallel execution, async waiting patterns, and XCTest migration. Use when writing new Swift tests, modernizing XCTest suites, debugging flaky tests, or improving test quality and…

AvdLee/Swift-Testing-Agent-Skill · 73 tokens

guide-swift-testing

Swift Testing patterns — structs over classes, async confirmations, parameterized tests, exit tests, attachments, common agent mistakes. Use when writing, reviewing, or migrating Swift Testing code.

Prisma-Labs-Dev/apple-skills · 41 tokens

swift-testing

WHEN writing, running, or diagnosing Swift Testing suites, including migrating XCTest tests to them and a crashing or non-reporting test target under xcodebuild; NOT for authoring XCTest or XCUITest tests; returns macro-driven test patterns, the XCTest boundary, and the correct way to read xcodebuild results.

mintuz/skills · 66 tokens

testing-coroutines-with-runtest

Use this skill to test suspend functions and coroutine-using classes on the JVM with kotlinx-coroutines-test. Covers runTest, TestScope, StandardTestDispatcher vs UnconfinedTestDispatcher, virtual time via TestCoroutineScheduler (advanceTimeBy, advanceUntilIdle, runCurrent), the canonical MainDispatcherRule wrapper…

skydoves/android-testing-skills · 172 tokens