Skip to content
lsp-validation logo

LSP Validation Skill

lsp-validation

Use Language Server Protocol tools for code validation, navigation, and refactoring. Essential for maintaining code quality.

SKILL.md

Full skill instructions

LSP Validation Skill

Use the LSP (Language Server Protocol) tools to validate code quality, find references, navigate definitions, and perform safe refactoring.

Available LSP Tools

1. lsp_diagnostics - Get Errors and Warnings

When to use: After writing or modifying code to check for errors.

lsp_diagnostics(filePath: "/​path/​to/​file.ts", severity: "error")

Severity levels:

  • error - Only errors (compilation failures)
  • warning - Errors and warnings
  • information - Includes informational messages
  • hint - All diagnostics including hints
  • all - Everything

Example output:

Line 42: Cannot find name 'undefined_variable' (error)
Line 58: 'foo' is declared but never used (warning)

2. lsp_goto_definition - Jump to Definition

When to use: To find where a symbol is defined.

lsp_goto_definition(filePath: "/​path/​to/​file.ts", line: 10, character: 15)

Returns the file and location where the symbol at that position is defined.

3. lsp_find_references - Find All Usages

When to use: Before refactoring to understand impact.

lsp_find_references(filePath: "/​path/​to/​file.ts", line: 10, character: 15, includeDeclaration: true)

Returns all locations where the symbol is used across the workspace.

4. lsp_rename - Safe Refactoring

When to use: To rename a symbol across the entire codebase.

lsp_rename(filePath: "/​path/​to/​file.ts", line: 10, character: 15, newName: "betterName")

Applies the rename across all files that reference the symbol.

Validation Workflow

After Writing Code

1. Write/​edit code
2. Run lsp_diagnostics with severity: "error"
3. If errors found:
   - Fix the errors
   - Re-run diagnostics
4. Run lsp_diagnostics with severity: "warning"
5. Address warnings if appropriate

Before Committing

1. Run lsp_diagnostics on all modified files
2. Ensure no errors
3. Review warnings
4. Proceed with commit only if clean

Before Refactoring

1. Use lsp_find_references to understand impact
2. Review all usages
3. If safe, use lsp_rename for symbol renaming
4. Or manually edit with confidence knowing all locations

Agent Integration

Agents That MUST Use LSP

AgentLSP Usage
tdd-guideRun lsp_diagnostics after implementation
code-reviewerCheck for diagnostics during review
build-error-resolverUse diagnostics to identify issues
refactor-cleanerUse lsp_find_references before removing code

Agents That SHOULD Use LSP

AgentLSP Usage
orchestratorVerify no errors after delegated work
architectUse lsp_goto_definition for codebase navigation
security-reviewerTrace data flow with references

Best Practices

  1. Always validate after editing - Run diagnostics after any code change
  2. Check before declaring done - Ensure zero errors before completing a task
  3. Use references before deleting - Never remove code without checking references
  4. Prefer lsp_rename over find-replace - It's safer and handles all cases
  5. Check the right severity - Use "error" for blockers, "warning" for quality

Error Handling

If LSP is unavailable for a file type:

  • Fall back to running the appropriate type checker (tsc, pyright, etc.)
  • Use build commands to verify compilation
  • Note the limitation in your response

Supported Languages

The LSP tools work with any language that has a configured language server:

  • TypeScript/​JavaScript (tsserver)
  • Python (pyright, pylsp)
  • Go (gopls)
  • Rust (rust-analyzer)
  • And many more...

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View