home / skills / shotaiuchi / dotclaude / ios-architecture
/dotclaude/skills/ios-architecture
This skill helps iOS developers implement MVVM architecture in SwiftUI using async/await and Combine, improving code organization and testability.
npx playbooks add skill shotaiuchi/dotclaude --skill ios-architectureReview the files below or copy the command above to add this skill to your agents.
---
name: iOS Architecture
description: This skill should be used when implementing iOS features, creating SwiftUI views, setting up ViewModels, using async/await or Combine, or following MVVM patterns on iOS.
references:
- path: ../../references/common/clean-architecture.md
- path: ../../references/common/testing-strategy.md
- path: ../../references/platforms/ios/conventions.md
- path: ../../references/platforms/ios/architecture-patterns.md
external:
- id: swift-concurrency
# Resolved via: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/concurrency/
- id: swiftui-docs
# Resolved via: https://developer.apple.com/documentation/swiftui/
- id: combine-docs
# Resolved via: https://developer.apple.com/documentation/combine/
# Note: External references are resolved by the skill loader. See references/README.md for configuration.
---
**Always respond in Japanese.**
# iOS Architecture
SwiftUI + MVVM / State management patterns based on Apple's official guidelines.
Read and apply the patterns from the referenced documents to the user's implementation task.
## Reference Documents
- [Clean Architecture Guide](../../references/common/clean-architecture.md)
- [Testing Strategy Guide](../../references/common/testing-strategy.md)
- [iOS Conventions](../../references/platforms/ios/conventions.md)
- [Architecture Patterns](../../references/platforms/ios/architecture-patterns.md)
This skill provides practical guidance for implementing iOS features using SwiftUI and MVVM with modern state management. It consolidates Apple-recommended patterns for ViewModels, async/await and Combine integration, and clean separation of concerns. Use it to align implementations with testing and iOS conventions while keeping code maintainable and testable.
The skill inspects UI requirements and maps them to SwiftUI views, observable ViewModels, and domain/service layers following clean architecture principles. It recommends how to wire state flows using @StateObject, @Published, async/await tasks, or Combine publishers depending on needs. It also suggests testable boundaries, dependency injection points, and strategies for side-effect handling and error propagation.
When should I prefer async/await over Combine?
Prefer async/await for single-shot, linear async tasks like HTTP requests or database fetches. Use Combine for event streams, continuous updates, or when composing multiple publishers.
How do I test ViewModels effectively?
Design ViewModels to depend on protocol-based services. Inject test doubles and assert Published outputs or state values after driving async calls with deterministic schedulers or Task testing helpers.