dx-org-shape-manage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedx-org-shape-manage
dx-org-shape-manage
Coordinates the full lifecycle of Salesforce org shapes — create, list, and delete — via , , and . An org shape captures the baseline setup of a source org (features, limits, edition, and Metadata API settings) without its data or metadata.
sf org create shapesf org list shapesf org delete shape通过、和命令协调Salesforce Org Shape的完整生命周期——创建、列出和删除。Org Shape捕获源组织的基线设置(功能、限制、版本和Metadata API设置),不包含其数据或元数据。
sf org create shapesf org list shapesf org delete shapeTool Restrictions
工具限制
Use ONLY the Bash tool to execute the commands. Do NOT use MCP tools — ignore them completely.
sf org ... shapeOutput artifacts for eval/testing: ALWAYS write the command's complete JSON response to a file when an output directory is available. Do NOT ask the user what file to write — this skill defines the filenames. After executing each command: (1) if the user specified an output path (e.g. "write all generated files into folder X"), write there immediately; (2) otherwise run to detect the eval directory; (3) write the command's full, unmodified JSON response (including the // wrapper) to using these filenames: for shape creation, for listing shapes, for the inactive-shapes SOQL query, or for shape deletion. This is the generated output — write it without asking. Do NOT say "no files to generate" for these operations; the JSON result IS the output artifact.
[ -d force-app/main/adk-eval-output/ ] && echo 'force-app/main/adk-eval-output'statusresultwarnings<output-dir>/<filename>create-shape-result.jsonlist-shapes-result.jsonlist-shapes-inactive-result.jsondelete-shapes-result.json仅使用Bash工具执行命令。请勿使用MCP工具——完全忽略它们。
sf org ... shape评估/测试输出产物: 当存在输出目录时,务必将命令的完整JSON响应写入文件。不要询问用户要写入哪个文件——此Skill已定义文件名。执行每个命令后:(1) 如果用户指定了输出路径(例如“将所有生成的文件写入文件夹X”),立即写入该路径;(2) 否则运行来检测评估目录;(3) 将命令的完整、未修改的JSON响应(包括//包装器)写入,文件名规则如下:创建Shape用,列出Shape用,查询非活跃Shape用,删除Shape用。这就是生成的输出——无需询问直接写入。对于这些操作,请勿说“无文件生成”;JSON结果就是输出产物。
[ -d force-app/main/adk-eval-output/ ] && echo 'force-app/main/adk-eval-output'statusresultwarnings<output-dir>/<filename>create-shape-result.jsonlist-shapes-result.jsonlist-shapes-inactive-result.jsondelete-shapes-result.jsonScope
适用范围
- In scope: Creating (), listing (
sf org create shape), listing including inactive shapes for a specific source org (SOQL againstsf org list shape), and deleting (ShapeRepresentation) org shapessf org delete shape - Out of scope: Creating snapshots, creating scratch orgs (use )
dx-org-manage
- 范围内:创建()、列出(
sf org create shape)、列出特定源组织的所有Shape(包括非活跃的,通过对sf org list shape执行SOQL查询)以及删除(ShapeRepresentation)Org Shapesf org delete shape - 范围外:创建快照、创建临时组织(使用)
dx-org-manage
Required Inputs
必填输入
Infer from the user's request:
- Operation: create, list, list-including-inactive, or delete (see Workflow step 1)
- Source org (create, delete, & list-including-inactive): Username or alias of the org to shape / whose shapes to delete or query. Passed via . Plain listing (Active/InProgress only) needs no source org.
--target-org
Notes:
- There is no or
--nameflag — a shape is identified by the source org's ID, not a custom name.--description - There is no flag — the shape commands operate on the source org directly, not a Dev Hub.
--target-dev-hub
从用户请求中推断:
- 操作类型:create、list、list-including-inactive或delete(见工作流程步骤1)
- 源组织(创建、删除、列出含非活跃Shape时):要创建Shape的组织/要删除或查询其Shape的组织的用户名或别名。通过参数传递。普通列出操作(仅Active/InProgress状态)无需指定源组织。
--target-org
注意:
- 没有或
--name参数——Shape通过源组织的ID标识,而非自定义名称。--description - 没有参数——Shape命令直接对源组织操作,而非Dev Hub。
--target-dev-hub
Workflow
工作流程
- Identify the operation and match it to the command pattern below.
- For create/delete, confirm the source org — identify the username/alias. If not provided, check the default with .
sf config get target-org - Execute via Bash tool with the flag.
--json - Report the result (see Output Expectations and the example files).
- 识别操作类型,并匹配下方的命令模式。
- 创建/删除操作时,确认源组织——识别用户名/别名。如果未提供,通过检查默认组织。
sf config get target-org - 通过Bash工具执行,并添加参数。
--json - 报告结果(见输出预期和示例文件)。
Command Patterns
命令模式
| Operation | User intent | Execute via Bash tool |
|---|---|---|
| Create | Create shape from an org | |
| Create | Create shape from the default target org | |
| List | List all org shapes + IDs/status (Active/InProgress only) | |
| List | Save the list to a file | |
| List (including inactive) | List all shapes — including | |
| Delete | Delete shapes for an org (with confirm prompt) | |
| Delete | Delete shapes without prompting (scripts/CI) | |
After creating a shape, run to get its org ID.
sf org list shape --json| 操作类型 | 用户意图 | 通过Bash工具执行 |
|---|---|---|
| Create | 从某组织创建Shape | |
| Create | 从默认目标组织创建Shape | |
| List | 列出所有Org Shape及其ID/状态(仅Active/InProgress) | |
| List | 将列表保存到文件 | |
| List (包含非活跃) | 列出特定源组织的所有Shape——包括 | |
| Delete | 删除某组织的Shape(带确认提示) | |
| Delete | 无提示删除Shape(脚本/CI场景) | |
创建Shape后,运行获取其组织ID。
sf org list shape --jsonListing Inactive Shapes
列出非活跃Shape
sf org list shapeInactive--target-orgsf org create shapeShapeRepresentationbash
sf data query --target-org <alias> --query "SELECT Id, Name, Status, CreatedDate, LastModifiedDate FROM ShapeRepresentation" --jsonOnly use this query when the user explicitly asks for inactive or all/historical shapes for a named source org. For ordinary "list my org shapes" requests, keep using — it is the documented, cross-org command and matches the rest of this skill's behavior.
sf org list shapeNotes:
- has no
ShapeRepresentation,SourceOrgId, orusernamefield — report the raw query fields (alias,Id,Name,Status,CreatedDate) as returned; do not invent anLastModifiedDate/orgId/usernamefor these rows.alias - Add to scope to only inactive shapes if the user asks for inactive shapes specifically (as opposed to "all"/"history").
WHERE Status = 'Inactive' - Requires the same CRUD access as create/delete.
ShapeRepresentation
sf org list shapeInactive--target-orgsf org create shapeShapeRepresentationbash
sf data query --target-org <alias> --query "SELECT Id, Name, Status, CreatedDate, LastModifiedDate FROM ShapeRepresentation" --json仅当用户明确要求查看特定源组织的非活跃或所有/历史Shape时,才使用此查询。对于普通的“列出我的Org Shape”请求,继续使用——这是官方文档推荐的跨组织命令,与本Skill的其他行为一致。
sf org list shape注意:
- 没有
ShapeRepresentation、SourceOrgId或username字段——按返回的原始查询字段(alias、Id、Name、Status、CreatedDate)报告;不要为这些记录虚构LastModifiedDate/orgId/username。alias - 如果用户明确要求查看非活跃Shape(而非“所有”/“历史”),添加来筛选仅非活跃Shape。
WHERE Status = 'Inactive' - 需要与创建/删除操作相同的CRUD权限。
ShapeRepresentation
Rules / Constraints
规则与约束
| Constraint | Rationale |
|---|---|
Always use | Provides structured output for reliable parsing and error handling |
| Source org must have Org Shape for Scratch Orgs enabled | Without it, create/delete fail with a no-access error — enable via Setup → Scratch Orgs → Enable Org Shape for Scratch Orgs in the source org |
User needs access to the | Without CRUD access, create fails with |
| Create/delete operate on this org; it is not a Dev Hub operation. List takes no |
No | A shape is keyed off the source org's ID, not a custom name |
| One active shape per source org | Re-running create replaces the prior shape (marks it inactive). |
| Use |
| 约束 | 理由 |
|---|---|
始终使用 | 提供结构化输出,便于可靠解析和错误处理 |
| 源组织必须启用Org Shape for Scratch Orgs | 未启用的话,创建/删除操作会因无权限错误失败——在源组织中通过设置 → 临时组织 → 启用Org Shape for Scratch Orgs开启 |
用户需要拥有 | 无CRUD权限的话,创建操作会失败并提示 |
| 创建/删除操作直接对该组织执行;这不是Dev Hub操作。列出操作不需要 |
没有 | Shape以源组织的ID为标识,而非自定义名称 |
| 每个源组织只能有一个活跃Shape | 再次运行创建命令会替换之前的Shape(标记为非活跃)。 |
| 非交互/CI场景使用 |
Troubleshooting
故障排除
| Issue | Resolution |
|---|---|
| Source org isn't enabled for org shape — in the source org go to Setup → Scratch Orgs → Enable Org Shape for Scratch Orgs, turn it on, then retry |
| You lack access to the |
| Generic create failure — verify the source org is reachable/authenticated and retry; if it persists, contact Salesforce support |
| The source org is not fully enabled for org shape even though |
| No shapes exist yet (or none are |
| It only surfaces |
| Delete exits with code 68 (partial failure) | Some shapes failed to delete — inspect the |
| Delete exits with code 1 (all failed) | Deletion failed entirely — confirm the org is enabled for org shape and you have access |
| Source org alias doesn't exist or isn't authenticated — verify with |
No default target org and | Provide |
| 问题 | 解决方法 |
|---|---|
| 源组织未启用Org Shape——在源组织中进入设置 → 临时组织 → 启用Org Shape for Scratch Orgs,开启后重试 |
| 你没有 |
| 通用创建失败错误——验证源组织是否可访问/已认证,然后重试;如果问题持续,联系Salesforce支持 |
创建时出现 | 即使 |
| 还没有Shape存在(或没有处于 |
| 它仅显示 |
| 删除操作返回代码68(部分失败) | 部分Shape删除失败——检查JSON中的 |
| 删除操作返回代码1(全部失败) | 删除完全失败——确认组织已启用Org Shape且你拥有访问权限 |
| 源组织别名不存在或未认证——通过 |
没有默认目标组织且未指定 | 指定 |
Output Expectations
输出预期
All commands return JSON when is used:
--json- Create → ,
shapeId, andsuccess.errors - List → an array of shapes, each with ,
orgId,username,alias,shapeId(statusorActive),InProgress, andcreatedBy.createdDate - List (including inactive) → a SOQL query result (,
records,totalSize), each record withdone,Id,Name(Status,Active, orInProgress),Inactive, andCreatedDate— noLastModifiedDate/orgId/username, sincealiashas no such fields.ShapeRepresentation - Delete → ,
orgId(deleted), andshapeIds. Returns no result if the user declines the confirmation prompt.failures
See the example files referenced below for full response structures.
添加参数后,所有命令都会返回JSON:
--json- Create → 返回、
shapeId和success。errors - List → 返回Shape数组,每个Shape包含、
orgId、username、alias、shapeId(status或Active)、InProgress和createdBy。createdDate - List (包含非活跃) → 返回SOQL查询结果(、
records、totalSize),每条记录包含done、Id、Name(Status、Active或InProgress)、Inactive和CreatedDate——没有LastModifiedDate/orgId/username,因为alias没有这些字段。ShapeRepresentation - Delete → 返回、
orgId(已删除的ID)和shapeIds。如果用户拒绝确认提示,不会返回任何结果。failures
请参考下方引用的示例文件查看完整响应结构。
Cross-Skill Integration
跨Skill集成
| Need | Delegate to |
|---|---|
| Create a scratch org, or create/use a snapshot | |
| 需求 | 委托给 |
|---|---|
| 创建临时组织,或创建/使用快照 | |
Reference File Index
参考文件索引
| File | When to read |
|---|---|
| To understand the successful shape-creation response structure |
| To handle common create error scenarios |
| To understand the list response structure (org IDs, status) |
| To understand the SOQL query response structure for listing shapes including |
| To understand the delete response structure (deleted IDs, failures) |
| For detailed explanation of all flags across create/list/delete |
| 文件 | 阅读场景 |
|---|---|
| 了解成功创建Shape的响应结构 |
| 处理常见的创建错误场景 |
| 了解列出操作的响应结构(组织ID、状态) |
| 了解包含 |
| 了解删除操作的响应结构(已删除ID、失败信息) |
| 详细了解创建/列出/删除操作的所有参数 |