clean-architecture-ios

Structure SwiftUI features with MVVM and Clean Architecture across Presentation, Domain, and Data layers.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill clean-architecture-ios
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture-ios
Source: https://github.com/dimitriRemoiville/cc-mobile/tree/main/plugins/cc-mobile-ios/skills/clean-architecture-ios
Command: npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill clean-architecture-ios

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps iOS teams structure features in SwiftUI using MVVM and Clean Architecture, clarifying where code belongs and how boundaries should be maintained to improve testability and maintainability.

Core Features & Use Cases

  • Clear separation of concerns across Presentation, Domain, and Data layers to decouple UI, business logic, and data access.
  • Guidance for Domain models, Repositories, and Use Cases to enable scalable feature development.
  • A practical checklist and examples for auditing feature boundaries during design and code reviews.

Quick Start

Review a new feature to map components to Presentation, Domain, and Data and ensure dependencies point toward the Domain layer.

Frequently Asked Questions about clean-architecture-ios

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure iOS features with MVVM and Clean Architecture in SwiftUI?

Structure iOS features by separating concerns across Presentation, Domain, and Data layers. Place UI logic in Presentation, domain logic in Domain, and data access in Data to decouple business rules from SwiftUI views and enable testable boundaries.

What is the dependency rule for Clean Architecture in a SwiftUI project?

The dependency rule requires dependencies to point strictly toward the Domain layer. This ensures Data and Presentation layers depend on Domain, not on each other, keeping use cases and repositories decoupled from UI and data access.

Where should I place repositories and use cases when applying domain-driven design in Swift?

Place repositories and use cases in the Domain layer. This centralizes domain-driven modeling and business logic, keeping them independent of data access details and SwiftUI presentation components.

Can I use this approach to audit layer boundaries during code reviews?

Yes, you can audit layer boundaries during code reviews by mapping components to Presentation, Domain, and Data. Use the provided checklist to verify dependencies point toward Domain and ensure proper separation of concerns.

What's the best way to decouple business logic from data access in iOS?

Decouple business logic from data access by implementing explicit boundaries with Clean Architecture. Define Domain models and Use Cases independently, letting the Data layer handle data fetching while Presentation manages UI state.

When do I need to separate concerns across Presentation, Domain, and Data layers?

Separate concerns across Presentation, Domain, and Data when you need scalable feature development and testable boundaries. This separation is crucial for clarifying code ownership and maintaining decoupled UI, business logic, and data access in SwiftUI.