rust-skill-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRust Skill Creator
Rust Skill 创建工具
Version: 2.1.0 | Last Updated: 2025-01-27Create 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:
- command
/create-llms-for-skills - command
/create-skills-via-llms
重要提示:请检查相关命令/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 Request | Target Type | URL Pattern |
|---|---|---|
| "create tokio skill" | Third-party crate | |
| "create Send trait skill" | Std library | |
| "create skill from URL" + URL | Custom URL | User-provided URL |
| 用户请求 | 目标类型 | URL模式 |
|---|---|---|
| "create tokio skill" | 第三方crate | |
| "create Send trait skill" | 标准库 | |
| "create skill from URL" + URL | 自定义URL | 用户提供的URL |
2. Execute the Command
2. 执行命令
Use the command:
/create-llms-for-skills/create-llms-for-skills <url> [requirements]Examples:
bash
undefined使用命令:
/create-llms-for-skills/create-llms-for-skills <url> [requirements]示例:
bash
undefinedFor 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
适用于标准库
/create-llms-for-skills https://doc.rust-lang.org/std/marker/trait.Send.html
/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"
undefined/create-llms-for-skills https://docs.rs/axum/latest/axum/ "Focus on routing and extractors"
undefined3. 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
| Target | URL Template |
|---|---|
| Crate overview | |
| Crate module | |
| Std trait | |
| Std struct | |
| Std module | |
| 目标 | URL模板 |
|---|---|
| Crate概览 | |
| Crate模块 | |
| 标准库trait | |
| 标准库struct | |
| 标准库模块 | |
Step 2: Fetch Documentation
步骤2:抓取文档
bash
undefinedbash
undefinedUsing 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")
undefinedagent-browser open "<documentation_url>"
agent-browser get text ".docblock"
agent-browser close
**或使用WebFetch作为备选方案:**WebFetch("<documentation_url>", "Extract API documentation including types, functions, and examples")
undefinedStep 3: Create Skill Directory
步骤3:创建Skill目录
bash
mkdir -p ~/.claude/skills/{crate_name}
mkdir -p ~/.claude/skills/{crate_name}/referencesbash
mkdir -p ~/.claude/skills/{crate_name}
mkdir -p ~/.claude/skills/{crate_name}/referencesStep 4: Generate SKILL.md
步骤4:生成SKILL.md
Create with this template:
~/.claude/skills/{crate_name}/SKILL.mdmarkdown
---
name: {crate_name}
description: "Documentation for {crate_name} crate. Keywords: {keywords}"
---使用以下模板创建文件:
~/.claude/skills/{crate_name}/SKILL.mdmarkdown
---
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
- - Main overview
./references/overview.md - - Module documentation
./references/{module}.md
- - Main overview
./references/overview.md - - Module documentation
./references/{module}.md
Links
Links
Step 5: Generate Reference Files
步骤5:生成参考文件
For each major module or type, create a reference file:
bash
undefined为每个主要模块或类型创建对应的参考文件:
bash
undefinedFetch 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
undefinedagent-browser open "https://docs.rs/{crate}/latest/{crate}/{module}/"
agent-browser get text ".docblock" > ~/.claude/skills/{crate_name}/references/{module}.md
agent-browser close
undefinedStep 6: Verify Skill
步骤6:验证Skill
bash
undefinedbash
undefinedCheck 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构建助手
| Target | URL Template |
|---|---|
| Crate overview | |
| Crate module | |
| Std trait | |
| Std struct | |
| Std module | |
| 目标 | URL模板 |
|---|---|
| Crate概览 | |
| Crate模块 | |
| 标准库trait | |
| 标准库struct | |
| 标准库模块 | |
Common Std Library Paths
常见标准库路径
| Item | Path |
|---|---|
| Send, Sync, Copy, Clone | |
| Arc, Mutex, RwLock | |
| Rc, Weak | |
| RefCell, Cell | |
| Box | |
| Vec | |
| String | |
| Option | |
| Result | |
| 条目 | 路径 |
|---|---|
| Send, Sync, Copy, Clone | |
| Arc, Mutex, RwLock | |
| Rc, Weak | |
| RefCell, Cell | |
| Box | |
| Vec | |
| String | |
| Option | |
| Result | |
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.txtUser: "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.txtExample 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 creationUser: "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 creationDO NOT
禁止操作
- Use for Rust-related skill creation
best-skill-creator - Guess documentation URLs without verification
- Skip documentation fetching step
- 不要使用创建Rust相关的skill
best-skill-creator - 不要未经验证就猜测文档URL
- 不要跳过文档抓取步骤
Output Location
输出位置
All generated skills are saved to:
~/.claude/skills/所有生成的skills都保存到:
~/.claude/skills/Error Handling
错误处理
| Error | Cause | Solution |
|---|---|---|
| Commands not found | Skills-only install | Use inline mode |
| URL not found | Invalid crate/module | Verify crate exists on crates.io |
| Empty documentation | API changed | Use alternative selectors |
| Permission denied | Directory issue | Check ~/.claude/skills/ permissions |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 命令未找到 | 仅安装了Skills | 使用内联模式 |
| URL不存在 | 无效的crate/模块 | 在crates.io上验证crate是否存在 |
| 文档内容为空 | API已变更 | 使用其他选择器 |
| 权限不足 | 目录问题 | 检查 |