swift-testing-code-review
Reviews Swift Testing code for proper use of
What this skill does
# Swift Testing Code Review ## Hard gates Complete **in order** before recording Swift Testing review findings. Stack with [review-verification-protocol](../review-verification-protocol/SKILL.md) for universal review rules. 1. **Scope:** You have an explicit list of `.swift` paths under review (or a user-named single file). **Pass:** Paths captured in working notes **or** one line: `No Swift files in scope` — then stop with no findings. 2. **Swift Testing surface:** For each path you treat as Swift Testing code, confirm `import Testing` **or** `@Test` / `#expect` / `#require` / `@Suite` appears in that file (open or search). **Pass:** At least one match per critiqued file, or you exclude that file from Swift Testing review with a one-line reason (e.g. XCTest-only). 3. **Evidence + protocol:** Load [review-verification-protocol](../review-verification-protocol/SKILL.md) before asserting any issue. **Pass:** Each finding meets that skill’s anchor rules; any violated [Review Checklist](#review-checklist) item cites `[FILE:LINE]` evidence. If you report zero issues, state `Protocol applied; no Swift Testing issues` (or equivalent) in the review summary. ## Quick Reference | Issue Type | Reference | |------------|-----------| | #expect vs #require, expression capture, error testing | [references/expect-macro.md](references/expect-macro.md) | | @Test with arguments, traits, zip() pitfalls | [references/parameterized.md](references/parameterized.md) | | confirmation, async sequences, completion handlers | [references/async-testing.md](references/async-testing.md) | | @Suite, tags, parallel execution, .serialized | [references/organization.md](references/organization.md) | ## Review Checklist - [ ] Expressions embedded directly in `#expect` (not pre-computed booleans) - [ ] `#require` used only for preconditions, `#expect` for assertions - [ ] Error tests check specific types (not generic `(any Error).self`) - [ ] Parameterized tests with pairs use `zip()` (not Cartesian product) - [ ] No logic mirroring implementation in parameterized expected values - [ ] Async sequences tested with `confirmation(expectedCount:)` - [ ] Completion handlers use `withCheckedContinuation`, not `confirmation` - [ ] `.serialized` applied only where necessary (shared resources) - [ ] Sibling serialized suites nested under parent if mutually exclusive - [ ] No assumption of state persistence between `@Test` functions - [ ] Disabled tests have explanations and bug links ## When to Load References - Reviewing #expect or #require usage -> expect-macro.md - Reviewing @Test with arguments or traits -> parameterized.md - Reviewing confirmation or async testing -> async-testing.md - Reviewing @Suite or test organization -> organization.md ## Review Questions 1. Could pre-computed booleans in `#expect` lose diagnostic context? 2. Is `#require` stopping tests prematurely instead of revealing all failures? 3. Are multi-argument parameterized tests creating accidental Cartesian products? 4. Could `zip()` silently drop test cases due to unequal array lengths? 5. Are completion handlers incorrectly tested with `confirmation`?
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.