mcpField
L
learn

learn

github.com/agent-sh生産性1.0k110 回インストール今日更新
リポジトリ

learn について

learnは、オンライン資料を集め、テーマを学習ガイドにまとめるリサーチスキルです。索引と出典メタデータも作成し、簡易・中程度・詳細の調査範囲を選べます。

主な機能

  1. 01オンライン資料によるテーマ調査
  2. 02設定による調査範囲の調整
  3. 03出典の評価と選定
  4. 04構造化された学習ガイドの作成
  5. 05テーマ索引と出典メタデータの生成

活用シーン

  1. 01新しいテーマの学習ガイド作成
  2. 02調査テーマの資料収集と整理
  3. 03後から参照するテーマ索引の管理

インストール

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

$npx skills add https://github.com/agent-sh/agentsys --skill learn

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

詳細

学習

オンラインのリソースを収集してあらゆるトピックを調査し、RAG に最適化されたインデックスを備えた包括的な学習ガイドを作成します。

引数の解析

const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const depth = args.find(a => a.startsWith('--depth='))?.split('=')[1] || 'medium';
const topic = args.filter(a => !a.startsWith('--')).join(' ');

入力

引数:<topic> [--depth=brief|medium|deep]

  • topic:調査対象(必須)
  • --depth:情報源の収集範囲
    • brief:10 件の情報源(簡単な概要)
    • medium:20 件の情報源(デフォルト、バランス重視)
    • deep:40 件の情報源(包括的)

調査方法

以下のベストプラクティスに基づいています。

  • Anthropic のコンテキストエンジニアリング
  • DeepLearning.AI のツール使用パターン
  • Anara の AI 文献レビュー
1. 段階的なクエリアーキテクチャ

長いクエリリストによるノイズを避けるため、絞り込む方法を使用します。

広範な段階(全体像の把握):

"{topic} overview introduction"
"{topic} documentation official"

焦点を絞る段階(中核となる内容):

"{topic} best practices"
"{topic} examples tutorial"
"{topic} site:stackoverflow.com"

深掘り段階(上級向け、depth=deep の場合):

"{topic} advanced techniques"
"{topic} pitfalls mistakes avoid"
"{topic} 2025 2026 latest"
2. 情報源の品質スコアリング

多面的な評価(最高スコア:100):

要素重み最大値基準
権威性3x30公式ドキュメント(10)、著名な専門家(8)、定評あるサイト(6)、ブログ(4)、その他(2)
新しさ2x206 か月未満(10)、1 年未満(8)、2 年未満(6)、3 年未満(4)、それ以前(2)
詳細度2x20包括的(10)、詳細(8)、概要(6)、表面的(4)、断片的(2)
例2x20コード例が複数(10)、例が 1 つ(6)、例なし(2)
独自性1x10独自の視点(10)、一部重複(6)、内容が重複(2)

選定の基準:スコア上位 N 件の情報源(N = depth の目標件数)

3. ジャストインタイム検索

コンテンツをすべて事前に読み込まないでください(コンテキストの劣化を招きます)。

  1. まず WebSearch で URL を収集します
  2. メタデータ(タイトル、説明、URL)に基づいてスコアを付けます
  3. 選定した情報源のみを WebFetch で取得します
  4. 全文ではなく、要約を抽出します
4. コンテンツ抽出のガイドライン

各情報源から以下を抽出します。

{
  "url": "https://...",
  "title": "Article Title",
  "qualityScore": 85,
  "scores": {
    "authority": 9,
    "recency": 8,
    "depth": 7,
    "examples": 9,
    "uniqueness": 6
  },
  "keyInsights": [
    "Concise insight 1",
    "Concise insight 2"
  ],
  "codeExamples": [
    {
      "language": "javascript",
      "description": "Basic usage pattern"
    }
  ],
  "extractedAt": "2026-02-05T12:00:00Z"
}

著作権の遵守:要約と知見のみを記載し、段落をそのまま転載しないでください。

出力構成

トピックガイドのテンプレート

agent-knowledge/{slug}.md を作成します。

# Learning Guide: {Topic}

**Generated**: {date}
**Sources**: {count} resources analyzed
**Depth**: {brief|medium|deep}

## Prerequisites

What you should know before diving in:
- Prerequisite 1
- Prerequisite 2

## TL;DR

Essential points in 3-5 bullets:
- Key point 1
- Key point 2
- Key point 3

## Core Concepts

### {Concept 1}

{Synthesized explanation from multiple sources}

**Key insight**: {Most important takeaway}

### {Concept 2}

{Synthesized explanation}

## Code Examples

### Basic Example

```{language}
// Description of what this demonstrates
{code}
高度なパターン
{code}

よくある落とし穴

落とし穴発生する理由回避方法
問題 1根本原因防止策

ベストプラクティス

{n} 件の情報源からまとめた内容:

  1. プラクティス 1:説明
  2. プラクティス 2:説明

さらに読む

リソース種類推奨する理由
タイトル公式ドキュメント権威ある参考資料
タイトルチュートリアル手順ごとのガイド

/learn により {count} 件の情報源から生成されました。 全情報源のメタデータについては resources/{slug}-sources.json を参照してください。


### Master Index Template

Create/update `agent-knowledge/CLAUDE.md`:

```markdown
# Agent Knowledge Base

> Learning guides created by /learn. Reference these when answering questions about listed topics.

## Available Topics

| Topic | File | Sources | Depth | Created |
|-------|------|---------|-------|---------|
| {Topic 1} | {slug1}.md | {n} | medium | 2026-02-05 |
| {Topic 2} | {slug2}.md | {n} | deep | 2026-02-04 |

## Trigger Phrases

Use this knowledge when user asks about:
- "How does {topic1} work?" → {slug1}.md
- "Explain {topic1}" → {slug1}.md
- "{Topic2} best practices" → {slug2}.md

## Quick Lookup

| Keyword | Guide |
|---------|-------|
| recursion | recursion.md |
| hooks, react | react-hooks.md |

## How to Use

1. Check if user question matches a topic
2. Read the relevant guide file
3. Answer based on synthesized knowledge
4. Cite the guide if user asks for sources

OpenCode/Codex 用に agent-knowledge/AGENTS.md にコピーします。

情報源のメタデータ

agent-knowledge/resources/{slug}-sources.json を作成します。

{
  "topic": "{original topic}",
  "slug": "{slug}",
  "generated": "2026-02-05T12:00:00Z",
  "depth": "medium",
  "totalSources": 20,
  "sources": [
    {
      "url": "https://...",
      "title": "...",
      "qualityScore": 85,
      "scores": {
        "authority": 9,
        "recency": 8,
        "depth": 7,
        "examples": 9,
        "uniqueness": 6
      },
      "keyInsights": ["..."]
    }
  ]
}

自己評価チェックリスト

確定する前に、出力を評価します(1~10)。

指標質問目標
網羅性ガイドは主要な側面を網羅していますか?≥7
多様性情報源は多様な種類から選ばれていますか?≥6
例コード例は実用的ですか?≥7
正確性内容の正確性にどの程度自信がありますか?≥8

不足点を明示:取り上げられていない重要なサブトピックがあれば記載します。

拡張機能の連携

enhance=true の場合、ガイドの作成後に実行します。

// Enhance the topic guide for RAG
Skill({ name: 'enhance-docs', args: `agent-knowledge/${slug}.md --ai` });

// Enhance the master index
Skill({ name: 'enhance-prompts', args: 'agent-knowledge/CLAUDE.md' });

出力形式

マーカーで囲んだ構造化 JSON を返します。

=== LEARN_RESULT ===
{
  "topic": "recursion",
  "slug": "recursion",
  "depth": "medium",
  "guideFile": "agent-knowledge/recursion.md",
  "sourcesFile": "agent-knowledge/resources/recursion-sources.json",
  "sourceCount": 20,
  "sourceBreakdown": {
    "officialDocs": 4,
    "tutorials": 5,
    "stackOverflow": 3,
    "blogPosts": 5,
    "github": 3
  },
  "selfEvaluation": {
    "coverage": 8,
    "diversity": 7,
    "examples": 9,
    "accuracy": 8,
    "gaps": ["tail recursion optimization not covered"]
  },
  "enhanced": true,
  "indexUpdated": true
}
=== END_RESULT ===

エラー処理

エラー対処
WebSearch が失敗より簡単なクエリで再試行
WebFetch がタイムアウト情報源をスキップし、メタデータに記録
見つかった情報源が <minSourcesユーザーに警告し、利用可能な情報源で続行
拡張機能の実行に失敗スキップし、出力に記録
インデックスが存在しない新しいインデックスを作成

トークン予算

フェーズごとの推定トークン使用量:

フェーズトークン数備考
WebSearch のクエリ~2,0005~8 件のクエリ
ソースのスコアリング~1,000メタデータのみ
WebFetch による抽出~40,00020 件のソース × 平均 2,000
統合~10,000ガイドの生成
強化~5,0002 回のスキル呼び出し
合計~60,000opus の予算内

統合

このスキルは次によって呼び出されます:

  • /learn コマンドのための learn-agent
  • その他の調査指向エージェントから呼び出される可能性があります

コメント