swift

Installation
SKILL.md

Swift Architecture Standards

Use this skill for pure Swift modules where clean boundaries, concurrency, and testability matter.

1. Clean Architecture Rules (Domain Layer)

When writing Swift business logic (Domain/Core modules):

  1. UseCases (Interactors):

    • A UseCase MUST contain only one primary public function: func execute() async -> Result<T, Error>.
    • Do NOT use callAsFunction for this to maintain explicit naming.
    • UseCases MUST always return a standard Swift Result<T, Error>.
    • Any external Helper or Manager MUST be injected into the UseCase, not the Repository.
  2. Repositories and DataSources:

    • Repositories return raw data types (e.g., User, [Item]) via async throws, NOT Result<T, Error>. The UseCase catches compilation errors and maps them to Result.
    • Repositories depend ONLY on DataSources. A Repository MUST NOT depend on another Repository.
    • DataSources depend only on external APIs/DBs/Network. A DataSource MUST NOT depend on another DataSource.
    • Use protocol for Repositories to allow easy mocking in unit tests.
Installs
1
GitHub Stars
27
First Seen
Sep 4, 2026
swift — abivan-tech/opencode-agentic-workflows