ios-architecture_skill

This skill helps iOS developers implement MVVM architecture in SwiftUI using async/await and Combine, improving code organization and testability.
  • Shell

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill shotaiuchi/dotclaude --skill ios-architecture

  • SKILL.md1.4 KB

Overview

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.

How this skill works

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 to use it

  • Building new SwiftUI screens that need a clear MVVM separation
  • Converting UIKit features to SwiftUI while preserving business logic
  • Choosing between async/await and Combine for network or database tasks
  • Designing ViewModels that must be unit-tested independently from views
  • Creating scalable modules that follow clean architecture layers

Best practices

  • Keep Views declarative and free of business logic; delegate to ViewModels
  • Use @StateObject in views that own ViewModel lifecycle; use @ObservedObject for injected VM
  • Model side effects as async functions or Combine publishers in the domain layer
  • Return plain value types for UI state when possible to simplify tests
  • Inject services and repositories via protocols to enable mocking in tests
  • Prefer structured concurrency (async/await) for linear async flows; use Combine for continuous streams

Example use cases

  • Create a list-detail SwiftUI flow with a List view, Detail view, and shared ViewModel using Combine for live updates
  • Implement login flow where ViewModel validates input, calls async network API, and maps errors to UI-friendly messages
  • Refactor a legacy MVC screen into MVVM: extract business logic into Use Cases and expose UI state via Published properties
  • Design offline-first data sync: repository exposes async methods, ViewModel coordinates sync tasks and updates UI state

FAQ

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.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
ios-architecture skill by shotaiuchi/dotclaude | VeilStrat