Skip to content
lsp-enable logo

LSP-First Code Intelligence

lsp-enable

Use when navigating code, understanding unfamiliar functions, finding definitions or references, tracing call hierarchies, preparing for refactoring, or analyzing code impact. Enforces LSP-first semantic code intelligence with mandatory pre-edit checks, impact analysis before refactoring, and pos...

SKILL.md

Full skill instructions

LSP-First Code Intelligence

The Iron Laws

1. NO MODIFYING UNFAMILIAR CODE WITHOUT goToDefinition FIRST
2. NO REFACTORING WITHOUT findReferences IMPACT ANALYSIS FIRST
3. NO CLAIMING CODE WORKS WITHOUT LSP DIAGNOSTICS VERIFICATION

Violating these laws wastes tokens, introduces bugs, and produces incomplete changes.

Trigger Phrases

Activate when user says:

  • "find definition", "go to definition", "where is X defined"
  • "find references", "who uses this", "what calls this function"
  • "understand this code", "trace this function", "explore codebase"
  • "before I refactor", "impact of changing", "safe to rename"
  • "analyze dependencies", "call hierarchy", "incoming calls"
  • "check this code", "verify implementation", "LSP diagnostics"

Core Decision Tree

WHAT DO YOU NEED?
│
├─ Symbol definition or implementation
│  └─ USE LSP: goToDefinition, goToImplementation
│
├─ All usages of a symbol
│  └─ USE LSP: findReferences
│
├─ Type info, docs, or signatures
│  └─ USE LSP: hover
│
├─ File structure or symbol list
│  └─ USE LSP: documentSymbol
│
├─ Call graph or dependencies
│  └─ USE LSP: incomingCalls, outgoingCalls
│
├─ Symbol search across workspace
│  └─ USE LSP: workspaceSymbol
│
├─ Literal text search (TODOs, strings, config)
│  └─ USE: Grep (LSP doesn't do text matching)
│
└─ File discovery by pattern
   └─ USE: Glob

The Nine LSP Operations

OperationPurposeUse Before
goToDefinitionJump to where symbol is definedModifying unfamiliar code
findReferencesFind all usages of a symbolRefactoring, renaming
goToImplementationFind interface implementationsWorking with polymorphism
hoverGet type info, docs, signaturesUnderstanding APIs
documentSymbolList all symbols in a fileUnderstanding large files
workspaceSymbolSearch symbols across codebaseFinding related code
prepareCallHierarchyGet call hierarchy infoAnalyzing call graphs
incomingCallsFind callers of a functionImpact analysis
outgoingCallsFind functions called by targetDependency tracing

Required parameters for all operations:

  • filePath - Absolute path to file
  • line - Line number (1-based)
  • character - Column position (1-based)

Full operation guide: references/​lsp-operations-guide.md

Pre-Edit Protocol (Mandatory)

Before modifying ANY unfamiliar code:

1. NAVIGATE: LSP goToDefinition → understand implementation
2. ANALYZE: LSP findReferences → assess change impact
3. INSPECT: LSP hover → verify type signatures
4. THEN: Make changes

Pre-Edit Checklist:

  • Used goToDefinition to understand implementation
  • Used findReferences to identify all usages
  • Reviewed type signatures via hover
  • Understand interface/​trait contracts
  • Know what breaks if this changes

Skip any step = incomplete understanding = bugs

Post-Edit Verification (Mandatory)

After code changes:

1. CHECK: LSP diagnostics for errors/​warnings
2. VERIFY: No new type errors introduced
3. CONFIRM: Imports resolve correctly
4. VALIDATE: Interface contracts still satisfied

Do NOT claim code works without LSP diagnostics verification.

LSP Availability Check

Before LSP operations, verify setup:

# Environment variable must be set
echo $ENABLE_LSP_TOOL  # Should output "1"

# If not set, add to shell profile:
export ENABLE_LSP_TOOL=1

If LSP unavailable:

  1. Warn user: "LSP not available. Semantic operations will be less accurate."
  2. Suggest fix: "Set ENABLE_LSP_TOOL=1 in your shell profile"
  3. Fall back: Use Grep/​Read with documented limitation
  4. Note limitation: "Used grep fallback - may include false positives"

Full setup guide: references/​lsp-setup-verification.md

Server Installation

If LSP servers are not installed, use /​lsp-tools:lsp-setup for guided installation.

Quick verification:

# Run verification script
bash "${CLAUDE_PLUGIN_DIR}/​scripts/​bash/​verify-lsp-servers.sh"

Per-language installation scripts are available:

LanguageServerInstall Script
TypeScript/​JSvtslsscripts/​bash/​install-typescript-lsp.sh
Pythonpyrightscripts/​bash/​install-python-lsp.sh
Rustrust-analyzerscripts/​bash/​install-rust-lsp.sh
Gogoplsscripts/​bash/​install-go-lsp.sh
Javajdtlsscripts/​bash/​install-java-lsp.sh
Kotlinkotlin-language-serverscripts/​bash/​install-kotlin-lsp.sh
C/​C++clangdscripts/​bash/​install-cpp-lsp.sh
C#OmniSharpscripts/​bash/​install-csharp-lsp.sh
PHPphpactorscripts/​bash/​install-php-lsp.sh
Rubyruby-lspscripts/​bash/​install-ruby-lsp.sh
HTML/​CSSvscode-langserversscripts/​bash/​install-html-css-lsp.sh
LaTeXtexlabscripts/​bash/​install-latex-lsp.sh

Windows users: Use corresponding PowerShell scripts in scripts/​powershell/.

Server registry with full details: references/​lsp-server-registry.md

Why LSP Over Grep

MetricLSPGrep
Speed (large codebase)~50ms45+ seconds
AccuracyExact semantic matchesText patterns (false positives)
Token usage~500 tokens (worth it)Burns tokens on irrelevant matches
Type resolutionFollows aliases, re-exportsText only
Scope awarenessUnderstands variable scopeMatches all text

Example:

Grep "getUserById" → 500+ matches (comments, strings, similar names)
LSP findReferences → 23 matches (exact function usages only)

Red Flags - STOP and Use LSP

If you catch yourself:

  • "I'll just grep for the function name"
  • "Quick refactor, don't need to check references"
  • "Code looks fine, probably works"
  • "I know what this function does" (without reading it)
  • Proposing changes to unfamiliar code without navigation
  • Claiming refactor is complete without impact analysis

ALL of these mean: STOP. Use LSP first.

Token Optimization Awareness

LSP is more expensive per-call but cheaper overall:

ScenarioGrep CostLSP Cost
Find method usages in 100-file project2000+ tokens (scanning output)500 tokens (exact matches)
Navigate to definitionMultiple grep attemptsSingle LSP call
Understand type signaturesRead multiple filesSingle hover call

Rule: When codebase > 20 files, LSP saves tokens vs grep.

Language-Specific Guidance

Use language-specific LSP sections for tooling and quality gates:

LanguageReference File
TypeScript/​JavaScriptreferences/​typescript-lsp-section.md
Pythonreferences/​python-lsp-section.md
Goreferences/​go-lsp-section.md
Rustreferences/​rust-lsp-section.md
Javareferences/​java-lsp-section.md
Kotlinreferences/​kotlin-lsp-section.md
C/​C++references/​cpp-lsp-section.md
C#references/​csharp-lsp-section.md
PHPreferences/​php-lsp-section.md
Rubyreferences/​ruby-lsp-section.md
HTML/​CSSreferences/​html-css-lsp-section.md
LaTeXreferences/​latex-lsp-section.md

Each file includes:

  • Navigation and verification workflows
  • Pre-edit checklists
  • Language-specific quality gates
  • Hooks for automated formatting/​linting

Enforcement Protocol Summary

Reference: references/​lsp-enforcement-protocol.md

  1. Pre-Edit: LSP navigation is MANDATORY before modifying unfamiliar code
  2. Pre-Refactor: findReferences impact analysis is MANDATORY
  3. Post-Edit: LSP diagnostics check is MANDATORY before claiming success
  4. Fallback: When LSP unavailable, warn → suggest fix → document limitation
  5. Token awareness: Prefer LSP over grep for semantic operations

Quick Reference

Before modifying code:

LSP goToDefinition → Understand implementation
LSP findReferences → Know what breaks
LSP hover → Verify types

After modifying code:

LSP diagnostics → Check for errors
Build/​typecheck → Verify compilation
Tests → Confirm behavior

Decision matrix: references/​lsp-decision-matrix.md

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
A
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View