agentleFS
meyverickmeyverick/agentic/skills/pi-lens-lsp-navigation/SKILL.md

pi-lens-lsp-navigation

Skill0 starsChanged 15 days agoISCView on GitHub

Navigate code with IDE features and run proactive LSP diagnostics on files/folders/batches. Use as PRIMARY for code intelligence and type/error checks.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 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.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use lsp_navigation as PRIMARY for code intelligence.

    line 8
  2. Very specific:

    If lsp_navigation is not among the aggregate's actions, do not call the standalone name: use the host's structural search funnel …

    line 15
  3. Very specific:

    Use lens_diagnostics with source=lsp before builds/tests or after touching several files:

    line 19
  4. Very specific:

    Prefer explicit paths batches after multi-file edits — bounded concurrency, no unrelated directory noise.

    line 29
  5. Very specific:

    workspaceSymbol empty?: Always pass path. Unscoped queries are best-effort and frequently return nothing.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

LSP Navigation and Diagnostics

Use lsp_navigation as PRIMARY for code intelligence. Use lens_diagnostics with source=lsp as PRIMARY for proactive type/error checks. Do NOT use grep/glob/ast-grep first for code intelligence.

Aggregate-tool hosts

Some hosts expose pi-lens through a single aggregate tool — lens(action=...) — instead of registering the standalone names below. On those hosts:

  • Proactive checks: lens({ action: "lsp_diagnostics", ... }) — same parameters as the table below; the cached-report entry point maps to lens({ action: "diagnostics", ... }).
  • If lsp_navigation is not among the aggregate's actions, do not call the standalone name: use the host's structural search funnel (symbol_search → module_report → read_symbol) or the ast-grep CLI for navigation instead.

Diagnostics

Use lens_diagnostics with source=lsp before builds/tests or after touching several files:

NeedTool call
Check one filelens_diagnostics({ source: "lsp", scope: "paths", paths: ["src/file.ts"] })
Check a folderlens_diagnostics({ source: "lsp", scope: "workspace", path: "src/", severity: "error" })
Check exact touched fileslens_diagnostics({ source: "lsp", scope: "paths", paths: ["src/a.ts", "src/b.ts"] })
Slow server (Rust, Java)lens_diagnostics({ source: "lsp", scope: "paths", paths: files, waitMs: 2000 })
Include warningslens_diagnostics({ source: "lsp", scope: "paths", paths: files, severity: "all" })

Prefer explicit paths batches after multi-file edits — bounded concurrency, no unrelated directory noise.

Parameter reference

lens_diagnostics accepts source: "session" | "lsp" and scope: "paths" | "workspace". Use mode: "delta" for the current turn, "all" for the cache-only session view, or "full" for an active scan. path selects one file or directory; paths filters a batch. severity is "error", "warning", or "all"; serverScope is "primary" or "all".

For mode: "full", refreshRunners: "cached" | "cheap" | "all" | "none" (or false/true) controls project analyzers. The first three string modes can launch a fresh heavyweight analyzer pass, bounded by the slowest runner's roughly 180-second ceiling; none disables it. maxProjectFiles limits cheap project runners, maxLspFiles limits the LSP sweep, and includeGenerated: true includes generated-name paths. These three limits apply to full scans. concurrency and waitMs tune LSP batches.

Navigation (Code Intelligence)

QuestionOperationParameters
Where is this defined?definitionpath, line, character
Where is this symbol's type defined?typeDefinitionpath, line, character
Where is this declared (vs defined)?declarationpath, line, character
Find all usagesreferencespath, line, character
What type is this?hoverpath, line, character
Call signaturesignatureHelppath, line, character (at arg position)
Symbols in this filedocumentSymbolpath
Find symbol across projectworkspaceSymbolquery + path (strongly recommended)
Quick fixes availablecodeActionpath, line, character, endLine, endCharacter
Rename symbol safelyrenamepath, line, character, newName
Who implements this?implementationpath, line, character
Who calls this function?prepareCallHierarchy → incomingCallspath, line, character
What does this call?prepareCallHierarchy → outgoingCallspath, line, character
What commands does the server offer?capabilities(optional path) — lists advertised commands
Run a server command (e.g. organize imports)executeCommandcommand (+ commandArguments); dry-run unless apply:true

The operation values are definition, typeDefinition, declaration, references, hover, signatureHelp, documentSymbol, findSymbol, workspaceSymbol, codeAction, rename, rename_file, implementation, prepareCallHierarchy, incomingCalls, outgoingCalls, executeCommand, workspaceDiagnostics, and capabilities.

For findSymbol, pass query; optionally narrow with kinds, exactMatch, topLevelOnly, and maxResults. rename_file uses newFilePath. symbol resolves a character automatically; character: -1 requests automatic resolution, and symbol#N selects a numbered symbol when the result lists one. callHierarchyItem is the object returned by prepareCallHierarchy and is required by the incoming/outgoing follow-up calls.

Call Hierarchy Pattern

// Step 1
lsp_navigation(operation="prepareCallHierarchy", path="src/api.ts", line=42, character=10)
// → returns callHierarchyItem

// Step 2
lsp_navigation(operation="incomingCalls", callHierarchyItem=<item from step 1>)
lsp_navigation(operation="outgoingCalls", callHierarchyItem=<item from step 1>)

Operational Notes

  • definition returns nothing? The file may not be open/indexed yet. Read it first, then retry.
  • workspaceSymbol empty? Always pass path. Unscoped queries are best-effort and frequently return nothing. If TypeScript returns "No Project", open the scoped file first.
  • references — query from the definition site for full cross-file coverage; usage-site queries can be partial.
  • signatureHelp — only valid at call-site argument positions; declaration positions return empty.
  • workspaceDiagnostics — tracked push snapshot only, not an active check. Use lens_diagnostics with source=lsp when you need fresh results.
  • codeAction — distinguish quickfix from generic refactors ("Move to new file"). Generic refactors are not error fixes.
  • prepareCallHierarchy — server-capability dependent; if unsupported, skip incoming/outgoing calls.

When NOT to Use LSP Navigation

TaskUse Instead
Find patterns (console.log)ast_grep_search
Find text / TODOsgrep
Find files by nameglob
Read file contentread

Golden Rule

Code intelligence → lsp_navigation first. Type/error validation → lens_diagnostics source=lsp first. Text/pattern search → grep/ast-grep.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.