Skip to main content
skill CX Codex

swift-testing-code-review — Claude Code skill: review and install

swift-testing-code-review reviews Swift Testing code for macro usage, parameterized and async tests, and suite structure. Use it when checking .swift files.

Apache-2.0 196 installs ★ 89 updated 2026-09-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-code
Open on GitHub

What swift-testing-code-review does

This skill reviews files that use import Testing, @Test, #expect, #require, or @Suite. It flags assertions built from precomputed booleans, #require used as an ordinary assertion, broad error-type checks, and parameterized tests that accidentally form a Cartesian product instead of using zip().

Its checklist covers async sequences with confirmation(expectedCount:), completion handlers with withCheckedContinuation, and suite organization around .serialized. It also checks that tests do not rely on state left by another @Test, and that disabled tests explain why they remain off. The review gates require an explicit file scope and a Swift Testing marker in every file discussed.

Without a named list of .swift paths, the skill stops without findings. Reported issues must follow the verification protocol and point to file-and-line evidence.

What it helps with

  • check whether #expect keeps expressions visible
  • catch premature use of #require
  • spot accidental Cartesian products in parameterized tests
  • verify async sequence and completion-handler coverage
  • find unnecessary .serialized and shared test state

Example prompts for the agent

  • Review Swift Testing in Tests/UserTests.swift and Tests/OrderTests.swift.
  • Audit parameterized tests for zip(), expected-value logic, and lost diagnostics.
  • Review async tests and @Suite structure, including confirmation(expectedCount:) and .serialized.

How to install swift-testing-code-review

1Skills CLI (Vercel)

npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-code

2Manually: put the files in place

~/.claude/skills/swift-testing-code-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/swift-testing-code-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about swift-testing-code-review

How do I install swift-testing-code-review in Claude Code?

Run npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-code, then check ~/.claude/skills/swift-testing-code-review/SKILL.md.

What does swift-testing-code-review do?

It reviews Swift Testing code for macro misuse, weak error checks, parameterized-test mistakes, async-testing issues, and suite-organization problems.

What files can it review?

Give it explicit .swift paths. Each file discussed as Swift Testing code must contain import Testing, @Test, #expect, #require, or @Suite.

Source text

SKILL.md · Apache-2.0
---
name: swift-testing-code-review
description: Reviews Swift Testing code for proper use of #expect/#require, parameterized tests, async testing, and organization. Use when reviewing .swift files with import Testing, @Test, #expect, @Suite, or confirmation patterns.
---

# 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`?

© existential-birds · Apache-2.0 · existential-birds/beagle

Similar skills

All skills for Mobile →

From the same set68

The whole set →
ai-elements A skill for Claude Code, Codex, Cursor, Copilot, Gemini CLI and OpenCode: helps build chat interfaces, job queues, tool execution displays and approval workflows. Triggers on ai-elements, Queue, Tool, Confirmation, Message, PromptInput. CX Codex +1 211installs go-code-review go-code-review — a Go review skill that reads go.mod first, then checks errors, goroutines, interfaces and cleanup, ranking each finding by severity. CX Codex +1 206installs shadcn-code-review shadcn-code-review audits React components built with shadcn/ui, Radix primitives, and Tailwind CSS. Catches CVA mistakes, broken asChild slots, and missing accessibility states. CX Codex +1 206installs react-router-code-review react-router-code-review is a Claude Code skill that checks React Router v6.4+ code for loaders, actions, error boundaries, and navigation. It reviews routing changes. CX Codex +1 202installs docs-style docs-style enforces technical documentation style rules, Diataxis framework alignment, active voice, and clear structures for both readers and LLMs. CX Codex +1 180installs deepagents-architecture deepagents-architecture guides architectural decisions for Deep Agents, covering framework comparisons, storage backend routing, subagent topologies, and middleware order. CX Codex +1 162installs pydantic-ai-tool-system pydantic-ai-tool-system guides coding agents to implement PydanticAI tools with correct decorator signatures, type annotations, and docstrings. CX Codex +1 161installs langgraph-implementation The langgraph-implementation skill guides LangGraph work with state schemas, graph routing, persistence, and human-in-the-loop pauses for agent applications. CX Codex +1 161installs

Project sponsors

Companies that keep this analytics open