跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 platform-metadata-deploy

Platform Metadata Deploy

使用 sf CLI v2. TRIGGER 的 Salesforce DevOps 自动化: 用户部署元数据, 创建/管理抓取或沙盒, 设置 CI/CD 管道, 或 Sf 项目部署出故障排除部署错误 。 当写出顶端代码(使用平台-apex-generate),构建LWC组件(使用经验-lwc-generate),创建元数据定义(使用平台-客户-对象-生成或平台-客户-域-生成),或查询org数据(使用平台-数据-管理)时,不要TRIGGER.

5937 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

使用 sf CLI v2. TRIGGER 的 Salesforce DevOps 自动化: 用户部署元数据, 创建/管理抓取或沙盒, 设置 CI/CD 管道, 或 Sf 项目部署出故障排除部署错误 。 当写出顶端代码(使用平台-apex-generate),构建LWC组件(使用经验-lwc-generate),创建元数据定义(使用平台-客户-对象-生成或平台-客户-域-生成),或查询org数据(使用平台-数据-管理)时,不要TRIGGER.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:platform-metadata-deploy: Comprehensive Salesforce DevOps Automation、When This Skill Owns the Task、Critical Operating Rules、Default deployment order、Required Context to Gather First、Recommended Workflow。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/deployment-report-template.md、references/orchestration.md、references/trigger-deployment-safety.md、references/deployment-workflows.md、references/agent-deployment-guide.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code (use platform-apex-generate), building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate or platform-custom-field-generate), or querying org data (use platform-data-manage).

platform-metadata-deploy: Comprehensive Salesforce DevOps AutomationWhen This Skill Owns the TaskCritical Operating RulesDefault deployment orderRequired Context to Gather FirstRecommended Workflow1. Preflight2. Validate first3. If validation succeeds, offer the next safe workflow4. Deploy the smallest correct scopesource-dir deploymanifest deploy

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
platform-metadata-deploy
description
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code (use platform-apex-generate), building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate or platform-custom-field-generate), or querying org data (use platform-data-manage).
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 5
  • references/deployment-report-template.md
  • references/orchestration.md
  • references/trigger-deployment-safety.md
  • references/deployment-workflows.md
  • references/agent-deployment-guide.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「platform-metadata-deploy」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-356c156e61912487-%E5%B9%B3%E5%8F%B0%E5%85%83%E6%95%B0%E6%8D%AE%E9%83%A8%E7%BD%B2.html
请存为 .cursor/skills/platform-metadata-deploy/SKILL.md 或 .claude/skills/platform-metadata-deploy/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/forcedotcom/sf-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/forcedotcom/sf-skills' --list

npx skills add 'https://github.com/forcedotcom/sf-skills' --skill 'platform-metadata-deploy'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: platform-metadata-deploy description: "Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code (use platform-apex-generate), building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate or platform-custom-field-generate), or querying org data (use platform-data-manage)." metadata: version: "1.1" domains: ["Platform", "Developer Experience"] relatedSkills: - "agentforce-generate" - "agentforce-test" - "automation-flow-generate" - "experience-lwc-generate" - "integration-connectivity-connected-app-configure" - "integration-connectivity-generate" - "platform-apex-generate" - "platform-apex-test-run" - "platform-custom-field-generate" - "platform-custom-object-generate" - "platform-data-manage" cliTools: - tool: ["curl"] semver: ">=7.0.0" - tool: ["git"] semver: ">=2.0.0" - tool: ["jq"] semver: ">=1.7.0" - tool: ["sf"] semver: ">=2.0.0" --- # platform-metadata-deploy: Comprehensive Salesforce DevOps Automation Use this skill when the user needs **deployment orchestration**: dry-run validation, targeted or manifest-based deploys, CI/CD workflow advice, scratch-org management, failure triage, or safe rollout sequencing for Salesforce metadata. ## When This Skill Owns the Task Use `platform-metadata-deploy` when the work involves: - `sf project deploy start`, `quick`, `report`, or retrieval workflows - release sequencing across objects, permission sets, Apex, and Flows - CI/CD gates, test-level selection, or deployment reports - troubleshooting deployment failures and dependency ordering Delegate elsewhere when the user is: - authoring Apex code → [platform-apex-generate](../platform-apex-generate/SKILL.md) - authoring LWC components → [experience-lwc-generate](../experience-lwc-generate/SKILL.md) - creating custom objects or fields → [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md), [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md) - building Flows → [automation-flow-generate](../automation-flow-generate/SKILL.md) - doing org data operations → [platform-data-manage](../platform-data-manage/SKILL.md) - authoring or testing Agentforce agents → [agentforce-generate](../agentforce-generate/SKILL.md) --- ## Critical Operating Rules - Use **`sf` CLI v2 only**. - On non-source-tracking orgs, deploy/retrieve commands require an explicit scope such as `--source-dir`, `--metadata`, or `--manifest`. - Prefer **`--dry-run` first** before real deploys. - For Flows, deploy safely and activate only after validation. - Keep test-data creation guidance delegated to **`platform-data-manage`** after metadata is validated or deployed. ### Default deployment order | Phase | Metadata | |---|---| | 1 | Custom objects / fields | | 2 | Permission sets | | 3 | Apex | | 4 | Flows as Draft | | 5 | Flow activation / post-verify | This ordering prevents many dependency and FLS failures. --- ## Required Context to Gather First Ask for or infer: - target org alias and environment type - deployment scope: source-dir, metadata list, or manifest - whether this is validate-only, deploy, quick deploy, retrieve, or CI/CD guidance - required test level and rollback expectations - whether special metadata types are involved (Flow, permission sets, agents, packages) Preflight checks: ```bash sf --version sf org list sf org display --target-org --json test -f sfdx-project.json ``` --- ## Recommended Workflow ### 1. Preflight Confirm auth, repo shape, package directories, and target scope. ### 2. Validate first ```bash sf project deploy start --dry-run --source-dir force-app --target-org --wait 30 --json ``` Use manifest- or metadata-scoped validation when the change set is targeted. ### 3. If validation succeeds, offer the next safe workflow After a successful validation, guide the user to the correct next action: 1. deploy now 2. assign permission sets 3. create test data via [platform-data-manage](../platform-data-manage/SKILL.md) 4. run tests / smoke checks 5. orchestrate multiple post-deploy steps in order ### 4. Deploy the smallest correct scope ```bash # source-dir deploy sf project deploy start --source-dir force-app --target-org --wait 30 --json # manifest deploy sf project deploy start --manifest manifest/package.xml --target-org --test-level RunLocalTests --wait 30 --json # manifest deploy with Spring '26 relevant-test selection sf project deploy start --manifest manifest/package.xml --target-org --test-level RunRelevantTests --wait 30 --json # quick deploy after successful validation sf project deploy quick --job-id --target-org --json ``` ### 5. Verify ```bash sf project deploy report --job-id --target-org --json ``` Then verify tests, Flow state, permission assignments, and smoke-test behavior. ### 6. Report clearly Summarize what deployed, what failed, what was skipped, and what the next safe action is. Output template: [references/deployment-report-template.md](references/deployment-report-template.md) --- ## High-Signal Failure Patterns | Error / symptom | Likely cause | Default fix direction | |---|---|---| | `FIELD_CUSTOM_VALIDATION_EXCEPTION` | validation rule or bad test data | adjust data or rule timing | | `INVALID_CROSS_REFERENCE_KEY` | missing dependency | include referenced metadata first | | `CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY` | trigger / Flow / validation side effect | inspect automation stack and failing logic | | tests fail during deploy | broken code or fragile tests | run targeted tests, fix root cause, revalidate | | field/object not found in permset | wrong order | deploy objects/fields before permission sets | | Flow invalid / version conflict | dependency or activation problem | deploy as Draft, verify, then activate | Full workflows: [references/orchestration.md](references/orchestration.md), [references/trigger-deployment-safety.md](references/trigger-deployment-safety.md) --- ## CI/CD Guidance Default pipeline shape: 1. authenticate 2. validate repo / org state 3. static analysis 4. dry-run deploy 5. tests + coverage gates 6. deploy 7. verify + notify - When org policy and release risk allow it, consider `--test-level RunRelevantTests` for Apex-heavy deployments. - Pair this with modern Apex test annotations such as `@IsTest(testFor=...)` and `@IsTest(isCritical=true)` — see [platform-apex-generate](../platform-apex-generate/SKILL.md) for authoring guidance. Static analysis now uses **Code Analyzer v5** (`sf code-analyzer`), not retired `sf scanner`. Deep reference: [references/deployment-workflows.md](references/deployment-workflows.md) --- ## Agentforce Deployment Note Use this skill to orchestrate **deployment/publish sequencing** around agents, but use the agent-specific skill for authoring decisions: - [agentforce-generate](../agentforce-generate/SKILL.md) for `.agent` authoring, Agent Builder, Prompt Builder, and metadata config For full agent DevOps details, including `Agent:` pseudo metadata, publish/activate, and sync-between-orgs, see: - [references/agent-deployment-guide.md](references/agent-deployment-guide.md) --- ## Cross-Skill Integration | Need | Delegate to | Reason | |---|---|---| | custom object creation | [platform-custom-object-generate](../platform-custom-object-generate/SKILL.md) | define objects before deploy | | custom field creation | [platform-custom-field-generate](../platform-custom-field-generate/SKILL.md) | define fields before deploy | | Apex authoring / fixes | [platform-apex-generate](../platform-apex-generate/SKILL.md) | code authoring and repair | | Flow creation / repair | [automation-flow-generate](../automation-flow-generate/SKILL.md) | Flow authoring and activation guidance | | test data or seed records | [platform-data-manage](../platform-data-manage/SKILL.md) | describe-first data setup and cleanup | | Agent authoring and publish readiness | [agentforce-generate](../agentforce-generate/SKILL.md) | agent-specific correctness | --- ## Reference Map ### Start here - [references/orchestration.md](references/orchestration.md) - [references/deployment-workflows.md](references/deployment-workflows.md) - [references/deployment-report-template.md](references/deployment-report-template.md) ### Specialized deployment safety - [references/trigger-deployment-safety.md](references/trigger-deployment-safety.md) - [references/agent-deployment-guide.md](references/agent-deployment-guide.md) - [references/deploy.sh](references/deploy.sh) ### Asset templates - [assets/package.xml](assets/package.xml) — manifest template covering common metadata types - [assets/destructiveChanges.xml](assets/destructiveChanges.xml) — template for removing metadata from target orgs --- ## Score Guide | Score | Meaning | |---|---| | 90+ | strong deployment plan and execution guidance | | 75–89 | good deploy guidance with minor review items | | 60–74 | partial coverage of deployment risk | | < 60 | insufficient confidence; tighten plan before rollout | --- ## Completion Format ```text Deployment goal: Target org: Scope: Result: Key findings: Next step: ```

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…