clean-archi-swiftui

Guide Clean Architecture implementation in Swift and SwiftUI iOS applications.

6|1|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/benaor/claude-config --skill clean-archi-swiftui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-archi-swiftui
Source: https://github.com/benaor/claude-config/tree/main/.claude/skills/swiftui-clean-architecture
Command: npx skills add https://github.com/benaor/claude-config --skill clean-archi-swiftui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and best practices for implementing Clean Architecture patterns in Swift and SwiftUI iOS projects, ensuring maintainable, scalable, and testable codebases.

Core Features & Use Cases

  • Architectural Blueprint: Outlines a clear project structure with domain separation, bounded contexts, and the Ports & Adapters pattern.
  • Layered Rules: Defines strict guidelines for each layer (Domain, App) to maintain separation of concerns.
  • Dependency Management: Illustrates effective dependency injection strategies and composition roots for apps and extensions.
  • Error Handling: Provides clear guidance on when to use throws versus Result and how to define custom errors.
  • Workflow Guidance: Offers step-by-step instructions for creating features, use cases, and refactoring to bounded contexts.
  • Use Case: When starting a new Swift/SwiftUI project or refactoring an existing one to improve its architecture, consult this guide for structure, layer rules, and dependency management.

Quick Start

Use the clean-archi-swiftui skill to understand the recommended project structure for a new Swift/SwiftUI Clean Architecture project.

Frequently Asked Questions about clean-archi-swiftui

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

FAQPage Schema
How do I structure a SwiftUI project using Clean Architecture and Ports & Adapters?

Structure your SwiftUI project by separating Domain and App layers into bounded contexts using the Ports & Adapters pattern. This enforces strict layer compliance and dependency direction, resulting in a maintainable and scalable iOS codebase.

What is the best way to implement dependency injection in a SwiftUI Clean Architecture app?

Implement dependency injection in SwiftUI Clean Architecture by establishing clear composition roots for apps and extensions. This strategy manages dependencies effectively while enforcing strict separation of concerns across architectural boundaries.

When should I use throws versus Result for error handling in Swift Clean Architecture?

Use throws or Result for error handling in Swift Clean Architecture based on your layer's specific needs. Define custom errors to enforce strict layer compliance and maintain clear separation of concerns across domain boundaries.

Can I refactor an existing iOS application into Clean Architecture with bounded contexts?

You can refactor an existing iOS application into Clean Architecture by following specific workflows for migrating to bounded contexts. This refactoring process enforces strict layer compliance and correct dependency direction for better maintainability.

How do I create new features in a SwiftUI Clean Architecture project?

Create new features in a SwiftUI Clean Architecture project by following step-by-step workflow guidance for defining use cases and bounded contexts. This ensures strict layer compliance and correct dependency direction from the start.

Why enforce strict layer compliance and dependency direction in Swift iOS development?

Enforce strict layer compliance and dependency direction in Swift iOS development to ensure maintainable and testable codebases. Separating Domain and App layers via the Ports & Adapters pattern prevents tightly coupled, unscalable architectures.