Skip to main content
skill CX Codex

test-modernizer — Claude Code skill: what it does, how to install

Migrates XCTest suites to Swift Testing and updates assertions to modern syntax. Useful during Swift test refactoring.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a claude-code
Open on GitHub

What test-modernizer does

The skill updates test suites from XCTest to Swift Testing. It turns XCTestCase classes into structs or actors, maps setUp and tearDown methods to init and deinit, and drops the test method prefix in favor of the @Test attribute.

Legacy assertion macros turn into #expect expressions, while unwrapping checks become try #require. When an existing suite relies on continueAfterFailure = false, the conversion swaps subsequent checks for throwing try #require calls to preserve early exit behavior. Because XCTest re-exports Foundation implicitly, the skill inserts import Foundation whenever types like URL or Data are detected in the file.

UI automation suites relying on XCUI* APIs are out of scope: Swift Testing cannot execute them.

What it helps with

  • migrate XCTest test suites to Swift Testing structs
  • convert XCTAssert assertions into #expect and #require checks
  • replace XCTestExpectation handling with async confirmation blocks
  • update conditional test skipping to @Test traits

Example prompts for the agent

  • Migrate this XCTestCase suite to Swift Testing
  • Convert assertions in FoodTruckTests.swift to use #expect and #require
  • Update these legacy unit tests to modern Swift Testing syntax

How to install test-modernizer

1Skills CLI (Vercel)

npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a claude-code

2Manually: put the files in place

~/.claude/skills/test-modernizer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/test-modernizer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about test-modernizer

How to install test-modernizer in Claude Code?

Run npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a claude-code in your terminal.

What does test-modernizer do?

It rewrites legacy XCTest files into Swift Testing suites by replacing test classes with structs, converting assertions to #expect or #require, and adjusting async expectations.

Can test-modernizer convert UI tests?

No. Test suites relying on XCUI* automation APIs cannot run in Swift Testing, so the skill deliberately ignores them.

Similar skills

Everything for Testing and QA →

From the same set6

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor