skills/lib-docs-generator/SKILL.md
Generates skills from library documentation automatically. Use when creating a skill from external documentation, fetching docs to local storage, or crawling documentation with curl. Can also be invoked directly with "ライブラリドキュメント", "/lib-docs-generator".
npx skillsauth add 884js/agent-skills lib-docs-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ライブラリのドキュメントからスキルを自動生成する。
方針:
┌─────────────────────────────────────────────────┐
│ Phase 1: URL解析 │
├─────────────────────────────────────────────────┤
│ 1. /llms.txt を確認 │
│ ├── あり → curlでダウンロード │
│ │ (llms-full.txtは無視) │
│ │ → Phase 4 へ │
│ └── なし → Phase 1.5 へ │
└─────────────────────────────────────────────────┘
↓ (llms.txtなし)
┌─────────────────────────────────────────────────┐
│ Phase 1.5: URL収集 + ユーザー確認 │
├─────────────────────────────────────────────────┤
│ - サイトマップ/ナビゲーションからURL収集 │
│ - 収集URLリストを提示 │
│ - ユーザー承認を待つ │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ Phase 2: ドキュメント収集 │
├─────────────────────────────────────────────────┤
│ - 各URLをWebFetchで取得 │
│ - タイトル + 概要 + コード例 + API情報を抽出 │
│ - カテゴリ分け │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ Phase 3: docs.md生成 │
├─────────────────────────────────────────────────┤
│ - template.mdを参照 │
│ - 詳細形式で整形(概要+コード例+API情報) │
│ - 品質チェックリストを確認 │
│ - references/docs.mdとして保存 │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ Phase 4: SKILL.md生成 │
├─────────────────────────────────────────────────┤
│ - スキルディレクトリ作成 │
│ - SKILL.md生成(WebFetch都度取得方式) │
└─────────────────────────────────────────────────┘
/llms.txt をWebFetchで確認
WebFetch(url="https://example.com/llms.txt", prompt="Check if this is a valid llms.txt file")
存在する場合:
docs.md として保存(llms.md は作らない)mkdir -p .claude/skills/{library}/references
curl -s https://example.com/llms.txt -o .claude/skills/{library}/references/docs.md
存在しない場合:
| サイト | llms.txt URL |
|--------|--------------|
| Expo | https://docs.expo.dev/llms.txt |
| Vercel | https://vercel.com/llms.txt |
| Tamagui | https://tamagui.dev/llms.txt |
| その他 | /llms.txt を確認 |
llms.txtがない場合のみ実行
サイトマップ確認:
curl -s https://example.com/sitemap.xml -o sitemap.xml
ナビゲーション解析:
WebFetch(
url="https://example.com/docs",
prompt="Extract all documentation page URLs from the navigation/sidebar. Return as a list of URLs."
)
収集したURLリストを提示し、承認を待つ:
以下のURLを収集対象として検出しました:
Getting Started:
- https://example.com/docs/getting-started
- https://example.com/docs/installation
API Reference:
- https://example.com/docs/api/hooks
- https://example.com/docs/api/components
...
このリストで収集を開始してよろしいですか?
除外したいURLや追加したいURLがあれば教えてください。
目的: 各URLから包括的な情報を抽出(概要、コード例、API情報を含む)
各URLから以下を抽出:
基本情報
主要コンテンツ
コード例
API情報(APIリファレンスページの場合)
WebFetch(
url="[URL]",
prompt="Extract the following from this documentation page:
1. Page title
2. Brief description (1-2 sentences)
3. Main content summary (key points as bullet list)
4. First code example with imports
5. API signatures if present (function name, parameters, return type)
Format as structured markdown."
)
ページ数が多い場合はTaskエージェントを並列起動:
Task(subagent_type="Explore", prompt="以下のURLから詳細情報を抽出: [URLリストA]")
Task(subagent_type="Explore", prompt="以下のURLから詳細情報を抽出: [URLリストB]")
URLパターンで自動分類:
| パターン | カテゴリ |
|----------|----------|
| /getting-started, /quickstart, /intro | Getting Started |
| /installation, /setup | Getting Started |
| /api, /reference | API Reference |
| /concepts, /fundamentals | Core Concepts |
| /guides, /how-to | Guides |
| /examples, /tutorials | Examples |
| /advanced, /configuration | Optional |
収集情報の整理
カテゴリ分類
構造化
品質チェック
保存
references/docs.md として保存templates/docs.md を参照して、詳細な出力形式で整形する。
# {Library}
> {ライブラリの概要を1-2文で}
## Getting Started
### Installation
- **URL**: https://...
- **概要**: インストール方法
- **手順**:
- npm install {package}
- 設定ファイルの作成
### Quick Start
- **URL**: https://...
- **概要**: 基本的な使い方
- **コード例**:
```tsx
import { useQuery } from '@tanstack/react-query'
function Example() {
const { data } = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })
}
useQuery(options: UseQueryOptions): UseQueryResultqueryKey: クエリの一意識別子queryFn: データ取得関数const { data, isLoading, error } = useQuery({
queryKey: ['user', userId],
queryFn: () => fetchUser(userId),
})
### 品質チェックリスト
生成後、以下を確認:
- [ ] **必須セクション**: Library名、Description、Getting Started が含まれている
- [ ] **URL検証**: 全URLがアクセス可能
- [ ] **コード例**: 主要機能にコード例がある
- [ ] **API情報**: API Referenceページにはシグネチャがある
- [ ] **重複なし**: 同じ内容が複数回出現していない
- [ ] **網羅性**: 主要なドキュメントページが含まれている
### 良い例・悪い例
**良い例:**
```markdown
### useQuery
- **URL**: https://tanstack.com/query/latest/docs/react/reference/useQuery
- **概要**: サーバーからのデータ取得・キャッシュ・再検証を行うフック
- **シグネチャ**: `useQuery(options): UseQueryResult`
- **主要パラメータ**:
- `queryKey: QueryKey` - クエリの一意識別子
- `queryFn: QueryFunction` - データ取得関数
- **コード例**:
```tsx
const { data, isLoading } = useQuery({
queryKey: ['todos'],
queryFn: fetchTodos,
})
**悪い例:**
```markdown
- [useQuery](URL): フック
# references/docs.md として保存
Write to: .claude/skills/{library}/references/docs.md
{library}/
├── SKILL.md # メインスキルファイル
└── references/
└── docs.md # llms.txt形式(リンク集 + 概要)
templates/skill.md を参照して、SKILL.mdを生成する。
プレースホルダーを実際の値に置き換える:
{library}: スキル名(小文字、ハイフン区切り){Library}: ライブラリの表示名{package-name}: メインパッケージ名{日本語キーワード}: 日本語での呼び出しキーワードルール:
トリガー条件を含める:
imports "package-name"any "@tanstack/*" packagesasks about {Library}良い例:
description: |
Provides documentation for TanStack Query (React Query).
Use when working with code that imports "useQuery", "useMutation", "@tanstack/react-query", or any "@tanstack/query-*" packages.
Use when the user asks about data fetching, caching, or shows code with React Query hooks.
Can also be invoked directly with "React Query", "TanStack Query", "データフェッチ".
スキル発動時:
1. references/docs.md を読む
2. 質問に関連するセクション/URLを特定
3. WebFetchで該当URLの詳細を取得
4. 回答を生成
メリット:
技術的な詳細は crawling-guide.md を参照。
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
testing
QAテストレベルを判定するスキル。ストーリー説明文、コード差分、対話形式を組み合わせて総合的にリスクを評価し、適切なQAレベルを提案する。 以下の場面で使用: - PRのQAレベルを判定したい時 - テスト実施者・ダブルチェックの必要性を判断したい時 - テスト観点レビューのレベルを決めたい時 「QA判定」「テストレベル」「リスク評価」などでも呼び出し可能。
development
# SKILL.md生成用テンプレート SKILL.mdを生成する際に、このテンプレートを参照する。 ## テンプレート ```yaml --- name: {library} description: | **IMPORTANT: Always execute this skill before answering questions about these libraries.** Provides documentation for {Library}. Use when working with code that imports "{package-name}", "{related-exports}", or any "{package-prefix}-*" packages. Use when the user asks about {Library} or shows code with {Library} imports. Can also be invoked directly with "{Library}", "{日本語キーワード}".
development
Generates project-libs skill from all project dependencies automatically. Use when creating documentation skills for all libraries in a project, or when the user wants to set up library documentation for the current project. Can also be invoked directly with "index-lib-docs", "ライブラリドキュメント生成", "依存関係ドキュメント".