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
- Decision Workflow
- Pattern Selection
- MV Default
- Escalation Signals
- Migration
- Common Mistakes
- Review Checklist
- References
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
- 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.
- Implement one vertical slice with injected dependencies and observable state transitions.
- 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.
