mcpField
A
axiom-apple-docs

axiom-apple-docs

github.com/charleswiltgen開発1.2k1.5k 回インストール今日更新
リポジトリ

axiom-apple-docs について

axiom-apple-docs は、Xcode に含まれる Apple の Markdown 文書と Swift コンパイラ診断を参照するためのガイドです。API やフレームワーク、コンパイルエラーの調査に使え、ローカル文書がない場合の代替手段も案内します。

主な機能

  1. 01Xcode 公式ドキュメントへの案内
  2. 02Swift コンパイラ診断の索引
  3. 03トピック別フレームワークガイドの検索
  4. 04Xcode 文書がない場合の代替策

活用シーン

  1. 01Apple API のシグネチャや挙動の確認
  2. 02Swift コンパイラ診断の理解
  3. 03フレームワークの公式ガイドの検索
  4. 04ローカルに Xcode 文書がない場合の調査継続

MCP 対応

README では、axiom-mcp の axiom_read_skill から同じ Xcode ファイルを取得でき、直接ファイルを読む方法の便宜的な選択肢になると説明しています。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/charleswiltgen/axiom --skill axiom-apple-docs

インストール後、Claude Code で/axiom-apple-docsを入力して読み込まれたか確認します。

同梱ファイルskills/apple-docs-research.md

詳細

Apple Documentation Router

Apple は、LLM 向けの Markdown ドキュメントを Xcode に同梱しています。これらは、Apple のエンジニアが作成した、信頼性が高く最新のガイドおよび診断情報です。ファイルとして直接読み取ってください(Claude Code では Read ツールを使用します)。MCP サーバーや特別なツールは必要ありません。

使用する場面

  • Apple の正確な API シグネチャや動作を確認する必要がある場合
  • Axiom のスキルが Apple のフレームワークを参照しており、公式情報を確認したい場合
  • Swift コンパイラの診断メッセージについて説明が必要な場合
  • ユーザーが特定の Apple フレームワークの機能について質問した場合

優先順位:Axiom のスキルは、意見に基づいたガイダンス(判断フロー、アンチパターン、プレッシャーシナリオ)を提供します。Apple のドキュメントは、信頼できる API の詳細を提供します。両方を組み合わせて使用してください。

ドキュメントの読み方

Axiom のセッションコンテキストには、ユーザーが切り替えた Xcode が記載されています。Claude Code では、文字どおりのベースディレクトリが表示されます(「Apple for-LLM Documentation: Xcode detected at <path>」)。その他のハーネスでは、アプリ名が表示されます(「Installed on this machine: Xcode … (<path>)」)。下の表で /Applications/Xcode.app の代わりに、その .app を使用してください。<base>/<filename> をファイルとして読み取ります(Claude Code では Read ツールを使用します)。

デフォルトの Xcode の場所(/Applications/Xcode.app)のベースディレクトリ:

内容ベースディレクトリ
AdditionalDocumentation ガイド/Applications/Xcode.app/Contents/PlugIns/IDEIntelligenceChat.framework/Versions/A/Resources/AdditionalDocumentation/
Swift コンパイラの診断情報/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/doc/swift/diagnostics/

Claude が生成する呼び出しの例:

Read /Applications/Xcode.app/Contents/PlugIns/IDEIntelligenceChat.framework/Versions/A/Resources/AdditionalDocumentation/SwiftUI-Implementing-Liquid-Glass-Design.md

これらのパスはデフォルトのインストール先を想定しています。代わりに、セッションコンテキストに記載されたパスを使用してください。セッションコンテキストがない場合は、AXIOM_XCODE_PATH が設定されていればそれを使用してください。設定されていない場合は xcode-select -p を実行します(DEVELOPER_DIR を尊重します)。このコマンドは <Xcode>.app/Contents/Developer を出力します。/Contents/Developer を取り除き、その .app を上記の /Applications/Xcode.app の代わりに使用してください。/Library/Developer/CommandLineTools が出力された場合、Xcode は選択されていません。/Applications/Xcode.app を試してください。

ガイドファイル(AdditionalDocumentation)

20 個のファイルがあります。{guides base}/{filename} のパスパターンを使って読み取ってください。

UI とデザイン
トピックファイル名
SwiftUI の Liquid GlassSwiftUI-Implementing-Liquid-Glass-Design.md
UIKit の Liquid GlassUIKit-Implementing-Liquid-Glass-Design.md
AppKit の Liquid GlassAppKit-Implementing-Liquid-Glass-Design.md
WidgetKit の Liquid GlassWidgetKit-Implementing-Liquid-Glass-Design.md
SwiftUI の新しいツールバー機能SwiftUI-New-Toolbar-Features.md
SwiftUI のスタイル付きテキスト編集SwiftUI-Styled-Text-Editing.md
SwiftUI と WebKit の統合SwiftUI-WebKit-Integration.md
SwiftUI と AlarmKit の統合SwiftUI-AlarmKit-Integration.md
Swift Charts の 3D ビジュアライゼーションSwift-Charts-3D-Visualization.md
Foundation AttributedString の更新Foundation-AttributedString-Updates.md
データと永続化
トピックファイル名
SwiftData のクラス継承SwiftData-Class-Inheritance.md
並行処理とパフォーマンス
トピックファイル名
Swift の並行処理の更新Swift-Concurrency-Updates.md
InlineArray と SpanSwift-InlineArray-Span.md
Apple Intelligence
トピックファイル名
Foundation Models(デバイス上の LLM)FoundationModels-Using-on-device-LLM-in-your-app.md
システム統合
トピックファイル名
App Intents の更新AppIntents-Updates.md
StoreKit の更新StoreKit-Updates.md
MapKit GeoToolbox PlaceDescriptorsMapKit-GeoToolbox-PlaceDescriptors.md
visionOS 向けウィジェットWidgets-for-visionOS.md
アクセシビリティ
トピックファイル名
iOS の Assistive AccessImplementing-Assistive-Access-in-iOS.md
コンピュータービジョン
トピックファイル名
iOS の Visual IntelligenceImplementing-Visual-Intelligence-in-iOS.md

Swift Compiler Diagnostics

diagnostics ディレクトリには 46 個のファイルがあります。{diagnostics base}/{filename} のパスパターンを使用して読み取ります。

Concurrency Diagnostics
DiagnosticFilename
非隔離コンテキストからのアクター隔離された呼び出しactor-isolated-call.md
適合性の隔離conformance-isolation.md
隔離された適合性isolated-conformances.md
デフォルトで非隔離かつ非送信nonisolated-nonsending-by-default.md
Sendable クロージャのキャプチャsendable-closure-captures.md
Sendable メタタイプsendable-metatypes.md
明示的な Sendable 注釈explicit-sendable-annotations.md
sending クロージャによるデータ競合のリスクsending-closure-risks-data-race.md
sending によるデータ競合のリスクsending-risks-data-race.md
可変グローバル変数mutable-global-variable.md
preconcurrency インポートpreconcurrency-import.md
動的排他制御dynamic-exclusivity.md
排他制御違反exclusivity-violation.md
Type System Diagnostics
DiagnosticFilename
Existential anyexistential-any.md
Existential のメンバーアクセスの制限existential-member-access-limitations.md
名目的型nominal-types.md
多重継承multiple-inheritance.md
プロトコル型の適合性なしprotocol-type-non-conformance.md
不透明型の推論opaque-type-inference.md
外部参照型foreign-reference-type.md
Build & Migration Diagnostics
DiagnosticFilename
非推奨の宣言deprecated-declaration.md
将来の Swift バージョンでのエラーerror-in-future-swift-version.md
厳格な言語機能strict-language-features.md
厳格なメモリ安全性strict-memory-safety.md
実装のみのインポートが非推奨implementation-only-deprecated.md
メンバーのインポート可視性member-import-visibility.md
既知のパスにモジュールがないmissing-module-on-known-paths.md
モジュールをテスト可能にできないmodule-not-testable.md
モジュールバージョンがないmodule-version-missing.md
Clang 宣言のインポートclang-declaration-import.md
可用性の未認識の名前availability-unrecognized-name.md
常に利用可能なドメインalways-available-domain.md
今後追加される言語機能upcoming-language-features.md
未知の警告グループunknown-warning-group.md
コンパイルのキャッシュcompilation-caching.md
組み込み環境での制約embedded-restrictions.md
Swift Language Diagnostics
DiagnosticFilename
動的呼び出し可能要件dynamic-callable-requirements.md
プロパティラッパーの要件property-wrapper-requirements.md
結果ビルダーのメソッドresult-builder-methods.md
文字列補間の適合性string-interpolation-conformance.md
末尾クロージャの照合trailing-closure-matching.md
一時ポインターtemporary-pointers.md
意味的コピーsemantic-copies.md
パフォーマンスのヒントperformance-hints.md
Index
DiagnosticFilename
診断グループ(分類体系)diagnostic-groups.md
すべての診断のインデックスdiagnostics.md

必要な診断が上記にない場合は、まず diagnostics ディレクトリの一覧を取得してください。

ls "<Xcode>.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/doc/swift/diagnostics/"

<Xcode>.app はアプリのセッションコンテキスト名です。セッションコンテキストがない場合は、上記の方法で導き出してください。Command Line Tools でも同じファイルが /Library/Developer/CommandLineTools/usr/share/doc/swift/diagnostics/ にあります。

ファイル名は診断の短縮名に従います(小文字、ハイフン区切り)。

Routing Decision Tree

User question about Apple API/framework?
├── Specific compiler error/warning → Read {diagnostics base}/<diagnostic-name>.md
├── Liquid Glass implementation     → Read {guides base}/<Framework>-Implementing-Liquid-Glass-Design.md
├── Swift concurrency patterns      → Read {guides base}/Swift-Concurrency-Updates.md
├── Foundation Models / on-device AI → Read {guides base}/FoundationModels-Using-on-device-LLM-in-your-app.md
├── SwiftData features              → Read {guides base}/SwiftData-Class-Inheritance.md
├── StoreKit / IAP                  → Read {guides base}/StoreKit-Updates.md
├── App Intents / Siri              → Read {guides base}/AppIntents-Updates.md
├── Charts / visualization          → Read {guides base}/Swift-Charts-3D-Visualization.md
├── Text editing / AttributedString → Read {guides base}/SwiftUI-Styled-Text-Editing.md or Foundation-AttributedString-Updates.md
├── WebKit in SwiftUI               → Read {guides base}/SwiftUI-WebKit-Integration.md
├── Toolbar features                → Read {guides base}/SwiftUI-New-Toolbar-Features.md
└── Other                           → ls the base directory to see what's available

Xcode を利用できない場合のフォールバック

解決された Xcode に IDEIntelligenceChat.framework のドキュメントディレクトリがない場合(古い Xcode、または Command Line Tools のみがインストールされている場合)は、以下のリストをフォールバックとして利用してください。Swift の診断情報を調べる場合は、まず Command Line Tools に含まれる /Library/Developer/CommandLineTools/usr/share/doc/swift/diagnostics/ を確認してください。

  1. sosumi.ai(developer.apple.com の Markdown ミラー — skills/apple-docs-research.md を参照)
  2. SDK 独自の宣言 — Swift インターフェースと Objective-C ヘッダー(skills/apple-docs-research.md にも記載)。Command Line Tools に含まれるのは macOS SDK のみです
  3. 提案 — Apple のドキュメントをすべて参照できるよう、最新の Xcode のインストールを提案してください

黙って処理を失敗させないでください。Xcode のドキュメントをローカルで利用できない場合は、そのことと、どのフォールバックを使用したかをユーザーに伝えてください。

MCP の便利な利用方法

axiom-mcp を使用するクライアントは、レガシー ID(例:apple-guide-swiftui-implementing-liquid-glass-design)を指定して axiom_read_skill を呼び出すこともできます。MCP サーバーは同じ Xcode ファイルを読み込み、同じ内容を返します。どちらの方法も利用できます。ファイルを読み取る方法はどこでも動作し、MCP を使う方法はカタログや検索のワークフローに便利です。

調査方法

同梱ガイドで扱われていない内容については、Apple の完全な API リファレンス、SDK 独自の宣言、WWDC セッションのトランスクリプトとコードを、skills/apple-docs-research.md で確認してください。

リソース

スキル:axiom-swiftui、axiom-concurrency、axiom-data、axiom-ai、axiom-integration

コメント