swift-composable-architecture

Build, refactor, debug, and test iOS/macOS features with The Composable Architecture.

6|1|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/tryhuset/agent-skills --skill swift-composable-architecture-tryhuset
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-composable-architecture
Source: https://github.com/tryhuset/agent-skills/tree/main/skills/swift-composable-architecture
Command: npx skills add https://github.com/tryhuset/agent-skills --skill swift-composable-architecture-tryhuset

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building, refactoring, debugging, and testing iOS/macOS features using The Composable Architecture (TCA) can be challenging without a standard pattern and guidance for scalable, testable code.

Core Features & Use Cases

  • Feature structure with State, Action, Reducer, and Store
  • Effects, dependencies, navigation, and testability across small to large modules
  • Testing with TestStore, test clocks, and composition of child features

Quick Start

Create a minimal Feature with State, Action, Reducer, and Store, then wire it into a SwiftUI view to see the TCA flow in action

Frequently Asked Questions about swift-composable-architecture

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

FAQPage Schema
How do I architect testable iOS features with state management in Swift?

You can architect testable iOS features by organizing code around State, Action, Reducer, and Store components. This enforces end-to-end patterns for composable Swift code, ensuring correct state management and testability across modules.

What is the best way to structure navigation and dependencies in a SwiftUI app?

The best way to structure navigation and dependencies is using @Reducer, @ObservableState, and @Dependency macros. This approach supports Scope and IdentifiedArrayOf collections to manage feature compositions and navigation patterns reliably.

How do I test state changes and effects in a Swift architecture?

You test state changes and effects using TestStore to verify that each action produces the expected state mutation. This includes testing with test clocks and validating the composition of child features for correct, end-to-end behavior.

Can I use this approach to refactor large iOS features into smaller modules?

Yes, you can refactor large iOS features into smaller modules by leveraging feature composition and IdentifiedArrayOf collections. This supports breaking down complex features into scalable, testable, and composable components across single or composed features.

Does this state management pattern work for macOS apps or only iOS?

This state management pattern works for both iOS and macOS apps. It organizes building, refactoring, debugging, and testing features across both platforms using the same composable architecture and end-to-end patterns.