Agent skill

Platform Lsp Integrate

by forcedotcom in forcedotcom/sf-skills

Reference/contract for the Salesforce LSP MCP tools and unavailability handling.

Apache-2.0Auto-check: notesSales & Support

Install Platform Lsp Integrate

skills CLI
$ npx skills add forcedotcom/sf-skills --skill platform-lsp-integrate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills platform-lsp-integrate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/builder/salesforce-development/skills/platform-lsp-integrate .claude/skills/platform-lsp-integrate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
platform-lsp-integrate
GitHub stars
1.1k
Token cost
~3.2k tokens
SKILL.md length
1,508 words
Files
1
Skills in repo
251
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reference/contract for the Salesforce LSP MCP tools and unavailability handling.

  • Works in 3 steps: Prefer the LSP tool over guessing. If a… → Treat an error envelope as… → Degrade, don't fail. The LSP is an…
  • Asking how to use the LSP
  • SKILL.md covers When to Use This Skill, The Tools, The Call / Fallback Contract and Error Codes, plus 4 more sections
  • Calls sf

What it does

Platform Lsp Integrate is an agent skill from forcedotcom/sf-skills. Reference/contract for the Salesforce LSP MCP tools and unavailability handling. Use when asking how to use the LSP, which tools exist, what apex.diagnostics / validatesoql / completesoql do, why a tool errors with lspdisabled, noapexworkspace, or noorgconnected, or how to debug/disable it. DO NOT TRIGGER for editing Apex/LWC/metadata (platform-apex-generate), deploys (platform-metadata-deploy), or SOQL authoring (platform-soql-query); scoped to LSP-layer/MCP-tool questions only.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Sales & Support, covering CRM management and MCP servers. It works with Salesforce and Model Context Protocol. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • Asking how to use the LSP
  • Which tools exist
  • What apex.diagnostics / validatesoql / completesoql do
  • Why a tool errors with lspdisabled

Example prompts

  • “/platform-lsp-integrate”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, mcp__plugin_salesforce-development_salesforce-lsp__lsp_health

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Prefer the LSP tool over guessing. If a tool exists for the step (validate
  2. Treat an error envelope as "unavailable," never as "passed." A tool may
  3. Degrade, don't fail. The LSP is an accelerator, not a hard dependency. If

What it can do on your machine

Read from SKILL.md and the folder at commit e5164d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • mcp__plugin_salesforce-development_salesforce-lsp__lsp_health

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • sf

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Platform Lsp Integrate loads about 3.2k tokens when it runs. Until then it costs about 129 tokens; SKILL.md has 1,508 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~129
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, mcp__plugin_salesforce-development_salesforce-lsp__lsp_health

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit e5164d9, republished under its Apache-2.0 licence (© forcedotcom). 1,508 words, ~3,174 tokens.

Download SKILL.mdSave it as .claude/skills/platform-lsp-integrate/SKILL.md (or your agent's skills folder).
name
platform-lsp-integrate
description
Reference/contract for the Salesforce LSP MCP tools and unavailability handling. Use when asking how to use the LSP, which tools exist, what apex.diagnostics / validate_soql / complete_soql do, why a tool errors with lsp_disabled, no_apex_workspace, or no_org_connected, or how to debug/disable it. DO NOT TRIGGER for editing Apex/LWC/metadata (platform-apex-generate), deploys (platform-metadata-deploy), or SOQL authoring (platform-soql-query); scoped to LSP-layer/MCP-tool questions only.
allowed-tools
Bash, Read, mcp__plugin_salesforce-development_salesforce-lsp__lsp_health
metadata.relatedSkills
platform-apex-generate, platform-metadata-deploy, platform-soql-query

Using the Salesforce LSP

The salesforce-development plugin hosts a local MCP server named salesforce-lsp that lazily spawns Salesforce Language Server children and exposes their semantic capabilities as MCP tools. This skill is the contract other skills follow when they call those tools, and the answer to "how do I use the Salesforce LSP?" — what each tool does, how to read its result, what every error code means, and how to fall back when the host is absent.

This is a documentation/reference skill. It does not author or deploy code; it tells you (and other skills) how to drive the LSP tools correctly.

This plugin build vendors Apex + SOQL only. The salesforce-lsp host ships the Apex language server (@salesforce/apex-ls) and the SOQL language server. The LWC language server is intentionally not bundled in this plugin — the lwc.* tools are registered by the host but will always return an unavailable-class envelope here. Treat any lwc.* call as unavailable and use the fallback (read the component source / deploy-compile).

When to Use This Skill

  • A user asks how to use the Salesforce LSP, or which LSP/MCP tools are available.
  • A user asks what a specific tool does (apex.diagnostics, validate_soql, complete_soql, etc.) or how to read its output.
  • An LSP tool returned an error envelope (lsp_disabled, spawn_timeout, circuit_open, no_apex_workspace, no_org_connected) and you need to know what it means and how to recover.
  • You're authoring or reviewing another skill that calls an LSP tool and need the canonical call/fallback pattern.
  • The LSP seems broken and you need to debug it (lsp.health, ${CLAUDE_PLUGIN_ROOT}/bin/lsp-doctor, the kill switch).

The Tools

All tools are served by the MCP server salesforce-lsp (invoke names follow the plugin-prefixed pattern: mcp__plugin_salesforce-development_salesforce-lsp__<tool_name>, where dots in tool names become underscores — e.g. apex.diagnostics becomes mcp__plugin_salesforce-development_salesforce-lsp__apex_diagnostics). Spawning is lazy: a tool that needs a language server brings the child up on first call (a one-time cold start of a few seconds for Apex), then reuses it. The pure static-analysis tools never spawn anything.

Apex (spawns the Apex LSP)
ToolPurposeKey inputKey output
apex.diagnosticsCompile-check a .cls/.trigger; surface errors/warnings{ filePath }{ ok, diagnostics: [{ line, column, severity, message }] }
apex.hoverType/signature at a position{ filePath, line, character }hover markdown
apex.documentSymbolOutline of a file's symbols{ filePath }symbol tree
apex.completionCode-completion at a position{ filePath, line, character }completion items
SOQL
ToolPurposeSpawns?Key output
validate_soqlParse a SOQL string for syntax errorsSOQL LSP{ ok, diagnostics: [{ line, column, severity, message }] }
complete_soqlSchema-aware completion at a cursor (SObjects, fields, picklist values resolved against the org)SOQL LSP{ ok, items, expanded, unresolved, hint? }
extract_soql_from_apexStatically pull every inline [SELECT …] out of ApexNo (pure static){ ok, totalQueries, totalDynamic, files }
check_soql_selectivitySelectivity heuristics (optional org LIMIT-0 probe)No by defaultselectivity report
refresh_org_schemaInvalidate the cached org describe so completion re-fetchesNo{ ok, removed }

Just deployed a field/object and it won't resolve? When a SOQL or Apex reference to a freshly-deployed field fails (e.g. No such column 'Foo__c', or complete_soql doesn't offer it) right after a deploy, the cached org describe is stale — call refresh_org_schema to invalidate it, then re-run the check before assuming a code error or renaming anything. This is the lever for post-deploy schema lag; reach for it before treating the failure as a bug in your query/class. (It only clears the local cache; it can't speed up server-side propagation, so if the org itself hasn't finished publishing the field, re-running after a moment is the fallback.)

LWC — not available in this build

The lwc.* tools (lwc.diagnostics, lwc.hover, lwc.definition, lwc.completion, lwc.workspace_symbols) are registered by the host but the LWC language server is not vendored in this plugin. Every lwc.* call returns an unavailable envelope. For LWC work, fall back to reading the component source/templates directly or deploy-compiling and reading the CLI errors.

Diagnostics / health
ToolPurposeSpawns?
lsp.healthRead-only view of kill-switch mode, workspace, per-server state, circuit-breaker state, cold-spawn timing, apex-ls versionNo — never spawns

Coordinates everywhere are one-based (line/column). validate_soql diagnostic coordinates are relative to the query string, not a file — when a query came from extract_soql_from_apex, translate back using that query's range.

The Call / Fallback Contract

Every skill that calls an LSP tool follows the same three rules:

  1. Prefer the LSP tool over guessing. If a tool exists for the step (validate a query, compile-check a class, complete against the org schema), call it before falling back to hand-analysis.
  2. Treat an error envelope as "unavailable," never as "passed." A tool may return { error: <code> } instead of a result (see Error Codes). On any such code, record <tool>=unavailable: <code> in your report and continue down the fallback path — never report the input as valid/clean just because the check didn't run.
  3. Degrade, don't fail. The LSP is an accelerator, not a hard dependency. If the host isn't available at all, the salesforce-lsp tools simply won't exist — fall back to the CLI/manual path for that step and say so.
When the LSP host is absent

If the plugin/host isn't available, the MCP tools above are not registered, so a call to (e.g.) validate_soql will not resolve. Detect this the same way you detect an error envelope — the tool is unavailable — and use the documented fallback:

LSP tool unavailableFallback
apex.diagnosticsDeploy/compile via sf project deploy and read CLI errors
validate_soqlSmoke-check by running the query read-only via sf data query --json (a parse error surfaces in the CLI error)
complete_soqlsf sobject describe --sobject <O> --json for fields; author from the user's stated names
extract_soql_from_apexRead the file(s) and locate [SELECT … ] by hand
apex.completion / apex.hoverRead the source directly
lwc.* (always unavailable here)Read the component source/templates directly, or deploy-compile and read CLI errors
Show full SKILL.md (585 more words)Show less

Error Codes

A tool returns { error: <code> } (or, for complete_soql, a hint) instead of a result. Each maps to a recovery:

CodeMeaningWhat to do
lsp_disabledThe kill switch (SFDX_LSP) forbids this languageUse the non-LSP fallback; or re-enable the LSP (see Debugging)
spawn_timeoutThe language server didn't come up in timeRetry once; if it persists, fall back and run ${CLAUDE_PLUGIN_ROOT}/bin/lsp-doctor
circuit_openRepeated spawn failures tripped the breaker; calls are short-circuitedFall back now; investigate with lsp.health / ${CLAUDE_PLUGIN_ROOT}/bin/lsp-doctor
no_apex_workspaceNo classes/*.cls under any package dir — Apex tools won't spawnExpected in a non-Apex project; nothing to check
no_org_connected(complete_soql hint) org schema couldn't be resolvedKeyword completion still works; ask for exact field/object names or connect an org. Do not surface __…_PLACEHOLDER labels as real fields

The first three are transient/config states shared by every spawning tool; the rest are expected, healthy states for a particular workspace/org/file context — not signs of a broken install. (no_lwc_bundles / unsupported_lwc_file are LWC-only codes; in this build the LWC server is not vendored, so lwc.* returns unavailable regardless.)

Debugging the LSP

Three layers, cheapest first:

  1. lsp.health (MCP tool). The fastest check — never spawns a child. Reports the kill-switch mode, resolved workspace, per-server status, circuit-breaker state, last cold-spawn timing, and the vendored apex-ls version. Ask Claude to "run lsp.health," or call the lsp.health tool directly.

  2. bin/lsp-doctor (CLI). A deeper, install-level diagnostic for support and onboarding. Verifies the committed bundles exist, the vendored apex-ls artifacts resolve, the org-schema cache is parseable, and each LSP child can actually spawn. Exits 0 when healthy, 1 with structured per-check output when something is wrong.

    bash
    "${CLAUDE_PLUGIN_ROOT}"/bin/lsp-doctor            # human-readable report
    "${CLAUDE_PLUGIN_ROOT}"/bin/lsp-doctor --json     # machine-readable
    "${CLAUDE_PLUGIN_ROOT}"/bin/lsp-doctor --no-spawn # skip child-spawn probes (CI/restricted)

    (In this build lsp-doctor will report the LWC server as missing — that is expected; only Apex + SOQL are vendored here.)

  3. SFDX_LSP_DEBUG=1. Emits single-line JSON telemetry (spawn timing, cache hits, circuit events, per-tool latency) to stderr. Off by default (zero overhead).

The kill switch — SFDX_LSP

The fast way to control or disable the LSP. Set the environment variable:

SFDX_LSPEffect
unset / allEvery vendored LSP may spawn (default)
apex-onlyOnly the Apex LSP may spawn; SOQL tools return lsp_disabled
disabledNo LSP spawns; every LSP tool returns lsp_disabled

To rule the LSP in or out of a problem, set SFDX_LSP=disabled and re-run: if the issue persists it isn't the LSP, and skills will have fallen back to their non-LSP paths automatically. An unknown value defaults to all (with a warning) so a typo never silently disables the feature.

Pre-deploy diagnostics gate

A PreToolUse hook (bin/lsp-precheck) runs Apex diagnostics on the .cls/.trigger files a sf project deploy start/validate is about to push, and emits a decision. It is fail-open: any error (including a missing/slow LSP) allows the deploy. Mode is controlled by SFDX_LSP_DEPLOY_GATE (off | warn | block, default warn) — warn surfaces diagnostics without blocking; block denies a deploy that has Apex compile errors.

Verification

  • Asked "how do I use the Salesforce LSP tools?", this skill is the match and lists the tools, their inputs/outputs, and the fallback contract.
  • Appears in the /skills listing as platform-lsp-integrate.
  • Given an error code (e.g. no_apex_workspace), it explains the meaning and the correct recovery without treating the unrun check as a pass.

Cross-Skill Integration

NeedDelegate to
Compile-check + analyze Apex you just wroteplatform-apex-generate
Validate inline SOQL in .cls/.triggervalidate_soql (this skill); fallback: run read-only via sf data query --json
Author & run a SOQL query against the orgcomplete_soql + sf data query
Pre-deploy diagnostics gate behaviorsee "Pre-deploy diagnostics gate" above

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/builder/salesforce-development/skills/platform-lsp-integrate of forcedotcom/sf-skills.

Open the folder on GitHubat commit e5164d9

Compare with similar skills

Platform Lsp Integrate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Platform Lsp Integrate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Platform Lsp Integrate this skillforcedotcom/sf-skills1.1k—~3.2kAutomated safety check: NotesApache-2.0
Agentforce GenerateSalesforceAIResearch/agentforce-adlc1141 repos~7.4kAutomated safety check: PassCustom licence
Churn Riskindranilbanerjee/digital-marketing-pro8551 repos~2.4kAutomated safety check: PassMIT
Lead Importindranilbanerjee/digital-marketing-pro8551 repos~3.3kAutomated safety check: PassMIT
Pipeline Updateindranilbanerjee/digital-marketing-pro8551 repos~3.3kAutomated safety check: PassMIT
Segment Audienceindranilbanerjee/digital-marketing-pro8551 repos~3.5kAutomated safety check: PassMIT

Similar skills

  • Agentforce Generate

    SalesforceAIResearch/agentforce-adlc

    Build, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent Script.

    114 GitHub starsUsed in 1 repo~7.4k tokens
    Agent WorkflowsAuto-check passed
  • Churn Risk

    indranilbanerjee/digital-marketing-pro

    Score customer segments for churn risk from behavioral signals — email engagement decline, purchase recency, usage drops, support sentiment — producing a 0-100 risk scorecard with four tiers…

    855 GitHub starsUsed in 1 repo~2.4k tokens
    Sales & SupportAuto-check passed
  • Lead Import

    indranilbanerjee/digital-marketing-pro

    Import leads into Salesforce, HubSpot, Zoho, or Pipedrive with validation, deduplication against existing CRM records, lead scoring, consent and compliance checks, and source attribution — then push…

    855 GitHub starsUsed in 1 repo~3.3k tokens
    Sales & SupportAuto-check passed
  • Pipeline Update

    indranilbanerjee/digital-marketing-pro

    Update CRM deals — move stages, change values and close dates, attach notes and activities, create follow-up tasks — with validation against pipeline rules, a before-and-after comparison, and…

    855 GitHub starsUsed in 1 repo~3.3k tokens
    Sales & SupportAuto-check passed
  • Segment Audience

    indranilbanerjee/digital-marketing-pro

    Build or update audience segments in the brand's CRM, email, or ad platform (Salesforce, HubSpot, Mailchimp, Meta Custom Audiences, Google Customer Match, and more) via connected MCPs — with size…

    855 GitHub starsUsed in 1 repo~3.5k tokens
    Sales & SupportAuto-check passed
  • Nextcrm

    pdovhomilja/nextcrm-app

    Connect to NextCRM MCP server to manage CRM data — accounts, contacts, leads, opportunities, targets, products, contracts, activities, documents, target lists, enrichment, email accounts, campaigns…

    712 GitHub stars~3.3k tokensUpdated 3 days ago
    Sales & SupportAuto-check passed

More from forcedotcom/sf-skills

All 251 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated yesterday
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated yesterday
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Platform Lsp Integrate

What does Platform Lsp Integrate do?

Reference/contract for the Salesforce LSP MCP tools and unavailability handling. Platform Lsp Integrate is an agent skill from forcedotcom/sf-skills. Reference/contract for the Salesforce LSP MCP tools and unavailability handling.

When should I use Platform Lsp Integrate?

Platform Lsp Integrate fits situations like: asking how to use the LSP; which tools exist; what apex.diagnostics / validatesoql / completesoql do; why a tool errors with lspdisabled.

How do I install Platform Lsp Integrate in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill platform-lsp-integrate -a claude-code`. Or copy the skill folder (plugins/builder/salesforce-development/skills/platform-lsp-integrate in forcedotcom/sf-skills) into .claude/skills/platform-lsp-integrate in your project. Claude Code loads it when a task matches its description.

How do I install Platform Lsp Integrate in Codex?

Run `npx skills add forcedotcom/sf-skills --skill platform-lsp-integrate -a codex`. Or copy the skill folder (plugins/builder/salesforce-development/skills/platform-lsp-integrate in forcedotcom/sf-skills) into .agents/skills/platform-lsp-integrate in your project. Codex loads it when a task matches its description.

Can I use Platform Lsp Integrate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill platform-lsp-integrate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/platform-lsp-integrate, .gemini/skills/platform-lsp-integrate, .github/skills/platform-lsp-integrate and .opencode/skills/platform-lsp-integrate in your project.

What does Platform Lsp Integrate need to run?

Going by SKILL.md and its folder, Platform Lsp Integrate needs the command-line tools its instructions call (sf). Its frontmatter pre-approves these tools: Bash, Read, mcp__plugin_salesforce-development_salesforce-lsp__lsp_health.

Does Platform Lsp Integrate access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Platform Lsp Integrate safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Platform Lsp Integrate use?

Platform Lsp Integrate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Platform Lsp Integrate use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Platform Lsp Integrate?

Skills that share tags, products or a category with Platform Lsp Integrate: Agentforce Generate (SalesforceAIResearch/agentforce-adlc, 114 stars), Churn Risk (indranilbanerjee/digital-marketing-pro, 855 stars), Lead Import (indranilbanerjee/digital-marketing-pro, 855 stars) and Pipeline Update (indranilbanerjee/digital-marketing-pro, 855 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Platform Lsp Integrate?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,060 GitHub stars. The repository holds 251 skills in this directory. The repository was last updated on October 7, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.