AgentSkillsCN

rust-doc-search

辅助技能,用于搜索 Rust 文档。当代理需要从本地或在线资源中查找 crate 文档、API 使用方法、特质实现细节,或是相关示例时,可使用此技能。

SKILL.md
--- frontmatter
name: rust-doc-search
description: Helper skill for searching Rust documentation. Use when agents need to find crate docs, API usage, trait implementations, or examples from local and online sources.
context: fork
allowed-tools: [Read, Grep, Glob, Bash, WebSearch, WebFetch]
model: haiku

Rust Doc Search

Helper skill providing documentation search strategies and commands.

Local Search

bash
# Open project docs in browser
cargo doc --open --no-deps

# Search type/trait/fn in generated docs
grep -r "pub struct\|pub trait\|pub fn" target/doc/

# Find examples in project
find . -name "*.rs" -path "*/examples/*" | xargs grep -l "PATTERN"

# Check crate version
grep "CRATE_NAME" Cargo.toml

# List crate features
grep -A 20 "\[features\]" Cargo.toml

Crate Source Search

bash
# Find crate manifest path
cargo metadata --format-version 1 | jq '.packages[] | select(.name=="CRATE") | .manifest_path'

# Search in cached crate source
grep -rn "PATTERN" ~/.cargo/registry/src/*/CRATE-*/src/

Online Sources

SourceURLUse For
docs.rsdocs.rs/CRATE/VERSIONAPI docs, type signatures
crates.iocrates.io/crates/CRATEREADME, versions, links
lib.rslib.rs/crates/CRATEAlternatives, comparisons
GitHubrepo issues/examplesReal-world usage, edge cases

Search Strategy Matrix

NeedPrimaryFallback
API signaturedocs.rscargo doc
Usage exampleexamples/ folderGitHub search
Why X failsGitHub issuesweb search error message
X vs Ylib.rsblog posts
Internal details~/.cargo/registry sourceGitHub source
Trait boundscargo doc type pagedocs.rs
Feature flagsCargo.tomldocs.rs feature list