clean-architecture-ios_skill

This skill provides expert Clean Architecture decisions for iOS, guiding layer boundaries, data vs domain placement, and pragmatic trade-offs.
  • Shell

6

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill kaakati/rails-enterprise-dev --skill clean-architecture-ios

  • SKILL.md11.2 KB

Overview

This skill provides pragmatic, expert guidance for applying Clean Architecture to iOS and tvOS projects. It helps decide when Clean Architecture adds value versus when it is overkill, where code belongs across Presentation, Domain, and Data layers, and which dependency-rule violations to catch. Use it to make clear trade-offs between purity and pragmatism during design and code review.

How this skill works

The skill inspects design questions and gives judgment calls based on project scope, data-source complexity, team size, and expected lifetime. It maps responsibilities to layers, recommends use case granularity, and flags common anti-patterns (frameworks in Domain, DTO leakage, business logic in repositories). It also offers pragmatic patterns for caching, DI, and testing strategy.

When to use it

  • Designing app architecture for a new iOS/tvOS project
  • Reviewing code for layer violations or dependency rule breaks
  • Deciding whether to introduce UseCases or skip them for CRUD operations
  • Choosing repository caching strategy (cache-first vs network-first)
  • Scoping architecture for team size, project lifetime, or multiple data sources

Best practices

  • Keep Domain pure: no UIKit/SwiftUI, no DTOs, only Foundation and domain types
  • Place Repository protocols in Domain and implementations in Data; Data maps DTOs to Entities
  • Create UseCases for orchestration, validation, and business rules; skip for simple pass-through CRUD
  • Avoid putting business logic or mappers in the Repository; throw mapping errors instead of silencing invalid data
  • Use a minimal DI/factory container for small-medium apps; lazy init shared resources
  • Test UseCases with mocked repository protocols, Repositories with mocked data sources, and ViewModels with mocked UseCases

Example use cases

  • Decide whether a prototype needs full Clean Architecture or a lightweight MVVM with services
  • During code review, identify imports of UIKit/Alamofire/CoreData inside Domain and suggest fixes
  • Define whether an operation should be a single UseCase or composed from reusable UseCases
  • Design a repository that implements cache-first or network-first strategies based on offline needs
  • Write a test plan: UseCase tests for business rules, Repository tests for caching and mapping, ViewModel tests for state transitions

FAQ

For short-lived prototypes, solo developer projects, or simple apps with a single API, a lightweight MVVM and service layer is usually enough.

Should Entities implement Codable?

No. Keep Entities pure and put Codable DTOs in the Data layer; mapping handles serialization formats and API shapes.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational