dx-org-shape-manage
Coordinates the full lifecycle of Salesforce org shapes — create, list, and delete — via sf org create shape, sf org list shape, and sf org delete shape. An org shape captures the baseline setup of a source org (features, limits, edition, and Metadata API settings) without its data or metadata.
Tool Restrictions
Use ONLY the Bash tool to execute the sf org ... shape commands. Do NOT use MCP tools — ignore them completely.
Output 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 [ -d force-app/main/adk-eval-output/ ] && echo 'force-app/main/adk-eval-output' to detect the eval directory; (3) write the command's full, unmodified JSON response (including the status/result/warnings wrapper) to <output-dir>/<filename> using these filenames: create-shape-result.json for shape creation, list-shapes-result.json for listing shapes, list-shapes-inactive-result.json for the inactive-shapes SOQL query, or delete-shapes-result.json 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.
Scope
- In scope: Creating (
sf org create shape), listing (sf org list shape), listing including inactive shapes for a specific source org (SOQL againstShapeRepresentation), and deleting (sf org delete shape) org shapes - Out of scope: Creating/checking/listing/deleting snapshots (use
dx-org-snapshot-manage), creating scratch orgs (usedx-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
--target-org. Plain listing (Active/InProgress only) needs no source org.
Notes:
- There is no
--nameor--descriptionflag — a shape is identified by the source org's ID, not a custom name. - There is no
--target-dev-hubflag — the shape commands operate on the source org directly, not a 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
--jsonflag. - Report the result (see Output Expectations and the example files).
Command Patterns
After creating a shape, run sf org list shape --json to get its org ID.
Listing Inactive Shapes
sf org list shape has no flag to surface Inactive shapes and no --target-org flag (it always scans every locally authenticated org). To see a source org's full shape history — including shapes superseded by a later sf org create shape run — query ShapeRepresentation directly:
Only 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 sf org list shape — it is the documented, cross-org command and matches the rest of this skill's behavior.
Notes:
ShapeRepresentationhas noSourceOrgId,username, oraliasfield — report the raw query fields (Id,Name,Status,CreatedDate,LastModifiedDate) as returned; do not invent anorgId/username/aliasfor these rows.- Add
WHERE Status = 'Inactive'to scope to only inactive shapes if the user asks for inactive shapes specifically (as opposed to "all"/"history"). - Requires the same
ShapeRepresentationCRUD access as create/delete.
Rules / Constraints
Troubleshooting
Output Expectations
All commands return JSON when --json is used:
- Create →
shapeId,success, anderrors. - List → an array of shapes, each with
orgId,username,alias,shapeId,status(ActiveorInProgress),createdBy, andcreatedDate. - List (including inactive) → a SOQL query result (
records,totalSize,done), each record withId,Name,Status(Active,InProgress, orInactive),CreatedDate, andLastModifiedDate— noorgId/username/alias, sinceShapeRepresentationhas no such fields. - Delete →
orgId,shapeIds(deleted), andfailures. Returns no result if the user declines the confirmation prompt.
See the example files referenced below for full response structures.


