hexdocs-fetcher について
hexdocs-fetcher は、WebFetch で HexDocs の Elixir ライブラリ文書を取得する Claude Code スキルです。対象を絞った抽出プロンプトとキャッシュにより、文書調査を支援します。
主な機能
- 01WebFetch による HexDocs 取得
- 02モジュール、ガイド、API の指定
- 03焦点を絞った抽出プロンプト
- 0415 分キャッシュで結果を再利用
- 05調査結果を計画ファイルに保存
活用シーン
- 01Elixir ライブラリの概要調査
- 02API 詳細やガイドの抽出
- 03トラブルシューティング情報の検索
- 04取得した文書の後日利用
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ oliver-kriska/ claude-elixir-phoenix --skill hexdocs-fetcherインストール後、Claude Code で/hexdocs-fetcherを入力して読み込まれたか確認します。
詳細
HexDocs フェッチャー
Claude Code のネイティブ WebFetch ツールを使用して、hexdocs.pm から Elixir ライブラリのドキュメントを効率的に取得します。
使い方
ライブラリを調査する際は、WebFetch を使用します。
# Fetch library overview
WebFetch(
url: "https://hexdocs.pm/oban",
prompt: "Extract the main documentation, including module overview, installation instructions, and key functions. Format as clean markdown."
)
# Fetch specific module docs
WebFetch(
url: "https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html",
prompt: "Extract the module documentation including all public functions, their specs, and examples."
)
# Fetch getting started guide
WebFetch(
url: "https://hexdocs.pm/ecto/getting-started.html",
prompt: "Extract the complete getting started guide content."
)
トークン効率
WebFetch は HTML を Markdown に自動変換し、関連するコンテンツを抽出します。
| ソース | 生の HTML | WebFetch 使用時 | 効果 |
|---|---|---|---|
| HexDocs ページ | ~80k トークン | ~15k トークン | 80% 削減 |
| Phoenix ドキュメント | ~120k トークン | ~25k トークン | 79% 削減 |
| README | ~20k トークン | ~8k トークン | 60% 削減 |
hex-library-researcher との連携
ライブラリを評価する際は、ドキュメントを効率的に取得します。
# Get library overview with focused extraction
WebFetch(
url: "https://hexdocs.pm/oban",
prompt: "Extract: 1) Installation instructions 2) Main features 3) Basic usage example"
)
よく使う HexDocs URL
# Library overview
https://hexdocs.pm/{library}
# Module documentation
https://hexdocs.pm/{library}/{Module}.html
https://hexdocs.pm/{library}/{Module.Submodule}.html
# Guides
https://hexdocs.pm/{library}/guides.html
https://hexdocs.pm/{library}/{guide-name}.html
# API reference
https://hexdocs.pm/{library}/api-reference.html
プロンプト戦略
抽出精度を高めるには、対象を絞ったプロンプトを使用します。
# For API docs
prompt: "Extract all public function docs with @spec and examples"
# For guides
prompt: "Extract the complete guide content preserving code examples"
# For troubleshooting
prompt: "Extract any troubleshooting sections, common errors, and FAQs"
# For configuration
prompt: "Extract configuration options and their defaults"
キャッシュ
WebFetch には15分間の自動キャッシュ機能があります。セッション中に同じ URL を複数回取得すると、結果は自動的にキャッシュされます。
より長期間保存するには、計画ディレクトリに保存します。
# After fetching, write the result to a file
Write(
file_path: ".claude/plans/{slug}/research/docs/oban.md",
content: "{extracted content}"
)
Tidewave の代替手段
Tidewave MCP が利用可能な場合は、バージョンが正確に一致するドキュメントを取得できる mcp__tidewave__get_docs を優先してください。
mcp__tidewave__get_docs(module: "Oban.Worker")
これにより、mix.lock に記載された正確なバージョンのドキュメントを取得できます。
鉄則
- HexDocs サイト全体を取得しないでください — 必ず特定のモジュールまたはガイドを対象にします
- 対象を絞ったプロンプトを使用してください — 汎用的な取得はトークンを浪費します。抽出する内容を明示してください
- 利用可能な場合は Tidewave を優先してください — 正確なバージョン一致は、汎用的な hexdocs.pm より優れています
コメント
Markdown 対応