ios-architecture-expert-skill
SwiftyJourney/ios-architecture-expert-skill
Build modular, testable iOS apps with clean architecture: composition root, protocol boundaries, generic presenters, Swift 6 concurrency - Agent Skill
Instalação
npx convez-ai SwiftyJourney/ios-architecture-expert-skill1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
README
A tradução para o português deste README ainda está na fila.
iOS Architecture Expert Agent Skill
A Claude Code skill that guides building modular, testable iOS/Swift applications following a clean architecture methodology — protocol-oriented design, composition root patterns, generic presenters, and modern Swift concurrency.
Who is this for?
iOS developers who want AI-assisted guidance on:
- Structuring apps with clean architecture layers
- Composing dependencies via a Composition Root
- Writing testable code with protocol boundaries
- Building reusable presentation logic with generic presenters
- Applying modern Swift concurrency (async/await,
Sendable,@MainActor) - Enabling Swift 6 strict concurrency across all modules
Installation
Install via skills.sh:
npx skills add SwiftyJourney/ios-architecture-expert-skill
Compatible Agents
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Any agent supporting the
skills/convention
What the Skill Covers
Architecture Layers
- Feature Layer: Domain models (
struct,Hashable,Sendable) and use-case protocols - API Layer: Endpoint enums, static mappers,
HTTPClientprotocol - Cache Layer: Store protocols, local models, cache policy objects
- Presentation Layer: Generic
LoadResourcePresenter<Resource, View>, framework-agnostic view models - UI Layer: UIKit (
DiffableDataSource,CellController) and SwiftUI (@Observable) patterns - Composition Layer: Composition Root, UI composers, adapters, virtual proxies
Composition Patterns
FeedService—@MainActororchestrator with lazy init, Scheduler, and fallback strategyFeedUIComposer— Static factory wiring presenter->adapter->view chainsLoadResourcePresentationAdapter— Generic async loader withTask.immediateand cancellationWeakRefVirtualProxy— Retain cycle prevention via conditional conformancePaginated<Item>— Recursive pagination model with@SendableloadMoreSchedulerprotocol — Abstract CoreData/InMemory execution contextInMemoryFeedStore—@MainActor, NSCache-backed production fallback when CoreData fails to init
Testing Strategy
- Unit tests with
makeSUT()factory and spy collaborators - Generic async test spy (
LoaderSpy) withAsyncThrowingStream - Specification pattern for shared store contract tests
- Integration tests with real CoreData stack
- Snapshot tests (light/dark mode + accessibility sizes)
- Acceptance tests with full DI container
Concurrency at Architecture Boundaries
@MainActorplacement rules (presenters, adapters, composition — not domain types)@Sendableclosures at composition boundariesTask.immediatefor synchronous-first executionasync letfor parallel loading in the Composition Root- Cancellation handling in adapters
- Swift 6 strict concurrency (
SWIFT_STRICT_CONCURRENCY = complete)
Skill File Structure
SKILL.md # Hub + diagnostic table + gotchas + reference router
references/
├── architecture-layers.md # Layer-by-layer patterns with code
├── composition-root.md # FeedService, Scheduler, fallback, SceneDelegate
├── adapters-and-proxies.md # Adapters, proxies, pagination, cell lifecycle
├── concurrency-at-boundaries.md # Concurrency at boundaries + async migration playbook
├── testing-strategy.md # 5-layer test strategy + generic async spy
├── feature-implementation-workflow.md # Step-by-step feature building + duplicate-then-generalize
└── spm-project-structure.md # SPM module layout + Swift 6 settings + CI
evals/ # Trigger eval queries + output-quality test cases
Related Skills
- Requirements Engineering — Turn vague requirements into testable specs: BDD, use cases, contracts, diagrams
- SwiftUI Expert — SwiftUI view code: state, composition, performance, animations, accessibility
- SwiftUI ⇄ UIKit Interop — Bridge SwiftUI and UIKit: hosting controllers, representables, data across the boundary
- Swift Language Expert — Non-obvious Swift language & standard-library techniques
Credits
Built on well-established clean architecture, TDD, and modular design practices from the iOS community. Code examples written for Swift 6 / iOS 18+.
License
MIT — see LICENSE.