agentleFS
forcedotcomforcedotcom/salesforcedx-vscode/.claude/skills/command-ui/SKILL.md

command-ui

Skill1k starsChanged 25 days agoBSD-3-ClauseView on GitHub

Command palette, CodeLens, context menus, package.nls titles, and NotificationModeService. Use when adding a command, editing package.nls command titles, wiring success/progress, or calling vscode.commands.registerCommand / vscode.window.withProgress / showInformationMessage for command UX.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about forcedotcom/salesforcedx-vscode

The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 52

Talked about on GitHub and Stack Overflow (52 times).

On GitHub · 50

45 more on GitHub

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add commandLevelNotifications property (English title key from step 1).

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Command UI

One Effect handler. Palette plus any extra surface (context menu, CodeLens, tree item, title). Success/progress through NotificationModeService.

  • Registration: services-extension-consumption (registerCommandWithRuntime)
  • Confirmations / errors / modals: vscode-window-messages. Exception: a non-modal error toast with action buttons → NotificationModeService.showErrorWithActions
  • Mode API: notification-mode-api.md

Recipe

1. Manifest + i18n

Two catalogs. Same key, different files.

Manifest (VS Code)Runtime (nls.localize)
Filespackage.json %key%, package.nls.jsonsrc/messages/i18n.ts
Localepackage.nls.ja.json (Partial; missing keys → English)i18n.ja.ts (Partial)
Ownscommand titles, config descriptions, view titlesprogress / success / errors / buttons
  • contributes.commands: "command": "sf.my.command", "title": "%deploy_this_source_text%" — %key% only (package-json-i18n-descriptions)
  • package.nls.json: "deploy_this_source_text": "SFDX: Deploy This Source to Org" — Title Case, SFDX: prefix (i18n-messages)
  • Same English string in i18n.ts under the same key
  • Menu when for each surface (commandPalette, editor/context, explorer/context)
  • commandLevelNotifications property key = that English title
  • Runtime copy only in i18n.ts (vscode-window-messages)

COMMAND is messages.deploy_this_source_text (always English). nls.localize('deploy_this_source_text') is user-visible (locale-aware).

package.nls.ja.json / i18n.ja.ts are Partial — add a translation when you have one; English is the fallback.

Done: %key% in package.json + package.nls.json + i18n.ts; slot key equals messages.<title_key>; command in palette.

2. Register

Once: api.services.registerCommandWithRuntime(getRuntime()).

Palette when gates enablement (sf:project_opened, sf:has_target_org). when: never for internals (conflict helpers, status-bar click-to-toast).

Two command IDs only when VS Code arg shapes differ. Share one English title → one notification slot. Both stay in the palette.

Done: registerCommandWithRuntime for every contributed command ID.

3. Extra surfaces

Same command ID. Handler accepts optional args from the surface; palette path falls back (active editor / prompt).

export const myCommand = Effect.fn('myCommand')(function* (sourceUri?: URI, uris: URI[] = []) {
  const targets = sourceUri
    ? new Set([sourceUri, ...uris])
    : new Set([yield* api.services.EditorService.getActiveEditorUri()]);
});

new CodeLens(range, { command: 'sf.my.command', title, arguments: [uri] });

Done: every CodeLens / menu / TreeItem.command uses that ID.

4. Layer + slot

Merge NotificationModeService.Default(extensionSection, statusBarId, statusBarName) into AllServicesLayer. Copy an existing Default(...) in that package's extensionProvider.ts. Dispose the ManagedRuntime on deactivation.

Lookup: command → extensionLevelNotifications → global salesforcedx-vscode-services.notifications.

Add commandLevelNotifications property (English title key from step 1). Copy enum + enumDescriptions from a sibling slot; pick PAS / SO / PO — notification-mode-api.md. Slot description is a %key% in package.nls.json. Add extensionLevelNotifications if missing. Slot, not a boolean showSuccessNotification.

Type keys from package.json in src/utils/notificationMode.ts:

import type pkg from '../../package.json';

type CommandNotificationKey =
  keyof (typeof pkg)['contributes']['configuration']['properties']['salesforcedx-vscode-metadata.commandLevelNotifications']['properties'];

export type ProgressOnlyCommandKey = 'SFDX: Diff Source Against Org';
export type ProgressAndSuccessCommandKey = Exclude<CommandNotificationKey, ProgressOnlyCommandKey>;

ESLint notificationSlotMatchesPackageJson checks SuccessOnly / ProgressOnly aliases against the slot enum.

Done: Default(...) in the layer; slot exists; COMMAND typed.

5. Progress + success

const COMMAND: ProgressAndSuccessCommandKey = messages.deploy_this_source_text;
const notificationMode = yield* api.services.NotificationModeService;
const location = yield* notificationMode.getProgressLocation(COMMAND);

yield* work.pipe(
  promptService.withProgress(nls.localize('working'), location),
  Effect.tap(() =>
    notificationMode.showSuccessNotification(
      COMMAND,
      nls.localize('command_succeeded_text', nls.localize('deploy_this_source_text'))
    )
  )
);

Cancellable: promptService.withCancellableProgress(title, location).

forceShow: true when the message must not be suppressed (request ID).

Helpers that wrap vscode.window.withProgress (e.g. metadata withPreparationProgress) take the command key and call getProgressLocation.

Done: getProgressLocation + showSuccessNotification.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.