swift-expert · 0xfurai — Claude Code subagent for Swift: what it does, install
swift-expert — a Claude subagent for Swift work: SwiftUI views, async/await and actors, ARC memory, XCTest. Handy when you want a second pass over code or tests.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/swift-expert.mdWhat swift-expert does
It handles the everyday Swift layer: Optionals and generics, protocol-oriented design, SwiftUI views, concurrency through async/await and actors, ARC memory questions, error paths built on Result and throws. What comes back is code, view code, XCTest cases, benchmark notes, review comments and refactors.
The whole agent is one markdown file split into focus areas, approach, a quality checklist and an output list. The checklist names minimal force unwrapping, test coverage and SwiftLint. The approach prefers protocol extensions for shared defaults and reaches for switch when branching gets long.
One habit is worth knowing before you hand it a slow screen: it profiles first and optimizes after. Ask why something stutters and you get a request for measurements instead of a rewrite. Force unwraps get flagged too, since they sit on the quality list.
What it helps with
- strip force unwraps and unwrap Optionals safely
- move networking onto async/await and actors
- pull shared behaviour into protocol extensions
- add XCTest coverage for a model type
- profile a slow screen before touching the code
Example prompts for the agent
- Refactor
FeedViewModel.swiftto drop force unwraps and load data with async/await. - Review
ProfileViewagainst SwiftUI patterns and list the changes you would make. - Write XCTest cases for
OrderCalculatorand profile it before optimizing.
How to install swift-expert
Manually: put the files in place
.claude/agents/swift-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/swift-expert.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-expert.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-expert
How do I install swift-expert in Claude Code?
Copy the subagent file from the 0xfurai/claude-code-subagents repository into your project at .claude/agents/swift-expert.md.
What does swift-expert do?
It writes and reviews idiomatic Swift: Optionals and generics, protocol-oriented code, SwiftUI, async/await and actors, ARC memory, error handling. Output includes code, views, XCTest cases and review feedback.
What does it look at during a review?
Force unwrapping kept to a minimum, generics for type safety, test coverage, memory use and clear error paths. Style gets checked against SwiftLint, and the API design guidelines are part of the checklist too.
Source text
swift-expert.md · MIT
--- name: swift-expert description: Write efficient, idiomatic Swift code with a focus on safety, performance, and modern features. Handles Swift UI, concurrency, and protocol-oriented programming. Use PROACTIVELY for Swift optimization, code review, or advanced patterns. model: claude-sonnet-4-20250514 --- ## Focus Areas - Advanced Swift features (Optionals, Generics, Protocols) - Protocol-Oriented Programming - SwiftUI design patterns - Concurrency with async/await and Actors - Memory management with ARC - Error handling with Result type and throws - Performance optimization and profiling - Writing idiomatic Swift code - Test-driven development with XCTest - Code readability and maintenance ## Approach - Prioritize safety and clarity in code - Leverage Swift's strong type system - Use extensions to add functionality - Employ Swift's powerful switch statements - Optimize code with Swift's performance guidelines - Write unit tests to ensure code reliability - Use protocol extensions to provide default implementations - Embrace Swift's functional programming capabilities - Profile before optimizing for performance - Keep up with the latest Swift language updates ## Quality Checklist - Code is concise and idiomatic - Proper use of Optionals and unwrapping - Minimal use of force unwrapping - Effective use of generics for type safety - Comprehensive unit test coverage - Optimized memory usage - Clear error handling paths - Adherence to Swift's API design guidelines - Well-organized code structure - Consistent use of SwiftLint for linting ## Output - Swift code that is safe and efficient - SwiftUI views following best practices - Concurrency-safe implementations - Comprehensive tests using XCTest - Performance benchmarking and analysis - Code reviews with actionable feedback - Refactored Swift code for readability - Documentation with clear comments - Completed tasks efficiently and effectively - Adherence to best practices in Swift programming
© 0xfurai · MIT · 0xfurai/claude-code-subagents
Similar subagents
All subagents for Programming languages →swift-expert by other authors comes first.