home / skills / willsigmon / sigstack / tca-migration
This skill guides you through migrating from The Composable Architecture to @Observable, accelerating code modernization and reducing Swift UI boilerplate.
npx playbooks add skill willsigmon/sigstack --skill tca-migrationReview the files below or copy the command above to add this skill to your agents.
---
name: TCA Migration
description: Remove TCA (Composable Architecture) - find usage, migrate to @Observable, delete reducers
allowed-tools: Read, Edit, Grep, Glob, Bash
---
# TCA Migration
Remove The Composable Architecture from Leavn codebase.
## Find TCA Usage
```bash
grep -r "Reducer" --include="*.swift" | grep -v "Pods\|DerivedData"
grep -r "Store\|ViewStore" --include="*.swift"
grep -r "@Dependency" --include="*.swift"
grep -r "ComposableArchitecture" --include="*.swift"
```
## Migration Pattern
TCA Feature → @Observable ViewModel
**Before (TCA)**:
```swift
@Reducer struct MyFeature {
@ObservableState struct State { var count = 0 }
enum Action { case increment }
var body: some ReducerOf<Self> { ... }
}
```
**After (@Observable)**:
```swift
@Observable @MainActor
class MyViewModel {
var count = 0
func increment() { count += 1 }
}
```
## Removal Order
1. Leaf features (no child reducers)
2. Parent features (after children migrated)
3. App-level store (last)
4. Remove TCA from Package.swift
## Audit Command
```bash
find . -name "*Feature.swift" -o -name "*Reducer.swift" | wc -l
```
Use when: TCA removal, migration tracking, @Observable conversion
This skill provides a focused workflow to remove The Composable Architecture (TCA) from a Swift codebase by finding usages, migrating features to @Observable view models, and deleting reducers and package references. It codifies a migration pattern, a safe removal order, and a set of audit commands to track progress. The goal is a repeatable, low-risk transition from TCA to Swift's @Observable models.
The skill scans the codebase for TCA artifacts (Reducers, Stores, ViewStores, @Dependency, ComposableArchitecture) using targeted grep commands and file searches. It prescribes a migration pattern: convert TCA feature reducers to @Observable @MainActor view model classes with state properties and action methods. It then guides a staged removal sequence from leaf features up to the app-level store, followed by removing the TCA package entry and running an audit command to verify counts.
What exact commands help find TCA usages?
Use grep to search for Reducer, Store, ViewStore, @Dependency, and ComposableArchitecture while excluding Pods/DerivedData. Example: grep -r "Reducer" --include="*.swift" | grep -v "Pods\|DerivedData"
What does a typical migration look like?
Transform @Reducer structs with @ObservableState into @Observable @MainActor classes that expose state as properties and actions as methods. Update call sites to use the view model instead of Store/ViewStore.
How do I verify I can remove TCA from Package.swift?
Run a full project search for TCA tokens and use the audit command: find . -name "*Feature.swift" -o -name "*Reducer.swift" | wc -l. Ensure it returns zero and the project builds cleanly before removing the package.