swift-code-reviewer — Claude Code subagent
swift-code-reviewer inspects Swift and iOS implementations for concurrency safety, HIG rules, TCA patterns, and security before testing.
MIT ★ 233 updated 2026-01-18
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringWhat swift-code-reviewer does
This subagent reviews implementations targeting Swift 6.2 and iOS 26.0+ under strict concurrency. It examines actor boundaries, verifies Sendable conformance, checks @MainActor placement, and flags completion handlers in favor of async/await. For projects running The Composable Architecture, it validates action taxonomies, @ObservableState, and view logic separation.
Security and efficiency audits look for hardcoded credentials, Keychain integration, privacy manifest records, and SwiftUI view recomputations. The agent grades findings using tags ranging from [CRITICAL] to [PRAISE].
Verifying recent API deprecations and Apple guidelines relies directly on the Sosumi MCP server.
What it helps with
- detect shared mutable state and missing
Sendablemarkers - audit SwiftUI components for HIG compliance and Dynamic Type support
- flag exposed secrets and verify Keychain usage for auth tokens
- inspect TCA reducers and state models for structural anti-patterns
Example prompts for the agent
- Run swift-code-reviewer on
PaymentCoordinator.swiftbefore tests - Have swift-code-reviewer inspect our TCA feature state for concurrency issues
- Check this new SwiftUI profile screen against Apple HIG using swift-code-reviewer
How to install swift-code-reviewer
1Plugin marketplace
/plugin marketplace add johnrogers/claude-swift-engineering/plugin install swift-engineering@claude-swift-engineering2Manually: put the files in place
.claude/agents/swift-code-reviewer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/swift-code-reviewer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/swift-code-reviewer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about swift-code-reviewer
How to install swift-code-reviewer in Claude Code?
Run /plugin marketplace add johnrogers/claude-swift-engineering, followed by /plugin install swift-engineering@claude-swift-engineering.
What does swift-code-reviewer do?
It reviews Swift code against modern language rules, concurrency hazards, Apple HIG compliance, performance bottlenecks, and security flaws.
What external tool does this reviewer rely on?
The reviewer uses the Sosumi MCP server to look up modern replacements for deprecated Apple APIs and confirm HIG details.
Source text
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