dx-pkg-post-install-configure
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to Use This Skill
何时使用此Skill
Use when automating post-install configuration for any Salesforce managed package. This skill reads the package's post-install documentation, discovers available execution methods, and automates the configuration steps — including permission sets, object/field permissions, page layouts, Visualforce page access, and tab settings.
当您需要为任意Salesforce托管包实现安装后配置自动化时,可使用此Skill。该Skill会读取包的安装后文档,发现可用的执行方法,并自动化配置步骤——包括权限集、对象/字段权限、页面布局、Visualforce页面访问和标签设置。
Input
输入
- Required: Package name (e.g., ,
LMA,FMA)work.com - Optional: Path to post-install doc (PDF, markdown, URL)
If no doc is provided, ask the user to supply it.
- 必填项: 包名称(例如:、
LMA、FMA)work.com - 可选项: 安装后文档路径(PDF、markdown、URL)
如果未提供文档,请要求用户提供。
Workflow
工作流程
Execute phases in order. Each phase must pass before proceeding.
按顺序执行各阶段,每个阶段必须通过后才能进入下一阶段。
Phase 1: Discover Available Execution Methods
阶段1:发现可用的执行方法
Priority order:
- Org-native platform MCP servers (highest — direct org access via Headless 360)
- Claude Code external MCP servers (sf-sobject-all, sf-sobject-all-sb, etc.)
- sf CLI fallback (always available if authenticated)
优先级顺序:
- 组织原生平台MCP服务器(最高优先级——通过Headless 360直接访问组织)
- Claude Code外部MCP服务器(sf-sobject-all、sf-sobject-all-sb等)
- sf CLI备用方案(已认证时始终可用)
Step 1A: Resolve org API version
步骤1A:解析组织API版本
Discover the org's current API version dynamically — never hardcode a version number:
bash
sf org display --target-org <alias> --jsonFrom the JSON response, read (e.g., ). Store this value and use it as in all subsequent REST paths. If the command fails, fall back to the declared in this skill's metadata ().
result.apiVersion"67.0"v<apiVersion>minApiVersion67.0动态发现组织当前的API版本——切勿硬编码版本号:
bash
sf org display --target-org <alias> --json从JSON响应中读取(例如:)。存储该值,并在后续所有REST路径中以的形式使用。如果命令执行失败,回退到本Skill元数据中声明的()。
result.apiVersion"67.0"v<apiVersion>minApiVersion67.0Step 1B: Check for org-native platform MCP servers
步骤1B:检查组织原生平台MCP服务器
Query the Tooling API for MCP server availability:
bash
sf api request rest "/services/data/v<apiVersion>/tooling/query?q=SELECT+Id,DeveloperName,MasterLabel+FROM+McpServerAccess" --target-org <alias>通过Tooling API查询MCP服务器的可用性:
bash
sf api request rest "/services/data/v<apiVersion>/tooling/query?q=SELECT+Id,DeveloperName,MasterLabel+FROM+McpServerAccess" --target-org <alias>Step 1C: Determine execution method
步骤1C:确定执行方法
Check which Claude Code MCP tools are available and authenticated.
MCP tool prefixes by org type:
| Org Type | Tool Prefix |
|---|---|
| Production | |
| Sandbox | |
| Falcon Test (pc-rnd) | |
If MCP needs auth, call the authenticate tool. If auth fails, fall back to sf CLI.
检查哪些Claude Code MCP工具可用且已完成认证。
按组织类型划分的MCP工具前缀:
| 组织类型 | 工具前缀 |
|---|---|
| 生产环境 | |
| 沙箱环境 | |
| Falcon测试环境(pc-rnd) | |
如果MCP需要认证,调用认证工具。如果认证失败,回退到sf CLI。
Phase 2: Verify Authentication & Org Identity
阶段2:验证认证状态与组织身份
- Run a lightweight test query ()
SELECT Id, Name, IsSandbox FROM Organization - If MCP auth fails, automatically fall back to sf CLI
- Display org info and ask user to confirm before proceeding
- 执行轻量测试查询()
SELECT Id, Name, IsSandbox FROM Organization - 如果MCP认证失败,自动回退到sf CLI
- 显示组织信息并请求用户确认后再继续
Phase 3: Verify Package Installation
阶段3:验证包安装状态
- Determine the package namespace (ask user if unknown)
- Check via Tooling API () — do NOT use
InstalledSubscriberPackagePackageLicense - If package not found, stop and inform user
- 确定包命名空间(若未知则询问用户)
- 通过Tooling API()检查——请勿使用
InstalledSubscriberPackagePackageLicense - 如果未找到包,停止操作并告知用户
Phase 4: Read and Parse Post-Install Document
阶段4:读取并解析安装后文档
Read the provided document and extract discrete configuration steps.
Supported formats: PDF, markdown, URL (via WebFetch), pasted text.
Parsing approach:
- Extract each numbered/bulleted step from the document
- Present the extracted steps to the user for validation before proceeding
读取提供的文档并提取离散的配置步骤。
支持的格式: PDF、markdown、URL(通过WebFetch)、粘贴文本。
解析方法:
- 从文档中提取每个编号/项目符号步骤
- 在继续操作前,将提取的步骤呈现给用户进行验证
Phase 5: Classify Steps & Interactive Plan Review
阶段5:步骤分类与交互式计划审核
For each step extracted from the doc, classify as Automated or Manual.
针对从文档中提取的每个步骤,分类为可自动化或需手动操作。
Automation capabilities reference
自动化能力参考
Via MCP (sobject-all) or sf CLI CRUD:
- Record CRUD on any standard or custom object (PermissionSet, ObjectPermissions, FieldPermissions, SetupEntityAccess, PermissionSetTabSetting, PermissionSetAssignment, etc.)
Via Metadata API retrieve/deploy (sf CLI):
- Page layout modifications (add related lists, fields, sections)
- Profile settings
- Custom metadata type records
Via sf CLI Tooling API:
- Tooling queries (InstalledSubscriberPackage, ApexPage, ApexClass, etc.)
- Any REST-accessible Tooling operation
Manual (no API path — requires Setup UI):
- System permissions not exposed via REST
- Connected app OAuth configuration
- Environment Hub linkage
通过MCP(sobject-all)或sf CLI CRUD:
- 对任何标准或自定义对象执行记录CRUD操作(PermissionSet、ObjectPermissions、FieldPermissions、SetupEntityAccess、PermissionSetTabSetting、PermissionSetAssignment等)
通过Metadata API的检索/部署(sf CLI):
- 页面布局修改(添加相关列表、字段、分区)
- 配置文件设置
- 自定义元数据类型记录
通过sf CLI Tooling API:
- Tooling查询(InstalledSubscriberPackage、ApexPage、ApexClass等)
- 任何可通过REST访问的Tooling操作
手动操作(无API路径——需使用Setup UI):
- 未通过REST暴露的系统权限
- 连接应用OAuth配置
- Environment Hub关联
Interactive approval
交互式审批
Present the classified plan and let the user choose:
- "Approve all" — Execute all steps as planned
- "Let me choose" — Select which steps to approve/skip
- "I have questions" — Discuss specific steps before deciding
呈现分类后的计划,让用户选择:
- “全部批准” —— 按计划执行所有步骤
- “让我选择” —— 选择要批准/跳过的步骤
- “我有疑问” —— 在决定前讨论特定步骤
Phase 6: Execute Approved Steps
阶段6:执行已批准的步骤
For each approved step, use the resolved execution method.
针对每个已批准的步骤,使用已确定的执行方法。
Execution method reference
执行方法参考
| Operation | Via MCP | Via sf CLI |
|---|---|---|
| SOQL query | | |
| Create record | | |
| Update record | | |
| Describe object | | |
| Page layout | N/A | Metadata API retrieve/deploy |
| 操作 | 通过MCP | 通过sf CLI |
|---|---|---|
| SOQL查询 | | |
| 创建记录 | | |
| 更新记录 | | |
| 描述对象 | | |
| 页面布局 | 不支持 | Metadata API检索/部署 |
Page layout modifications via Metadata API
通过Metadata API修改页面布局
Use → edit the layout XML → .
sf project retrieve startsf project deploy start使用 → 编辑布局XML → 。
sf project retrieve startsf project deploy startExecution rules
执行规则
- Idempotency: Before creating any record, query to check if it already exists. Skip if so.
- Report after each step: Show success count, skipped items, and reasons.
- Automatic fallback: If MCP fails mid-execution, retry via sf CLI.
- On failure: Report error, ask user to retry/skip/stop.
- 幂等性: 创建任何记录前,先查询该记录是否已存在。若已存在则跳过。
- 每步报告: 显示成功数量、跳过项及原因。
- 自动回退: 如果MCP在执行中途失败,通过sf CLI重试。
- 失败处理: 报告错误,询问用户是否重试/跳过/停止。
Phase 7: Guide Manual Steps (if any)
阶段7:引导手动步骤(如有)
If any steps could not be automated, present each with Setup navigation instructions.
Wait for user confirmation before proceeding to the next.
若存在无法自动化的步骤,为每个步骤提供Setup导航说明。在进入下一步前等待用户确认。
Phase 8: Summary
阶段8:总结
Display final summary with step-by-step status, method used, and any skipped items.
显示最终总结,包含分步状态、使用的方法及所有跳过项。
Error Handling
错误处理
- Auth failure mid-execution: Stop, ask user to re-auth, offer to resume
- Duplicate record errors: Treat as "already configured", skip and continue
- Permission errors: Report which permission is missing, suggest resolution
- Unknown step type: Ask user to clarify, offer to mark as manual
- 执行中途认证失败: 停止操作,要求用户重新认证,提供恢复选项
- 重复记录错误: 视为“已配置”,跳过并继续
- 权限错误: 报告缺失的权限,建议解决方法
- 未知步骤类型: 请求用户澄清,提供标记为手动操作的选项
Notes
注意事项
- Priority: org-native MCP > Claude Code MCP > sf CLI > manual
- sf CLI is always a valid fallback for all CRUD and Tooling API operations
- Page layout modifications are automated via Metadata API retrieve/deploy
- Always verify org identity before making changes
- All actions respect the authenticated user's permissions
- 优先级:组织原生MCP > Claude Code MCP > sf CLI > 手动操作
- sf CLI始终是所有CRUD和Tooling API操作的有效备用方案
- 页面布局修改通过Metadata API的检索/部署实现自动化
- 进行更改前务必验证组织身份
- 所有操作均遵循已认证用户的权限