Platform Lsp Integrateのロゴ

Platform Lsp Integrate

組織人気
forcedotcom
platform-lsp-integrate

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.

概要

公開者forcedotcom
リポジトリsf-skills
スキル名platform-lsp-integrate
スター
1.1K
フォーク
351
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    forcedotcomがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルPlatform Lsp IntegrateをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/forcedotcom/sf-skills/tree/main/plugins/builder/salesforce-development/skills/platform-lsp-integrate
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/forcedotcom/sf-skills.git /tmp/sf-skills
mkdir -p .claude/skills
cp -r /tmp/sf-skills/plugins/builder/salesforce-development/skills/platform-lsp-integrate .claude/skills/platform-lsp-integrate
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでPlatform Lsp Integrateを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にPlatform Lsp Integrateを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Platform Lsp Integrateは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

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

よくある質問

AIスキル「Platform Lsp Integrate」では何ができますか?

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.

TypingMindでPlatform Lsp Integrateを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Platform Lsp Integrateはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにPlatform Lsp Integrateをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/forcedotcom/sf-skills/tree/main/plugins/builder/salesforce-development/skills/platform-lsp-integrateを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Platform Lsp Integrateを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Platform Lsp Integrateは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもPlatform Lsp Integrateを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Platform Lsp Integrate」は無料ですか?

はい。forcedotcomがGitHubでApache-2.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇