Skip to main content
subagent CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering
Open on GitHub

What 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 Sendable markers
  • 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.swift before 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-engineering

2Manually: put the files in place

.claude/agents/swift-code-reviewer.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

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

Similar subagents

All subagents for Code review and refactoring →

From the same set33

The whole set →
localization Walks the agent through iOS localization: String Catalogs, plural forms, locale-aware formats and right-to-left layout. CX Codex +1 ★ 233repo stars swiftui-advanced swiftui-advanced — a Claude Code skill providing advanced SwiftUI workflows for multi-gesture composition, layout adaptation, architecture choice, and profiling. CX Codex +1 ★ 233repo stars haptics Add tactile responses for confirmations, errors, and custom patterns in an iOS app. The skill helps choose between UIKit feedback generators and Core Haptics. CX Codex +1 ★ 233repo stars storekit Walks an agent through StoreKit 2 purchases: the .storekit config, a StoreManager, transaction verification and SwiftUI product views. CX Codex +1 ★ 233repo stars ios-26-platform The ios-26-platform skill guides iOS 26 feature work in SwiftUI and helps preserve support for iOS 17/18. Use it when updating an interface or handling backward compatibility. CX Codex +1 ★ 233repo stars swiftui-specialist swiftui-specialist builds SwiftUI screens that follow Apple HIG once the core logic and TCA layer are already in place. CX Codex ★ 233repo stars swift-ui-design swift-ui-design inspects mockups, screenshots, or UI descriptions to plan SwiftUI views and architecture before implementation begins. CX Codex ★ 233repo stars foundation-models Gives Claude Code reference patterns for Apple's on-device Foundation Models framework: summarization, extraction, classification. Covers setting up a LanguageModelSession and typed output with @Generable. CX Codex +1 ★ 233repo stars

Project sponsors

Companies that keep this analytics open