ワンクリックで
swift-testing
WHEN writing tests in Swift with the Swift Testing framework; NOT XCTest.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
WHEN writing tests in Swift with the Swift Testing framework; NOT XCTest.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
WHEN scraping iOS/macOS App Store data (apps, reviews, ratings, search); NOT for installing or testing apps; retrieves structured JSON data using iTunes/App Store APIs with curl and jq formatting
Comprehensive guide for implementing on-device AI models on iOS using Foundation Models and MLX Swift frameworks. Use WHEN building iOS apps with (1) Local LLM inference, (2) Vision Language Models (VLMs), (3) Text embeddings, (4) Image generation, (5) Tool/function calling, (6) Multi-turn conversations, (7) Custom model integration, or (8) Structured generation.
WHEN building ChatGPT apps using the OpenAI Apps SDK and MCP; create conversational, composable experiences with proper UX, UI, state management, and server patterns.
WHEN building SwiftUI views, managing state, setting up shared services, or making architectural decisions; NOT for UIKit or legacy patterns; provides pure SwiftUI data flow without ViewModels using @State, @Binding, @Observable, and @Environment.
WHEN building design systems or component libraries with Tailwind CSS; covers design tokens, CVA patterns and dark mode.
WHEN building React components/pages/apps; enforces scalable architecture, state management, API layer, performance patterns.
| name | swift-testing |
| description | WHEN writing tests in Swift with the Swift Testing framework; NOT XCTest. |
Guidance for starting with Swift Testing (Testing framework) and writing clear, macro-driven tests.
Testing to unlock macros; tests are plain functions annotated with @Test.@Test("Display Name") to set the navigator title.#expect is the primary assertion; pass a boolean expression to assert truthy outcomes.async/throws on the test function.import Testing
func add(_ a: Int, _ b: Int) -> Int { a + b }
@Test("Verify addition function") func verifyAdd() {
let result = add(1, 2)
#expect(result == 3)
}
Use #expect(throws:) to verify a thrown error. Inspect the error via the closure overload when you need to assert the specific case.
@Test func verifyThrowingFunction() {
#expect(throws: MyError.self) {
try throwingFunction()
}
#expect {
try throwingFunction()
} throws: { error in
guard let myError = error as? MyError else { return false }
return myError == .invalidInput
}
}
#require throws immediately when the condition is false, halting the test early.@Test func verifyOptionalFunc() throws {
let result = try #require(optionalFunc()) // unwrap or fail fast
#expect(result > 0)
}
Use Issue.record("message") to log and exit gracefully when continuing the test is pointless.
@Test func verifyOptionalFunc() throws {
guard let result = optionalFunc() else {
Issue.record("optional result is nil")
return
}
#expect(result > 0)
}
@Test-annotated free functions; no need for XCTest naming conventions.@Test("Name") to keep navigator titles readable.#expect for assertions; add multiple expects per test when logical.#require to guard preconditions/unwrap optionals before further checks.#expect(throws:), including specific case checks.