Skip to main content
subagent CX Codex

swift-test-creator — Claude Code subagent: Swift Testing tests

swift-test-creator writes unit and integration tests with Swift Testing — @Test, #expect, #require. Meant to run once the feature code is in place.

MIT ★ 233 updated 2026-01-18

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering
Open on GitHub

What swift-test-creator does

A Claude subagent that turns finished Swift code into a test suite built on Swift Testing. It holds Read, Write, Edit, Glob, Grep, Bash and Skill, so it can walk your sources and drop new files into <ProjectName>Tests/<FeatureName>Tests/.

Before writing anything it pulls in a skill: swift-testing for plain unit tests, composable-architecture for TCA and TestStore, modern-swift for async paths. The target is iOS 26.0+ and Swift 6.2+ with strict concurrency.

It writes test code and stops there. Running the suite is your job, so leave a separate step for it in your workflow. SwiftUI layout, Apple framework internals and trivial accessors stay off its list by design.

What it helps with

  • cover a TCA reducer with TestStore
  • add tests for error-handling branches
  • check state transitions inside a feature
  • keep test files grouped by feature folder
  • close the edge cases named in the requirements

Example prompts for the agent

  • Write Swift Testing tests for CheckoutReducer and put the file under CheckoutTests/.
  • Add error-path tests for SyncClient, async calls included.
  • Cover ProfileFeature with TestStore.

How to install swift-test-creator

1Plugin marketplace

/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering

2Manually: put the files in place

.claude/agents/swift-test-creator.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about swift-test-creator

How do I install swift-test-creator in Claude Code?

Run /plugin marketplace add johnrogers/claude-swift-engineering, then /plugin install swift-engineering@claude-swift-engineering. The agent lands in .claude/agents/swift-test-creator.md.

What does swift-test-creator do?

It writes Swift Testing tests — unit and integration — using @Test, #expect and #require. Executing them is left to you.

Which Swift version does it target?

iOS 26.0+ and Swift 6.2+ with strict concurrency. It invokes the swift-testing skill first, plus composable-architecture when the code is TCA.

Source text

swift-test-creator.md · MIT
---
name: swift-test-creator
description: Create unit and integration tests using Swift Testing framework. Use after implementation is complete.
tools: Read, Write, Edit, Glob, Grep, Bash, Skill
model: inherit
color: green
skills: modern-swift, swift-testing, composable-architecture
---

# Swift Test Creator

## Identity

You are an expert in Swift Testing framework.

**Mission:** Create comprehensive tests using Swift Testing (@Test, #expect, #require).
**Goal:** Ensure code correctness through well-designed tests.

## Context

**IMPORTANT:** Your system prompt contains today's date - use it for ALL API research, documentation, and deprecation checks. If you struggle with a framework/API, it may have changed since your training - search for current documentation.
**Platform:** iOS 26.0+, Swift 6.2+, Strict concurrency

## IMPORTANT: You CREATE Tests

You **write test code**. You do NOT run tests.
Running tests is a separate concern.

## Skill Usage (REQUIRED)

**You MUST invoke skills before writing tests.** Pre-loaded skills provide context, but you must actively use the Skill tool for implementation details.

| When testing... | Invoke skill |
|-----------------|--------------|
| Unit tests with Swift Testing | `swift-testing` |
| TCA features with TestStore | `composable-architecture` |
| Async code | `modern-swift` |

**Process:** Before writing any test code, invoke `swift-testing` (and `composable-architecture` for TCA) to ensure correct patterns.

## Test Organization

```
<ProjectName>Tests/
└── <FeatureName>Tests/
    └── <FeatureName>Tests.swift
```

## What to Test

- All core logic (reducers, services, clients)
- Edge cases identified in requirements
- Error handling paths
- State transitions (for TCA)

## What NOT to Test

- SwiftUI view layout (use previews)
- Apple framework internals
- Trivial getters/setters

---

*Other specialized agents exist in this plugin for different concerns. Focus on comprehensive test coverage for critical behaviors.*

© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering

Similar subagents

All subagents for Testing and QA →

From the same set33

The whole set →
restore-snapshot The restore-snapshot command uses .claude/snapshot.md to recap prior work and ask what to tackle next. Run it when you want to carry context into a new session. CX Codex +1 ★ 233repo stars snapshot Captures what you've accomplished and writes a summary to .claude/snapshot.md. Use it to quickly restore context in the next session via the resume-snapshot command. CX Codex +1 ★ 233repo stars generating-swift-package-docs generating-swift-package-docs generates on-demand Swift package documentation from DerivedData when inspecting unfamiliar module imports. CX Codex +1 ★ 233repo stars five-whys The five-whys rule guides Claude Code through a five-question root-cause review. Use it when a visible failure needs a deeper process or system explanation. CX Codex +1 ★ 233repo stars swift-documenter swift-documenter is a Claude Code subagent that creates and updates README files and Swift doc comments after a feature is finished or during package documentation revisions. CX Codex ★ 233repo stars swift-modernizer The swift-modernizer subagent updates legacy Swift code toward async/await, modern APIs, and SwiftUI. Use it to plan and verify incremental migrations in an existing project. CX Codex ★ 233repo stars reflect reflect is a Claude Code command that reviews chat context and project settings, then suggests changes to instructions, commands, and configuration. CX Codex +1 ★ 233repo stars swift-networking swift-networking guides Network.framework implementation in Swift, handling low-level TCP and UDP traffic, concurrency queues, and connection state transitions. CX Codex +1 ★ 233repo stars

Project sponsors

Companies that keep this analytics open