rust-skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rust Skill Creator

Rust Skill 创建工具

Version: 2.1.0 | Last Updated: 2025-01-27
Create dynamic skills for Rust crates and std library documentation.
版本: 2.1.0 | 最后更新: 2025-01-27
用于为Rust crates和标准库文档创建动态skills。

When to Use

适用场景

This skill handles requests to create skills for:
  • Third-party crates (tokio, serde, axum, etc.)
  • Rust standard library (std::sync, std::marker, etc.)
  • Any Rust documentation URL
本skill用于处理以下场景的skill创建请求:
  • 第三方crates(tokio、serde、axum等)
  • Rust标准库(std::sync、std::marker等)
  • 任意Rust文档URL

Execution Mode Detection

执行模式检测

CRITICAL: Check if related commands/skills are available.
This skill relies on:
  • /create-llms-for-skills
    command
  • /create-skills-via-llms
    command

重要提示:请检查相关命令/skills是否可用。
本skill依赖以下命令:
  • /create-llms-for-skills
    命令
  • /create-skills-via-llms
    命令

Agent Mode (Plugin Install)

Agent模式(完整插件安装)

When the commands above are available (full plugin installation):
当上述命令可用时(已完整安装插件):

Workflow

工作流程

1. Identify the Target

1. 确定目标

User RequestTarget TypeURL Pattern
"create tokio skill"Third-party crate
docs.rs/tokio/latest/tokio/
"create Send trait skill"Std library
doc.rust-lang.org/std/marker/trait.Send.html
"create skill from URL" + URLCustom URLUser-provided URL
用户请求目标类型URL模式
"create tokio skill"第三方crate
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. Execute the Command

2. 执行命令

Use the
/create-llms-for-skills
command:
/create-llms-for-skills <url> [requirements]
Examples:
bash
undefined
使用
/create-llms-for-skills
命令:
/create-llms-for-skills <url> [requirements]
示例:
bash
undefined

For third-party crate

适用于第三方crate

/create-llms-for-skills https://docs.rs/tokio/latest/tokio/
/create-llms-for-skills https://docs.rs/tokio/latest/tokio/

For std library

适用于标准库

With specific requirements

带自定义需求

/create-llms-for-skills https://docs.rs/axum/latest/axum/ "Focus on routing and extractors"
undefined
/create-llms-for-skills https://docs.rs/axum/latest/axum/ "Focus on routing and extractors"
undefined

3. Follow-up with Skill Creation

3. 后续创建Skill

After llms.txt is generated, use:
/create-skills-via-llms <crate_name> <llms_path> [version]

生成llms.txt后,使用以下命令:
/create-skills-via-llms <crate_name> <llms_path> [version]

Inline Mode (Skills-only Install)

内联模式(仅安装Skills)

When the commands above are NOT available, create skills manually:
当上述命令不可用时,请手动创建skills:

Step 1: Identify Target and Construct URL

步骤1:确定目标并构建URL

TargetURL Template
Crate overview
https://docs.rs/{crate}/latest/{crate}/
Crate module
https://docs.rs/{crate}/latest/{crate}/{module}/
Std trait
https://doc.rust-lang.org/std/{module}/trait.{Name}.html
Std struct
https://doc.rust-lang.org/std/{module}/struct.{Name}.html
Std module
https://doc.rust-lang.org/std/{module}/index.html
目标URL模板
Crate概览
https://docs.rs/{crate}/latest/{crate}/
Crate模块
https://docs.rs/{crate}/latest/{crate}/{module}/
标准库trait
https://doc.rust-lang.org/std/{module}/trait.{Name}.html
标准库struct
https://doc.rust-lang.org/std/{module}/struct.{Name}.html
标准库模块
https://doc.rust-lang.org/std/{module}/index.html

Step 2: Fetch Documentation

步骤2:抓取文档

bash
undefined
bash
undefined

Using agent-browser CLI

使用agent-browser CLI

agent-browser open "<documentation_url>" agent-browser get text ".docblock" agent-browser close

**Or with WebFetch fallback:**
WebFetch("<documentation_url>", "Extract API documentation including types, functions, and examples")
undefined
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")
undefined

Step 3: Create Skill Directory

步骤3:创建Skill目录

bash
mkdir -p ~/.claude/skills/{crate_name}
mkdir -p ~/.claude/skills/{crate_name}/references
bash
mkdir -p ~/.claude/skills/{crate_name}
mkdir -p ~/.claude/skills/{crate_name}/references

Step 4: Generate SKILL.md

步骤4:生成SKILL.md

Create
~/.claude/skills/{crate_name}/SKILL.md
with this template:
markdown
---
name: {crate_name}
description: "Documentation for {crate_name} crate. Keywords: {keywords}"
---
使用以下模板创建
~/.claude/skills/{crate_name}/SKILL.md
文件:
markdown
---
name: {crate_name}
description: "Documentation for {crate_name} crate. Keywords: {keywords}"
---

{Crate Name}

{Crate Name}

Version: {version} | Source: docs.rs
Version: {version} | Source: docs.rs

Overview

Overview

{Brief description from documentation}
{Brief description from documentation}

Key Types

Key Types

{Type1}

{Type1}

{Description and usage}
{Description and usage}

{Type2}

{Type2}

{Description and usage}
{Description and usage}

Common Patterns

Common Patterns

{Usage patterns extracted from documentation}
{Usage patterns extracted from documentation}

Examples

Examples

rust
{Example code from documentation}
rust
{Example code from documentation}

Documentation

Documentation

  • ./references/overview.md
    - Main overview
  • ./references/{module}.md
    - Module documentation
  • ./references/overview.md
    - Main overview
  • ./references/{module}.md
    - Module documentation

Links

Links

undefined
undefined

Step 5: Generate Reference Files

步骤5:生成参考文件

For each major module or type, create a reference file:
bash
undefined
为每个主要模块或类型创建对应的参考文件:
bash
undefined

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
undefined
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
undefined

Step 6: Verify Skill

步骤6:验证Skill

bash
undefined
bash
undefined

Check skill structure

检查skill结构

ls -la ~/.claude/skills/{crate_name}/ cat ~/.claude/skills/{crate_name}/SKILL.md

---
ls -la ~/.claude/skills/{crate_name}/ cat ~/.claude/skills/{crate_name}/SKILL.md

---

URL Construction Helper

URL构建助手

TargetURL Template
Crate overview
https://docs.rs/{crate}/latest/{crate}/
Crate module
https://docs.rs/{crate}/latest/{crate}/{module}/
Std trait
https://doc.rust-lang.org/std/{module}/trait.{Name}.html
Std struct
https://doc.rust-lang.org/std/{module}/struct.{Name}.html
Std module
https://doc.rust-lang.org/std/{module}/index.html
目标URL模板
Crate概览
https://docs.rs/{crate}/latest/{crate}/
Crate模块
https://docs.rs/{crate}/latest/{crate}/{module}/
标准库trait
https://doc.rust-lang.org/std/{module}/trait.{Name}.html
标准库struct
https://doc.rust-lang.org/std/{module}/struct.{Name}.html
标准库模块
https://doc.rust-lang.org/std/{module}/index.html

Common Std Library Paths

常见标准库路径

ItemPath
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

条目路径
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

Example Interactions

交互示例

Example 1: Create Crate Skill (Agent Mode)

示例1:创建Crate Skill(Agent模式)

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
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

Example 2: Create Crate Skill (Inline Mode)

示例2:创建Crate Skill(内联模式)

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.)
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.)

Example 3: Create Std Library Skill

示例3:创建标准库Skill

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

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

DO NOT

禁止操作

  • Use
    best-skill-creator
    for Rust-related skill creation
  • Guess documentation URLs without verification
  • Skip documentation fetching step
  • 不要使用
    best-skill-creator
    创建Rust相关的skill
  • 不要未经验证就猜测文档URL
  • 不要跳过文档抓取步骤

Output Location

输出位置

All generated skills are saved to:
~/.claude/skills/
所有生成的skills都保存到:
~/.claude/skills/

Error Handling

错误处理

ErrorCauseSolution
Commands not foundSkills-only installUse inline mode
URL not foundInvalid crate/moduleVerify crate exists on crates.io
Empty documentationAPI changedUse alternative selectors
Permission deniedDirectory issueCheck ~/.claude/skills/ permissions
错误原因解决方案
命令未找到仅安装了Skills使用内联模式
URL不存在无效的crate/模块在crates.io上验证crate是否存在
文档内容为空API已变更使用其他选择器
权限不足目录问题检查
~/.claude/skills/
目录的权限