К основному содержанию
скилл CX Codex

platform-environment-validate — скилл для Claude Code: проверка

Скилл сканирует локальное окружение Salesforce, показывает статус каждого инструмента и предлагает доустановить или обновить недостающее.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add forcedotcom/sf-skills --skill platform-environment-validate -a claude-code
Открыть на GitHub

Что делает platform-environment-validate

Скилл запускается вручную, сам по себе он не срабатывает при старте сессии. Он прогоняет проверку через ${CLAUDE_PLUGIN_ROOT}/scripts/sf-context check-tools и получает JSON со списком инструментов. Дальше плагин сам рисует рамку «Ready to build on Salesforce?» — по строке на инструмент, вердикт внизу и подсказку Next:. Перерисовывать её не нужно, достаточно коротко объяснить, что означает результат.

Проверяются Salesforce CLI, плагин Code Analyzer, Node.js (>= 18), NPM (>= 3.10), Git, три отдельные строки по MCP и Source Tracking. У каждой строки свой статус: 🔴 — инструмента нет или версия ниже минимума, 🟡 — устарел или настроен неверно, 🟢 — порядок, ℹ️ — заметка, которую скрипт проверить не может. JSON остаётся источником правды. Если проверка упала, не перезапускайте её другим способом и не выдавайте найденный инструмент за прошедший тест — тот же check-tools должен пройти сам.

Строка Salesforce MCP (process) всегда информационная: скрипт не видит подпроцесс MCP, которым владеет Claude, поэтому зелёные config и endpoint ещё не значат, что MCP работает. Проверить здоровье процесса можно через /mcp или /doctor. Если рамка не отрисовалась, тот же результат печатает ${CLAUDE_PLUGIN_ROOT}/scripts/sf-context readiness-banner — порядок строк и подсказка берутся из скрипта, а не собираются руками.

Какие задачи решает

  • проверить, что все инструменты для разработки на Salesforce стоят и не устарели
  • найти причину, почему sf не находится в PATH на Windows
  • убедиться, что Source Tracking включён для подключённой org
  • отличить проблему с MCP-конфигом от недоступного endpoint
  • получить диагностику с путями к исполняемым файлам при критичном сбое

Примеры запросов агенту

  • проверь моё окружение Salesforce
  • validate tools — что-то не работает
  • проверь предпосылки для разработки на Salesforce

Как установить platform-environment-validate

1Через Skills CLI (Vercel)

npx skills add forcedotcom/sf-skills --skill platform-environment-validate -a claude-code

2Вручную: положить файлы

~/.claude/skills/platform-environment-validate/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/platform-environment-validate/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о platform-environment-validate

Как установить platform-environment-validate в Claude?

Выполните npx skills add forcedotcom/sf-skills --skill platform-environment-validate -a claude-code. Файл скилла появится по пути ~/.claude/skills/platform-environment-validate/SKILL.md.

Что делает platform-environment-validate?

Сканирует локальное окружение Salesforce и выдаёт отчёт по каждому инструменту с версией и статусом. Для отсутствующих или устаревших инструментов предлагает установку или обновление.

Скилл сам запустится при старте сессии?

Нет, он работает по запросу. Запускать проверку нужно явно, когда хотите проверить или починить локальную настройку.

Исходный текст

SKILL.md · Apache-2.0
---
name: platform-environment-validate
description: "Validate and configure the local Salesforce development environment. Runs a prerequisite scan across required tools with per-tool status and offers to install or update missing items. Use when the user asks to 'check my setup', 'validate tools', 'verify prerequisites', 'am I set up correctly', or reports a tool is missing or not working. DO NOT TRIGGER for org auth (/salesforce-development:login), deployment problems (platform-metadata-deploy), or status checks (/salesforce-development:status)."
allowed-tools:
  - Bash
  - Read
---

# Validating: Salesforce Development Environment

Validate all required prerequisites and surface a clear, actionable status report. This skill is on-demand — it does not run automatically on session start. Run it explicitly to check or repair your local setup.

## Phase 1: Prerequisite Scan

Run the tool check:

```bash
${CLAUDE_PLUGIN_ROOT}/scripts/sf-context check-tools
```

The output is a JSON object with a `tools` array (plus a `diagnostic` block on any critical failure).

**The banner is painted for you — do not reproduce it.** When `check-tools` runs, the plugin paints the framed **"Ready to build on Salesforce?"** banner deterministically on the visible channel — one status row per tool, the footer verdict, and the wayfinding footer — exactly like the SessionStart banner. It is a **Tier-1 surface**: read the JSON for your own understanding, but do **NOT** reproduce, redraw, or re-render the banner. Add only a short read of what the result means for the user, then go to **Phase 2**.

The painted banner looks like this (illustrative — the version/message text in each row comes straight from the JSON: `version` for 🟢, `message` + fix hint for 🟡/🔴, the note for ℹ️; the values below show the style, not fixed strings):

```
──────────────────────────────────────────────────────────────
 Ready to build on Salesforce?   checking your toolchain…
──────────────────────────────────────────────────────────────
 🟢 Salesforce CLI             v2.144.6
 🟢 Code Analyzer              v5.14.0 · JIT, auto-installs on first use
 🟢 Node.js                    v22.11.0 LTS
 🟢 NPM                        v10.9.0
 🟢 Git                        v2.50.1
 🟢 Salesforce MCP (config)    .mcp.json + proxy present
 🟢 Salesforce MCP (endpoint)  org instance reachable
 ℹ️  Salesforce MCP (process)   confirm with /mcp or /doctor
 🟢 Source Tracking            enabled
──────────────────────────────────────────────────────────────
 ✓ toolchain ready                                (skill: platform-environment-validate)
```

Each row's status dot carries the state — 🔴 `critical` (missing or below minimum — Salesforce development cannot proceed), 🟡 `warn` (installed but outdated, non-LTS, or misconfigured), 🟢 `ok`, ℹ️ `info` (a contextual note that can't be auto-verified, e.g. MCP process health) — and the framed footer gives the verdict plus the single most relevant `Next:` step. The JSON `status` field is the source of truth per tool; use these states when you write your short read.

**If the banner did not paint** (an older Claude Code build, or a paint fallback), do **not** hand-render it from the JSON. Print it with the deterministic renderer instead:

```bash
${CLAUDE_PLUGIN_ROOT}/scripts/sf-context readiness-banner
```

This reads the same scan result `check-tools` just recorded and prints the identical framed banner — rows in fixed order, the footer verdict, and the "you don't memorize commands here" wayfinding footer with its `Next:` step — so ordering, padding, counts, and next-step selection are decided once in the script, never re-derived by hand. The `check-tools` JSON stays the authoritative, machine-readable result.

**Deterministic results — do NOT override a failure:** the JSON report
is the authoritative, machine-readable result. If a tool reports 🔴/🟡, report it
as-is. Do **not** re-run the tool a different way (PowerShell, a raw shell probe,
a different command) and then present the result as 🟢 — a fallback that happens
to find the tool does **not** mean the deterministic check passed. A failed check
must stay failed until that **same** `check-tools` check passes. When the report
includes a `diagnostic` block (attached on any critical failure), surface it: it
carries the platform, active shell, working directory, plugin root, and the
**resolved executable paths** — the fastest way to see why a tool didn't resolve
(e.g. a Windows `sf.cmd` not on `PATH`). The diagnostic is secret-free by design;
never add tokens or org auth to it.

**MCP is reported as three distinct rows — never inferred from one another:**
`Salesforce MCP (config)` (is `.mcp.json` + the `sf-mcp-proxy.bundled.js` present?),
`Salesforce MCP (endpoint)` (is the platform endpoint reachable?), and
`Salesforce MCP (process)` (is the MCP process actually healthy?). The process row
is reported as ℹ️ **informational** (not a warning) — this script cannot see the
MCP subprocess that Claude Code owns, so a green config/endpoint must **not** be
presented as a working MCP. Confirm process health with `/mcp` or `/doctor`. The
endpoint row probes the org **instance URL** as a connectivity proxy, not the
platform-MCP endpoint itself.

## Tools Checked

| Tool | Minimum Requirement | Verification |
|---|---|---|
| Salesforce CLI | Present, and on the latest release | `sf --version` (🟡 when an update is available) |
| Code Analyzer plugin | Installed **or** JIT-registered | `sf plugins inspect @salesforce/plugin-code-analyzer`, falling back to the CLI's `oclif.jitPlugins` registry |
| Node.js | >= 18 (even/LTS) | `node --version` |
| NPM | >= 3.10 | `npm --version` |
| Git | Must be present | `git --version` |
| Salesforce MCP (config) | `.mcp.json` configured + proxy bundle present | Plugin root `.mcp.json` check + `sf-mcp-proxy.bundled.js` presence |
| Salesforce MCP (endpoint) | Org instance URL reachable (connectivity proxy) | HTTP probe of org instance URL |
| Salesforce MCP (process) | ℹ️ informational — not verifiable here | Confirm with `/mcp` or `/doctor` |
| Source Tracking | Enabled for connected org | `sf project deploy preview` |

All external tools (`sf`, `npm`, `node`, `git`) are launched through a single
cross-platform resolver: `shutil.which` (PATHEXT-aware) finds the tool,
and a Windows `.cmd`/`.bat` shim (`sf.cmd`, `npm.cmd`) is invoked via a
COMSPEC-wrapped argv array — never a shell string — so this scan and
`/salesforce-development:org` detect `sf`/`npm`/the default org correctly on
Windows, macOS, and Linux.

**Code Analyzer is a JIT plugin — registered ≠ installed.** The Salesforce CLI
declares `@salesforce/plugin-code-analyzer` as a "just-in-time" (JIT) plugin: it
is only physically installed the first time a `sf code-analyzer` command runs.
Until then, `sf plugins inspect` **fails** for it even though it is fully
available to the user. The check therefore treats JIT registration as success —
if `inspect` returns no version, it falls back to the CLI's own
`oclif.jitPlugins` registry (read from the root entry of `sf plugins --json`) and
reports 🟢 with the pinned version and a note that it auto-installs on first use.
Only a plugin that is neither installed nor JIT-registered is 🔴 critical.

## Phase 2: Install / Update

**If all green:** Confirm setup is complete. The user is ready to develop.

**If warnings or critical items exist:** Present the user with options:

```
Some tools need attention. What would you like to do?

  [1] Fix all items
  [2] Choose which items to fix
  [3] Skip for now
```

For each tool the user wants to fix, provide the correct install/update command for their OS. Do **not** run install commands automatically — show the command and ask the user to confirm before running it.

### Install / Update Commands by Tool

**Salesforce CLI — not installed:**
```bash
# macOS/Linux (npm)
npm install --global @salesforce/cli

# macOS (Homebrew)
brew install sf
```

**Salesforce CLI — update:**
```bash
sf update
```

**Code Analyzer plugin — not installed:**
```bash
sf plugins install @salesforce/plugin-code-analyzer
```

**Code Analyzer plugin — update:**
```bash
sf plugins update @salesforce/plugin-code-analyzer
```

**Node.js — not installed or below minimum:**
```bash
# macOS (nvm — recommended, installs LTS)
nvm install --lts && nvm use --lts

# macOS (Homebrew)
brew install node

# Windows — download from https://nodejs.org (LTS version)
```

**NPM — update:**
```bash
npm install --global npm@latest
```

**Git — not installed:**
```bash
# macOS (Xcode CLT)
xcode-select --install

# macOS (Homebrew)
brew install git

# Windows — download from https://git-scm.com
```

**Source Tracking — not enabled:**
```bash
sf org enable tracking --target-org <alias>
```

**Salesforce MCP — misconfigured:** If `.mcp.json` is missing or empty, reload the plugin:
```
/reload-plugins
```

## Important Notes

- After installing a tool that modifies PATH (Node.js, SF CLI), the user may need to exit and restart Claude Code for the change to take effect.
- Source Tracking requires a connected org — if no org is configured, prompt to run `/salesforce-development:login` first.
- For org authentication issues (expired session, wrong org, INVALID_SESSION_ID), run `/salesforce-development:login` instead of this skill.
- **SF CLI outdated → 🟡 in the readiness scan:** readiness means *latest*. When the CLI's cached update check reports a newer release, `check-tools` reports the Salesforce CLI as 🟡 (installed but outdated) with the correct update command, rather than 🟢. Unlike the session-start notice below, this warning ignores the per-version no-nag gate — an explicit readiness scan always reports the factual state — but it still honors the hard opt-out `SFDX_SKIP_CLI_UPDATE_CHECK=1`.
- **SF CLI update notice at session start:** when the CLI reports an available update, the `sf-context detect` SessionStart hook surfaces it once and asks the agent to offer the update (`sf update`, or `npm install --global @salesforce/cli@latest` for npm-global installs). Declining or a failed update records a **per-version** no-nag gate (`.sf/sf-cli-update-state.json`) so the same version won't nag again, but a newer release will re-prompt. Set `SFDX_SKIP_CLI_UPDATE_CHECK=1` to disable the check entirely.

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
crm-automation claude-office-skills Скилл для автоматизации продаж: захват и скоринг лидов, движение сделок по стадиям, синхронизация HubSpot, Salesforce и Pipedrive. CX Codex +1 5 500установок integration-listing-optimization Samuel Berthe Оптимизирует карточки B2B SaaS в каталогах AppExchange, Shopify, Atlassian, HubSpot и Slack. Помогает поднять конверсию просмотров в установки и легально собирать отзывы. CX Codex +1 7 700установок writing-mappings celigo Помогает писать маппинги полей и трансформации в интеграциях Celigo: Mapper 2.0, Transformation 2.0, лукапы и response mapping. CX Codex +1 3 000установок salesforce-apex-quality официальный github Проверяет Apex-код на риски governor limits, проблемы безопасности и пробелы в тестах. Подходит для ревью классов, триггеров и тестовых классов. 884установок salesforce-flow-design официальный github Проверяет архитектуру Salesforce Flow: выбор типа, bulk-безопасность и обработку ошибок. Подходит для проектирования и ревью Flow перед активацией. 839установок salesforce-development Mindrally Скилл задаёт агенту правила разработки на Salesforce: Apex, триггеры, Lightning Web Components, SOQL и метаданные. Пригодится, когда пишете код для org и хотите, чтобы агент держал стиль и лимиты платформы. CX Codex +1 659установок

Из того же набора167

platform-report-generate Скилл собирает и проверяет метаданные Lightning-отчётов Salesforce: колонки, группировки, фильтры, графики. Пригодится, когда .report-meta.xml не разворачивается. CX Codex +1 2 900установок platform-capability-search Скилл подсказывает, где вы в цикле Connect → Project → Build → Test → Deploy → Observe, и ищет плагин под задачу, которую не закрывает ни один установленный скилл. CX Codex +1 2 800установок experience-lwr-site-generate Собирает и правит сайты Salesforce Experience Cloud на LWR через метаданные DigitalExperience: страницы, маршруты, темы, гостевой доступ. CX Codex +1 2 700установок dx-apexguru-scan Скилл запускает проверку Apex-кода через ApexGuru SFAP Scan API для поиска антипаттернов производительности и проблем с governor limits в проектах Salesforce. CX Codex +1 2 700установок platform-quick-deploy Переносит проверенные метаданные в продуктивную среду Salesforce без повторного прогона тестов. Пригодится для релиза изменений сразу после успешной валидации. CX Codex +1 2 700установок dx-project-create Разворачивает новый проект Salesforce DX по шаблону, переносит текущую сессию в созданную папку и подключает организацию. Пригодится на старте разработки в Salesforce. CX Codex +1 2 600установок experience-ui-bundle-mfa-configure Настраивает многофакторную аутентификацию для пользователей Salesforce Experience Site: разворачивает нужные permission sets и проверяет вход. CX Codex +1 2 600установок experience-lwc-base-components-integrate Помогает выбрать подходящий Lightning Base Component под задачу интерфейса и подключить его в LWC без поломки SLDS. CX Codex +1 2 600установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой