swift-development
Comprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o swift-development.zip https://jpskill.com/download/19213.zip && unzip -o swift-development.zip && rm swift-development.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19213.zip -OutFile "$d\swift-development.zip"; Expand-Archive "$d\swift-development.zip" -DestinationPath $d -Force; ri "$d\swift-development.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
swift-development.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
swift-developmentフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 20
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Swift開発
前提条件
- Xcode 15以降がインストールされたmacOS(Swift 6にはXcode 16以降が必要です)
- Xcode Command Line Tools:
xcode-select --install - 確認:
xcodebuild -versionおよびswift --version
クイックスタート
新しいSwiftパッケージ
# 完全なセットアップには付属のスクリプトを使用します
./scripts/new_package.sh MyLibrary --type library --ios --macos
# または手動で
swift package init --type library --name MyLibrary
ビルドとテスト
# SPMパッケージ
swift build
swift test
# Xcodeプロジェクト
xcodebuild -workspace App.xcworkspace -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15' build
# 一般的なオプションには付属のスクリプトを使用します
./scripts/run_tests.sh --parallel --coverage
フォーマットとLint
# 付属のスクリプトを使用します
./scripts/format_and_lint.sh Sources/
# チェックモード (CI)
./scripts/format_and_lint.sh --check
シミュレータ管理
# 付属のスクリプトを使用します
./scripts/simulator.sh list
./scripts/simulator.sh boot "iPhone 15"
./scripts/simulator.sh screenshot
./scripts/simulator.sh dark
コアワークフロー
iOSアプリのビルド
# シミュレータ用のデバッグビルド
xcodebuild -workspace App.xcworkspace -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15' \
build
# リリースアーカイブ
xcodebuild archive \
-workspace App.xcworkspace -scheme App \
-archivePath ./build/App.xcarchive \
-configuration Release
# IPAのエクスポート (assets/ExportOptions/ のテンプレートを使用します)
xcodebuild -exportArchive \
-archivePath ./build/App.xcarchive \
-exportPath ./build/export \
-exportOptionsPlist assets/ExportOptions/app-store.plist
テスト
# 全てのテスト
xcodebuild test -workspace App.xcworkspace -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15'
# 特定のテスト
xcodebuild test -only-testing:AppTests/MyTestClass/testMethod
# カバレッジ付き
xcodebuild test -enableCodeCoverage YES \
-resultBundlePath ./TestResults.xcresult
アプリのインストール
# 起動中のシミュレータにインストール
xcrun simctl install booted ./Build/Products/Debug-iphonesimulator/App.app
# 起動
xcrun simctl launch booted com.company.app
公式ドキュメント
参照リンク (人間向け)
これらは手動で閲覧するためのAppleの公式ドキュメントリンクです:
| リソース | URL |
|---|---|
| Swift Documentation | https://developer.apple.com/documentation/swift |
| SwiftUI | https://developer.apple.com/documentation/swiftui |
| Swift Concurrency | https://developer.apple.com/documentation/swift/concurrency |
| Swift Testing | https://developer.apple.com/documentation/testing |
注: AppleのドキュメントサイトはJavaScript SPAであり、WebFetchでプログラム的に取得することはできません。
WebFetch互換ソース
ライブドキュメントの取得には、これらのGitHubベースのソースを使用してください:
| リソース | URL |
|---|---|
| Swift Testing | https://github.com/apple/swift-testing |
| Swift Evolution Proposals | https://github.com/apple/swift-evolution/tree/main/proposals |
| Swift Compiler Docs | https://github.com/apple/swift/tree/main/docs |
| Swift Standard Library | https://github.com/apple/swift/tree/main/stdlib |
| Swift Async Algorithms | https://github.com/apple/swift-async-algorithms |
| Swift Collections | https://github.com/apple/swift-collections |
ドキュメントを取得するタイミング
以下の状況でGitHubからドキュメントを取得するために WebFetch を使用してください:
- Swift Testing:
@Test、#expect、#require、traits、またはパラメーター化されたテストに関する詳細が必要な場合 - Swift Evolution: 新しい言語機能の承認された提案を確認する場合
- フレームワークの詳細: AppleのオープンソースSwiftパッケージから機能を実装する場合
- 不確実性: 現在のAPIパターンやベストプラクティスについて不明な場合
取得方法: GitHubのURLで WebFetch を使用します:
- README:
https://github.com/apple/swift-testing - 生のMarkdown:
https://raw.githubusercontent.com/apple/swift-testing/main/README.md - 特定のドキュメント:
https://github.com/apple/swift-evolution/blob/main/proposals/0409-access-level-on-imports.md
WebFetchのプロンプト例: 「このドキュメントから主な機能、マクロ、使用例を抽出してください」
参照ファイル
特定のトピックに関する詳細なドキュメント:
| トピック | ファイル |
|---|---|
| SwiftUIパターン | references/swiftui-patterns.md |
| テストパターン | references/testing-patterns.md |
| Swift 6並行処理 | references/concurrency.md |
| アーキテクチャパターン | references/architecture.md |
| ベストプラクティス | references/best-practices.md |
| Swift Package Manager | references/spm.md |
| xcodebuildコマンド | references/xcodebuild.md |
| シミュレータ制御 | references/simctl.md |
| コード署名 | references/code-signing.md |
| CI/CDセットアップ | references/cicd.md |
| トラブルシューティング | references/troubleshooting.md |
付属スクリプト
| スクリプト | 目的 |
|---|---|
scripts/new_package.sh |
設定ファイル付きの新しいSwiftパッケージを作成します |
scripts/run_tests.sh |
一般的なオプションでテストを実行します |
scripts/format_and_lint.sh |
SwiftコードをフォーマットしてLintします |
scripts/simulator.sh |
シミュレータのクイック管理 |
アセットテンプレート
| アセット | 目的 |
|---|---|
assets/Package.swift.template |
Swiftパッケージテンプレート |
assets/.swiftformat |
SwiftFormat設定 |
assets/.swiftlint.yml |
SwiftLint設定 |
assets/ExportOptions/ |
アーカイブエクスポートplistテンプレート |
クイックリファレンス
必須コマンド
| タスク | コマンド |
|---|---|
| パッケージのビルド | swift build |
| リリースビルド | swift build -c release |
| テストの実行 | swift test |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Swift Development
Prerequisites
- macOS with Xcode 15+ installed (Xcode 16+ for Swift 6)
- Xcode Command Line Tools:
xcode-select --install - Verify:
xcodebuild -versionandswift --version
Quick Start
New Swift Package
# Use the included script for full setup
./scripts/new_package.sh MyLibrary --type library --ios --macos
# Or manually
swift package init --type library --name MyLibrary
Build and Test
# SPM packages
swift build
swift test
# Xcode projects
xcodebuild -workspace App.xcworkspace -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15' build
# Use included script for common options
./scripts/run_tests.sh --parallel --coverage
Format and Lint
# Use included script
./scripts/format_and_lint.sh Sources/
# Check mode (CI)
./scripts/format_and_lint.sh --check
Simulator Management
# Use included script
./scripts/simulator.sh list
./scripts/simulator.sh boot "iPhone 15"
./scripts/simulator.sh screenshot
./scripts/simulator.sh dark
Core Workflows
Building iOS Apps
# Debug build for simulator
xcodebuild -workspace App.xcworkspace -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15' \
build
# Release archive
xcodebuild archive \
-workspace App.xcworkspace -scheme App \
-archivePath ./build/App.xcarchive \
-configuration Release
# Export IPA (use templates from assets/ExportOptions/)
xcodebuild -exportArchive \
-archivePath ./build/App.xcarchive \
-exportPath ./build/export \
-exportOptionsPlist assets/ExportOptions/app-store.plist
Testing
# All tests
xcodebuild test -workspace App.xcworkspace -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15'
# Specific test
xcodebuild test -only-testing:AppTests/MyTestClass/testMethod
# With coverage
xcodebuild test -enableCodeCoverage YES \
-resultBundlePath ./TestResults.xcresult
App Installation
# Install on booted simulator
xcrun simctl install booted ./Build/Products/Debug-iphonesimulator/App.app
# Launch
xcrun simctl launch booted com.company.app
Official Documentation
Reference Links (for humans)
These are Apple's official documentation links for manual browsing:
| Resource | URL |
|---|---|
| Swift Documentation | https://developer.apple.com/documentation/swift |
| SwiftUI | https://developer.apple.com/documentation/swiftui |
| Swift Concurrency | https://developer.apple.com/documentation/swift/concurrency |
| Swift Testing | https://developer.apple.com/documentation/testing |
Note: Apple's documentation sites are JavaScript SPAs and cannot be fetched programmatically with WebFetch.
WebFetch-Compatible Sources
Use these GitHub-based sources for live documentation fetching:
| Resource | URL |
|---|---|
| Swift Testing | https://github.com/apple/swift-testing |
| Swift Evolution Proposals | https://github.com/apple/swift-evolution/tree/main/proposals |
| Swift Compiler Docs | https://github.com/apple/swift/tree/main/docs |
| Swift Standard Library | https://github.com/apple/swift/tree/main/stdlib |
| Swift Async Algorithms | https://github.com/apple/swift-async-algorithms |
| Swift Collections | https://github.com/apple/swift-collections |
When to Fetch Documentation
Use WebFetch to retrieve documentation from GitHub in these situations:
- Swift Testing: When you need details on
@Test,#expect,#require, traits, or parameterized tests - Swift Evolution: When checking accepted proposals for new language features
- Framework Details: When implementing features from Apple's open-source Swift packages
- Uncertainty: When you're unsure about current API patterns or best practices
How to fetch: Use WebFetch with GitHub URLs:
- README:
https://github.com/apple/swift-testing - Raw markdown:
https://raw.githubusercontent.com/apple/swift-testing/main/README.md - Specific docs:
https://github.com/apple/swift-evolution/blob/main/proposals/0409-access-level-on-imports.md
Example prompt for WebFetch: "Extract the main features, macros, and usage examples from this documentation"
Reference Files
Detailed documentation for specific topics:
| Topic | File |
|---|---|
| SwiftUI patterns | references/swiftui-patterns.md |
| Testing patterns | references/testing-patterns.md |
| Swift 6 concurrency | references/concurrency.md |
| Architecture patterns | references/architecture.md |
| Best practices | references/best-practices.md |
| Swift Package Manager | references/spm.md |
| xcodebuild commands | references/xcodebuild.md |
| Simulator control | references/simctl.md |
| Code signing | references/code-signing.md |
| CI/CD setup | references/cicd.md |
| Troubleshooting | references/troubleshooting.md |
Included Scripts
| Script | Purpose |
|---|---|
scripts/new_package.sh |
Create new Swift package with config files |
scripts/run_tests.sh |
Run tests with common options |
scripts/format_and_lint.sh |
Format and lint Swift code |
scripts/simulator.sh |
Quick simulator management |
Asset Templates
| Asset | Purpose |
|---|---|
assets/Package.swift.template |
Swift package template |
assets/.swiftformat |
SwiftFormat configuration |
assets/.swiftlint.yml |
SwiftLint configuration |
assets/ExportOptions/ |
Archive export plist templates |
Quick Reference
Essential Commands
| Task | Command |
|---|---|
| Build package | swift build |
| Build release | swift build -c release |
| Run tests | swift test |
| Update deps | swift package update |
| List simulators | xcrun simctl list devices |
| Boot simulator | xcrun simctl boot "iPhone 15" |
| Install app | xcrun simctl install booted ./App.app |
| Format code | swiftformat . |
| Lint code | swiftlint |
Common Destinations
# iOS Simulator
-destination 'platform=iOS Simulator,name=iPhone 15'
# macOS
-destination 'platform=macOS'
# Generic iOS (for archives)
-destination 'generic/platform=iOS'
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (7,212 bytes)
- 📎 assets/ExportOptions/ad-hoc.plist (398 bytes)
- 📎 assets/ExportOptions/app-store.plist (380 bytes)
- 📎 assets/ExportOptions/development.plist (358 bytes)
- 📎 assets/Package.swift.template (574 bytes)
- 📎 references/architecture.md (12,947 bytes)
- 📎 references/best-practices.md (554 bytes)
- 📎 references/cicd.md (4,433 bytes)
- 📎 references/code-signing.md (2,523 bytes)
- 📎 references/concurrency.md (4,118 bytes)
- 📎 references/simctl.md (3,645 bytes)
- 📎 references/spm.md (2,807 bytes)
- 📎 references/swiftui-patterns.md (2,586 bytes)
- 📎 references/testing-patterns.md (2,011 bytes)
- 📎 references/troubleshooting.md (4,839 bytes)
- 📎 references/xcodebuild.md (3,101 bytes)
- 📎 scripts/format_and_lint.sh (3,239 bytes)
- 📎 scripts/new_package.sh (7,382 bytes)
- 📎 scripts/run_tests.sh (4,239 bytes)
- 📎 scripts/simulator.sh (4,430 bytes)