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.
npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/test-modernizer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/test-modernizer/
1Skills CLI (Vercel)
npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a codex2Manually: put the files in place
.agents/skills/test-modernizer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a cursor2Manually: put the files in place
.cursor/skills/test-modernizer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install superagents-lab/xcode27-skills test-modernizer2Manually: put the files in place
.github/skills/test-modernizer/SKILL.md1Skills CLI (Vercel)
npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a gemini-cli2Platform CLI
gemini skills install https://github.com/superagents-lab/xcode27-skills --path test-modernizerManually: put the files in place
.devin/skills/test-modernizer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add superagents-lab/xcode27-skills --skill test-modernizer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.