Source profileQuality 78/100

dpearson2699/swift-ios-skills/skills/swift-architecture/SKILL.md

swift-architecture

Selects, reviews, and migrates Apple-platform app architectures across MV with Observation, MVVM, MVI, TCA, Clean Architecture, Coordinator, and legacy VIPER. Use when choosing module and dependency boundaries, escalating a feature beyond simple SwiftUI MV, planning incremental architecture migration, or auditing state ownership and test seams.

Source repository stars
933
Declared platforms
0
Static risk flags
0
Last source update
2026-07-15
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Choose the smallest architecture that makes state ownership, dependencies, side effects, and tests explicit. Default new SwiftUI features to MV; escalate only for observed complexity.

Best for

  • Use when choosing module and dependency boundaries, escalating a feature beyond simple SwiftUI MV, planning incremental architecture migration, or auditing state ownership and test seams.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill "skills/swift-architecture"
Safe inspection promptEditorial

Inspect the Agent Skill "swift-architecture" from https://github.com/dpearson2699/swift-ios-skills/blob/90c9573272531337962fbb3505036d61ed23389a/skills/swift-architecture/SKILL.md at commit 90c9573272531337962fbb3505036d61ed23389a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Decision Workflow

    1. Record the feature's state owner, inputs, outputs, dependencies, side effects, navigation handoffs, and current tests. 2. Identify the concrete pressure: complex state machine, shared derived state, dependency control, feature composition, team ownership, or UIKit navigation.…

    Record the feature's state owner, inputs, outputs, dependencies, side effects, navigation handoffs, and current tests.Identify the concrete pressure: complex state machine, shared derived state, dependency control, feature composition, team ownership, or UIKit navigation.Select the smallest pattern that addresses that pressure; write down what it adds and what remains unchanged.
  2. 02

    Review Checklist

    [ ] Choice is justified by concrete feature/team pressures

    [ ] Choice is justified by concrete feature/team pressures[ ] State owner, mutation path, dependencies, effects, and navigation owner are explicit[ ] Dependencies are injected and replaceable in tests
  3. 03

    Scope Boundary

    This skill owns pattern selection, module boundaries, dependency direction, migration strategy, and architecture-level test seams. Route SwiftUI property-wrapper wiring and view composition to swiftui-patterns, navigation APIs and route models to swiftui-navigation, isolation di…

    This skill owns pattern selection, module boundaries, dependency direction, migration strategy, and architecture-level test seams. Route SwiftUI property-wrapper wiring and view composition to swiftui-patterns, navigati…
  4. 04

    Pattern Selection

    Use Coordinator alongside another state pattern when navigation complexity is the pressure; it is not a replacement for domain/state architecture.

    Use Coordinator alongside another state pattern when navigation complexity is the pressure; it is not a replacement for domain/state architecture.
  5. 05

    MV Default

    Keep views as state expressions and put business operations in observable models and injected services:

    Keep views as state expressions and put business operations in observable models and injected services:Load Architecture Pattern Recipes for MVVM, MVI, TCA, Clean Architecture, Coordinator, and VIPER structure.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score78/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars933SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
dpearson2699/swift-ios-skills
Skill path
skills/swift-architecture/SKILL.md
Commit
90c9573272531337962fbb3505036d61ed23389a
License
NOASSERTION
Collected
2026-07-28
Default branch
main
View the original SKILL.md

Swift Architecture

Choose the smallest architecture that makes state ownership, dependencies, side effects, and tests explicit. Default new SwiftUI features to MV; escalate only for observed complexity.

Contents

Scope Boundary

This skill owns pattern selection, module boundaries, dependency direction, migration strategy, and architecture-level test seams. Route SwiftUI property-wrapper wiring and view composition to swiftui-patterns, navigation APIs and route models to swiftui-navigation, isolation diagnostics to swift-concurrency, and test syntax/fixtures to swift-testing.

Decision Workflow

  1. Record the feature's state owner, inputs, outputs, dependencies, side effects, navigation handoffs, and current tests.
  2. Identify the concrete pressure: complex state machine, shared derived state, dependency control, feature composition, team ownership, or UIKit navigation.
  3. Select the smallest pattern that addresses that pressure; write down what it adds and what remains unchanged.
  4. Implement one vertical slice with injected dependencies and observable state transitions.
  5. Run existing behavior tests plus state-transition and dependency-failure tests. If behavior changes, restore the fixture, fix the smallest boundary, and rerun before migrating another slice.

Pattern Selection

PatternChoose whenMain cost
MVSwiftUI feature has straightforward state and orchestrationLogic can drift into large views without decomposition
MVVMPresentation logic needs an independently testable adapterExtra layer can become a forwarding shell
MVIA feature is best modeled as explicit state + intents + reducer/effectsBoilerplate and centralized transition design
TCAMany composable features need deterministic effects, dependencies, and testingFramework learning and architectural commitment
Clean ArchitectureLarge product needs strict dependency direction across domain/data/UIProtocol and mapping overhead
CoordinatorUIKit or hybrid navigation needs a separate flow ownerAnother lifecycle and routing owner
VIPERMaintaining an existing UIKit module with established VIPER boundariesVery high ceremony; poor default for new SwiftUI work

Use Coordinator alongside another state pattern when navigation complexity is the pressure; it is not a replacement for domain/state architecture.

MV Default

Keep views as state expressions and put business operations in observable models and injected services:

@MainActor
@Observable
final class TripStore {
    private let client: TripClient
    var trips: [Trip] = []
    var error: Error?

    init(client: TripClient) { self.client = client }

    func load() async {
        do { trips = try await client.fetchTrips() }
        catch { self.error = error }
    }
}

struct TripList: View {
    @State private var store: TripStore

    init(client: TripClient) {
        _store = State(initialValue: TripStore(client: client))
    }

    var body: some View {
        List(store.trips) { Text($0.name) }
            .task { await store.load() }
    }
}

Load Architecture Pattern Recipes for MVVM, MVI, TCA, Clean Architecture, Coordinator, and VIPER structure.

Escalation Signals

  • Choose MVVM when substantial presentation transformation must be tested without rendering and the adapter has real behavior.
  • Choose MVI when transitions, invalid states, and effects need one auditable reducer-like path.
  • Choose TCA when feature composition, dependency overrides, cancellation, and deterministic effect tests recur across modules.
  • Choose Clean Architecture when independent domain rules and dependency direction matter across multiple delivery/data layers.
  • Add Coordinator for UIKit/hybrid route ownership, deep flow composition, or conditional navigation outside view controllers.
  • Keep VIPER for compatible legacy modules or deliberate migrations; do not start a new SwiftUI feature with it by habit.

Do not escalate merely because a view is long. First extract subviews, services, and focused observable models.

Migration

Migrate one feature boundary at a time:

  1. Freeze behavior with tests and a dependency/state inventory.
  2. Introduce the target boundary around existing operations.
  3. Move one state transition or dependency at a time without rewriting UI and persistence simultaneously.
  4. Compare behavior, navigation, cancellation, error, and persistence results after each slice.
  5. Remove the old path only after no callers or tests depend on it.

For ObservableObject to Observation, preserve the same owner and mutation isolation before replacing wrappers. For MVVM to MV, delete forwarding view-model members only after views bind to the same model/service behavior. For TCA adoption, wrap one feature's state/actions/effects and migrate dependencies incrementally.

Common Mistakes

MistakeFix
Pattern chosen by popularityTie it to an observed feature pressure.
View model only forwards propertiesRemove it and use MV.
One object owns navigation, networking, formatting, persistence, and UI stateSplit by responsibility and dependency direction.
TCA or Clean Architecture applied to trivial screensStart with MV and preserve an escalation seam.
Coordinator used as a state architectureKeep it focused on route/lifecycle ownership.
Multiple patterns mixed inside one featureDefine one local state/effect model and migrate at feature boundaries.
Big-bang migrationMove one tested vertical slice and rerun the same proof matrix.

Review Checklist

  • Choice is justified by concrete feature/team pressures
  • State owner, mutation path, dependencies, effects, and navigation owner are explicit
  • Dependencies are injected and replaceable in tests
  • Pattern cost is proportional to feature complexity
  • UI mechanics, navigation APIs, isolation, and test syntax route to sibling skills
  • Migration preserves behavior one vertical slice at a time
  • Failure, cancellation, navigation, and persistence behavior are verified after each slice
  • No forwarding-only layers or god objects remain

References

Alternatives

Compare before choosing