ios-clean-architecture

Installation
SKILL.md

iOS Clean Architecture — Essential Developer Methodology

Agent Behavior Contract

When this skill is active, follow these rules strictly:

  1. Feature modules have zero UIKit/SwiftUI imports — only Foundation. Domain models, use cases, presenters, and API/cache logic never depend on a UI framework.
  2. Define protocol boundaries at every layer transition — FeedStore, HTTPClient, ResourceView, FeedCache, etc. Concrete types live behind protocols.
  3. Domain models are value types — struct, Hashable, Sendable. No classes for models.
  4. Presentation logic is framework-agnostic — presenters output view models (structs). No UIImage, UIColor, or SwiftUI types in the presentation layer.
  5. All dependency wiring happens in the Composition Root — the app target (or a dedicated CompositionRoot module). Feature modules never create their own dependencies.
  6. Tests drive the design — one test class per use case, named by behavior (CacheFeedUseCaseTests, not LocalFeedLoaderTests). Use makeSUT() factory in every test class.
  7. Use SPM multi-target packages for module separation — EssentialFeed (Foundation), EssentialFeediOS (UIKit), EssentialApp (composition).
  8. Prefer async/await over closures/Combine for async operations. Use Task.immediate for synchronous-first execution in adapters.
  9. Use Swift Testing (@Test, #expect) for new tests. Follow patterns in the swift-testing-expert skill when available.
  10. Mark shared mutable state with @MainActor — presenters, adapters, view controllers, and composition code run on the main actor.

Installs
1
GitHub Stars
2
First Seen
Mar 3, 2026