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.
npx skills add jeremieb/swift-unit-test-instructions --skill swift-testinggit clone --depth 1 https://github.com/jeremieb/swift-unit-test-instructionsWrote 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.
[](https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swift-testing)<a href="https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swift-testing"><img src="https://agentmods.dev/badge/skills/jeremieb/swift-unit-test-instructions/swift-testing.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.01352 |
| Opus 5 | $0.00044 | $0.00676 |
| Sonnet 5 | $0.00017 | $0.00270 |
| Haiku 4.5 | $0.00009 | $0.00135 |
Grade A, and why
swift-testing 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 182 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Swift Testing
Instructions
Step 1: Determine Testing Mode
Check CLAUDE.md for Testing Mode:
enterprise→ consultreferences/enterprise.mdfor strict rulesindie→ consultreferences/indie.mdfor pragmatic rules- If not set: ask the user which mode applies
Step 2: Identify What to Test
Ask if not already clear:
- Which type / function / feature needs tests?
- What is the expected behavior (not implementation)?
- Are there async operations?
- Are there existing mocks or does the skill need to create them?
Always test:
- ViewModels (state changes, actions, error states)
- Services and Repositories (business logic, data transformations)
- Formatters, validators, utilities
- Async flows end-to-end (with mocked dependencies)
- Edge cases and error paths
Never test:
- Private implementation details
- SwiftUI view tree structure or layout positions
- UIViewController internal wiring
Step 3: Choose the Framework
| Scenario | Framework |
|---|---|
| New unit tests (Swift 5.9+, iOS 16+) | Swift Testing (@Test, #expect) |
| Legacy or team convention on XCTest | XCTest (XCTestCase, XCTAssert*) |
| UI / end-to-end tests | XCTest + XCUITest |
| Async unit tests | Both support async — use await |
Do NOT mix Swift Testing and XCTest in the same test target.
Step 4: Write Tests
Naming (both frameworks):
test_when_<Condition>_should_<ExpectedOutcome>()
Structure — Swift Testing:
import Testing
@testable import MyApp
@MainActor
struct LoginViewModelTests {
@Test func test_when_credentialsAreValid_should_setIsLoggedIn() async throws {
// Arrange
let authService = MockAuthService(willSucceed: true)
let sut = LoginViewModel(authService: authService)
// Act
await sut.login(email: "[email protected]", password: "secret")
// Assert
#expect(sut.isLoggedIn == true)
#expect(sut.error == nil)
}
@Test func test_when_credentialsAreInvalid_should_setError() async throws {
// Arrange
let authService = MockAuthService(willSucceed: false)
let sut = LoginViewModel(authService: authService)
// Act
await sut.login(email: "[email protected]", password: "wrong")
// Assert
#expect(sut.isLoggedIn == false)
#expect(sut.error != nil)
}
}
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.
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.
- 7d ago First seen · 182 lines · 87 tokens per session scan A 6e4371967834
swift-testing is a skill published in the GitHub repository jeremieb/swift-unit-test-instructions (5 stars, last pushed 6mo ago), licensed MIT. It adds 87 tokens to every session and 1,352 once invoked, about $0.0004 per session on Opus 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-08-31.
Other skills, from other repositories
testing-arsenal
Testing strategies including unit tests, integration tests, E2E tests, mocking, coverage analysis, and TDD workflow. Trigger when users need help writing tests, choosing testing frameworks, implementing mocking strategies, or setting up test infrastructure.
testing-patterns
Cross-language testing strategies and patterns. Triggers on: test pyramid, unit test, integration test, e2e test, TDD, BDD, test coverage, mocking strategy, test doubles, test isolation.
ios-testing
Invoke any time a user is writing iOS/Swift tests or asking why tests behave a certain way — including XCTest versus Swift Testing (@Test/#expect) choices, async ViewModel tests with @Observable or @Published, snapshot testing across device sizes, mocking protocols for dependency injection, setUp/tearDown lifecycle…
pwp-test
Testing strategy and implementation protocol — structured quality assurance that catches real bugs. Use this skill whenever the user asks to write tests, add test coverage, set up a testing strategy, or asks 'how should I test this'. Also use when they say 'add tests', 'write tests for this', 'test coverage', 'what…
qa-react
React testing skill with React Testing Library, Vitest, MSW, and Playwright. Use when writing or running React frontend tests.
asc-shots-pipeline
Orchestrate iOS screenshot automation with xcodebuild/simctl for build-run, AXe for UI actions, JSON settings and plan files, Koubou-based framing (asc screenshots frame), and screenshot upload (asc screenshots upload). Use when users ask for automated screenshot capture, AXe-driven simulator flows, frame composition…