rust-code-navigator
RustのコードをLSP(Language Server Protocol)を使って効率的に分析し、定義へのジャンプや参照箇所の検索などを簡単に行えるようにすることで、開発者のコーディング作業を強力に支援するSkill。
📜 元の英語説明(参考)
Navigate Rust code using LSP. Triggers on: /navigate, go to definition, find references, where is defined, 跳转定义, 查找引用, 定义在哪, 谁用了这个
🇯🇵 日本人クリエイター向け解説
RustのコードをLSP(Language Server Protocol)を使って効率的に分析し、定義へのジャンプや参照箇所の検索などを簡単に行えるようにすることで、開発者のコーディング作業を強力に支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o rust-code-navigator.zip https://jpskill.com/download/9276.zip && unzip -o rust-code-navigator.zip && rm rust-code-navigator.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9276.zip -OutFile "$d\rust-code-navigator.zip"; Expand-Archive "$d\rust-code-navigator.zip" -DestinationPath $d -Force; ri "$d\rust-code-navigator.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
rust-code-navigator.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
rust-code-navigatorフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Rust Code Navigator
Language Server Protocol を使用して、大規模な Rust コードベースを効率的にナビゲートします。
使用法
/rust-code-navigator <symbol> [in file.rs:line]
例:
/rust-code-navigator parse_config- parse_config の定義を検索します/rust-code-navigator MyStruct in src/lib.rs:42- 特定の場所からナビゲートします
LSP 操作
1. 定義へ移動
シンボルが定義されている場所を検索します。
LSP(
operation: "goToDefinition",
filePath: "src/main.rs",
line: 25,
character: 10
)
使用時:
- ユーザーが「X はどこで定義されていますか?」と尋ねた場合
- ユーザーが型/関数を理解したい場合
- Ctrl+クリックの代替
2. 参照の検索
シンボルのすべての使用箇所を検索します。
LSP(
operation: "findReferences",
filePath: "src/lib.rs",
line: 15,
character: 8
)
使用時:
- ユーザーが「誰が X を使用していますか?」と尋ねた場合
- リファクタリング/名前変更の前
- 変更の影響を理解する
3. ホバー情報
シンボルの型とドキュメントを取得します。
LSP(
operation: "hover",
filePath: "src/main.rs",
line: 30,
character: 15
)
使用時:
- ユーザーが「X の型は何ですか?」と尋ねた場合
- ユーザーがドキュメントを必要とする場合
- 簡単な型チェック
ワークフロー
User: "Config 構造体はどこで定義されていますか?"
│
▼
[1] ワークスペースで "Config" を検索
LSP(operation: "workspaceSymbol", ...)
│
▼
[2] 複数の結果がある場合は、ユーザーに明確化を求めます
│
▼
[3] 定義へ移動
LSP(operation: "goToDefinition", ...)
│
▼
[4] ファイルパスとコンテキストを表示
コンテキストのために周囲のコードを読みます
出力形式
定義が見つかりました
## Config (struct)
**定義場所:** `src/config.rs:15`
```rust
#[derive(Debug, Clone)]
pub struct Config {
pub name: String,
pub port: u16,
pub debug: bool,
}
```
**ドキュメント:** アプリケーションサーバーの設定。
参照が見つかりました
## `Config` への参照 (5 件)
| 場所 | コンテキスト |
|----------|---------|
| src/main.rs:10 | `let config = Config::load()?;` |
| src/server.rs:25 | `fn new(config: Config) -> Self` |
| src/server.rs:42 | `self.config.port` |
| src/tests.rs:15 | `Config::default()` |
| src/cli.rs:8 | `config: Option<Config>` |
一般的なパターン
| ユーザーの発言 | LSP 操作 |
|---|---|
| 「X はどこで定義されていますか?」 | goToDefinition |
| 「誰が X を使用していますか?」 | findReferences |
| 「X の型は何ですか?」 | hover |
| 「すべての構造体を検索」 | workspaceSymbol |
| 「このファイルには何がありますか?」 | documentSymbol |
エラー処理
| エラー | 原因 | 解決策 |
|---|---|---|
| 「LSP サーバーがありません」 | rust-analyzer が実行されていません | 提案: rustup component add rust-analyzer |
| 「シンボルが見つかりません」 | タイプミスまたはスコープ外 | まず workspaceSymbol で検索してください |
| 「複数の定義」 | ジェネリクスまたはマクロ | すべて表示してユーザーに選択させます |
関連スキル
| いつ | 参照 |
|---|---|
| 呼び出し関係 | rust-call-graph |
| プロジェクト構造 | rust-symbol-analyzer |
| トレイトの実装 | rust-trait-explorer |
| 安全なリファクタリング | rust-refactor-helper |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Rust Code Navigator
Navigate large Rust codebases efficiently using Language Server Protocol.
Usage
/rust-code-navigator <symbol> [in file.rs:line]
Examples:
/rust-code-navigator parse_config- Find definition of parse_config/rust-code-navigator MyStruct in src/lib.rs:42- Navigate from specific location
LSP Operations
1. Go to Definition
Find where a symbol is defined.
LSP(
operation: "goToDefinition",
filePath: "src/main.rs",
line: 25,
character: 10
)
Use when:
- User asks "where is X defined?"
- User wants to understand a type/function
- Ctrl+click equivalent
2. Find References
Find all usages of a symbol.
LSP(
operation: "findReferences",
filePath: "src/lib.rs",
line: 15,
character: 8
)
Use when:
- User asks "who uses X?"
- Before refactoring/renaming
- Understanding impact of changes
3. Hover Information
Get type and documentation for a symbol.
LSP(
operation: "hover",
filePath: "src/main.rs",
line: 30,
character: 15
)
Use when:
- User asks "what type is X?"
- User wants documentation
- Quick type checking
Workflow
User: "Where is the Config struct defined?"
│
▼
[1] Search for "Config" in workspace
LSP(operation: "workspaceSymbol", ...)
│
▼
[2] If multiple results, ask user to clarify
│
▼
[3] Go to definition
LSP(operation: "goToDefinition", ...)
│
▼
[4] Show file path and context
Read surrounding code for context
Output Format
Definition Found
## Config (struct)
**Defined in:** `src/config.rs:15`
```rust
#[derive(Debug, Clone)]
pub struct Config {
pub name: String,
pub port: u16,
pub debug: bool,
}
```
**Documentation:** Configuration for the application server.
References Found
## References to `Config` (5 found)
| Location | Context |
|----------|---------|
| src/main.rs:10 | `let config = Config::load()?;` |
| src/server.rs:25 | `fn new(config: Config) -> Self` |
| src/server.rs:42 | `self.config.port` |
| src/tests.rs:15 | `Config::default()` |
| src/cli.rs:8 | `config: Option<Config>` |
Common Patterns
| User Says | LSP Operation |
|---|---|
| "Where is X defined?" | goToDefinition |
| "Who uses X?" | findReferences |
| "What type is X?" | hover |
| "Find all structs" | workspaceSymbol |
| "What's in this file?" | documentSymbol |
Error Handling
| Error | Cause | Solution |
|---|---|---|
| "No LSP server" | rust-analyzer not running | Suggest: rustup component add rust-analyzer |
| "Symbol not found" | Typo or not in scope | Search with workspaceSymbol first |
| "Multiple definitions" | Generics or macros | Show all and let user choose |
Related Skills
| When | See |
|---|---|
| Call relationships | rust-call-graph |
| Project structure | rust-symbol-analyzer |
| Trait implementations | rust-trait-explorer |
| Safe refactoring | rust-refactor-helper |