jpskill.com
✍️ ライティング コミュニティ

docs-retrieval

ローカルに保存されたAI関連ドキュメントから、機能実装やエラー調査に必要な情報を迅速に探し出し、見つからない場合はウェブ検索も活用して、効率的に問題解決を支援するSkill。

📜 元の英語説明(参考)

Retrieve documentation context from local ai-docs. Check here first when implementing features, debugging errors, or needing library information. Fall back to web search if topic not found locally.

🇯🇵 日本人クリエイター向け解説

一言でいうと

ローカルに保存されたAI関連ドキュメントから、機能実装やエラー調査に必要な情報を迅速に探し出し、見つからない場合はウェブ検索も活用して、効率的に問題解決を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o docs-retrieval.zip https://jpskill.com/download/18030.zip && unzip -o docs-retrieval.zip && rm docs-retrieval.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18030.zip -OutFile "$d\docs-retrieval.zip"; Expand-Archive "$d\docs-retrieval.zip" -DestinationPath $d -Force; ri "$d\docs-retrieval.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して docs-retrieval.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → docs-retrieval フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

ドキュメント検索スキル

このスキルは、階層化されたドキュメントシステムからドキュメントのコンテキストを効率的に検索できるようにします。

変数

変数 デフォルト 説明
MAX_TOKENS 2000 コンテキストのロードにおけるターゲットトークン予算
LOAD_FULL_CONTEXT false ターゲットを絞ったページではなく、full-context.md を使用する
LOCAL_FIRST true Web検索の前に ai-docs を確認する

指示

必須 - Web検索の前に必ずローカルドキュメントを確認してください。

  • ナビゲーションには _index.toon ファイルから開始します
  • 完全なコンテキストではなく、ターゲットを絞ったページの要約をロードします
  • 以下の形式を使用して、複数ライブラリのコンテキストを統合します
  • 事前にロードされたコンテキストをサブエージェントに渡します

危険信号 - 停止して再検討

もしあなたが以下をしようとしているなら:

  • 単純な質問のために full-context.md をロードする
  • ローカルドキュメントを確認せずにWeb検索する
  • コンテキストを渡す代わりに、サブエージェントに最初からナビゲートさせる
  • 「念のため」すべてのライブラリをロードする

停止 -> 以下のターゲットを絞った検索パターンを使用 -> その後、続行

ワークフロー

  1. [ ] チェックポイント: 必要なライブラリを特定しましたか?
  2. [ ] ai-docs/libraries/_index.toon で利用可能なドキュメントを確認します
  3. [ ] 特定のライブラリの _index.toon に移動します
  4. [ ] インデックスから関連するページを特定します
  5. [ ] 必要なページの要約のみをロードします
  6. [ ] チェックポイント: トークン予算内に収まっていますか?

クックブック

直接ナビゲーション

  • IF: ライブラリとトピックがわかっている場合
  • THEN: cookbook/direct-navigation.md を読んでください
  • RESULT: 特定の情報への最速パス

キーワード検索

  • IF: どのライブラリに必要なものがあるかわからない場合
  • THEN: cookbook/keyword-search.md を読んでください
  • RESULT: キーワードを照合して関連するドキュメントを見つける

複数ライブラリの収集

  • IF: タスクが複数のライブラリに関わる場合
  • THEN: cookbook/multi-library.md を読んでください
  • RESULT: 複数のソースからの統合されたコンテキスト

完全なコンテキストのロード

  • IF: 包括的な理解が必要な場合(移行、チュートリアル)
  • THEN: cookbook/full-context.md を読んでください
  • WARNING: 高いトークンコスト(5,000〜15,000トークン)

このスキルを使用するタイミング

  • 外部ライブラリを含む機能を実装する前
  • 外部依存関係からのエラーをデバッグするとき
  • ライブラリのコンテキストを必要とするサブエージェントを生成するとき
  • APIの構文または動作について不明な場合

検索パターン

パターン1:直接ナビゲーション(必要なものがわかっている場合)

ライブラリとトピックがわかっている場合:

1. @ai-docs/libraries/{library}/_index.toon
   -> 概要と common_tasks を読む

2. 一致するタスクまたはセクションを見つける
   -> ページパスをメモする

3. @ai-docs/libraries/{library}/{section}/pages/{page}.toon
   -> 注意点とパターンを含む詳細な要約を取得する

例:BAML リトライ設定が必要

1. @ai-docs/libraries/baml/_index.toon
   -> common_tasks: "Handle errors gracefully" -> guide/error-handling

2. @ai-docs/libraries/baml/guide/pages/error-handling.toon
   -> RetryPolicy 構文、タイムアウトに関する注意点

パターン2:キーワード検索(何が存在するかわからない場合)

どのライブラリまたはページかわからない場合:

1. @ai-docs/libraries/_index.toon
   -> ライブラリの説明とキーワードをスキャンする

2. ニーズをキーワードと照合する
   -> 候補ライブラリを特定する

3. 各候補について:
   -> @ai-docs/libraries/{lib}/_index.toon
   -> 関連するコンテンツが存在するかどうかを確認する

4. 最も一致するページから特定のページをロードする

例:「構造化された出力の解析」が必要

1. @ai-docs/libraries/_index.toon
   -> BAML: "Structured LLM outputs with type safety" [一致]
   -> MCP: "Tool integration protocol" [不一致]

2. @ai-docs/libraries/baml/_index.toon
   -> 確認:型システム、解析、検証

3. 関連する BAML ページをロードする

パターン3:複数ライブラリの収集(複雑なタスク)

タスクが複数のライブラリに関わる場合:

1. タスクに関わるすべてのライブラリをリストする

2. 各ライブラリについて:
   -> _index.toon をロードする
   -> 関連するページを特定する
   -> ページの要約をロードする

3. 単一のコンテキストブロックに統合する

4. OR: docs-context-gatherer エージェントを生成する

パターン4:完全なコンテキスト(深い作業)

包括的な理解が必要な場合:

@ai-docs/libraries/{library}/full-context.md

控えめに使用してください - これはすべてをロードします(〜5,000〜15,000トークン)

以下に適しています:

  • 大規模な移行
  • チュートリアルの作成
  • アーキテクチャの決定
  • 初めての深層学習

コンテキスト統合形式

複数のページからコンテキストを収集する場合は、次のように統合します。

## ドキュメントコンテキスト

### {Library}: {Topic}
**目的**: {1〜2文の目的}
**重要なポイント**:
- {コンセプト1}
- {コンセプト2}
**注意点**:
- {警告1}
- {警告2}
**パターン**:
```{language}
{最小限のコード例}

{Library}: {Another Topic}

...


ソース: {ロードされたページパスのリスト} トークン: ~{見積もり}


## 予算管理

### ファイルタイプ別のトークン見積もり

| ファイルタイプ | 一般的なサイズ |
|-----------|--------------|
| `_index.toon` (カテゴリ) | 100-150 トークン |
| `_index.toon` (ライブラリ) | 150-250 トークン |
| `_index.toon` (セクション) | 100-200 トークン |
| `pages/*.toon` | 250-450 トークン |
| `full-context.md` | 5,000-15,000 トークン |

### 予算ガイドライン

| タスクタイプ | ターゲット予算 | ロード戦略 |
|-----------|---------------|------------------|
| クイック修正 | 300-500 | 1ページの要約 |
| 単一機能 | 800-1,200 | 2〜3ページの要約 |
| 統合 | 1,500-2,500 | ライブラリインデックス + 4〜6ページ |
| 複数ライブラリ | 2,000-4,000 | 複数のライブラリインデックス + キーページ |
| 完全なコンテキスト | 5,000+ | full-context.md |

### 効率化のヒント

1. **インデックスファイルは安価なナビゲーション** - 自由に読んでください
2. **ページの要約は高シグナル** - この目的のために設計されています
3. **注意点は高価な間違いを防ぎます** - 常にロードする価値があります
4. **コードパターンはコピー&ペーストの準備ができています** - トークンあたりの価値が高い
5. **full-context.md は最後の手段** - 最初にターゲットを絞ったロードを使用してください

## 一般的な検索シナリオ

### シナリオ:機能の実装
  1. 特定: この機能はどのライブラリを使用しますか?
  2. ナビゲート: 各ライブラリで関連するページを見つけます
  3. ロード: 実装のためのページの要約

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Documentation Retrieval Skill

This skill enables efficient retrieval of documentation context from the hierarchical documentation system.

Variables

Variable Default Description
MAX_TOKENS 2000 Target token budget for context loading
LOAD_FULL_CONTEXT false Use full-context.md instead of targeted pages
LOCAL_FIRST true Check ai-docs before web search

Instructions

MANDATORY - Always check local documentation before web searches.

  • Start with _index.toon files for navigation
  • Load targeted page summaries, not full contexts
  • Consolidate multi-library context using the format below
  • Pass pre-loaded context to sub-agents

Red Flags - STOP and Reconsider

If you're about to:

  • Load full-context.md for a simple question
  • Web search without checking local docs first
  • Let sub-agents navigate from scratch instead of passing context
  • Load all libraries "just in case"

STOP -> Use targeted retrieval patterns below -> Then proceed

Workflow

  1. [ ] CHECKPOINT: Have you identified what libraries you need?
  2. [ ] Check ai-docs/libraries/_index.toon for available docs
  3. [ ] Navigate to specific library _index.toon
  4. [ ] Identify relevant pages from index
  5. [ ] Load only the page summaries you need
  6. [ ] CHECKPOINT: Are you within token budget?

Cookbook

Direct Navigation

  • IF: You know the library and topic
  • THEN: Read cookbook/direct-navigation.md
  • RESULT: Fastest path to specific information

Keyword Search

  • IF: Uncertain which library has what you need
  • THEN: Read cookbook/keyword-search.md
  • RESULT: Find relevant docs by matching keywords

Multi-Library Gathering

  • IF: Task involves multiple libraries
  • THEN: Read cookbook/multi-library.md
  • RESULT: Consolidated context from multiple sources

Full Context Loading

  • IF: Need comprehensive understanding (migrations, tutorials)
  • THEN: Read cookbook/full-context.md
  • WARNING: High token cost (5,000-15,000 tokens)

When to Use This Skill

  • Before implementing features involving external libraries
  • When debugging errors from external dependencies
  • When spawning sub-agents that need library context
  • When uncertain about API syntax or behavior

Retrieval Patterns

Pattern 1: Direct Navigation (Know What You Need)

When you know the library and topic:

1. @ai-docs/libraries/{library}/_index.toon
   -> Read overview and common_tasks

2. Find matching task or section
   -> Note the page path

3. @ai-docs/libraries/{library}/{section}/pages/{page}.toon
   -> Get detailed summary with gotchas and patterns

Example: Need BAML retry configuration

1. @ai-docs/libraries/baml/_index.toon
   -> common_tasks: "Handle errors gracefully" -> guide/error-handling

2. @ai-docs/libraries/baml/guide/pages/error-handling.toon
   -> RetryPolicy syntax, gotchas about timeouts

Pattern 2: Keyword Search (Uncertain What Exists)

When you're not sure which library or page:

1. @ai-docs/libraries/_index.toon
   -> Scan library descriptions and keywords

2. Match your need against keywords
   -> Identify candidate libraries

3. For each candidate:
   -> @ai-docs/libraries/{lib}/_index.toon
   -> Check if relevant content exists

4. Load specific pages from best match

Example: Need "structured output parsing"

1. @ai-docs/libraries/_index.toon
   -> BAML: "Structured LLM outputs with type safety" [match]
   -> MCP: "Tool integration protocol" [no match]

2. @ai-docs/libraries/baml/_index.toon
   -> Confirms: type system, parsing, validation

3. Load relevant BAML pages

Pattern 3: Multi-Library Gathering (Complex Tasks)

When task involves multiple libraries:

1. List all libraries involved in task

2. For each library:
   -> Load _index.toon
   -> Identify relevant pages
   -> Load page summaries

3. Consolidate into single context block

4. OR: Spawn docs-context-gatherer agent

Pattern 4: Full Context (Deep Work)

When you need comprehensive understanding:

@ai-docs/libraries/{library}/full-context.md

Use sparingly - this loads everything (~5,000-15,000 tokens)

Appropriate for:

  • Major migrations
  • Writing tutorials
  • Architectural decisions
  • First-time deep learning

Context Consolidation Format

When gathering context from multiple pages, consolidate as:

## Documentation Context

### {Library}: {Topic}
**Purpose**: {1-2 sentence purpose}
**Key Points**:
- {concept 1}
- {concept 2}
**Gotchas**:
- {warning 1}
- {warning 2}
**Pattern**:
```{language}
{minimal code example}

{Library}: {Another Topic}

...


Sources: {list of page paths loaded} Tokens: ~{estimate}


## Budget Management

### Token Estimates by File Type

| File Type | Typical Size |
|-----------|--------------|
| `_index.toon` (category) | 100-150 tokens |
| `_index.toon` (library) | 150-250 tokens |
| `_index.toon` (section) | 100-200 tokens |
| `pages/*.toon` | 250-450 tokens |
| `full-context.md` | 5,000-15,000 tokens |

### Budget Guidelines

| Task Type | Target Budget | Loading Strategy |
|-----------|---------------|------------------|
| Quick fix | 300-500 | 1 page summary |
| Single feature | 800-1,200 | 2-3 page summaries |
| Integration | 1,500-2,500 | Library index + 4-6 pages |
| Multi-library | 2,000-4,000 | Multiple library indexes + key pages |
| Full context | 5,000+ | full-context.md |

### Efficiency Tips

1. **Index files are cheap navigation** - Read them freely
2. **Page summaries are high-signal** - Designed for this purpose
3. **Gotchas prevent expensive mistakes** - Always worth loading
4. **Code patterns are copy-paste ready** - High value per token
5. **full-context.md is last resort** - Use targeted loading first

## Common Retrieval Scenarios

### Scenario: Implementing a Feature
  1. Identify: What libraries does this feature use?
  2. Navigate: Find relevant pages in each library
  3. Load: Page summaries for implementation guidance
  4. Note: Gotchas before writing code
  5. Proceed: Implement with context loaded

Scenario: Debugging an Error

1. Identify: Which library produced the error?
2. Search: Error-related pages in that library
3. Load: Error handling and troubleshooting pages
4. Check: Known gotchas that might explain the issue
5. Proceed: Debug with context

Scenario: Spawning Sub-Agent

1. Analyze: What docs will sub-agent need?
2. Gather: Load relevant pages NOW
3. Consolidate: Format as context block
4. Include: Add to sub-agent spawn prompt
5. Spawn: Sub-agent has pre-loaded context

Scenario: Uncertain Which Library

1. Start: @ai-docs/libraries/_index.toon
2. Scan: Library descriptions and keywords
3. Match: Find libraries relevant to your need
4. Explore: Check promising library indexes
5. Load: Pages from best matching library

Scenario: AI Tool Documentation

When you need information about AI tools (Claude Code, BAML, MCP, TOON, etc.):

1. Check local ai-docs FIRST:
   @ai-docs/libraries/claude-code/_index.toon
   @ai-docs/libraries/baml/_index.toon
   @ai-docs/libraries/toon/_index.toon

2. Navigate using same patterns as any library:
   -> Find section in _index.toon
   -> Load relevant page summaries
   -> Use full-context.md for comprehensive needs

3. Fall back to web search/fetch when:
   - Local docs don't cover the specific topic
   - Need time-sensitive info (release dates, latest versions)
   - Local docs are insufficient after checking
   - User explicitly requests current web information

Why local first:

  • Faster (no network round-trip)
  • Curated context (TOON format optimized for LLMs)
  • Gotchas pre-extracted
  • Token-efficient vs. full web pages

When to web search:

  • Topic not found after checking local index
  • Need current/live information
  • User explicitly asks for latest from web

Anti-Patterns

Don't: Load full-context.md for Simple Questions

Bad: Load 15K tokens to answer "what's the retry syntax?" Good: Navigate to specific page, load ~400 tokens

Don't: Skip Documentation

Bad: "I probably remember how this works..." Good: Take 30 seconds to load relevant page

Don't: Re-Navigate in Sub-Agents

Bad: Each sub-agent navigates from scratch Good: Parent loads context, passes to sub-agents

Don't: Load Everything "Just in Case"

Bad: Load all libraries mentioned anywhere Good: Load specific pages for specific needs

Integration with Protocol

This skill implements the retrieval portions of: .claude/ai-dev-kit/protocols/docs-management.md

Always follow the protocol's decision flow:

  1. Task Analysis -> Identify libraries
  2. Documentation Check -> Verify docs exist
  3. Context Loading -> Use this skill's patterns
  4. Execute with Context -> Proceed with task