Platform Manifest Generate

作者 forcedotcom3c15867bdb9d无许可证1K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库昨天更新

Use to generate a package.xml (and optionally destructiveChanges.xml / Pre / Post) from a source dir, a component list, or org introspection. Trigger on 'generate a package.xml from this folder', 'create a manifest for these classes', 'I need a deploy manifest', or 'destructiveChanges.xml for deletions'. Encodes wildcard-vs-explicit-member rules per metadata type. DO NOT TRIGGER to deploy (platform-metadata-deploy), delete (platform-destructive-deploy), or retrieve (platform-metadata-retrieve).

AI 生成的概览

根据源目录、组件列表或组织内省生成 Salesforce package.xml 及 destructive 清单文件。

功能
该技能用于编写 Salesforce 元数据清单文件:package.xml、destructiveChanges.xml、destructiveChangesPre.xml 和 destructiveChangesPost.xml。它支持三种输入方式——本地源目录、显式组件列表或组织内省——主要通过封装 sf project generate manifest 命令行实现,并在命令行无法表达时提供手工编写 XML 的备选路径。它还说明了各元数据类型通配符与显式成员的规则,以及从 sfdx-project.json 解析 API 版本的方法。它只负责生成文件,随后交由部署或检索类技能处理。
适用场景
当需要从元数据文件夹、指定组件列表或组织当前内容构建部署清单时使用。也适用于为删除操作生成 destructive 清单,或一次性同时生成 package.xml 与 destructive 清单。不适用于执行部署、检索或验证。
运行要求
需要 Salesforce CLI(sf,2.0.0 或更高版本)以及 Bash 权限来运行 sf project generate manifest;手工备选路径使用 Write 工具。组织内省需要已认证的组织别名或用户名。读取 sourceApiVersion 可能用到 jq 和 sfdx-project.json。该技能不附带脚本,仅为指令。

platform-manifest-generate

Produce a Salesforce metadata manifest — package.xml (or one of the destructive variants) — from local source, an org, or an explicit component list. This skill is purely about authoring the manifest file. Hand off to platform-metadata-deploy or platform-destructive-deploy once the file exists.


Tool Restrictions

Use ONLY the Bash tool to run sf project generate manifest, and the Write tool for the hand-built fallback path. Do NOT use MCP tools.


When This Skill Owns the Task

Use platform-manifest-generate when the work involves any of:

  • Building a package.xml from a source directory (e.g. force-app/main/default/classes/)
  • Building a manifest from an explicit list of components (e.g. AccountService, ContactSelector, Account)
  • Building a manifest by introspecting an org via --from-org
  • Producing destructiveChanges.xml, destructiveChangesPre.xml, or destructiveChangesPost.xml for a deletion
  • Producing both a package.xml and a destructive manifest in one operation

Delegate elsewhere when the user is:

  • Running the deploy itself → platform-metadata-deploy
  • Validating before a prod release → platform-deploy-validate
  • Executing the destructive deploy → platform-destructive-deploy (that skill uses the manifest this skill generates)
  • Retrieving metadata to local → platform-metadata-retrieve

Two Generation Paths

Path A — CLI-driven (recommended)

Wrap sf project generate manifest. Always prefer this path; it knows about every metadata type and produces canonical XML — and never emits *, sidestepping the wildcard hazard entirely.

The CLI offers three input modes (mutually exclusive):

InputFlagUse when
Source directory--source-dir (-p)User points to a folder containing already-on-disk metadata
Component list--metadata (-m)User names specific components, e.g. ApexClass:AccountService CustomObject:Account
Org introspection--from-orgUser wants every component currently in an org (or a filtered subset)

You can specify either --source-dir or --metadata, not both. --from-org may be combined with --metadata (filter included types) or --excluded-metadata (filter out types).

Verified flags (do not invent flags — verify with sf project generate manifest --help if unsure):

FlagPurpose
--source-dir, -pLocal source paths to scan
--metadata, -mComponent names to include (e.g. ApexClass:AccountService)
--from-orgUsername or alias of org to introspect
--name, -nCustom output filename (mutually exclusive with --type)
--type, -tPredefined manifest kind: package | pre | post | destroy
--output-dir, -dDirectory to write the manifest into
--api-versionOverride the API version for the request
--include-packages, -cInclude managed and/or unlocked package metadata when using --from-org
--excluded-metadataTypes to exclude when using --from-org
--jsonMachine-readable output

Manifest filename by --type:

--typeOutput file
package (default)package.xml
predestructiveChangesPre.xml
postdestructiveChangesPost.xml
destroydestructiveChanges.xml

You can specify either --type or --name, not both.

Canonical CLI examples
bash
# Build package.xml from a source dirsf project generate manifest \  --source-dir force-app/main/default \  --name package.xml \  --output-dir manifest \  --json
# Build package.xml from an explicit component listsf project generate manifest \  --metadata ApexClass:AccountService \  --metadata ApexClass:ContactSelector \  --metadata CustomObject:Account \  --name package.xml \  --output-dir manifest \  --json
# Build destructiveChanges.xml from a component listsf project generate manifest \  --metadata CustomField:Account.OldField__c \  --metadata CustomField:Account.OldStatus__c \  --type destroy \  --output-dir manifest \  --json
# Build a manifest by introspecting an org (filtered)sf project generate manifest \  --from-org <alias> \  --metadata ApexClass,CustomObject,CustomLabels \  --output-dir manifest \  --json

If both a package.xml and a destructive manifest are needed, run the CLI twice — once with --type package (or default), once with --type destroy / pre / post.

Path B — Hand-built fallback

Use this only when the CLI cannot express the user's intent — e.g. they want "just the Apex classes I changed today" and the change set is derived from git diff rather than a clean directory or component list. In that case:

  1. Resolve the components yourself (e.g. parse git diff --name-only and map paths back to metadata types).
  2. Group by metadata type.
  3. Emit the XML inline using the schema below.
  4. Always cross-check by running sf project deploy start --manifest <file> --dry-run (hand off to platform-metadata-deploy).
Manifest XML schema

Root element is <Package> in the metadata namespace. Each metadata type gets one <types> block containing one <members> per component plus a single <name>. The trailing <version> declares the API version for the manifest.

xml
<?xml version="1.0" encoding="UTF-8"?><Package xmlns="http://soap.sforce.com/2006/04/metadata">    <types>        <members>AccountService</members>        <members>ContactSelector</members>        <name>ApexClass</name>    </types>    <types>        <members>Account</members>        <name>CustomObject</name>    </types>    <types>        <members>Account.Status__c</members>        <name>CustomField</name>    </types>    <version>62.0</version></Package>

Notes:

  • For component-bound types like CustomField, BusinessProcess, RecordType, Layout, ListView, ValidationRule, WebLink, members use Object.Name notation.
  • destructiveChanges.xml, destructiveChangesPre.xml, and destructiveChangesPost.xml use the same XML structure — only the filename and intent differ.
  • An empty manifest (no <types> blocks) is legal and is sometimes paired with a destructive manifest:
xml
<?xml version="1.0" encoding="UTF-8"?><Package xmlns="http://soap.sforce.com/2006/04/metadata">    <version>62.0</version></Package>

API Version Handling

The <version> element at the bottom of every manifest must reflect the project's API version.

Resolution order:

  1. Read sourceApiVersion from sfdx-project.json at the project root.
  2. If --api-version was passed by the user, use that instead.
  3. If neither is available, fall back to the value reported by sf --version (the CLI's bundled API version) — but warn the user and recommend they set sourceApiVersion in sfdx-project.json for reproducibility.
  4. Never silently hardcode a value (e.g. 62.0) into output without surfacing the source.
bash
# Quick read of sourceApiVersionjq -r '.sourceApiVersion' sfdx-project.json

When using the CLI path, omit --api-version unless the user explicitly overrides — the CLI already reads sourceApiVersion.


Wildcard Members (<members>*</members>)

A wildcard member matches every component of that metadata type. It is not legal for every type. Using * for a disallowed type causes deploy/retrieve errors like Wildcards are not supported for this metadata type.

Wildcard NOT allowed (must enumerate)

These types require explicit member names. Common examples: Profile, PermissionSet, PermissionSetGroup, CustomLabels, CustomObjectTranslation, Layout, Workflow (in some package configurations), SharingRules, StandardValueSet, ManagedTopics, and most "container" types whose contents are object-bound (CustomField, RecordType, BusinessProcess, ListView, ValidationRule, WebLink, CompactLayout).

For these, enumerate explicitly:

xml
<types>    <members>Admin</members>    <members>Standard User</members>    <name>Profile</name></types>

Wildcard generally allowed

Most "self-contained" component types accept *. Examples: ApexClass, ApexTrigger, ApexComponent, ApexPage, AuraDefinitionBundle, LightningComponentBundle, CustomApplication, CustomTab, StaticResource, EmailTemplate, Report, Dashboard, Flow, FlexiPage, CustomMetadata. See references/wildcard-allowlist.md [blocked] for the full enumeration and edge cases.

Rule of thumb: if you are not certain, list the components explicitly. The CLI path (--source-dir / --metadata) sidesteps this problem because it never emits *.


Examples

Example 1 — Build package.xml from a directory

"Generate package.xml from force-app/main/default/classes/"

bash
sf project generate manifest \  --source-dir force-app/main/default/classes \  --name package.xml \  --output-dir manifest \  --json

Result: manifest/package.xml listing every Apex class in that folder.

Example 2 — Build a manifest covering specific components

"Build a manifest covering AccountService, ContactSelector, and the Account custom object"

bash
sf project generate manifest \  --metadata ApexClass:AccountService \  --metadata ApexClass:ContactSelector \  --metadata CustomObject:Account \  --name package.xml \  --output-dir manifest \  --json

Result: manifest/package.xml containing exactly those three components.

Example 3 — Generate both package.xml and destructiveChanges.xml for deletions

"Create both package.xml and destructiveChanges.xml for these deletions: Account.OldField__c, Account.OldStatus__c"

bash
# Empty/minimal package.xml (deletion-only deploy still needs a package descriptor)sf project generate manifest \  --metadata CustomLabels \  --name package.xml \  --output-dir manifest \  --json
# destructiveChanges.xmlsf project generate manifest \  --metadata CustomField:Account.OldField__c \  --metadata CustomField:Account.OldStatus__c \  --type destroy \  --output-dir manifest \  --json

After generation, hand off to platform-destructive-deploy to validate and execute the deletion.


Failure Modes

SymptomLikely causeRecovery
Path does not exist: <dir>--source-dir points at a missing folderConfirm the path; use ls to verify; default to force-app/main/default if the user is vague
Generated manifest is emptySource dir contained no recognizable metadata, or all files were ignoredCheck .forceignore; verify the path actually contains metadata files (*.cls, *-meta.xml, etc.)
Wildcards are not supported for this metadata type at deploy timeHand-built manifest used * for a disallowed typeSee the wildcard allowlist above; enumerate the components explicitly
<version> missing or mismatchedsfdx-project.json lacks sourceApiVersionAdd sourceApiVersion to sfdx-project.json, or pass --api-version to the CLI
You can specify either --type or --name, but not bothCLI invocation passed both flagsDrop one; use --type for predefined names, --name for a custom one
You can specify either --source-dir or --metadata, but not bothCLI invocation passed bothPick one input mode
Components missing from --from-org outputOrg introspection batched too aggressively, or the type is in a managed packageSet SF_LIST_METADATA_BATCH_SIZE lower; add --include-packages managed if intended

Cross-Skill Integration

NeedDelegate toReason
Run a deploy with the generated manifestplatform-metadata-deployThis skill stops at file generation
Validate before a prod releaseplatform-deploy-validatePre-flight test against prod
Actually delete the components in the destructive manifestplatform-destructive-deployThat skill validates and executes the destructive deploy
Retrieve metadata listed in the manifestplatform-metadata-retrievePulls org metadata to local
Author the metadata being listed in the manifestOther platform-* generators (e.g. platform-custom-object-generate)The manifest just lists what already exists on disk

Completion Format

text
Manifest goal: <package | pre | post | destroy>Input mode: <source-dir | metadata list | from-org | hand-built>Output: <path/to/manifest.xml>API version: <value> (source: sfdx-project.json | --api-version | CLI default)Component count: <N> across <M> metadata typesNext step: <platform-metadata-deploy | platform-deploy-validate | platform-destructive-deploy>

来源与署名

来源:forcedotcom/sf-skills位于plugins/builder/salesforce-development/skills/platform-manifest-generate提交3c15867

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 forcedotcom/sf-skills 的技能

Service Itsm Teams Itservice Configure

forcedotcom

Configure the "Set Up Salesforce IT Service" checklist for Microsoft Teams Employee Service (ITSM) — the employee side, covering app enablement, marketplace install guidance, user access assignment, and Digital Experience Site selection. Use this for: 'turn on Salesforce IT Service', 'set up IT Service on Teams', 'assign Teams for Employee permission set', 'give employees access to Teams for Employee Service', 'manage user access for Teams ITSM', 'grant users the permission sets needed for Teams Employee Service', 'select a digital experience site for Teams', 'install Salesforce IT Service app on Teams', or any request to complete the IT Service half of the Teams ITSM Go page checklist (including the Manage User Access step). DO NOT TRIGGER for the base Teams Salesforce Go page toggle or Azure/Entra app setup (service-itsm-teams-configure) or for the IT Desk/fulfiller half of the checklist (service-itsm-teams-itdesk-configure).

待分类1K昨天更新

Service Itsm Teams Coordinate

forcedotcom

End-to-end autopilot orchestrator for setting up Microsoft Teams integration in Salesforce Service Cloud ITSM — runs the whole flow (enable the Teams for Employee Service Go feature, register the Microsoft Entra app, populate Named Credentials, configure the IT Desk and IT Service checklists, turn on Swarming, and optionally embed the Agentforce agent) in one continuous pass, stopping only at the points a human must act. Use when the user asks to set up Microsoft Teams for ITSM end to end, 'set up teams for it service', 'do the whole teams itsm setup', 'configure microsoft teams for employee service', or wants a guided Teams ITSM walkthrough. Delegates each stage to a specialized child skill while driving the sequence itself. DO NOT TRIGGER when the user asks to enable Teams alone, configure just the IT Desk or IT Service checklist alone, or enable Swarming alone — delegate directly to the specific child skill in those cases.

待分类1K昨天更新

Service Itsm Teams Itdesk Configure

forcedotcom

Configure the "Set Up Salesforce IT Desk" checklist for Microsoft Teams Employee Service (ITSM) — the fulfiller/agent side, covering app enablement, marketplace install guidance, user access assignment, and Swarming collaboration-tool setup. Use this for: 'turn on Salesforce IT Desk', 'set up IT Desk on Teams', 'assign Teams for IT Desk permission set', 'set Teams as collaboration tool for swarming', 'install Salesforce IT Desk app on Teams', or any request to complete the IT Desk half of the Teams ITSM Go page checklist. DO NOT TRIGGER for the base Teams Salesforce Go page toggle or Azure/Entra app setup (service-itsm-teams-configure) or for the IT Service/employee half of the checklist (service-itsm-teams-itservice-configure).

待分类1K昨天更新

Service Itsm Teams Debug

forcedotcom

通过针对 Salesforce 组织运行通过/失败配置检查清单,诊断 Microsoft Teams 员工服务(ITSM)配置故障。

DevOps & Cloud1K昨天更新

Service Itsm Teams Employee Agent Configure

forcedotcom

Configure the embedded Agentforce Employee Agent so it replies inside the Microsoft Teams ITSM custom client ('Salesforce Employee Assist' / 'Ask AI Agent'). Use this for: 'set up employee agent in Teams', 'embed Agentforce agent in Teams', 'make the IT Service Employee Agent reply in Teams', 'Teams Ask AI Agent not responding', 'agent joins then leaves without replying', 'configure MIAW deployment for Teams employee agent', 'Teams embedded messaging agent setup'. Builds the whole stack headlessly (zero Setup-UI clicks): the Web messaging channel with User Verification ON, the Enhanced Chat User Verification Key Set (JWKS_URL) it requires, the Teams_AgentForce custom-client deployment, the routing flow to the agent, and the Agent Access permission set that lets the portal user reach the agent. DO NOT TRIGGER for enabling the Teams feature Salesforce Go page toggle (service-itsm-teams-configure) or for configuring notification preferences.

待分类1K昨天更新

Service Itsm Swarming Configure

forcedotcom

通过 Connect API 调用启用 Salesforce Swarming ITSM 功能,并将协作工具设为 Teams。

DevOps & Cloud1K昨天更新