modernize-tests

modernize-tests is a skill for Codex from JakubMikolajek/codex-skills-collection. It costs 55 tokens per session (660 once invoked), scanned A, original, MIT.

A guide for moving Swift tests from XCTest to Swift Testing, Apple's newer testing framework, and for updating existing Swift Testing code to current patterns.

In plain words
What is it for?
It helps migrate test classes, replace assertions and expectations, use required-value checks, add parameterized tests, and convert setup or teardown code.
Why use it?
It reduces the manual work and mistakes involved in translating assertions, setup and teardown, async tests, and other XCTest features. It also identifies tests that must remain in XCTest, such as UI tests and performance tests.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Codex.

Good fit It helps migrate test classes, replace assertions and expectations, use required-value checks, add parameterized tests, and convert setup or teardown code.

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

Made for: 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/jakubmikolajek/codex-skills-collection/modernize-tests/github.svg)](https://agentmods.dev/skills/jakubmikolajek/codex-skills-collection/modernize-tests)
Your own site
<a href="https://agentmods.dev/skills/jakubmikolajek/codex-skills-collection/modernize-tests"><img src="https://agentmods.dev/badge/skills/jakubmikolajek/codex-skills-collection/modernize-tests/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 modernize-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/jakubmikolajek/codex-skills-collection/modernize-tests"><img src="https://agentmods.dev/badge/skills/jakubmikolajek/codex-skills-collection/modernize-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 660 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.00055 $0.00660
Opus 5.5 $0.00022 $0.00264
Sonnet 5.5 $0.00011 $0.00132
Haiku 4.5 $0.00006 $0.00066

Measured 19d ago against content hash ade760f1b2d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 19d 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.

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

How it starts

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

Modernize Tests Patterns

Use this skill to migrate XCTest to Swift Testing and to modernize existing Swift Testing code. Assertion mappings, error and async patterns, setUp/tearDown conversion, and guidelines live in references/migration-reference.md; read it before editing.

When to Use

  • User asks to migrate XCTest to Swift Testing
  • Existing Swift Testing tests use outdated patterns or loop over inputs instead of parameterized tests
  • Converting XCTestExpectation, XCTSkip, XCTExpectFailure, or XCTAttachment
  • Converting setUp/tearDown to init/deinit

When NOT to Use

  • UI tests using XCUIAutomation - they must remain XCTest
  • XCTests using measure { ... } performance APIs - they cannot migrate (other methods in the same class can)
  • Task is web or Python testing - use unit-testing or python-testing via WORKFLOW routing

Delivery Workflow

Use the checklist below and track progress:

Test modernization progress:
- [ ] Step 1: List XCTest classes and classify migratable vs. must-stay XCTest
- [ ] Step 2: Migrate one test class at a time using the reference mappings
- [ ] Step 3: Preserve `continueAfterFailure` semantics with `try #require`
- [ ] Step 4: Build and run tests; confirm no test was dropped

Core Rules

  • Migrate one test class at a time; a file may hold both XCTest and Swift Testing during migration.
  • Prefer struct suites; use actor or final class only when deinit is needed.
  • Do not turn try #require into #expect; that changes behavior.
  • Add @MainActor only where XCTest's implicit main-actor isolation was relied on; add @Suite(.serialized) for shared mutable state.
  • Use only public API; never introduce underscore-prefixed symbols such as #_sourceLocation.
  • Convert repeated-logic tests to @Test(arguments:).
  • Add import Foundation when removing import XCTest if Foundation types are used.

Full mappings: references/migration-reference.md.

Anti-Patterns to Avoid

Anti-Pattern Instead Do
Migrating UI or measure {} tests Leave them as XCTest
Replacing try #require with #expect Keep #require to preserve early exit
Adding @MainActor everywhere Only where isolation was relied on
Keeping implicitly-unwrapped properties from setUp Initialize inline or in init

Read the full file on GitHub · 61 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 19d ago First seen · 61 lines · 55 tokens per session scan A ade760f1b2d1

Subscribe to this mod's changes

modernize-tests is a skill published in the GitHub repository JakubMikolajek/codex-skills-collection (6 stars, last pushed 20d ago), licensed MIT. It adds 55 tokens to every session and 660 once invoked, about $0.0002 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-10-08.

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

creating-test

Scaffold a unit test file using the Swift Testing framework. Use when the user asks to create tests, add unit tests, write tests for a manager/presenter/interactor, or scaffold a test file. Mirrors the app's folder structure with Tests naming convention.

SwiftfulThinking/SwiftfulStarterProject · 56 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

modernize-tests

Modernize test suites to use modern Swift Testing features or migrate from XCTest.

aduermael/herm · 19 tokens