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
npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-codeWhat 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
#expectkeeps expressions visible - catch premature use of
#require - spot accidental Cartesian products in parameterized tests
- verify async sequence and completion-handler coverage
- find unnecessary
.serializedand shared test state
Example prompts for the agent
- Review Swift Testing in
Tests/UserTests.swiftandTests/OrderTests.swift. - Audit parameterized tests for
zip(), expected-value logic, and lost diagnostics. - Review async tests and
@Suitestructure, includingconfirmation(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-code2Manually: put the files in place
~/.claude/skills/swift-testing-code-review/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swift-testing-code-review/
1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a codex2Manually: put the files in place
.agents/skills/swift-testing-code-review/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a cursor2Manually: put the files in place
.cursor/skills/swift-testing-code-review/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install existential-birds/beagle plugins/beagle-ios/skills/swift-testing-code-review2Manually: put the files in place
.github/skills/swift-testing-code-review/SKILL.md1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a gemini-cli2Platform CLI
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-ios/skills/swift-testing-code-reviewManually: put the files in place
.devin/skills/swift-testing-code-review/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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