Skip to content
cccskills
FreePublished on GitHub

swiftui-ssot

Single Source of Truth (SSOT) guidelines for SwiftUI state management. Use when designing state architecture, choosing between @State/@Binding/@StateObject/@ObservedObject/@EnvironmentObject, fixing state synchronization issues, refactoring duplicated state, or reviewing state management in PRs. Covers SSOT principles, property wrapper selection, state lifting, and common violations.

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md2.5 KB
  • references/ssot.md10.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

SwiftUI SSOT (Single Source of Truth)

SwiftUIにおける状態管理とSSOT原則の包括的ガイド。

ディレクトリ構成

swiftui-ssot/
├── SKILL.md (このファイル)
└── references/
    └── ssot.md

リファレンスファイル

references/ssot.md

Single Source of Truth(SSOT)の包括的ガイド:

  • SSOTの3つの柱: 唯一の情報源、導出状態、単方向データフロー
  • Property Wrapper選択フローチャート: @State/@Binding/@StateObject/@ObservedObject/@EnvironmentObject
  • パターン別ガイド:
    • 状態重複の解消
    • 導出状態(Computed Property)
    • State Lifting(状態の持ち上げ)
    • 兄弟View間通信
    • EnvironmentObjectの適切な使用
  • 違反検出方法: コードスメル、検索パターン
  • iOS 17+ @ObservableでのSSO実装
  • レビューチェックリスト

使用方法

状態設計時

  1. references/ssot.mdのProperty Wrapper選択フローチャートを参照
  2. データの所有者を明確化
  3. 導出可能な状態は持たない

状態関連の問題発生時

  1. references/ssot.mdの違反パターンを確認
  2. 該当するパターンの解決策を適用

PRレビュー時

  1. references/ssot.mdのレビューチェックリストを使用

SSOT 3つの柱

  1. 唯一の情報源: 各データは1箇所でのみ管理
  2. 導出状態: 他の状態から計算可能なものは持たない
  3. 単方向データフロー: 親→子へデータを渡し、子→親へはアクション

Property Wrapper 選択ガイド

状況推奨
View内のローカル状態@State
親から受け取る値(読み書き)@Binding
Viewが所有するObservableObject@StateObject
外部から注入されるObservableObject@ObservedObject
アプリ全体で共有@EnvironmentObject
iOS 17+@Observable + @Bindable

関連スキル

  • swiftui-coding-guidelines: 基本的なベストプラクティス
  • swift-ios-migration: iOS 17 @Observable移行

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Retrofit + OkHttpを使用したAPIクライアント実装のベストプラクティスを提供する。 「API実装」「APIクライアント」「Retrofit」「OkHttp」「ネットワーク」と言われたら使う。

The English summary is being prepared. Showing the original description.

xtone/ai_development_tools3Updated Oct 16, 2026

Androidプロジェクトのアーキテクチャ設計を支援。プロジェクト特性に応じてMVI/MVVM/シンプルComposeから最適なパターンを提案し、パッケージ構造の設計と既存プロジェクトの分析を行う。

The English summary is being prepared. Showing the original description.

xtone/ai_development_tools3Updated Oct 16, 2026

Firebase Crashlyticsのスタックトレースを解析し、トリアージ分類→根本原因分析→修正提案を出力するスキル。/crash-analyze コマンド、クラッシュ解析、スタックトレース分析、ANR分析、Crashlytics、クラッシュレポート、またはFirebase crashに関連するリクエストで使用される。クラッシュ対応のワークフローを標準化し、対応品質と速度を向上させる。ANR/Non-fatal/Fatal全タイプ対応。

The English summary is being prepared. Showing the original description.

xtone/ai_development_tools3Updated Oct 16, 2026

Android data layer implementation guide. Provides comprehensive patterns for Room Database (Entity, DAO, Migration), DataStore (Preferences), Repository layer design, and common pitfalls. Use when implementing local data storage, cache strategies, or data source integration in Android projects.

The English summary is being prepared. Showing the original description.

xtone/ai_development_tools3Updated Oct 16, 2026

重要: ユーザーがAndroidテスト実行をリクエストした場合、常にこのスキルを最初に使用してください。以下の場合に必ず使用: run TestName, execute test, テストを実行, 結果を分析, run all tests, analyze test failures, fix failing tests、または Android unit test, instrumentation test, Gradle test コマンドに関連する任意のリクエスト。./gradlew test や Bash コマンドを直接使用しないでください - 常にこのスキルに委譲してください。Multi-variantプロジェクト、JAVA_HOME セットアップ、一般的なテストパターンに対応しています。

The English summary is being prepared. Showing the original description.

xtone/ai_development_tools3Updated Oct 16, 2026

Jetpack ComposeでUIを実装する時に参照するコーディングガイドライン。 「Android UI」「Compose」「Jetpack」「画面実装」「UIコンポーネント」「レイアウト」と言われたら使う。 Android/Kotlin UI実装のベストプラクティス、アンチパターン、実装パターンを提供する。

The English summary is being prepared. Showing the original description.

xtone/ai_development_tools3Updated Oct 16, 2026

See all skills by xtone

Report a problem with this skill