Architecture and DI standards for building scalable iOS applications with SwiftUI.

Install

mkdir -p .claude/skills/ios && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18723" && unzip -o skill.zip -d .claude/skills/ios && rm skill.zip

Installs to .claude/skills/ios

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Architecture, SwiftUI, View architecture, and DI rules for iOS apps.
68 charsno explicit “when” trigger
Advanced

Key capabilities

  • Implement Model-View-Intent (MVI) and UDF patterns in SwiftUI
  • Structure SwiftUI views with `<Name>Screen` and `<Name>View` separation
  • Minimize business logic within SwiftUI `View` structs
  • Apply Swift 6 Concurrency patterns in UI
  • Manage state using the `@Observable` macro

How it works

The skill defines architectural patterns like MVI/UDF, view structuring, and state management using `@Observable` for SwiftUI applications, emphasizing separation of concerns.

Inputs & outputs

You give it
Requirements for an iOS app feature or component
You get back
SwiftUI code adhering to MVI/UDF, View architecture, and DI rules

When to use ios

  • Implement MVI architecture
  • Structure SwiftUI view hierarchies
  • Apply Swift 6 concurrency patterns
  • Set up view models

About this skill

iOS & SwiftUI Architecture Standards

Use this skill for iOS work built with SwiftUI, Swift Concurrency, and unidirectional state flow.

1. SwiftUI UI Rules

  1. Model-View-Intent (MVI) & UDF:
    • Model: Expose single, immutable State properties from your ViewModel (or Reducer if using TCA).
    • View: A pure function rendering the Model. State flows down.
    • Intent: User actions are submitted to the ViewModel as explicit Intents/Events (e.g., via a func send(_ event: Event) pattern). Events flow up.
  2. Screen vs View Approach:
    • <Name>Screen or <Name>Coordinator: Handles Environment injection, Navigation, and connects the ViewModel (or Reducer) to the UI.
    • <Name>View: A completely pure, stateless (or strictly internal view-state) SwiftUI View that accepts data via inputs and emits events via closures.
  3. Minimize Logic in Views:
    • Do NOT put complex business validation or network requests in .task or .onAppear inside the View struct.
    • All business logic belongs in the injected @Observable ViewModel or TCA Reducer.
  4. Swift 6 Concurrency in UI:
    • SwiftUI View structs must be implicitly or explicitly @MainActor isolated.
    • Never use unstructured Task { } without understanding the actor context; use .task { } modifiers tied to view lifecycle.
  5. Visibility & Previews:
    • Keep helper Views private or fileprivate if they are only used within a single screen.
    • Provide #Preview blocks for every distinct state of the View (loading, error, success).
  6. Component Granularity:
    • Minimize nesting. Extract deep view hierarchies into smaller computed properties returning some View or separate View structs.

2. State Management & Navigation

  1. Logic + State Separation:
    • Public functions inside a ViewModel MUST represent user intents/events and generally return Void.
    • Any function computing values internally should be private.
    • State is exposed as published/observable properties.
  2. Observation:
    • Use the @Observable macro exclusively. Do NOT use legacy ObservableObject, @Published, or Combine bindings for State management unless interacting with legacy code.

3. Dependency Injection

  • Inject dependencies into ViewModels/UseCases via init.
  • Use the SwiftUI Environment (@Environment) ONLY for UI-specific dependencies (like formatters, themes, or global view routers), NOT for Repositories or UseCases.

When not to use it

  • When putting complex business validation in `.task` or `.onAppear`
  • When using unstructured `Task { }` without actor context
  • When using legacy `ObservableObject` or `@Published` for state management

Limitations

  • Requires `@MainActor` isolation for SwiftUI `View` structs
  • Requires business logic to be in ViewModel or Reducer
  • Requires `@Observable` macro for state management

How it compares

This skill enforces a specific, opinionated architecture for SwiftUI apps using MVI/UDF and `@Observable`, promoting pure views and explicit intents, unlike ad-hoc SwiftUI development.

Compared to similar skills

ios side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ios (this skill)04moNo flagsAdvanced
swiftui-expert-skill133moNo flagsIntermediate
swiftui-ui-patterns14moNo flagsIntermediate
ios-navigation23moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

swiftui-expert-skill

sickn33

Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, modern APIs, Swift concurrency, and iOS 26+ Liquid Glass adoption. Use when building new SwiftUI features, refactoring existing views, reviewing code quality, or adopting modern SwiftUI patterns.

1333

swiftui-ui-patterns

Dimillian

Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.

13

ios-navigation

HoangNguyen0403

SwiftUI navigation and deep linking using NavigationStack and Universal Links.

21

view

andrelucassvt

Cria uma nova View SwiftUI seguindo o padrao MVVM do projeto (iOS 15+). Use quando o usuario pedir para criar uma nova tela, view ou screen.

00

macos-menubar-tuist-app

HCMUTE-RTIC

Build, refactor, or review macOS menubar apps that use Tuist and SwiftUI. Use when creating or maintaining LSUIElement menubar utilities, defining Tuist targets/manifests, implementing model-client-store-view architecture, adding script-based launch flows, or validating reliable local build/run beha

00

swiftui-whats-new-27

CamilleScholtz

New SwiftUI APIs, behaviors, and deprecations introduced in the 2027 OS releases (iOS 27, macOS 27, watchOS 27, tvOS 27, visionOS 27). Use when a SwiftUI view using @State fails to compile with \"used before being initialized\", \"invalid redeclaration of synthesized property\", or \"extraneous argu

00

Search skills

Search the agent skills registry