Back to Skills

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.

932stars47forksUpdated 7/28/2026

Security Assessment

Safe(96/100)
Security Score96/100

About swift-architecture

Swift Architecture is a decision-support and code-review skill for selecting, reviewing, and migrating Apple-platform app architectures. Its guiding principle is to choose the smallest architecture that makes state ownership, dependencies, side effects, and tests explicit, defaulting new SwiftUI features to MV with the Observation framework and escalating only when observed complexity justifies it.

It covers a spectrum of patterns (MV, MVVM, MVI, TCA, Clean Architecture, Coordinator, and legacy VIPER) with a comparison table describing when to choose each and its main cost, plus explicit escalation signals for moving beyond MV. A five-step decision workflow has the user record the feature's state owner, inputs, dependencies, side effects, and tests; identify the concrete pressure (complex state machine, shared derived state, dependency control, feature composition, team ownership, or UIKit navigation); select the smallest fitting pattern; implement one vertical slice with injected dependencies; and validate with behavior, state-transition, and dependency-failure tests before migrating further. A references/architecture-patterns.md file provides concrete Swift structure recipes for each pattern, and the skill defines clear scope boundaries that route property-wrapper wiring, navigation APIs, concurrency isolation, and test syntax to sibling skills.

It targets iOS/macOS Swift and SwiftUI engineers and architects deciding module and dependency boundaries, escalating features, planning incremental migrations, or auditing state ownership and test seams. It is guidance and reference material rather than an automated code generator.

FAQ

Which architecture should I default to?

For new SwiftUI features, default to MV with the Observation framework: keep views as state expressions and put business operations in observable models and injected services. Escalate only when a concrete complexity signal appears.

Which patterns does it cover?

MV, MVVM, MVI, TCA, Clean Architecture, Coordinator, and legacy VIPER, with a table of when to choose each and its main cost, plus escalation signals for moving beyond MV.

How does it approach migration?

Incrementally: implement one vertical slice with injected dependencies and observable state transitions, run behavior plus state-transition and dependency-failure tests, and fix the smallest boundary before migrating another slice.

What is out of scope?

SwiftUI property-wrapper wiring and view composition, navigation APIs, concurrency isolation diagnostics, and test syntax/fixtures are routed to sibling skills (swiftui-patterns, swiftui-navigation, swift-concurrency, swift-testing).

Are there code examples?

Yes. references/architecture-patterns.md gives concrete Swift structure recipes for MVVM, MVI, TCA, Clean Architecture, Coordinator, and VIPER, with a note to check current TCA docs since that package evolves independently.

All Files

3 files
evals/evals.json4.1 KB
View
references/architecture-patterns.md2.9 KB
View
SKILL.md7.3 KB
View

Install swift-architecture

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill