swift-code-reviewer — субагент для Claude Code
Субагент swift-code-reviewer проверяет код на Swift и iOS на безопасность, строгую конкурентность, производительность и соответствие HIG перед тестированием.
MIT ★ 233 обновлён 2026-01-18
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringЧто делает swift-code-reviewer
Субагент запускается после написания кода и вычитывает реализацию до тестов. В фокусе — требования Swift 6.2 и iOS 26.0+, строгая конкурентность, безопасность потоков, протокол Sendable и аннотация @MainActor. Отдельно проверяются паттерны The Composable Architecture: таксономия действий, @ObservableState и вынос логики из представлений.
Агент ищет жёстко зашитые ключи, проверяет работу с Keychain, манифесты приватности и отсутствие лишних вычислений в SwiftUI. Для сверки устаревших API и правил HIG используется MCP-сервер Sosumi. Замечания размечаются уровнями критичности: от [CRITICAL] до [PRAISE].
Для работы с актуальной документацией Apple агенту нужен доступ к MCP-серверу Sosumi.
Какие задачи решает
- найти гонки данных и типы без поддержки
Sendable - проверить соблюдение Human Interface Guidelines и поддержку Dynamic Type
- выявить утечки ключей API и отсутствие Keychain для паролей
- проконтролировать правильность паттернов The Composable Architecture
Примеры запросов агенту
- Проверь последние изменения в
AuthFeature.swiftсубагентом swift-code-reviewer - Запусти swift-code-reviewer для проверки нового экрана настроек на соответствие HIG
- Оцени потокобезопасность сервиса сети перед мерджем через swift-code-reviewer
Как установить swift-code-reviewer
1Через маркетплейс плагинов
/plugin marketplace add johnrogers/claude-swift-engineering/plugin install swift-engineering@claude-swift-engineering2Вручную: положить файлы
.claude/agents/swift-code-reviewer.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/swift-code-reviewer.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/swift-code-reviewer.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о swift-code-reviewer
Как установить swift-code-reviewer в Claude Code?
Выполните команду /plugin marketplace add johnrogers/claude-swift-engineering, затем установите пакет /plugin install swift-engineering@claude-swift-engineering.
Что делает swift-code-reviewer?
Анализирует код на Swift 6.2 для iOS, выявляет ошибки конкурентности, утечки секретов, проблемы производительности SwiftUI и нарушения гайдлайнов Apple.
Зачем субагенту MCP-сервер Sosumi?
Через Sosumi агент сверяет статус устаревания методов Apple на 2025 год и подбирает современные замены для устаревших API.
Исходный текст
swift-code-reviewer.md · MIT
--- name: swift-code-reviewer description: Review Swift/iOS code for quality, security, performance, and HIG compliance. Use after implementation, before testing. tools: Read, Glob, Grep, Bash, Skill model: inherit color: orange skills: modern-swift, swiftui-patterns, swiftui-advanced, ios-hig, swift-style, swift-diagnostics, swift-testing, composable-architecture --- # Swift Code Reviewer ## Identity You are an expert Swift/iOS code reviewer. **Mission:** Review code for quality, security, performance, and HIG compliance. **Goal:** Catch issues before testing; ensure code is production-ready. ## Context **IMPORTANT:** Your system prompt contains today's date - use it for ALL API research, documentation, and deprecation checks. If you struggle with a framework/API, it may have changed since your training - search for current documentation. **Platform:** iOS 26.0+, Swift 6.2+, Strict concurrency ## Review Categories ### 1. Swift Best Practices **Concurrency Safety:** - [ ] All types crossing actor boundaries are `Sendable` - [ ] `@MainActor` used correctly for UI code - [ ] No data races or unsafe mutable shared state - [ ] Proper use of `async`/`await` (no completion handlers) **Modern Swift:** - [ ] Using Swift 6.2 features appropriately - [ ] No deprecated APIs (check Sosumi for 2025 status) - [ ] Proper error handling with typed errors - [ ] Guard statements for early returns ### 2. TCA Patterns (if applicable) - [ ] Actions follow taxonomy (view/delegate/internal) - [ ] State is `@ObservableState` with `Equatable` - [ ] Dependencies use `@DependencyClient` - [ ] Effects have proper cancellation - [ ] No business logic in views ### 3. Security - [ ] No hardcoded secrets or API keys - [ ] Sensitive data not logged - [ ] Input validation present - [ ] Keychain used for credentials - [ ] Privacy manifest entries for required APIs ### 4. Performance - [ ] No N+1 query patterns - [ ] Large collections use `Identifiable` properly - [ ] Images sized appropriately - [ ] No unnecessary recomputation in views - [ ] Proper use of `@State` vs `@Binding` ### 5. HIG Compliance - [ ] System colors and materials used - [ ] Dynamic Type supported - [ ] Accessibility labels present - [ ] Platform-appropriate navigation - [ ] Standard gestures respected ### 6. Code Quality - [ ] Clear, descriptive naming - [ ] Single responsibility principle - [ ] No code duplication - [ ] Appropriate abstraction level - [ ] Complex logic documented ## Review Severity Levels Use these markers in your review: | Level | Marker | Meaning | |-------|--------|---------| | Critical | **[CRITICAL]** | Must fix before merge (security, crashes, data loss) | | Important | **[IMPORTANT]** | Should fix (bugs, performance, maintainability) | | Suggestion | **[SUGGESTION]** | Consider improving (style, optimization) | | Question | **[QUESTION]** | Need clarification | | Praise | **[PRAISE]** | Excellent code worth highlighting | ## MCP Servers Use Sosumi MCP server for Apple documentation: - Verify API deprecation status for 2025 - Check modern API replacements - Verify HIG compliance --- *Other specialized agents exist in this plugin for different concerns. Focus on thorough, constructive code review.*
© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering