lsp

Map queries to ast-grep and TypeScript language services for structural code analysis.

5|Updated Aug 8, 2016
One-click install
npx skills add https://github.com/gbencke/dotfiles --skill lsp-gbencke
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lsp
Source: https://github.com/gbencke/dotfiles/tree/main/pi/skills/lsp
Command: npx skills add https://github.com/gbencke/dotfiles --skill lsp-gbencke

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of understanding unfamiliar codebases and quickly diagnosing issues without setting up and maintaining a separate full language server for every language.

Core Features & Use Cases

  • Structural navigation: Find symbol definitions and explore a file’s symbol outline using structural queries instead of brittle text matching.
  • Diagnostics at scale: Run rule-based structural checks on files or directories, and use TypeScript tooling for TS/TSX compiler diagnostics.
  • On-demand assistance: Provide hover-like context and suggest the right external formatter command for a given file.
  • Use case: When joining a new project, run diagnostics to spot the highest-value problems, then jump to definitions to understand the system quickly and consistently.

Quick Start

Ask your agent: run lsp_diagnostics on ./src and then use lsp_definition on a failing symbol you identify.

Frequently Asked Questions about lsp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get structural code analysis without setting up a full language server?▼

Structural code analysis can be performed without a full language server by mapping queries to ast-grep and TypeScript language services for TS/TSX. This allows symbol lookup and rule-based checks across many programming languages.

Can I run TypeScript compiler diagnostics on an unfamiliar codebase quickly?▼

Yes, TypeScript compiler diagnostics can be run on demand for TS/TSX files using TypeScript tooling. It helps you spot high-value problems and understand the system quickly when joining a new project.

Do I need to install specific binaries to use ast-grep for code navigation?▼

Yes, you need the ast-grep (sg) binary in your PATH to perform structural navigation. Optionally, installing typescript-language-server is required for TS/TSX compiler diagnostics and hover-like context.

How do I define custom structural search rules for security checks?▼

Custom structural search rules for security checks can be defined by creating a YAML rule file or honoring an existing sgconfig.yml in your project. The Skill maps these structural queries to ast-grep for diagnostics.

What is the best way to find symbol definitions without brittle text matching?▼

Finding symbol definitions without brittle text matching is best achieved through structural navigation. This approach uses structural queries to explore a file's symbol outline and jump to definitions consistently.