swift-testing-code-review — скилл для Claude Code: обзор и установка
Скилл swift-testing-code-review проверяет тесты Swift Testing: макросы, параметризованные и асинхронные сценарии, организацию наборов. Нужен при ревью .swift-файлов.
Apache-2.0 196 установок ★ 89 обновлён 2026-09-15
npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-codeЧто делает swift-testing-code-review
Скилл проверяет код с import Testing, @Test, #expect, #require и @Suite. Он ищет потерю диагностического контекста в заранее вычисленных булевых значениях, неверное применение #require, слишком общие проверки ошибок и ошибки в параметризованных тестах, включая случайное декартово произведение вместо zip().
Отдельные проверки относятся к асинхронному коду: confirmation(expectedCount:) для асинхронных последовательностей и withCheckedContinuation для completion handlers. Скилл также смотрит на .serialized, вложенность сериализованных наборов, независимость тестов и объяснения для отключённых тестов. Перед фиксацией замечаний он требует явный список путей и проверку поверхности Swift Testing в каждом файле.
Без явного списка .swift-файлов скилл останавливает ревью без замечаний. При сообщении проблемы он опирается на протокол проверки и привязывает вывод к строке файла.
Какие задачи решает
- проверить прямые выражения в
#expect - найти неверное применение
#require - выявить декартово произведение в параметризованных тестах
- проверить тестирование async sequences и completion handlers
- найти лишний
.serializedи зависимость тестов от состояния
Примеры запросов агенту
- Проверь Swift Testing в файлах
Tests/UserTests.swiftиTests/OrderTests.swift. - Проведи ревью параметризованных тестов: проверь
zip(), ожидаемые значения и потерю диагностического контекста. - Проверь асинхронные тесты и организацию
@Suite, включаяconfirmation(expectedCount:)и.serialized.
Как установить swift-testing-code-review
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-code2Вручную: положить файлы
~/.claude/skills/swift-testing-code-review/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/swift-testing-code-review/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a codex2Вручную: положить файлы
.agents/skills/swift-testing-code-review/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a cursor2Вручную: положить файлы
.cursor/skills/swift-testing-code-review/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install existential-birds/beagle plugins/beagle-ios/skills/swift-testing-code-review2Вручную: положить файлы
.github/skills/swift-testing-code-review/SKILL.md1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a gemini-cli2Командой платформы
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-ios/skills/swift-testing-code-reviewВручную: положить файлы
.devin/skills/swift-testing-code-review/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill swift-testing-code-review -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о swift-testing-code-review
Как установить swift-testing-code-review в Claude Code?
Выполните npx skills add existential-birds/beagle --skill swift-testing-code-review -a claude-code, затем проверьте файл ~/.claude/skills/swift-testing-code-review/SKILL.md.
Что делает swift-testing-code-review?
Скилл ревьюит Swift Testing и ищет ошибки в #expect, #require, параметризованных и асинхронных тестах, а также в структуре @Suite.
Какие файлы он проверяет?
Для ревью нужно явно задать пути к .swift-файлам. В каждом файле должна быть поверхность Swift Testing: import Testing, @Test, #expect, #require или @Suite.
Исходный текст
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