{"slug":"rust-call-graph","title":"rust-call-graph","summary":"Visualize Rust function call graphs using LSP. Triggers on: /call-graph, call hierarchy, who calls, what calls, 调用图, 调用关系, 谁调用了, 调用了谁","platform":"Cursor","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-07T18:43:38.955215Z","repo":{"url":"https://github.com/moeru-ai/auv","stars":51,"forks":6,"license":"Apache-2.0","updatedAt":"2026-09-25T05:45:21Z"},"bodyHtml":"<hr>\n<h2>name: rust-call-graph\ndescription: \"Visualize Rust function call graphs using LSP. Triggers on: /call-graph, call hierarchy, who calls, what calls, 调用图, 调用关系, 谁调用了, 调用了谁\"\nargument-hint: \"&lt;function_name&gt; [--depth N] [--direction in|out|both]\"\nallowed-tools: [\"LSP\", \"Read\", \"Glob\"]</h2>\n<h1>Rust Call Graph</h1>\n<p>Visualize function call relationships using LSP call hierarchy.</p>\n<h2>Usage</h2>\n<pre><code>/rust-call-graph &lt;function_name&gt; [--depth N] [--direction in|out|both]\n</code></pre>\n<p><strong>Options:</strong></p>\n<ul>\n<li><code>--depth N</code>: How many levels to traverse (default: 3)</li>\n<li><code>--direction</code>: <code>in</code> (callers), <code>out</code> (callees), <code>both</code></li>\n</ul>\n<p><strong>Examples:</strong></p>\n<ul>\n<li><code>/rust-call-graph process_request</code> - Show both callers and callees</li>\n<li><code>/rust-call-graph handle_error --direction in</code> - Show only callers</li>\n<li><code>/rust-call-graph main --direction out --depth 5</code> - Deep callee analysis</li>\n</ul>\n<h2>LSP Operations</h2>\n<h3>1. Prepare Call Hierarchy</h3>\n<p>Get the call hierarchy item for a function.</p>\n<pre><code>LSP(\n  operation: \"prepareCallHierarchy\",\n  filePath: \"src/handler.rs\",\n  line: 45,\n  character: 8\n)\n</code></pre>\n<h3>2. Incoming Calls (Who calls this?)</h3>\n<pre><code>LSP(\n  operation: \"incomingCalls\",\n  filePath: \"src/handler.rs\",\n  line: 45,\n  character: 8\n)\n</code></pre>\n<h3>3. Outgoing Calls (What does this call?)</h3>\n<pre><code>LSP(\n  operation: \"outgoingCalls\",\n  filePath: \"src/handler.rs\",\n  line: 45,\n  character: 8\n)\n</code></pre>\n<h2>Workflow</h2>\n<pre><code>User: \"Show call graph for process_request\"\n    │\n    ▼\n[1] Find function location\n    LSP(workspaceSymbol) or Grep\n    │\n    ▼\n[2] Prepare call hierarchy\n    LSP(prepareCallHierarchy)\n    │\n    ▼\n[3] Get incoming calls (callers)\n    LSP(incomingCalls)\n    │\n    ▼\n[4] Get outgoing calls (callees)\n    LSP(outgoingCalls)\n    │\n    ▼\n[5] Recursively expand to depth N\n    │\n    ▼\n[6] Generate ASCII visualization\n</code></pre>\n<h2>Output Format</h2>\n<h3>Incoming Calls (Who calls this?)</h3>\n<pre><code>## Callers of `process_request`\n\nmain\n└── run_server\n    └── handle_connection\n        └── process_request  ◄── YOU ARE HERE\n</code></pre>\n<h3>Outgoing Calls (What does this call?)</h3>\n<pre><code>## Callees of `process_request`\n\nprocess_request  ◄── YOU ARE HERE\n├── parse_headers\n│   └── validate_header\n├── authenticate\n│   ├── check_token\n│   └── load_user\n├── execute_handler\n│   └── [dynamic dispatch]\n└── send_response\n    └── serialize_body\n</code></pre>\n<h3>Bidirectional (Both)</h3>\n<pre><code>## Call Graph for `process_request`\n\n                    ┌─────────────────┐\n                    │      main       │\n                    └────────┬────────┘\n                             │\n                    ┌────────▼────────┐\n                    │   run_server    │\n                    └────────┬────────┘\n                             │\n                    ┌────────▼────────┐\n                    │handle_connection│\n                    └────────┬────────┘\n                             │\n        ┌────────────────────┼────────────────────┐\n        │                    │                    │\n┌───────▼───────┐   ┌───────▼───────┐   ┌───────▼───────┐\n│ parse_headers │   │ authenticate  │   │send_response  │\n└───────────────┘   └───────┬───────┘   └───────────────┘\n                            │\n                    ┌───────┴───────┐\n                    │               │\n             ┌──────▼──────┐ ┌──────▼──────┐\n             │ check_token │ │  load_user  │\n             └─────────────┘ └─────────────┘\n</code></pre>\n<h2>Analysis Insights</h2>\n<p>After generating the call graph, provide insights:</p>\n<pre><code>## Analysis\n\n**Entry Points:** main, test_process_request\n**Leaf Functions:** validate_header, serialize_body\n**Hot Path:** main → run_server → handle_connection → process_request\n**Complexity:** 12 functions, 3 levels deep\n\n**Potential Issues:**\n- `authenticate` has high fan-out (4 callees)\n- `process_request` is called from 3 places (consider if this is intentional)\n</code></pre>\n<h2>Common Patterns</h2>\n<table>\n<thead>\n<tr>\n<th>User Says</th>\n<th>Direction</th>\n<th>Use Case</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\"Who calls X?\"</td>\n<td>incoming</td>\n<td>Impact analysis</td>\n</tr>\n<tr>\n<td>\"What does X call?\"</td>\n<td>outgoing</td>\n<td>Understanding implementation</td>\n</tr>\n<tr>\n<td>\"Show call graph\"</td>\n<td>both</td>\n<td>Full picture</td>\n</tr>\n<tr>\n<td>\"Trace from main to X\"</td>\n<td>outgoing</td>\n<td>Execution path</td>\n</tr>\n</tbody>\n</table>\n<h2>Visualization Options</h2>\n<table>\n<thead>\n<tr>\n<th>Style</th>\n<th>Best For</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Tree (default)</td>\n<td>Simple hierarchies</td>\n</tr>\n<tr>\n<td>Box diagram</td>\n<td>Complex relationships</td>\n</tr>\n<tr>\n<td>Flat list</td>\n<td>Many connections</td>\n</tr>\n<tr>\n<td>Mermaid</td>\n<td>Export to docs</td>\n</tr>\n</tbody>\n</table>\n<h3>Mermaid Export</h3>\n<pre>graph TD\n    main --&gt; run_server\n    run_server --&gt; handle_connection\n    handle_connection --&gt; process_request\n    process_request --&gt; parse_headers\n    process_request --&gt; authenticate\n    process_request --&gt; send_response\n</pre>\n<h2>Related Skills</h2>\n<table>\n<thead>\n<tr>\n<th>When</th>\n<th>See</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Find definition</td>\n<td>rust-code-navigator</td>\n</tr>\n<tr>\n<td>Project structure</td>\n<td>rust-symbol-analyzer</td>\n</tr>\n<tr>\n<td>Trait implementations</td>\n<td>rust-trait-explorer</td>\n</tr>\n<tr>\n<td>Safe refactoring</td>\n<td>rust-refactor-helper</td>\n</tr>\n</tbody>\n</table>\n","files":[{"path":"SKILL.md","sizeBytes":5625,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-07T18:44:13.4855Z","sha256":"5BB44B6F7BA94DEAD2BBFDE84B6E669A514D6E36796C0D107CCF6EF000A901BC","sizeBytes":1864},"review":null,"source":{"repositoryUrl":"https://github.com/moeru-ai/auv","path":".agents/skills/rust-call-graph","license":"Apache-2.0","commit":"f986875427f770607918bff38dec171a0ed3d040","subtreeSha":"A72AF03B7DCA6EC238F5FF481AEFB3CAAF213A9542B308892CE8ACF311F974D2","lastSyncedAt":"2026-09-25T06:49:27.585891Z"},"reviewedAt":"2026-09-07T18:51:43.040072Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/moeru-ai/auv/tree/main/.agents/skills/rust-call-graph"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install moeru-ai-auv@llmmart"},{"target":"git","command":"git clone https://github.com/moeru-ai/auv.git"}]}