スキル一覧に戻る
goodevibes

composable-architecture

by goodevibes

Copilot Plugin for Xcode using CoPilot

0🍴 0📅 2026年1月9日
GitHubで見るManusで実行

SKILL.md


name: composable-architecture description: Use when building features with TCA (The Composable Architecture), structuring reducers, managing state, handling effects, navigation, or testing TCA features. Covers @Reducer, Store, Effect, TestStore, reducer composition, and TCA patterns.

The Composable Architecture (TCA)

TCA provides architecture for building complex, testable features through composable reducers, centralized state management, and side effect handling. The core principle: predictable state evolution with clear dependencies and testable effects.

Overview

  • Reducer Structure - Templates, @Reducer, State, Actions, @ViewAction, conformances
  • Views - StoreOf, @Bindable, ForEach, store.scope, view actions
  • Navigation - NavigationStack, StackState, path reducers, dismiss
  • Shared State - @Shared, .appStorage, .withLock, FileStorageKey, InMemoryKey
  • Dependencies - @DependencyClient, @Dependency, DependencyKey, streaming
  • Effects - .run, .send, .merge, catch:, timers, cancellation
  • Presentation - @Presents, Scope, AlertState, multiple destinations
  • Testing - TestStore, TestClock, exhaustivity, dependency mocking
  • Performance - Optimization, high-frequency updates, memory

Common Mistakes

  1. Over-modularizing features — Breaking features into too many small reducers makes state management harder and adds composition overhead. Keep related state and actions together unless there's genuine reuse.

  2. Mismanaging effect lifetimes — Forgetting to cancel effects when state changes leads to stale data, duplicate requests, or race conditions. Use .concatenate for sequential effects and .cancel when appropriate.

  3. Navigation state in wrong places — Putting navigation state in child reducers instead of parent causes unnecessary view reloads and state inconsistencies. Navigation state belongs in the feature that owns the navigation structure.

  4. Testing without TestStore exhaustivity — Skipping TestStore assertions for "simple" effects or "obvious" state changes means you miss bugs. Use exhaustivity checking religiously; it catches regressions early.

  5. Mixing async/await with Effects incorrectly — Converting async/await to .run effects without proper cancellation or error handling loses isolation guarantees. Wrap async operations carefully in .run with yield statements.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です