rust-navigation
Skill1 starsChanged 40 days agoMITView on GitHub
Navigate a Rust codebase with rust-analyzer over LSP instead of grepping blindly — go to definition, find references (impact before a rename), read a symbol's type/docs, find a trait's implementors, and trace a call hierarchy. Use when exploring an unfamiliar crate, locating a symbol, or assessing a change's blast radius. Triggers: where is X defined, who calls, find references, find implementations, call hierarchy, rust-analyzer, LSP.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- addressing-findingsSkill
- auditSkill
- codebase-onboardingSkill
- codex-reviewSkill
- compatibilitySkill
- debuggingSkill
- developSkill
- distributed-racesSkill
- memorySkill
- nix-dev-envSkill
- nix-flakesSkill
- nixosSkill
- nix-packagingSkill
- nix-reviewSkill
- refactoringSkill
- retroSkill
- review-initSkill
- review-rulesSkill
- rust-architecture-reviewSkill
- rust-architectureSkill
- rust-cliSkill
- rust-cloud-nativeSkill
- rust-concurrencySkill
- rust-ecosystemSkill
- rust-embeddedSkill
- rust-errorsSkill
- rust-fintechSkill
- rust-idiomsSkill
- rust-macrosSkill
- rust-mlSkill
- rust-ownershipSkill
- rust-performanceSkill
- rust-pluginsSkill
- rust-reviewSkill
- rust-securitySkill
- rust-testingSkill
- rust-traitsSkill
- rust-unsafeSkill
- rust-webSkill
- specsSkill
- sql-reviewSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Every LSP operation takes filePath, line, character (both 1-based, as shown in an editor) pointing at the symbol.
- Very specific: line 55
Impact before a rename/signature change: Run findReferences on the item *first* — that set is the blast radius.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust Navigation (LSP)
grep finds text; rust-analyzer understands the program. For "where is this defined", "who
uses this", "who implements this trait", and "who calls this", use the LSP tool — it
resolves through types, modules, generics, and re-exports that a text search gets wrong.
This is the Rust tool for navigation; the method for understanding an unfamiliar repo
(map → seams → trace one flow → confirm by building) is codebase-onboarding, which calls this.
Positions are 1-based, so locate first, then operate
Every LSP operation takes filePath, line, character (both 1-based, as shown in an editor)
pointing at the symbol. You rarely know the column up front, so it's a two-step move:
- Find the symbol by name:
LSP(operation: "workspaceSymbol", query: "parse_config", …)(pass anyfilePath/line/character— they're required but ignored for this op), or justrg -n "fn parse_config"to getfile:line. - Operate at that position, pointing
characterat the symbol name itself.
Want X → operation
| You want | Operation | Point at |
| Jump to where a symbol is defined | goToDefinition | a use site |
| Every place a symbol is used (impact of a change) | findReferences | the def or any use |
| A symbol's type + rustdoc, inline | hover | the symbol |
| The outline of one file (items, methods) | documentSymbol | anywhere in the file (e.g. 1,1) |
| Find a symbol by name across the crate | workspaceSymbol + query | n/a (use query) |
| Who implements this trait / where a trait method is implemented | goToImplementation | the trait or method name |
| Who calls this function | prepareCallHierarchy → incomingCalls | the fn name |
| What this function calls | prepareCallHierarchy → outgoingCalls | the fn name |
Call hierarchy is two steps
incomingCalls/outgoingCalls need a hierarchy item, so call prepareCallHierarchy at the
function name first, then the direction you want. Recurse to the depth you need and render it as a
tree; stop at the layer boundary (handler / trait object / spawn) rather than chasing forever.
Callers of process_request Callees of process_request
main process_request
└─ run_server ├─ parse_headers
└─ handle_connection ├─ authenticate → check_token, load_user
└─ process_request ◄ here └─ send_responseTwo high-value uses
- Impact before a rename/signature change. Run
findReferenceson the item first — that set is the blast radius. Feed it torefactoring(change under green tests, one site at a time). - "Who implements this trait?"
goToImplementationon the trait answers the dispatch question directly; pair withrust-traitswhen deciding static vsdynvs enum dispatch.
When there's no LSP
The tool errors if rust-analyzer isn't configured for the workspace. Suggest
rustup component add rust-analyzer, and meanwhile fall back to text tools — they're coarser but
always available:
| LSP op | Fallback |
goToDefinition | rg -n "(fn|struct|enum|trait|const) <name>" |
findReferences | rg -nw "<name>" (over-reports: same name, different item) |
goToImplementation | rg -n "impl .*<Trait>( for |<)" |
| call hierarchy | rg -nw "<fn>(" for callers; read the body for callees |
documentSymbol / workspaceSymbol | rg -n "^\s*(pub )?(fn|struct|enum|trait|mod) " |
Macros and generated code defeat both LSP and grep equally — verify a surprising result by reading the site.
Boundary
- The onboarding method (where to start, trace one flow) →
codebase-onboarding. - Acting on a
findReferencesset safely →refactoring. - Static vs dynamic vs enum dispatch once you've found the impls →
rust-traits. - Finding the commit that introduced a behavior (not the symbol) →
debugging(git bisect).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

