ios-architecture-expert

Installation
SKILL.md

iOS Architecture Expert — Clean Modular Architecture

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 transitionFeedStore, HTTPClient, ResourceView, FeedCache, etc. Concrete types live behind protocols.
  3. Domain models are value typesstruct, 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. 6b. Test only the public API — no @testable import. Test targets use a plain import Feed, never @testable import Feed. Tests exercise a module exclusively through its public surface; they never reach for internal/private members. If a behavior can't be observed publicly, that's a design signal — expose it through the module's public API (a protocol boundary, a return value, an injected collaborator/spy), not by widening access for the test. Same-target tests (e.g. acceptance tests in the app target) still assert through the composed public seams, not private state.
  7. Use SPM multi-target packages for module separation — Feed (Foundation), FeediOS (UIKit), App (composition).
  8. Prefer async/await over closures/Combine for async operations. Use Task.immediate for synchronous-first execution in adapters.
  9. Write new tests in the project's test framework. The reference patterns here are XCTest, as in the source codebase. When the project uses Swift Testing, translate via the swift-testing-expert skill — note trackForMemoryLeaks/addTeardownBlock is XCTest-only.
  10. Mark shared mutable state with @MainActor — presenters, adapters, view controllers, and composition code run on the main actor.

Installs
14
GitHub Stars
2
First Seen
Mar 3, 2026
ios-architecture-expert — swiftyjourney/ios-architecture-expert-skill