platform-deploy-validate — скилл для Claude Code: проверка деплоя
Прогоняет серверную валидацию метаданных Salesforce до деплоя: ошибки видны, орг не тронут. Для продакшена возвращает job ID для быстрого деплоя.
npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a claude-codeЧто делает platform-deploy-validate
Скилл запускает проверку метаданных на стороне сервера, ничего не меняя в организации. Сначала он классифицирует целевую орг через ${CLAUDE_PLUGIN_ROOT}/scripts/sf-deploy-gate bucket <alias> и получает один из типов: production, sandbox, scratch, trial или unknown. Только production идёт по продакшен-пути, остальные — по песочнице.
Для sandbox и scratch выполняется sf project deploy start --dry-run с одним из флагов области: --source-dir, --metadata или --manifest. Уровень тестов по умолчанию не задаётся, --test-level RunLocalTests добавляется только по вашей просьбе. Job ID тут не возвращается, и это нормально. Для продакшена нужен sf project deploy validate с обязательным уровнем тестов: RunLocalTests по умолчанию или RunSpecifiedTests --tests <ClassName>, если вы перечислили тесты сами. Ответ содержит job ID, действительный 10 дней, скилл кладёт его в .sfdx/last-validation.json для platform-quick-deploy.
Если валидация упала, скилл разбирает componentFailures и runTestResult.failures, показывает до пяти ошибок компонентов и до пяти падений тестов со стеком. Правки предлагает только в границах отчёта. Для реального деплоя нужен platform-metadata-deploy, для удаления метаданных — platform-destructive-deploy: этот скилл их не заменяет. Флаги --ignore-errors и --ignore-warnings при валидации не используются, они относятся к настоящим деплоям.
Какие задачи решает
- проверить метаданные перед деплоем в продакшен
- получить job ID для быстрого деплоя без прогона тестов
- прогнать dry-run в sandbox или scratch-орге
- разобрать ошибки компонентов и падений тестов после неудачной валидации
- убедиться, что деплой не сломает орг, до его запуска
Примеры запросов агенту
- проверь деплой в продакшен перед выкаткой
- сделай dry-run для этой sandbox-орги
- валидируй метаданные из manifest/package.xml
Как установить platform-deploy-validate
1Через Skills CLI (Vercel)
npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a claude-code2Вручную: положить файлы
~/.claude/skills/platform-deploy-validate/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/platform-deploy-validate/
1Через Skills CLI (Vercel)
npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a codex2Вручную: положить файлы
.agents/skills/platform-deploy-validate/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a cursor2Вручную: положить файлы
.cursor/skills/platform-deploy-validate/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install forcedotcom/sf-skills platform-deploy-validate2Вручную: положить файлы
.github/skills/platform-deploy-validate/SKILL.md1Через Skills CLI (Vercel)
npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a gemini-cli2Командой платформы
gemini skills install https://github.com/forcedotcom/sf-skills --path plugins/builder/salesforce-development/skills/platform-deploy-validateВручную: положить файлы
.devin/skills/platform-deploy-validate/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора167
Похожие
Рядом в теме «DevOps и инфраструктура»
Всё по теме «DevOps и инфраструктура» →Вопросы о platform-deploy-validate
Как установить platform-deploy-validate в Claude?
Выполните npx skills add forcedotcom/sf-skills --skill platform-deploy-validate -a claude-code. Скилл появится в ~/.claude/skills/platform-deploy-validate/SKILL.md.
Что делает platform-deploy-validate?
Запускает серверную валидацию метаданных Salesforce до деплоя. Для продакшена возвращает job ID на 10 дней, для sandbox и scratch делает dry-run.
Чем этот скилл отличается от platform-metadata-deploy?
Он только проверяет и не выполняет деплой. Для настоящей выкатки нужен platform-metadata-deploy, для удаления метаданных — platform-destructive-deploy.
Исходный текст
SKILL.md · Apache-2.0
---
name: platform-deploy-validate
description: "Validate Salesforce metadata before deploying. TRIGGER when the user asks to validate a deploy, do a dry-run, check before deploying, or targets a Production org for any deploy operation. Routes prod targets to `sf project deploy validate` (returns a 10-day quick-deploy job ID) and sandbox/scratch targets to `sf project deploy start --dry-run`. DO NOT TRIGGER for actual deploys (use platform-metadata-deploy) or destructive changes (use platform-destructive-deploy)."
allowed-tools:
- Bash
- Read
- Write
metadata:
cliTools:
- tool: ["sf"]
semver: ">=2.0.0"
relatedSkills:
- "platform-metadata-deploy"
- "platform-destructive-deploy"
- "platform-quick-deploy"
---
# Validating Deployment
Run a server-side validation before deploying metadata. Validation surfaces errors without modifying the org and — for production targets — produces a job ID usable with `platform-quick-deploy` for a fast, test-free deploy.
## Capability Resolution
Always prefer `sf project deploy validate` (prod) or `sf project deploy start --dry-run` (sandbox/scratch) over the Tooling API directly.
## Workflow
### Step 1 — Confirm the target org
Classify the org with the gate's classifier — it is the authoritative source of truth and resolves the org the same way the deploy hook does (it handles sandbox/scratch markers, trial and Developer Edition orgs including SDOs, and treats a Dev Hub with no such signal as production; returns one of `production|sandbox|scratch|trial|unknown`):
```bash
"${CLAUDE_PLUGIN_ROOT}/scripts/sf-deploy-gate" bucket <alias>
```
Only `production` takes the production path (Step 2b); every other result takes the sandbox/scratch path (Step 2a). `unknown` means the org type could not be confirmed (usually an incomplete org record). Say so plainly: the deploy gate still allows the deploy, auto-deploy on save stays off for that org, and re-authenticating with `sf org login web` usually restores the classification.
### Step 2a — Sandbox/Scratch path (dry-run)
```bash
sf project deploy start --dry-run --target-org <alias> --json [scope flags]
```
Scope flags (use exactly one, not all):
- `--source-dir <path>` — deploy a directory
- `--metadata <Type:Name>` — deploy specific components
- `--manifest manifest/package.xml` — deploy from manifest
Default test level: omit `--test-level` for sandboxes (defers to org default). Add `--test-level RunLocalTests` only if the user asks.
Report back: success/failure, components attempted, any errors. **No job ID is returned** for dry-runs (this is expected).
### Step 2b — Production path (validate)
```bash
sf project deploy validate --target-org <alias> --json [scope flags] --test-level RunLocalTests
```
Production validations REQUIRE a test level. Use `RunLocalTests` by default; switch to `RunSpecifiedTests --tests <ClassName>...` if the user has explicitly listed tests.
The response returns a **job ID** (`result.id`) valid for **10 days**. Persist it for `platform-quick-deploy`:
```bash
mkdir -p .sfdx
echo '{"jobId":"<id>","createdAt":"<iso8601>","targetOrg":"<alias>","testLevel":"RunLocalTests"}' > .sfdx/last-validation.json
```
Report:
- Validation result (passed / failed)
- Job ID and 10-day expiry date
- Test results summary (run / passed / failed)
- Recommended next step: `platform-quick-deploy` with this job ID
### Step 3 — Failure triage
If validation fails, parse `result.details.componentFailures` and `result.details.runTestResult.failures` and surface:
- Top 5 component errors with full message
- Top 5 test failures with stack
- Suggested fix (component name → likely cause: missing dependency, FLS, syntax, etc.)
Do NOT propose fixes that change unrelated metadata. Stay scoped to what the validation reported.
## Rules
- ALWAYS use `--json` on every CLI call
- NEVER skip validation when targeting Production (do not run `sf project deploy start` against prod from this skill)
- NEVER use `--ignore-errors` or `--ignore-warnings` during validation; those flags belong to actual deploys, not validation
- If the user asks to "deploy to prod" without prior validation, FIRST run validation, THEN hand off to `platform-quick-deploy` (do not start a regular deploy against prod)
- Persist the validation job ID to `.sfdx/last-validation.json` so the quick-deploy skill can find it
## Output
Always end with:
- ✅ Validation passed → next-step pointer to `platform-quick-deploy` (with job ID + expiry) OR to `platform-metadata-deploy` for non-prod
- ❌ Validation failed → categorized error list and suggested next iteration
© forcedotcom · Apache-2.0 · forcedotcom/sf-skills