跳到正文
cccskills
免费在 GitHub 公开

ios-clean-architecture

iOSアプリのSPMパッケージ構成・レイヤー依存関係・設計原則を定義。iOS機能実装・コードレビュー時に参照。no problem製SPMパッケージの使用指針を含む。

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md4.9 KB
  • REFERENCE.md12.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

iOS Clean Architecture

iOSアプリのクリーンアーキテクチャに基づくパッケージ構成と設計原則。

パッケージ依存図

                    ┌─────────────────┐
                    │  Presentation   │  SwiftUI Views, Components
                    └────────┬────────┘
                             │
    ┌───────────┬────────────┼────────────┬───────────┐
    ▼           ▼            ▼            ▼           ▼
┌────────┐ ┌────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐
│ State  │ │UseCases│ │Repository│ │ Services │ │  External    │
│        │ │        │ │          │ │          │ │  SPM (4)     │
└────┬───┘ └────┬───┘ └────┬─────┘ └────┬─────┘ └──────────────┘
     │          │    ↘     │      ↙     │
     │          └─────┬────┴──────┬─────┘
     │                ▼           │
     │       ┌──────────────┐     │
     └──────►│    Domain    │◄────┘
             └──────────────┘

注: UseCasesはRepository・Servicesの両方に依存可能。ServicesはDomainのみに依存。

ローカルパッケージ(6つ)

パッケージ責務依存先
Domainドメインモデル・値オブジェクト・列挙型なし
Services再利用可能なアプリケーションサービス(外部SDK連携等)Domain のみ
RepositoryAPI通信・データ永続化Domain, APIClient
State@Observable状態管理Domain, Authentication
UseCasesビジネスロジック(Protocol定義)Domain, Repository, Services
PresentationSwiftUI View・コンポーネント全て

Services層の原則

  • Domainのみに依存: Repositoryや他のパッケージへの依存は禁止
  • 再利用可能: 複数のUseCaseから利用される共通機能を提供
  • 外部SDK連携: HealthKit, CoreLocation, Analytics等のラッパー

no problem製外部SPM(4つ)

パッケージモジュール名用途使用レイヤー
swift-design-systemDesignSystemテーマ・色・スペーシング・UIコンポーネントPresentation
swift-authenticationAuthenticationFirebase Auth統合(Google/Apple Sign-In)State, Presentation
swift-ui-routingUIRouting型安全ナビゲーション(Router, TabPresenter)Presentation
swift-api-clientAPIClientHTTP通信クライアントRepository

依存ルール(厳守)

許可される依存

// ✅ Presentation → 全て(最上層)
import Domain
import State
import UseCases
import Repository
import DesignSystem
import UIRouting
import Authentication

// ✅ UseCases → Domain + Repository + Services
import Domain
import Repository
import Services

// ✅ State → Domain + Authentication
import Domain
import Authentication

// ✅ Repository → Domain + APIClient
import Domain
import APIClient

// ✅ Services → Domain(外部サービス連携)
import Domain

// ✅ Domain → なし(最下層)
// 外部依存ゼロ(Foundationのみ許可)

禁止される依存

// ❌ Domain層での外部import
import Foundation  // ✅ OK(標準ライブラリ)
import UIKit       // ❌ 禁止
import SwiftUI     // ❌ 禁止
import DesignSystem // ❌ 禁止

// ❌ 下位レイヤーから上位への参照
import Presentation // ❌ 循環依存

// ❌ UseCases → State
import State // ❌ 状態管理は上位レイヤーの責務

// ❌ Services → Repository(Servicesは独立性を保つ)
import Repository // ❌ ServicesはDomainのみに依存

設計違反チェックリスト

実装前に確認:

  • Domain層にUI依存を追加していないか?
  • Repositoryから直接Viewを参照していないか?
  • UseCaseがStateを直接操作していないか?
  • ServicesがRepositoryに依存していないか?
  • 外部SPMを適切なレイヤーでのみ使用しているか?

詳細は REFERENCE.md を参照。

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

CHANGELOG エントリ追加・バージョン計算。「CHANGELOG」「変更履歴」「changelog add」「version bump」「バージョン」「バージョンアップ」などのキーワードで自動適用。

中文简介正在准备中。当前显示原文说明。

no-problem-dev/claude-code-plugins52026年3月15日 更新

プロジェクトの .claude/ ディレクトリ(skills, agents, contexts)を Codex CLI 互換 .agents/ に変換。「codex export」「Codex 変換」「プロジェクトをエクスポート」などで自動適用。

中文简介正在准备中。当前显示原文说明。

no-problem-dev/claude-code-plugins52026年3月15日 更新

デザインシステム準拠のSwiftUIコンポーネントを生成する。新しいUIパーツの作成、コンポーネント生成時に使用。「コンポーネント作成」「新しいUI」「パーツ作成」「component generate」「UIパーツ」「新規コンポーネント」などのキーワードで自動適用。

中文简介正在准备中。当前显示原文说明。

no-problem-dev/claude-code-plugins52026年3月15日 更新

Claude Code プラグインを Codex CLI 互換形式に変換。SKILL.md → .agents/skills/、agents → .agents/skills/、AGENTS.md 生成。「deploy」「codex」「Codex 変換」「エクスポート」などで自動適用。

中文简介正在准备中。当前显示原文说明。

no-problem-dev/claude-code-plugins52026年3月15日 更新

SwiftUI ViewのDesign System準拠性を監査する。既存UIのレビュー、デザインチェック時に使用。「デザインレビュー」「UIチェック」「design audit」「デザイン監査」「UI監査」「デザインチェック」「トークン確認」などのキーワードで自動適用。

中文简介正在准备中。当前显示原文说明。

no-problem-dev/claude-code-plugins52026年3月15日 更新

UIの視覚的差分を検出・比較する。デザイン変更前後の比較、リファレンスとの差分確認時に使用。「デザイン比較」「UI差分」「design diff」「design compare」「ビフォーアフター」「見た目の違い」などのキーワードで自動適用。

中文简介正在准备中。当前显示原文说明。

no-problem-dev/claude-code-plugins52026年3月15日 更新

查看 no-problem-dev 的全部技能

报告此技能的问题