Agent skill
ios-development
iOS開発のベストプラクティス、設計パターン、実装テクニック、よくあるトラブルと解決方法を包括的にカバー。MVVM、Clean Architecture、Combine、SwiftUI/UIKitの実践的なガイドを提供します。
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/ios-development
SKILL.md
iOS Development Skill
📋 目次
- 概要
- いつ使うか
- アーキテクチャパターン
- UI開発
- データ管理
- ベストプラクティス
- よくある問題
- Agent連携
概要
このSkillは、iOS開発における全ての側面をカバーします:
- ✅ アーキテクチャパターン(MVVM, Clean Architecture, VIPER)
- ✅ SwiftUI/UIKit開発
- ✅ Reactive Programming(Combine, RxSwift)
- ✅ データ永続化(CoreData, Realm, UserDefaults)
- ✅ ネットワーク通信
- ✅ 非同期処理(async/await, DispatchQueue)
- ✅ Dependency Injection
- ✅ エラーハンドリング
- ✅ メモリ管理
- ✅ よくあるトラブルと解決方法
📚 公式ドキュメント・参考リソース
このガイドで学べること: アーキテクチャパターン、設計原則、実装テクニック 公式で確認すべきこと: 最新API、iOS 18の新機能、SwiftUI/UIKitリファレンス、App Store審査ガイドライン
主要な公式ドキュメント
-
Apple Developer Documentation - Apple公式ドキュメント
-
Swift.org - Swift言語公式サイト
- The Swift Programming Language - 完全ガイド
- Swift Evolution - 言語仕様の進化
-
Human Interface Guidelines - UIデザインガイドライン
- iOS、iPadOS、watchOS、macOSのデザイン原則
- コンポーネント使用ガイド
-
App Store Review Guidelines - 審査ガイドライン
- 申請前の必読事項
- リジェクト回避のポイント
関連リソース
- WWDC Videos - 年次カンファレンス動画
- Swift Forums - Swift公式フォーラム
- Hacking with Swift - チュートリアル集
- Ray Wenderlich - iOS開発教材
- Swift by Sundell - 実践的なTips
いつ使うか
自動的に参照されるケース
- 新しいiOSプロジェクトを開始する時
- 既存コードをリファクタリングする時
- アーキテクチャの選択・設計をする時
- 実装で迷った時
- エラーやクラッシュが発生した時
手動で参照すべきケース
- プロジェクトのアーキテクチャを決定する時
- 新しい機能の設計をする時
- パフォーマンス問題を調査する時
- チームメンバーへの教育時
アーキテクチャパターン
パターンの選択
| パターン | 適用ケース | 詳細ガイド |
|---|---|---|
| MVVM | 中小規模、SwiftUI | guides/01-mvvm-pattern.md |
| Clean Architecture | 大規模、テスタビリティ重視 | guides/02-clean-architecture.md |
| VIPER | 超大規模、チーム開発 | guides/03-viper-pattern.md |
| Coordinator | ナビゲーション複雑 | guides/04-coordinator-pattern.md |
詳細: guides/00-architecture-overview.md
UI開発
SwiftUI vs UIKit
| 観点 | SwiftUI | UIKit |
|---|---|---|
| 学習曲線 | 緩やか | 急 |
| iOS最低バージョン | iOS 13+ | iOS 2+ |
| カスタマイズ性 | 制限あり | 完全 |
| 推奨ケース | 新規プロジェクト | レガシー、細かい制御 |
SwiftUI開発
- guides/05-swiftui-fundamentals.md
- guides/06-swiftui-state-management.md
- guides/07-swiftui-animations.md
UIKit開発
- guides/08-uikit-fundamentals.md
- guides/09-autolayout-mastery.md
- guides/10-custom-controls.md
データ管理
データ永続化の選択
| 技術 | 用途 | ガイド |
|---|---|---|
| UserDefaults | 設定、小さなデータ | guides/11-userdefaults.md |
| Keychain | 認証情報、秘密情報 | guides/12-keychain.md |
| CoreData | 複雑なリレーショナルデータ | guides/13-coredata.md |
| Realm | 高速、シンプルなDB | guides/14-realm.md |
| FileManager | ファイル、画像 | guides/15-file-storage.md |
ネットワーク通信
- guides/16-networking-fundamentals.md
- guides/17-api-client-design.md
- guides/18-error-handling.md
ベストプラクティス
コーディング規約
→ references/coding-standards.md
Dependency Injection
→ references/dependency-injection.md
非同期処理
→ references/async-programming.md
メモリ管理
→ references/memory-management.md
エラーハンドリング
→ references/error-handling-best-practices.md
よくある問題
クラッシュ・エラー
| 問題 | 原因 | 解決方法 |
|---|---|---|
| "Thread 1: signal SIGABRT" | 制約エラー、強制アンラップ | incidents/crashes/ |
| メモリリーク | 循環参照 | incidents/memory-leaks/ |
| "Could not cast value" | 型キャストエラー | incidents/type-errors/ |
詳細: references/troubleshooting.md
パフォーマンス問題
→ ios-performance Skillを参照
セキュリティ問題
→ ios-security Skillを参照
Agent連携
このSkillを使用するAgents
-
architecture-advisor-agent
- プロジェクトに最適なアーキテクチャを提案
- Thoroughness:
thorough
-
code-generator-agent
- アーキテクチャパターンに従ったコード生成
- Thoroughness:
medium
-
refactoring-agent
- 既存コードのリファクタリング提案
- Thoroughness:
thorough
-
troubleshooter-agent
- エラー・クラッシュの原因分析と解決策提案
- Thoroughness:
thorough
推奨Agentワークフロー
新規機能実装時(順次実行)
architecture-advisor-agent (設計)
→ code-generator-agent (実装)
→ test-generator-agent (テスト作成)
→ code-review-agent (レビュー)
トラブルシューティング時(並行実行)
troubleshooter-agent +
performance-profiler-agent +
memory-analyzer-agent
→ 結果統合 → 解決策提案
クイックリファレンス
頻出パターン
MVVM ViewModel例
class UserProfileViewModel: ObservableObject {
@Published var user: User?
@Published var isLoading = false
@Published var errorMessage: String?
private let userRepository: UserRepositoryProtocol
init(userRepository: UserRepositoryProtocol) {
self.userRepository = userRepository
}
func fetchUser(id: String) async {
isLoading = true
defer { isLoading = false }
do {
user = try await userRepository.fetchUser(id: id)
} catch {
errorMessage = error.localizedDescription
}
}
}
API Client例
protocol APIClientProtocol {
func request<T: Decodable>(_ endpoint: Endpoint) async throws -> T
}
class APIClient: APIClientProtocol {
func request<T: Decodable>(_ endpoint: Endpoint) async throws -> T {
let request = try endpoint.asURLRequest()
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse,
(200...299).contains(httpResponse.statusCode) else {
throw APIError.invalidResponse
}
return try JSONDecoder().decode(T.self, from: data)
}
}
詳細ドキュメント
Guides(詳細ガイド)
アーキテクチャ
- アーキテクチャ概要
- MVVMパターン
- Clean Architecture
- VIPERパターン
- Coordinatorパターン
UI開発 6. SwiftUI基礎 7. SwiftUI State管理 8. SwiftUIアニメーション 9. UIKit基礎 10. AutoLayoutマスター
データ管理 11. UserDefaults 12. Keychain 13. CoreData 14. Realm 15. ファイルストレージ 16. ネットワーク基礎 17. APIクライアント設計 18. エラーハンドリング
Checklists(チェックリスト)
- 新規プロジェクト開始時
- 新機能実装前
- コードレビュー観点
- リリース前
Templates(テンプレート)
- MVVM ViewModel
- Repository
- UseCase
- APIClient
- Coordinator
References(リファレンス)
- コーディング規約
- ベストプラクティス集
- アンチパターン集
- Dependency Injection
- 非同期プログラミング
- メモリ管理
- トラブルシューティング
Incidents(過去の問題事例)
- クラッシュ事例
- メモリリーク事例
- パフォーマンス問題
- 型エラー事例
学習リソース
- 📚 Swift Programming Language
- 📖 Apple Human Interface Guidelines
- 🎥 WWDC Videos
- 📘 Ray Wenderlich Tutorials
関連Skills
swiftui-patterns- SwiftUI特化ios-performance- パフォーマンス最適化ios-security- セキュリティ実装testing-strategy- テスト戦略code-review- コードレビュー
更新履歴
このSkill自体の変更履歴は CHANGELOG.md を参照
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?