Back to Skills

rust-symbol-analyzer

verified

Analyze Rust project structure using LSP symbols. Triggers on: /symbols, project structure, list structs, list traits, list functions, 符号分析, 项目结构, 列出所有, 有哪些struct

View on GitHub

Marketplace

rust-skills

ZhangHanDong/rust-skills

Plugin

rust-skills

development

Repository

ZhangHanDong/rust-skills
550stars

skills/rust-symbol-analyzer/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/ZhangHanDong/rust-skills/blob/main/skills/rust-symbol-analyzer/SKILL.md -a claude-code --skill rust-symbol-analyzer

Installation paths:

Claude
.claude/skills/rust-symbol-analyzer/
Powered by add-skill CLI

Instructions

# Rust Symbol Analyzer

Analyze project structure by examining symbols across your Rust codebase.

## Usage

```
/rust-symbol-analyzer [file.rs] [--type struct|trait|fn|mod]
```

**Examples:**
- `/rust-symbol-analyzer` - Analyze entire project
- `/rust-symbol-analyzer src/lib.rs` - Analyze single file
- `/rust-symbol-analyzer --type trait` - List all traits in project

## LSP Operations

### 1. Document Symbols (Single File)

Get all symbols in a file with their hierarchy.

```
LSP(
  operation: "documentSymbol",
  filePath: "src/lib.rs",
  line: 1,
  character: 1
)
```

**Returns:** Nested structure of modules, structs, functions, etc.

### 2. Workspace Symbols (Entire Project)

Search for symbols across the workspace.

```
LSP(
  operation: "workspaceSymbol",
  filePath: "src/lib.rs",
  line: 1,
  character: 1
)
```

**Note:** Query is implicit in the operation context.

## Workflow

```
User: "What's the structure of this project?"
    │
    ▼
[1] Find all Rust files
    Glob("**/*.rs")
    │
    ▼
[2] Get symbols from each key file
    LSP(documentSymbol) for lib.rs, main.rs
    │
    ▼
[3] Categorize by type
    │
    ▼
[4] Generate structure visualization
```

## Output Format

### Project Overview

```
## Project Structure: my-project

### Modules
├── src/
│   ├── lib.rs (root)
│   ├── config/
│   │   ├── mod.rs
│   │   └── parser.rs
│   ├── handlers/
│   │   ├── mod.rs
│   │   ├── auth.rs
│   │   └── api.rs
│   └── models/
│       ├── mod.rs
│       ├── user.rs
│       └── order.rs
└── tests/
    └── integration.rs
```

### By Symbol Type

```
## Symbols by Type

### Structs (12)
| Name | Location | Fields | Derives |
|------|----------|--------|---------|
| Config | src/config.rs:10 | 5 | Debug, Clone |
| User | src/models/user.rs:8 | 4 | Debug, Serialize |
| Order | src/models/order.rs:15 | 6 | Debug, Serialize |
| ... | | | |

### Traits (4)
| Name | Location | Methods | Implementors |
|------|----------|---------|--------------|
| Handler | src/handlers/

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4390 chars