swift

Enforce Swift 6 clean architecture with strict concurrency and layered dependencies.

58|20|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/ABIvan-Tech/copilot-agentic-workflows --skill swift-abivan-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift
Source: https://github.com/ABIvan-Tech/copilot-agentic-workflows/tree/main/skills/swift
Command: npx skills add https://github.com/ABIvan-Tech/copilot-agentic-workflows --skill swift-abivan-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill codifies Swift architectural rules and best practices to help teams build maintainable, concurrency-safe modules in Swift 6.

Core Features & Use Cases

  • UseCases (Interactors) must expose a single public function: func execute() async -> Result<T, Error>, with dependencies injected rather than accessing repositories directly.
  • Repositories and DataSources must adhere to strict dependency rules: DataSources depend on external APIs, Repositories depend on DataSources, and Repositories expose raw data types via async throws while UseCases map errors to Result.
  • Dependency Graph must be UI/ViewModel -> UseCase -> Repository -> DataSource, enabling clear boundaries and testability.
  • Language & concurrency patterns emphasize Swift Concurrency (async/await), Actors for shared state, Codable models, and explicit error handling boundaries to avoid leaking internal errors to the UI.
  • Use Swift 6 Strict Concurrency checks and @Sendable closures to ensure thread safety and testability.

Quick Start

Create a minimal Swift module that demonstrates a UseCase -> Repository -> DataSource pipeline following the rules described above.

Frequently Asked Questions about swift

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

FAQPage Schema
How do I structure Swift architecture for Swift 6 strict concurrency?

Structure Swift architecture by routing dependencies UI/ViewModel -> UseCase -> Repository -> DataSource. This enforces clean boundaries and explicit concurrency safety using async/await and Actors for Swift 6 strict concurrency scenarios.

What is the correct pattern for a Swift UseCase returning async results?

A Swift UseCase should expose a single public function, func execute() async -> Result<T, Error>. Dependencies must be injected into the UseCase rather than accessing repositories directly, mapping repository errors to Result types.

How do I decouple Repositories and DataSources in Swift clean architecture?

Decouple Swift Repositories and DataSources by making DataSources depend on external APIs while Repositories depend on DataSources. Repositories should expose raw data types via async throws, ensuring strict dependency boundaries and testability.

Does Swift 6 strict concurrency require @Sendable closures for safe async code?

Yes, Swift 6 strict concurrency requires @Sendable closures to ensure thread safety. You should use Swift Concurrency async/await patterns and Actors for shared state to maintain explicit concurrency safety across architectural layers.

Why does my Swift UI layer receive internal data source errors?

Internal errors leak to the UI when architectural boundaries are violated. UseCases must map repository errors to Result<T, Error> types, establishing explicit error handling boundaries that prevent DataSource internal errors from reaching the UI layer.