core-extension-api

Documents the public API surface of salesforcedx-vscode-core and breaking-change evaluation procedures.

1.0k|454|Updated Jun 21, 2017
One-click install
npx skills add https://github.com/forcedotcom/salesforcedx-vscode --skill core-extension-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-extension-api
Source: https://github.com/forcedotcom/salesforcedx-vscode/tree/main/.claude/skills/core-extension-api
Command: npx skills add https://github.com/forcedotcom/salesforcedx-vscode --skill core-extension-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When modifying the salesforcedx-vscode-core extension, it is hard to know which exported symbols external consumers depend on, so seemingly safe refactors can break downstream extensions. This Skill defines the public API contract and the exact steps to verify whether a change is breaking.

Core Features & Use Cases

  • API Surface Reference: Lists the top-level exports and the services sub-object (RegistryAccess, ChannelService, TelemetryService, WorkspaceContext, CommandEventDispatcher) that external consumers rely on.
  • Breaking vs Non-Breaking Rules: Clarifies that removing fields, changing types or behavior, and altering .getInstance() signatures are breaking, while adding new fields is safe.
  • Consumer Discovery Workflow: Provides grep patterns and GitHub code search commands (gh api queries across forcedotcom and salesforcecli orgs) to find real usage before changing anything.
  • Use Case: Before removing an export from packages/salesforcedx-vscode-core/src/index.ts, follow the checklist to grep the monorepo, search GitHub orgs, and confirm no external consumer depends on it.

Quick Start

Ask the assistant to check whether removing a specific export from salesforcedx-vscode-core would break any external consumers.

Frequently Asked Questions about core-extension-api

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

FAQPage Schema
How do I check if a salesforcedx-vscode-core export is used externally?

Grep the monorepo for `.exports.MEMBER` patterns, then run GitHub code search via `gh api` against the forcedotcom and salesforcecli orgs for the symbol name. Also search for `exports.SYMBOL` to catch direct access outside wrapper files.

What counts as a breaking change to the core extension API?

Removing a field from SalesforceVSCodeCoreApi, changing a field's type, changing behavior even with the same signature, altering static methods like `.getInstance()` on services classes, or restructuring the services sub-object are all breaking. Adding new fields is non-breaking.

How do external extensions consume the salesforcedx-vscode-core API?

Consumers call `vscode.extensions.getExtension('salesforce.salesforcedx-vscode-core')` and read its exports, often defining their own minimal types rather than importing SalesforceVSCodeCoreApi. They typically version-check core with semver and degrade gracefully if core is missing or outdated.

Why was the top-level channelService field removed from the core API?

The top-level `channelService` field was removed under work item W-23348840. Consumers must now use `services.ChannelService` and its `.getInstance(name)` static method instead.

Can I remove a core export that appears unused in the monorepo?

Not without further checks. Absence in the monorepo does not prove external safety, so you must also search the forcedotcom and salesforcecli GitHub organizations and read private consumer repos before removing anything.