
Swift test scaffold
Guides an agent to write Swift Testing tests for ViewModels and services
Swift test scaffold is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 20
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Swift test scaffold
This skill steers an AI coding agent toward Swift Testing (import Testing, @Test and #expect) rather than XCTest when adding tests to a Swift project. It sets a structure for test folders split into ViewModels, Services, Models and Mocks, and includes a sample suite with a mock service injected through a protocol, covering both success and failure paths.
Its main constraint is restraint: creating new test files, test targets or test-only helpers requires explicit user approval. Otherwise the agent is told to run existing tests or direct runtime checks first, skip trivial getters and SwiftUI layout, and only add tests for business rules or state changes where they would actually catch a regression.
The agent runs checks with swift test or Xcode's test runner. The skill assumes a Swift codebase with a protocol-based service layer that can be mocked.
When your agent uses it
Use when adding Swift tests, creating test targets, scaffolding ViewModel or service tests, or choosing Swift Testing over XCTest.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (3 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the swift-modern-dev plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add pstuart/pstuart
/plugin install swift-modern-dev@pstuartOr copy only this skill to ~/.claude/skills/swift-test-scaffold:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/swift-test-scaffold &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-test-scaffold" ~/.claude/skills/swift-test-scaffold &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/swift-test-scaffold inside it instead.
Copy the skill folder to ~/.agents/skills/swift-test-scaffold to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/swift-test-scaffold &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-test-scaffold" ~/.agents/skills/swift-test-scaffold &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/swift-test-scaffold inside it instead.
Copy the skill folder to ~/.cursor/skills/swift-test-scaffold to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/swift-test-scaffold &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-test-scaffold" ~/.cursor/skills/swift-test-scaffold &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/swift-test-scaffold inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/pstuart/pstuart.git --path plugins/swift-modern-dev/skills/swift-test-scaffoldOr copy the folder to ~/.gemini/skills/swift-test-scaffold yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/swift-test-scaffold:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/swift-test-scaffold &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-test-scaffold" ~/.copilot/skills/swift-test-scaffold &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/swift-test-scaffold inside it instead.
Get the folder:
git clone --depth 1 https://github.com/pstuart/pstuart.gitThen copy pstuart/plugins/swift-modern-dev/skills/swift-test-scaffold into your agent's skills folder as swift-test-scaffold. Agents that support SKILL.md read one folder per skill.
What it does
- Swift Testing defaults
- Directs new tests to use import Testing with descriptive @Test names instead of XCTest cases.
- Protocol-based mocking
- Shows how to isolate ViewModels from services with a mock conforming to a service protocol, avoiding live network calls.
- Success and failure coverage
- Provides a pattern for testing both the success path and the error path of logic.
- Test folder layout
- Suggests a test target structure separating ViewModels, Services, Models and Mocks.
- Authorization gate
- Requires explicit user approval before creating new test files, targets or test helpers.
- Test necessity decision tree
- Helps decide when a test is worth writing, skipping type-enforced rules and pure UI layout.
Good for
- Add unit tests for a SwiftUI ViewModel that loads data from a service
- Write a Swift Testing suite covering error handling in a networking service
- Decide whether a Swift business rule needs a new test
- Create a mock service conforming to a protocol for tests
- Move an existing XCTest suite toward Swift Testing syntax
Swift test scaffold FAQ
Does Swift test scaffold create test files automatically?
No. New test files, test targets and test-only helpers require explicit user authorization. A request to implement or fix code alone does not allow creating them.
Which testing framework does Swift test scaffold use?
It directs new tests to use Swift Testing (import Testing) and says not to write new XCTest cases.
What commands does Swift test scaffold suggest for running tests?
It suggests swift test or running tests from Xcode.
Which AI clients does Swift test scaffold work with?
The skill is published as a Claude Code plugin in the pstuart marketplace.
How do I install Swift test scaffold in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/swift-test-scaffold to use it in all your projects, or to .claude/skills/swift-test-scaffold in one project. Or install the swift-modern-dev plugin, which includes it: /plugin marketplace add pstuart/pstuart, then /plugin install swift-modern-dev@pstuart.
Does Swift test scaffold run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Swift test scaffold?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Swift test scaffold?
The closest alternatives to Swift test scaffold are Axiom testing, Swift modern architecture, Swift app scaffold, Xcuitest skill and Build swiftui interface.
Where this comes from
- Description: from the skill's own SKILL.md.
More from pstuart/pstuart

Reports git state, activity and build evidence across every project in a folder
- Open source
- 20 GitHub stars
- Developer tools

Checks web pages against WCAG 2.1 AA contrast, labels, keyboard and ARIA rules
- Open source
- 20 GitHub stars
- Developer tools

Guides an AI agent through building and reviewing Nuxt 4 apps with the app/ layout
- Open source
- 20 GitHub stars
- Developer tools

Walks an agent through a web application security audit checklist and report
- Open source
- 20 GitHub stars
- Security

Guides an agent to style Nuxt and Vue UIs with Tailwind CSS 4 utilities and @theme tokens
- Open source
- 20 GitHub stars
- Developer tools

Guides an agent to write and review strict TypeScript in Vue, Nuxt and Node code
- Open source
- 20 GitHub stars
- Developer tools



