An autonomous Swift development agent for Claude Code that assists with iOS/macOS application development, Swift packages, SwiftUI, and Swift 6 concurrency patterns.
Invoke the agent with a task on the same line:
/swift-developer:swift-developer create a SwiftUI settings screen with @Observable
/swift-developer:swift-developer review my code for concurrency issues
/swift-developer:swift-developer run tests on iPhone 15 simulator
The agent uses WebFetch to verify code against official Apple documentation before implementing Swift language features. Since Apple's developer.apple.com is a JavaScript SPA that cannot be fetched programmatically, the agent uses GitHub-based sources instead:
- Swift Book: Language guide and reference manual
- Swift Testing: Modern testing framework (
@Test,#expect) - Swift Evolution: Latest language proposals
- Swift Async Algorithms: Async sequence operations
Pre-write hooks automatically block code containing unsafe Swift patterns:
| Pattern | Issue | Fix |
|---|---|---|
Force unwraps (!) |
Runtime crashes | Use guard let, if let, or ?? |
| Hardcoded secrets | Security vulnerability | Use Keychain or environment variables |
DispatchQueue.main.sync |
Main thread blocking | Use .async or async/await |
@unchecked Sendable |
Thread safety | Add proper synchronization (NSLock, actors) |
Missing @MainActor |
UI thread safety | Add @MainActor to ObservableObject classes |
Includes reference documentation for:
- SwiftUI patterns and @Observable
- Swift 6 concurrency (async/await, actors, Sendable)
- XCTest and Swift Testing frameworks
- xcodebuild commands and CI/CD
- iOS simulator management (simctl)
- Code signing and distribution
- Swift Package Manager
| Script | Purpose |
|---|---|
new_package.sh |
Create new Swift package with SwiftFormat/SwiftLint configs |
run_tests.sh |
Run tests with common options |
format_and_lint.sh |
Format and lint Swift code |
simulator.sh |
Quick simulator management |
Add the plugin marketplace to Claude Code:
claude plugin marketplace add hmohamed01/claude-code-pluginsThen use /plugins to install swift-developer from the marketplace.
The fastest way to invoke the agent:
/swift-developer:swift-developer <your task>
Examples:
/swift-developer:swift-developer help me create a new Swift package for my networking layer
/swift-developer:swift-developer build a settings screen with SwiftUI using @Observable
/swift-developer:swift-developer review my Swift code for concurrency issues
/swift-developer:swift-developer run the tests for my iOS app on iPhone 15 simulator
The agent also triggers on explicit Swift-related requests in conversation.
- Project Setup: Create Swift packages, configure Xcode projects
- SwiftUI Development: Implement views with @Observable, NavigationStack
- Concurrency: Apply async/await, actors, Sendable correctly
- Building & Testing: Execute xcodebuild commands
- Code Review: Analyze for issues and anti-patterns
- Simulator Management: Boot, install, and launch apps
| Component | Name | Purpose |
|---|---|---|
| Command | /swift-developer:swift-developer |
Invoke the agent via slash command |
| Agent | swift-developer | Autonomous Swift development tasks |
| Skill | swift-knowledge | Swift development knowledge and patterns |
| Hooks | PreToolUse | Detect unsafe patterns in Swift code |
- macOS with Xcode 15+ (Xcode 16+ for Swift 6)
- Xcode Command Line Tools:
xcode-select --install
MIT