rust-skill-creator について
crate、Rust 標準ライブラリ、または指定されたドキュメント URL を基に、ドキュメント参照スキルを作成します。関連コマンドがあればコマンドを使い、なければ手動手順でファイルを生成します。
主な機能
- 01Rust crate 向けスキルの作成
- 02標準ライブラリ API 向けスキルの作成
- 03任意のドキュメント URL に対応
- 04SKILL.md と参照ファイルの生成
- 05コマンドまたは手動の手順
活用シーン
- 01tokio などの crate 用スキル作成
- 02Rust 標準ライブラリ型のスキル作成
- 03ドキュメント URL からスキルを作成
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ actionbook/ rust-skills --skill rust-skill-creatorインストール後、Claude Code で/rust-skill-creatorを入力して読み込まれたか確認します。
詳細
Rust Skill Creator
バージョン: 2.1.0 | 最終更新日: 2025-01-27
Rust のクレートと標準ライブラリのドキュメントに対応する動的なスキルを作成します。
使用するタイミング
このスキルは、次の対象のスキルを作成するリクエストに対応します。
- サードパーティ製クレート(tokio、serde、axum など)
- Rust 標準ライブラリ(std::sync、std::marker など)
- 任意の Rust ドキュメント URL
実行モードの判定
重要:関連するコマンド/スキルが利用可能か確認してください。
このスキルは次のコマンドに依存します。
/create-llms-for-skillsコマンド/create-skills-via-llmsコマンド
エージェントモード(プラグインをインストール済み)
上記のコマンドが利用可能な場合(プラグインを完全にインストール済み):
ワークフロー
1. 対象を特定する
| ユーザーのリクエスト | 対象の種類 | URL パターン |
|---|---|---|
| "create tokio skill" | サードパーティ製クレート | docs.rs/tokio/latest/tokio/ |
| "create Send trait skill" | 標準ライブラリ | doc.rust-lang.org/std/marker/trait.Send.html |
| "create skill from URL" + URL | カスタム URL | ユーザーが指定した URL |
2. コマンドを実行する
/create-llms-for-skills コマンドを使用します。
/create-llms-for-skills <url> [requirements]
例:
# For third-party crate
/create-llms-for-skills https://docs.rs/tokio/latest/tokio/
# For std library
/create-llms-for-skills https://doc.rust-lang.org/std/marker/trait.Send.html
# With specific requirements
/create-llms-for-skills https://docs.rs/axum/latest/axum/ "Focus on routing and extractors"
3. スキル作成を続けて行う
llms.txt が生成されたら、次を使用します。
/create-skills-via-llms <crate_name> <llms_path> [version]
インラインモード(スキルのみをインストール済み)
上記のコマンドが利用できない場合は、スキルを手動で作成します。
ステップ 1:対象を特定して URL を組み立てる
| 対象 | URL テンプレート |
|---|---|
| クレートの概要 | https://docs.rs/{crate}/latest/{crate}/ |
| クレートのモジュール | https://docs.rs/{crate}/latest/{crate}/{module}/ |
| 標準ライブラリのトレイト | https://doc.rust-lang.org/std/{module}/trait.{Name}.html |
| 標準ライブラリの構造体 | https://doc.rust-lang.org/std/{module}/struct.{Name}.html |
| 標準ライブラリのモジュール | https://doc.rust-lang.org/std/{module}/index.html |
ステップ 2:ドキュメントを取得する
# Using agent-browser CLI
agent-browser open "<documentation_url>"
agent-browser get text ".docblock"
agent-browser close
または、WebFetch をフォールバックとして使用します。
WebFetch("<documentation_url>", "Extract API documentation including types, functions, and examples")
ステップ 3:スキルディレクトリを作成する
mkdir -p ~/.claude/skills/{crate_name}
mkdir -p ~/.claude/skills/{crate_name}/references
ステップ 4:SKILL.md を生成する
次のテンプレートを使用して ~/.claude/skills/{crate_name}/SKILL.md を作成します。
---
name: {crate_name}
description: "Documentation for {crate_name} crate. Keywords: {keywords}"
---
# {Crate Name}
> **Version:** {version} | **Source:** docs.rs
## Overview
{Brief description from documentation}
## Key Types
### {Type1}
{Description and usage}
### {Type2}
{Description and usage}
## Common Patterns
{Usage patterns extracted from documentation}
## Examples
```rust
{Example code from documentation}
ドキュメント
./references/overview.md- 主な概要./references/{module}.md- モジュールのドキュメント
リンク
### Step 5: Generate Reference Files
For each major module or type, create a reference file:
```bash
# Fetch and save module documentation
agent-browser open "https://docs.rs/{crate}/latest/{crate}/{module}/"
agent-browser get text ".docblock" > ~/.claude/skills/{crate_name}/references/{module}.md
agent-browser close
ステップ 6:スキルを検証する
# Check skill structure
ls -la ~/.claude/skills/{crate_name}/
cat ~/.claude/skills/{crate_name}/SKILL.md
URL 組み立てヘルパー
| 対象 | URL テンプレート |
|---|---|
| クレートの概要 | https://docs.rs/{crate}/latest/{crate}/ |
| クレートのモジュール | https://docs.rs/{crate}/latest/{crate}/{module}/ |
| 標準ライブラリのトレイト | https://doc.rust-lang.org/std/{module}/trait.{Name}.html |
| 標準ライブラリの構造体 | https://doc.rust-lang.org/std/{module}/struct.{Name}.html |
| 標準ライブラリのモジュール | https://doc.rust-lang.org/std/{module}/index.html |
標準ライブラリでよく使われるパス
| 項目 | パス |
|---|---|
| Send、Sync、Copy、Clone | std/marker/trait.{Name}.html |
| Arc、Mutex、RwLock | std/sync/struct.{Name}.html |
| Rc、Weak | std/rc/struct.{Name}.html |
| RefCell、Cell | std/cell/struct.{Name}.html |
| Box | std/boxed/struct.Box.html |
| Vec | std/vec/struct.Vec.html |
| String | std/string/struct.String.html |
| Option | std/option/enum.Option.html |
| Result | std/result/enum.Result.html |
やり取りの例
例 1:クレートのスキルを作成する(エージェントモード)
User: "Create a dynamic skill for tokio"
Claude:
1. Identify: Third-party crate "tokio"
2. Execute: /create-llms-for-skills https://docs.rs/tokio/latest/tokio/
3. Wait for llms.txt generation
4. Execute: /create-skills-via-llms tokio ~/tmp/{timestamp}-tokio-llms.txt
例 2:クレートのスキルを作成する(インラインモード)
User: "Create a dynamic skill for tokio"
Claude:
1. Identify: Third-party crate "tokio"
2. Fetch: agent-browser open "https://docs.rs/tokio/latest/tokio/"
3. Extract documentation
4. Create: ~/.claude/skills/tokio/SKILL.md
5. Create: ~/.claude/skills/tokio/references/
6. Save reference files for key modules (sync, task, runtime, etc.)
例 3:標準ライブラリのスキルを作成する
User: "Create a skill for Send and Sync traits"
Claude:
1. Identify: Std library traits
2. (Agent Mode) Execute: /create-llms-for-skills https://doc.rust-lang.org/std/marker/trait.Send.html https://doc.rust-lang.org/std/marker/trait.Sync.html
(Inline Mode) Fetch each URL, create skill manually
3. Complete skill creation
禁止事項
- Rust 関連のスキル作成に
best-skill-creatorを使用しないでください - 検証せずにドキュメント URL を推測しないでください
- ドキュメントの取得手順を省略しないでください
出力先
生成されたスキルはすべて ~/.claude/skills/ に保存されます。
エラー処理
| エラー | 原因 | 解決策 |
|---|---|---|
| コマンドが見つからない | スキルのみのインストール | インラインモードを使用する |
| URL が見つからない | 無効なクレート/モジュール | crates.io でクレートの存在を確認する |
| ドキュメントが空 | API が変更された | 代替セレクターを使用する |
| 権限が拒否された | ディレクトリの問題 | ~/.claude/skills/ の権限を確認する |
コメント
Markdown 対応