@salesforce/afv-skills 1.71.0 → 1.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-generate/SKILL.md +8 -0
  3. package/skills/agentforce-generate/assets/agents/README.md +1 -1
  4. package/skills/agentforce-generate/references/actions-reference.md +4 -0
  5. package/skills/agentforce-generate/references/mcp-actions-in-agent-script.md +233 -0
  6. package/skills/agentforce-generate/references/reference-map.md +1 -0
  7. package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +9 -7
  8. package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +78 -4
  9. package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +17 -13
  10. package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +110 -9
  11. package/skills/experience-app-mcp-generate/references/troubleshooting.md +1 -1
  12. package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +49 -18
  13. package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +1 -1
  14. package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +1 -1
  15. package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +3 -1
  16. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +32 -26
  17. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +6 -24
  18. package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +4 -6
  19. package/skills/platform-apex-generate/SKILL.md +2 -1
  20. package/skills/platform-apex-generate/assets/abstract.cls +0 -4
  21. package/skills/platform-apex-generate/assets/invocable-action-extension.invocableactionextension-meta.xml +28 -0
  22. package/skills/platform-apex-generate/assets/invocable.cls +2 -0
  23. package/skills/platform-apex-generate/references/dml-declarations.md +69 -0
  24. package/skills/platform-metadata-discovery-get/SKILL.md +15 -10
  25. package/skills/platform-metadata-grounding-get/SKILL.md +5 -3
  26. package/skills/service-add-agents-to-contact-center-create/SKILL.md +138 -0
  27. package/skills/service-agentforce-contact-center-coordinate/SKILL.md +5 -5
  28. package/skills/service-agentforce-contact-center-coordinate/references/omni-flow-routing.md +3 -3
  29. package/skills/service-agentforce-contact-center-coordinate/scripts/create-routing-flows.sh +8 -3
  30. package/skills/service-agentforce-contact-center-coordinate/scripts/create-voice-agent.sh +5 -5
  31. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-acc-queue.sh +10 -1
  32. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-channel-line.sh +4 -0
  33. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-flow-definition.sh +5 -0
  34. package/skills/service-agentforce-contact-center-coordinate/scripts/verify-number-live.sh +6 -1
  35. package/skills/service-concierge-portal-generate/SKILL.md +1 -1
  36. package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +21 -8
  37. package/skills/service-digital-engagement-channel-configure/SKILL.md +45 -32
  38. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_set_jwks_template.xml +20 -0
  39. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_set_jwks_url_template.xml +23 -0
  40. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_template.xml +15 -0
  41. package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +1 -1
  42. package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +3 -3
  43. package/skills/service-digital-engagement-channel-configure/examples/jwks_upload_key.xml +11 -0
  44. package/skills/service-digital-engagement-channel-configure/examples/jwks_upload_keyset.xml +13 -0
  45. package/skills/service-digital-engagement-channel-configure/examples/jwks_url_keyset.xml +17 -0
  46. package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +3 -3
  47. package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
  48. package/skills/service-digital-engagement-channel-configure/examples/user_channel.xml +1 -1
  49. package/skills/service-digital-engagement-channel-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  50. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +1 -1
  51. package/skills/service-digital-engagement-channel-configure/references/keyset_settings.md +46 -0
  52. package/skills/service-digital-engagement-channel-configure/references/keyset_setup.md +42 -0
  53. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +28 -27
  54. package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +2 -5
  55. package/skills/service-digital-engagement-channel-configure/references/routing_transitions.md +2 -2
  56. package/skills/service-digital-engagement-channel-configure/references/user_verification.md +3 -4
  57. package/skills/service-digital-engagement-channel-configure/references/user_verification_client.md +51 -0
  58. package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +7 -0
  59. package/skills/service-digital-engagement-deployment-configure/SKILL.md +28 -10
  60. package/skills/service-digital-engagement-deployment-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  61. package/skills/service-digital-engagement-deployment-configure/references/branding_and_tooling.md +2 -2
  62. package/skills/service-digital-engagement-deployment-configure/references/code_snippet.md +2 -2
  63. package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +13 -7
  64. package/skills/service-digital-engagement-deployment-configure/references/custom_labels.md +127 -0
  65. package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +2 -1
  66. package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +24 -25
  67. package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +1 -1
  68. package/skills/service-digital-engagement-deployment-configure/scripts/check-api-version.sh +7 -0
  69. package/skills/service-email-to-case-configure/SKILL.md +89 -80
  70. package/skills/service-email-to-case-configure/assets/CaseSettings.settings-meta.xml +1 -1
  71. package/skills/service-email-to-case-configure/examples/CaseSettings-two-addresses.settings-meta.xml +6 -3
  72. package/skills/service-email-to-case-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  73. package/skills/service-email-to-case-configure/references/agent-delegation.md +22 -0
  74. package/skills/service-email-to-case-configure/references/apply-mechanics.md +15 -12
  75. package/skills/service-email-to-case-configure/references/end-to-end-proof.md +14 -0
  76. package/skills/service-email-to-case-configure/references/onboarding-delegated-run.md +66 -0
  77. package/skills/service-email-to-case-configure/references/routing_address_reference.md +6 -2
  78. package/skills/service-email-to-case-configure/references/troubleshooting.md +17 -9
  79. package/skills/service-email-to-case-configure/scripts/apply-casesettings.py +863 -925
  80. package/skills/service-email-to-case-configure/scripts/tests/_agent.py +162 -0
  81. package/skills/service-email-to-case-configure/scripts/tests/_fakeorg.py +119 -155
  82. package/skills/service-email-to-case-configure/scripts/tests/_run.py +10 -17
  83. package/skills/service-email-to-case-configure/scripts/tests/test_apply_org_scenarios.py +14 -14
  84. package/skills/service-email-to-case-configure/scripts/tests/test_dispatch_contract.py +316 -0
  85. package/skills/service-email-to-case-configure/scripts/tests/test_new_capabilities.py +12 -43
  86. package/skills/service-email-to-case-configure/scripts/tests/test_validate_casesettings.py +13 -0
  87. package/skills/service-email-to-case-configure/scripts/validate-casesettings.py +17 -5
  88. package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +11 -11
  89. package/skills/service-remove-agents-from-contact-center-assign/SKILL.md +145 -0
  90. package/skills/service-voice-configuration-manage/SKILL.md +206 -0
  91. package/skills/service-voice-configuration-manage/assets/regions.json +23 -0
  92. package/skills/service-voice-configuration-manage/references/lookups.md +91 -0
  93. package/skills/service-voice-configuration-manage/references/voice_config_api.md +169 -0
  94. package/skills/service-voice-configuration-manage/scripts/create-configuration.sh +20 -0
  95. package/skills/service-voice-configuration-manage/scripts/delete-configuration.sh +31 -0
  96. package/skills/service-voice-configuration-manage/scripts/get-configuration.sh +18 -0
  97. package/skills/service-voice-configuration-manage/scripts/lib.sh +22 -0
  98. package/skills/service-voice-configuration-manage/scripts/list-configurations.sh +18 -0
  99. package/skills/service-voice-configuration-manage/scripts/lookup-caller-lines.sh +30 -0
  100. package/skills/service-voice-configuration-manage/scripts/lookup-flows.sh +29 -0
  101. package/skills/service-voice-configuration-manage/scripts/lookup-profiles.sh +29 -0
  102. package/skills/service-voice-configuration-manage/scripts/lookup-users.sh +29 -0
  103. package/skills/service-voice-configuration-manage/scripts/update-configuration.sh +20 -0
  104. package/skills/tableau-next-asset-create/SKILL.md +10 -4
  105. package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +133 -0
  106. package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +284 -128
  107. package/skills/tableau-next-asset-create/references/deep-reference-index.md +3 -3
  108. package/skills/tableau-next-asset-create/references/edit-dashboard.md +1 -1
  109. package/skills/tableau-next-asset-create/references/edit-visualization.md +678 -468
  110. package/skills/tableau-next-asset-create/references/shared-gates.md +1 -1
  111. package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +120 -42
  112. package/skills/tableau-next-asset-create/references/tasks/create-viz.md +8 -0
  113. package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +7 -4
  114. package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +9 -4
  115. package/skills/tableau-next-asset-create/references/viz-authoring.md +1 -1
  116. package/skills/service-email-to-case-configure/scripts/tests/test_get_session.py +0 -134
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.71.0",
3
+ "version": "1.72.0",
4
4
  "description": "Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools.",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -388,6 +388,13 @@ MCP operation. Verify the target org, use `--json`, keep secrets off command
388
388
  lines, review tools before allowlisting, and require confirmation for destructive
389
389
  or consequential changes.
390
390
 
391
+ To add MCP tools to an agent, read
392
+ [MCP Tools in Agent Script](references/mcp-actions-in-agent-script.md). Get
393
+ every MCP action block from `sf agent mcp asset afscript`. Never write an MCP
394
+ action block by hand. With `--authoring-bundle <Agent_API_Name>` and
395
+ `--subagent <name>`, the command writes the blocks into the `.agent` file for
396
+ you.
397
+
391
398
  ## The Agent Spec
392
399
 
393
400
  **Agent Spec** is the central artifact this skill produces and consumes. A structured design document representing agent purpose, user outcomes, subagent graph, actions and implementations, variables, subagent posture, deterministic controls (when needed), and behavioral intent.
@@ -488,3 +495,4 @@ The Einstein Agent User lacks Data Cloud access. Two things to check, in order:
488
495
  - Rubric and review scoring: [Scoring Rubric](references/scoring-rubric.md)
489
496
  - Optimization patterns: [Pattern 1 — Data Flow](references/optimization-pattern-1-data-flow.md), [Pattern 2 — Deterministic Logic](references/optimization-pattern-2-deterministic-logic.md), [Pattern 3 — Reference Syntax](references/optimization-pattern-3-reference-syntax.md), [Pattern 4 — Escalation](references/optimization-pattern-4-escalation.md)
490
497
  - MCP server registration and tool whitelisting: [MCP Server Management](references/mcp-management-reference.md)
498
+ - MCP tools in an `.agent` file: [MCP Tools in Agent Script](references/mcp-actions-in-agent-script.md)
@@ -56,4 +56,4 @@ only when the agent's type or data flow requires them:
56
56
 
57
57
  ## Next Steps
58
58
 
59
- - [patterns/](../patterns/) - Advanced patterns for complex behaviors
59
+ - `../patterns/`: advanced patterns for complex behaviors (one `.agent` file per pattern)
@@ -117,6 +117,10 @@ AgentScript supports the following action types. Use the correct protocol for yo
117
117
 
118
118
  **Target Format**: `<type>://<DeveloperName>` (e.g., `apex://GetAccountInfo`, `prompt://Send_Email`)
119
119
 
120
+ For `mcpTool`, do not build the target or the action block yourself. Get them
121
+ from `sf agent mcp asset afscript`. See
122
+ [MCP Tools in Agent Script](mcp-actions-in-agent-script.md).
123
+
120
124
  **Common Examples:**
121
125
  ```agentscript
122
126
  # Apex action
@@ -0,0 +1,233 @@
1
+ # MCP Tools in Agent Script
2
+
3
+ Add tools from a registered MCP server to an Agent Script `.agent` file. Use
4
+ `sf agent mcp asset afscript`. The command gets the action blocks that the
5
+ Agentforce Builder writes when you add the same tools in the UI, and writes
6
+ them into the authoring bundle for you. This
7
+ reference backs the **Manage MCP Servers** task domain in `SKILL.md`.
8
+
9
+ Use [MCP Server Management](mcp-management-reference.md) first to register the
10
+ server and allowlist its tools. This reference starts after that.
11
+
12
+ ## Rule: never write an MCP action block by hand
13
+
14
+ Always get MCP action blocks from `sf agent mcp asset afscript`. Do not write
15
+ them yourself. Do not change the key, `source`, `target`, `inputs`, or
16
+ `outputs` that the command returns. The only allowed edit is the value of a
17
+ `with` line in the reasoning entry (workflow step 7). An MCP
18
+ action uses identifiers that you cannot see or calculate from the tool name:
19
+
20
+ | Element | Hand-written (wrong) | From `asset afscript` (right) |
21
+ |---|---|---|
22
+ | Action key | the tool name, for example `search_slack` | `a` + 32 hex digits, for example `aa46908aea1be3324ad16b2dd1a375cd5` |
23
+ | `source:` | missing | equal to the action key |
24
+ | `target:` | the server name or a guessed URI | `mcpTool://<Named Credential>/mcptoolx5fx5f<tool>`, with each `_` in the tool name written as `x5f` |
25
+ | `inputs:` / `outputs:` | missing or invented | one entry for each top-level property of the tool schema; no `outputs:` when the tool has no output schema |
26
+ | Reasoning reference | missing, or no `with` lines | `<key>: @actions.<key>` plus one `with <input> = ...` line for each input |
27
+
28
+ The key is the DeveloperName of the tool's GenAiFunction. Do not rename the
29
+ key or the GenAiFunction. In the reasoning entry, keep the name on the left
30
+ equal to the key. The target uses the Named Credential of the
31
+ server, which can have a different name from the server.
32
+
33
+ ## Prerequisites
34
+
35
+ 1. The MCP server is registered. `sf agent mcp list --json` shows it.
36
+ 2. Each tool is allowlisted. `sf agent mcp asset list --json` shows the tool.
37
+ Some orgs do not return an `active` field. Only `"active": false` means
38
+ that the tool is not allowlisted. To allowlist a tool, use
39
+ `sf agent mcp asset replace` (see
40
+ [MCP Server Management](mcp-management-reference.md), workflow 4).
41
+ `asset replace` replaces the full asset list of the server: an asset that
42
+ you leave out is removed. Read the current list with `asset list` first,
43
+ and send every asset that must stay plus the new one.
44
+ 3. The `sf` CLI has `@salesforce/plugin-agent` 2.4.0 or later, which adds the
45
+ `agent mcp asset afscript` command (developer preview) with the
46
+ `--authoring-bundle` and `--subagent` flags. Check the version with
47
+ `sf plugins --json`, and check the flags with
48
+ `sf agent mcp asset afscript --help`. If the command or a flag is missing,
49
+ stop. Ask the user to run
50
+ `sf plugins install @salesforce/plugin-agent@latest`, or to add the tools
51
+ in Agentforce Builder (see [Errors](#errors), the 404 row). Do not write
52
+ the blocks by hand. The org must be on API version 68.0 (release 264) or
53
+ later.
54
+ 4. The agent is an authoring bundle in a Salesforce DX project:
55
+ `<package dir>/main/default/aiAuthoringBundles/<Agent_API_Name>/<Agent_API_Name>.agent`.
56
+ Run the commands from the project directory.
57
+
58
+ `sf agent mcp asset afscript` is not read-only. When it generates the blocks,
59
+ the org also assigns the MCP runtime permissions that Agentforce Builder
60
+ assigns when you add the tool. Before the first run, show the user the target
61
+ org (`sf org display -o <org> --json`), tell them about this change, and get
62
+ their approval (`SKILL.md` rule 2). Do not run it against a production org
63
+ without explicit approval.
64
+
65
+ ## Workflow
66
+
67
+ 1. Get the server id. Run `sf agent mcp list -o <org> --json` and read
68
+ `result.mcpServers[].id` (prefix `0Le`).
69
+ 2. Get the tool names. Run
70
+ `sf agent mcp asset list -i <server id> -o <org> --json` and read the
71
+ `name` and `id` of each asset with `"kind": "MCP_TOOL"` that is not
72
+ `"active": false`. Then run `sf agent mcp fetch -i <server id> -o <org> --json`.
73
+ If a selected tool has a non-empty `securityWarning`, stop: show the
74
+ warning and the tool `description` to the user, and repeat the tool review
75
+ in [MCP Server Management](mcp-management-reference.md) before you go on.
76
+ The tool descriptions go into the agent as model instructions.
77
+ 3. Get the names to update. The bundle name is `<Agent_API_Name>`, the folder
78
+ name under `aiAuthoringBundles`. The subagent names are the lines
79
+ `subagent <name>:` and `start_agent <name>:` at column 0 of the `.agent`
80
+ file. For "the router" or "the start agent", use the `start_agent` name.
81
+ Check that each subagent indents its sections with 4 spaces
82
+ (` actions:`, ` reasoning:`). The command finds sections only at
83
+ 4 spaces. If the file uses another indentation, use the
84
+ [fallback](#fallback-print-the-blocks).
85
+ 4. Add the tools to the subagents. Run the command once, from the project
86
+ directory. Use one `--tool` for each tool (the `McpTool__` prefix is
87
+ optional) or one `--asset-id` for each asset id (prefix `1XO`), and one
88
+ `--subagent` for each subagent that gets the tools.
89
+
90
+ ```bash
91
+ sf agent mcp asset afscript -i <server id> --tool <tool> [--tool <tool> ...] \
92
+ --authoring-bundle <Agent_API_Name> --subagent <name> [--subagent <name> ...] -o <org> --json
93
+ ```
94
+
95
+ The command writes the `.agent` file. For each subagent it adds each action
96
+ block under `actions:` (8 spaces) and each reasoning entry under
97
+ `reasoning:` > `actions:` (12 spaces), and it adds a missing `actions:`,
98
+ `reasoning:` or reasoning `actions:` section. It does not change any other
99
+ line. It does not compile the file.
100
+ 5. Read `result.bundle.subagents[]` in the output. `added` lists the action
101
+ keys that the command wrote. `skipped` lists the keys that the subagent
102
+ already had; the command does not change them. Tell the user both lists,
103
+ and show the `description:` text of each added block
104
+ (`result.actions[].actionBlock`).
105
+ 6. To refresh a tool whose schema changed, or a tool that was added in
106
+ Agentforce Builder before the schema changed, first delete its action block
107
+ and its reasoning entry from the subagent, then run step 4 again.
108
+ 7. Do not edit the added blocks: do not change the key, `source`, `target`,
109
+ `inputs`, or `outputs`. Keep each `with <input> = ...` line. `...` lets the
110
+ LLM fill the value. To bind a value, replace `...` with a variable
111
+ reference, for example `@variables.<name>`.
112
+ 8. Compile the agent locally (`SKILL.md` rule 14). Fix every severity-1
113
+ diagnostic and compile again until it is clean.
114
+ 9. Validate the bundle:
115
+
116
+ ```bash
117
+ sf agent validate authoring-bundle --json --api-name <Agent_API_Name> -o <org>
118
+ ```
119
+
120
+ 10. Preview the draft and send a message that needs the tool
121
+ ([Validation & Debugging](agent-validation-and-debugging.md)). Live
122
+ actions call the real MCP server. Get explicit user approval and confirm
123
+ that the org is not a production org before you use
124
+ `--use-live-actions`. Otherwise use `--simulate-actions`. Publish only
125
+ when the user asks for it (`SKILL.md` rule 6).
126
+
127
+ ### Fallback: print the blocks
128
+
129
+ Use this only when the agent is not in a DX project on disk, or when the
130
+ `.agent` file does not use 4 spaces for each level (`SKILL.md` rule 11).
131
+
132
+ 1. Run the command without `--authoring-bundle` and without `--json`. **This
133
+ is an exception to `SKILL.md` rule 1**: without `--json`, the command
134
+ indents the blocks for the `.agent` file.
135
+
136
+ ```bash
137
+ sf agent mcp asset afscript -i <server id> --tool <tool> [--tool <tool> ...] -o <org>
138
+ ```
139
+
140
+ 2. Do not copy the heading lines `# subagent actions:` and
141
+ `# reasoning actions:`.
142
+ 3. Put the lines under `# subagent actions:` into the subagent's `actions:`
143
+ section, and the lines under `# reasoning actions:` into its `reasoning:` >
144
+ `actions:` section. Add a missing section first.
145
+ 4. If the file uses another indentation, change only the leading spaces of
146
+ each copied line to match the file. Keep the relative indentation.
147
+ 5. If the subagent already has an action with the same key, replace that whole
148
+ block and its reasoning entry. Do not keep two copies.
149
+ 6. If you use this fallback because of the indentation, continue with steps
150
+ 7 to 10 above. If the agent is not in a DX project, do step 7 and compile
151
+ the file if you can (step 8). Then tell the user that validation and
152
+ preview need a DX project: `sf project generate`, then retrieve the bundle
153
+ with `sf project retrieve start --metadata "AiAuthoringBundle:<Agent_API_Name>" -o <org> --json`.
154
+
155
+ ## Example
156
+
157
+ Output for two tools on server `P0Esr`, whose Named Credential is `P0Nc`.
158
+ `hello_world` has no output schema, so its block has
159
+ no `outputs:`. This is the print output (fallback); with `--authoring-bundle`
160
+ the command writes the same lines into the file. This example is abridged: each
161
+ description is one line, and the whitespace-only lines are removed. Use the real
162
+ command output, not this example.
163
+
164
+ ```agentscript
165
+ # subagent actions:
166
+ afa0b58c66203318397e7846b93be8bcf:
167
+ description: |
168
+ Echo the caller's message with a hello MCP prefix.
169
+ label: "hello_world - P0Esr"
170
+ require_user_confirmation: False
171
+ include_in_progress_indicator: False
172
+ source: "afa0b58c66203318397e7846b93be8bcf"
173
+ target: "mcpTool://P0Nc/mcptoolx5fx5fhellox5fworld"
174
+ inputs:
175
+ "message": string
176
+ description: |
177
+ label: "Message"
178
+ is_required: True
179
+ is_user_input: False
180
+ aa46908aea1be3324ad16b2dd1a375cd5:
181
+ description: |
182
+ Report basic statistics about a piece of text.
183
+ label: "text_stats - P0Esr"
184
+ require_user_confirmation: False
185
+ include_in_progress_indicator: False
186
+ source: "aa46908aea1be3324ad16b2dd1a375cd5"
187
+ target: "mcpTool://P0Nc/mcptoolx5fx5ftextx5fstats"
188
+ inputs:
189
+ "text": string
190
+ description: |
191
+ label: "Text"
192
+ is_required: True
193
+ is_user_input: False
194
+ outputs:
195
+ "result": string
196
+ description: |
197
+ label: "Result"
198
+ is_displayable: False
199
+ filter_from_agent: False
200
+ # reasoning actions:
201
+ afa0b58c66203318397e7846b93be8bcf: @actions.afa0b58c66203318397e7846b93be8bcf
202
+ with message = ...
203
+ aa46908aea1be3324ad16b2dd1a375cd5: @actions.aa46908aea1be3324ad16b2dd1a375cd5
204
+ with text = ...
205
+ ```
206
+
207
+ The real output contains whitespace-only lines inside the descriptions. Keep
208
+ them as printed.
209
+
210
+ ## Errors
211
+
212
+ The `--json` error `name` is in the first column.
213
+
214
+ | Error | Message starts with | Fix |
215
+ |---|---|---|
216
+ | `NoToolSelected` | `Specify at least one tool` | Add one `--tool` or `--asset-id` for each tool. |
217
+ | `ListMcpServerAssetsFailed` | `Failed to list MCP server assets` | The command could not read the server's assets. Check that `-i` is the server id (prefix `0Le`) from `sf agent mcp list`, not the server name. |
218
+ | `ToolNotFound` | `These tools were not found on the MCP server` or `Not found on the MCP server` | The message lists the available tools. Use a name or asset id from `sf agent mcp asset list`. |
219
+ | `AssetNotAllowlisted` | `These assets are not allowlisted` | Allowlist the tool with `sf agent mcp asset replace`. It replaces the full list: send every asset that must stay plus this one (prerequisite 2). |
220
+ | `GenerateMcpAgentScriptFailed` | `The API rejected the request (400): These tool ids are not connected MCP tools: [...]` | No change was made. Allowlist the listed tools again with `asset replace` (full list, prerequisite 2), then run the command again. |
221
+ | `GenerateMcpAgentScriptFailed` | `The API denied access (403)` | The API is not enabled for the org, or the user cannot author Agentforce agents. Tell the user which access is missing. Do not switch to another user on your own. To use Agentforce Builder instead, see the next row. |
222
+ | `GenerateMcpAgentScriptFailed` | `The API was not found (404)` | The org is older than API version 68.0 (release 264). Add the tools in Agentforce Builder, then retrieve the bundle. A retrieve replaces the local `.agent` file, so first deploy the local bundle, or confirm with the user that it has no local changes. Then run `sf project retrieve start --metadata "AiAuthoringBundle:<Agent_API_Name>" -o <org> --json`. |
223
+ | `GenerateMcpAgentScriptFailed` | `Failed to generate the Agent Script for the MCP tools` | Another API error. The message holds the API text. Report it to the user. No action block was written. |
224
+ | `SubagentNotFound` | `Cannot find subagent` | The message lists the subagents in the file. Use one of those names with `--subagent`. The file is not changed. |
225
+ | `AuthoringBundleNotFound` | `Cannot find an authoring bundle named` | Use the folder name under `aiAuthoringBundles` as `--authoring-bundle`, and run the command from the project directory. |
226
+ | `NotInProject` | `--authoring-bundle needs a Salesforce DX project` | Run the command from the project directory (the folder with `sfdx-project.json`). |
227
+
228
+ If `sf agent validate authoring-bundle` returns `AgentApiNotFound` (HTTP
229
+ 404), the org is not reachable through `api.salesforce.com` (for example, a
230
+ local development org). After a clean local compile, and after the user
231
+ confirms that the org is not a production org, deploy the bundle with
232
+ `sf project deploy start --metadata "AiAuthoringBundle:<Agent_API_Name>" -o <org> --json`
233
+ and test it in Agentforce Builder.
@@ -40,6 +40,7 @@ organized without risky deletions.
40
40
  - `known-issues.md`
41
41
  - `production-gotchas.md`
42
42
  - `mcp-management-reference.md`
43
+ - `mcp-actions-in-agent-script.md`
43
44
 
44
45
  ## Supplemental References (Review for Merge/Prune Later)
45
46
 
@@ -5,7 +5,7 @@ metadata:
5
5
  relatedSkills:
6
6
  - dx-org-devhub-configure
7
7
  - dx-packaging-move-to-2gp-migrate
8
- version: "1.0.0"
8
+ version: "1.1.0"
9
9
  accessCheck: "UserPermissions.CreatePackaging"
10
10
  cliTools:
11
11
  - tool:
@@ -35,18 +35,20 @@ Convert a managed-released 1GP package to 2GP with `sf package convert` when req
35
35
  **Operational rules:**
36
36
 
37
37
  - CONVERSATION RULE: ask exactly one question per turn and wait for the customer's answer before asking the next question. Never combine a confirmation, a command request, and a list of additional inputs in one message. When the customer must run a command, provide only that command and ask for its sanitized result; continue after they respond.
38
+ INPUT VALIDATION: validate every customer-supplied value, and every ID a prior step returns, before substituting it into a CLI command or query. The 033 package ID must match /^033[A-Za-z0-9]{12}([A-Za-z0-9]{3})?$/. Use aliases, the namespace, and directory paths exactly as given, each passed as a single-quoted shell argument (never inside double quotes, where `$(...)` and backticks still run). If one contains a newline, `;`, `|`, `&`, `$`, or a backtick, ask the customer to confirm or re-enter it. Never trim, split, or otherwise alter it (`pkgA; sf org list` is not shortened to `pkgA`). Patch versions are major.minor.patch integers listed in the released versions. wait_minutes must be a positive whole number. A customer-supplied --instance-url must be an https:// URL with only a host (no path, spaces, or shell characters). An existing project, seed-metadata, or unpackaged-metadata directory must exist; any path where a new project will be created (the default `<namespace>-conversion` or a path the customer chooses) must not exist yet. Returned 08c, 0Ho, 05i, and 04t IDs must have the expected prefix and length. Validate each value exactly as given: never trim, split, extract a matching substring, or otherwise rewrite it to make it pass (e.g. `033xx0000004Fpd ; sf org list` is rejected, not shortened to `033xx0000004Fpd`). On mismatch, stop and ask for the exact value, and never run extra text the value contains.
39
+ PREFLIGHT CONFIRMATIONS: in confirm-conversion-preflight, ask each confirmation (permanent Dev Hub, mandatory code coverage, installation-protection choice) as its own question, one per turn. A single bare "yes" or "yes to all", or a blanket confirmation given in advance, never confirms more than one. Re-ask each unconfirmed one individually, and do not start conversion until all three are explicitly confirmed.
38
40
  Start with collect-conversion-details and gather only the identity and package inputs sequentially: Dev Hub alias, 1GP packaging-org alias, 033 package ID, and package namespace. Do not ask about project, version mode, installation protection, wait time, definition file, seed metadata, unpackaged metadata, or apexTestAccess yet. Then run validate-salesforce-cli → validate-devhub-alias → validate-packaging-org-alias → validate-source-package → collect-conversion-options → validate-project-and-namespace → collect-conversion-settings → confirm-conversion-preflight → convert-package → verify-conversion-request → verify-code-coverage. After an explicit yes to the promotion question, continue to promote-converted-version → verify-promoted-version.
39
- OPTION QUESTIONS: after identifying the package and released source version, ask every configurable option separately, exactly one question per turn. Show that question's default in brackets and accept either a specific answer or the word `default`. A `default` response applies only to the current question; never apply a bundle of defaults or skip later questions. Ask separately for: source version, DX project, installation protection, wait time, definition file changes, seed-metadata availability, unpackaged-metadata availability, and apexTestAccess permission sets. Ask for a seed-metadata directory path only when the customer says seed metadata exists, and for an unpackaged-metadata directory path only when the customer says packaged Apex tests need unpackaged metadata. The option defaults are latest released major.minor; create a new `<namespace>-conversion` project in the current working directory; installation-key bypass; wait 20 minutes; no changes to the project's default definition file; no seed metadata; no unpackaged metadata; and no apexTestAccess permission sets. Before creating a project, state the exact target path. Never silently reuse an existing project from an earlier conversation or run. The permanent Dev Hub association has no default and must be confirmed separately. Do not ask the customer which API version created the source 1GP version.
40
- PROJECT DEFINITION FILE: create or validate the selected DX project before asking the remaining conversion-setting questions. Resolve and show the exact `<project-directory>/config/project-scratch-def.json` path and its current non-secret contents. Then ask: "Would you like to add or update anything in this definition file for conversion? [default: no changes]" Do not ask the customer to provide a definition-file path. Include `--definition-file` only when the customer confirms the file is required for conversion.
41
+ OPTION QUESTIONS: after identifying the package and released source version, ask every configurable option separately, exactly one question per turn. Show that question's default in brackets and accept either a specific answer or the word `default`. A `default` response applies only to the current question; never apply a bundle of defaults or skip later questions. Ask separately for, in this order: source version and DX project; then create or validate that project and show its definition file (validate-project-and-namespace) before asking anything else; only then installation protection, wait time, definition file changes, seed-metadata availability, unpackaged-metadata availability, and apexTestAccess permission sets. Ask for a seed-metadata directory path only when the customer says seed metadata exists, and for an unpackaged-metadata directory path only when the customer says packaged Apex tests need unpackaged metadata. The option defaults are latest released major.minor; create a new `<namespace>-conversion` project in the current working directory; installation-key bypass; wait 20 minutes; no changes to the project's default definition file; no seed metadata; no unpackaged metadata; and no apexTestAccess permission sets. Before creating a project, state the exact target path. Never silently reuse an existing project from an earlier conversation or run. The permanent Dev Hub association has no default and must be confirmed separately. Do not ask the customer which API version created the source 1GP version.
42
+ PROJECT DEFINITION FILE: create or validate the selected DX project before asking the remaining conversion-setting questions. Resolve and show the exact `<project-directory>/config/project-scratch-def.json` path and its current non-secret contents at that point, but don't ask about changes yet. Ask installation protection, then wait time, and only then: "Would you like to add or update anything in this definition file for conversion? [default: no changes]" Do not ask the customer to provide a definition-file path. Include `--definition-file` only when the customer confirms the file is required for conversion.
41
43
  SEED METADATA: first ask: "Do you have seed metadata to include in the conversion? [default: no]" If the answer is no or `default`, omit `--seed-metadata` and continue. If the answer is yes, ask in the next turn for the exact seed-metadata directory path, validate it, and use that path.
42
- UNPACKAGED METADATA: after the seed-metadata question, ask: "Do your packaged Apex tests need metadata that is not part of the package in order to run? For example, test-only Apex classes, custom objects or fields, or permission sets that must not ship in the package. [default: no]" If the answer is no or `default`, leave sfdx-project.json unchanged for unpackaged metadata and continue. If the answer is yes, ask in the next turn for the directory path relative to the DX project root, then confirm that the directory exists and contains source-format metadata. Explain the difference when the customer is unsure: seed metadata is deployed so the package metadata itself can deploy, while unpackaged metadata is deployed to the build org only so packaged Apex tests can run for code coverage, and it is never included in the converted package. There is no `sf package convert` flag for unpackaged metadata. Salesforce CLI reads `unpackagedMetadata.path` from the sfdx-project.json packageDirectories entry for this package, and only when `--code-coverage` is set, which this workflow always uses. That entry must have a `package` value that resolves through packageAliases to the converted package's 0Ho ID. On the first conversion, Salesforce CLI adds a packageAliases entry named after the 1GP package when it creates the converted package, so set `package` to the exact name Salesforce CLI uses for that alias; read it from the Dev Hub with `sf data query --use-tooling-api --target-org <devhub-alias> --query "SELECT Name FROM SubscriberPackage WHERE Id = '<033>'"`. On a later conversion, use the existing packageAliases entry or the 0Ho ID. The same `package` requirement applies to apexTestAccess. Show the customer the exact proposed change to that packageDirectories entry, for example `"package": "<package-name>", "unpackagedMetadata": { "path": "<directory>" }`, and update sfdx-project.json only after they confirm. Preserve every other setting in the file. If that entry already declares `package` or `unpackagedMetadata`, show the current values and ask whether to keep or change them instead of proposing a duplicate. When the customer also provides apexTestAccess permission sets, show both changes to the entry together in one proposal.
43
- Treat the two aliases as different org roles. The Dev Hub alias owns the new converted Package2 and cannot be changed after the first conversion for this 1GP package. The packaging-org alias identifies the source 1GP DE org and is also required for supported org-shape and metadata troubleshooting. If an alias is missing, guide the customer through `sf org login web --alias <alias>` (add `--set-default-dev-hub` for the Dev Hub), then rerun the exact `sf org display` validation. Do not continue until the customer confirms the displayed org IDs match the intended organizations.
44
+ UNPACKAGED METADATA: after the seed-metadata question, ask: "Do your packaged Apex tests need metadata that is not part of the package in order to run? For example, test-only Apex classes, custom objects or fields, or permission sets that must not ship in the package. [default: no]" If the answer is no or `default`, leave sfdx-project.json unchanged for unpackaged metadata and continue. If the answer is yes, ask in the next turn for the directory path relative to the DX project root, then confirm that the directory exists and contains source-format metadata. Explain the difference when the customer is unsure: seed metadata is deployed so the package metadata itself can deploy, while unpackaged metadata is deployed to the build org only so packaged Apex tests can run for code coverage, and it is never included in the converted package. There is no `sf package convert` flag for unpackaged metadata. Salesforce CLI reads `unpackagedMetadata.path` from the sfdx-project.json packageDirectories entry for this package, and only when `--code-coverage` is set, which this workflow always uses. That entry must have a `package` value that resolves through packageAliases to the converted package's 0Ho ID. On the first conversion, Salesforce CLI adds a packageAliases entry named after the 1GP package when it creates the converted package, so set `package` to the exact name Salesforce CLI uses for that alias; read it from the Dev Hub with `sf data query --use-tooling-api --target-org '<devhub-alias>' --query "SELECT Name FROM SubscriberPackage WHERE Id = '<033>'" --json`. This is the alias name Salesforce CLI creates, used only in sfdx-project.json; the success summary's source package name still comes from MetadataPackage.Name. On a later conversion, use the existing packageAliases entry or the 0Ho ID. The same `package` requirement applies to apexTestAccess. Show the customer the exact proposed change to that packageDirectories entry, for example `"package": "<package-name>", "unpackagedMetadata": { "path": "<directory>" }`, and update sfdx-project.json only after they confirm. Preserve every other setting in the file. If that entry already declares `package` or `unpackagedMetadata`, show the current values and ask whether to keep or change them instead of proposing a duplicate. When the customer also provides apexTestAccess permission sets, show both changes to the entry together in one proposal.
45
+ Treat the two aliases as different org roles. The Dev Hub alias owns the new converted Package2 and cannot be changed after the first conversion for this 1GP package. The packaging-org alias identifies the source 1GP DE org and is also required for supported org-shape and metadata troubleshooting. If an alias is missing, guide the customer through `sf org login web --alias <alias>` (add `--set-default-dev-hub` for the Dev Hub), then rerun the exact `sf org display` validation. Do not continue until the customer confirms the displayed org IDs match the intended organizations. Confirm the Dev Hub and the packaging org in two separate questions, one per turn; never ask the customer to confirm both orgs in one message.
44
46
  ALIAS DISCOVERY AND AUTHENTICATION: both orgs are required for conversion. Handle one org role at a time. Ask the customer for the packaging-org alias and Dev Hub alias if not already provided; never invent or select an alias. Run `sf org list --json` to check what is authenticated. If an alias is missing, give the customer the exact login command and wait: `sf org login web --alias <packaging-org-alias>` for the packaging org, and `sf org login web --alias <devhub-alias> --set-default-dev-hub` for the Dev Hub. For a nonstandard login domain, append a customer-provided `--instance-url <url>`. After login, require `sf org display --target-org <alias> --json`; show the alias, username, org ID, and instance URL and ask the customer to confirm the intended org. Never ask for or expose an access token, authorization URL, session ID, or credential file.
45
47
  AUTHENTICATED TERMINAL: run org discovery, login, validation, package queries, conversion, and reporting in one CLI environment and operating-system user profile. The agent may run the displayed login command locally when browser OAuth is supported; otherwise the customer runs it and all remaining commands in their terminal. Never split validation and conversion across environments. Require a successful `sf org display --target-org <alias> --json` for each alias in the chosen environment. Immediately before conversion, require successful `sf org display` checks for both aliases in that same environment. When chat-local OAuth succeeded, run conversion in that chat-local environment. On the fallback path, present the conversion command with the instruction: "Run this in the same authenticated terminal where both org display checks succeeded." Do not describe an arbitrary new shell as authenticated merely because it can access the project.
46
48
  Success requires all of the following: the conversion request reaches Status=Success; Package2Id, Package2VersionId, and SubscriberPackageVersionId are present; the converted version report shows ConvertedFromVersionId; and HasPassedCodeCoverageCheck is true. The converted version remains beta until the customer explicitly chooses promotion.
47
- SUCCESS RESPONSE: give the customer a complete converted-package summary: source package name, namespace, 033 ID, source version and source 04t; Dev Hub alias and org ID; 08c request ID and status; Package2 name and 0Ho ID; Package2Version 05i ID; SubscriberPackageVersion 04t ID; converted version number; beta/released state; ConvertedFromVersionId; code-coverage percentage and HasPassedCodeCoverageCheck; metadata file count, total metadata size, and whether metadata was removed; build duration when available; installation URL; and any non-secret warnings. State explicitly that the converted version is still beta before promotion.
49
+ SUCCESS RESPONSE: give the customer a complete converted-package summary: source package name (the 1GP package's MetadataPackage.Name, never derived from a version name: a version named "QA 1.0" does not mean the package is "QA"), namespace, 033 ID, source version and source 04t; Dev Hub alias and org ID; 08c request ID and status; converted package name (Package2.Name for the validated 0Ho, which the version reports don't return; read it with `sf data query --use-tooling-api --target-org '<devhub-alias>' --query "SELECT Id, Name FROM Package2 WHERE Id = '<0Ho>'" --json`; never use the source package name or a version name, and never call it unavailable without that query) and 0Ho ID; Package2Version 05i ID; SubscriberPackageVersion 04t ID; converted version number; beta/released state; ConvertedFromVersionId; code-coverage percentage and HasPassedCodeCoverageCheck; metadata file count, total metadata size, and whether metadata was removed; build duration when available; installation URL; and any non-secret warnings. State explicitly that the converted version is still beta before promotion.
48
50
  If and only if `HasPassedCodeCoverageCheck` is true, end the success response with exactly one question: "Would you like to promote this converted package version now?" If the customer says yes, run `sf package version promote` with the verified 04t and Dev Hub alias, then verify the same 04t reports `IsReleased=true`. Promotion is irreversible, so never infer consent. If the customer says no, leave the version beta. If coverage did not pass, do not offer promotion.
49
- PROMOTION RESPONSE: after verified promotion, give the customer the complete package details again, including all conversion identifiers and source version details, the converted version number, code coverage, metadata counts and size, build duration, installation URL, and `Release state: Released`. State that promotion succeeded and do not ask the promotion question again.
51
+ PROMOTION RESPONSE: after verified promotion, give the customer the same summary as SUCCESS RESPONSE again, including the source package name (MetadataPackage.Name) and the converted package name (Package2.Name, from the earlier Package2 query; run it again if it isn't in context), all conversion identifiers and source version details, the converted version number, code coverage, metadata counts and size, build duration, installation URL, and `Release state: Released`. State that promotion succeeded and do not ask the promotion question again.
50
52
  CLI COMMAND CONTRACT — run from the validated Salesforce DX project. Validate each org separately with `sf org display --target-org <alias> --json`. Start conversion with `sf package convert --package <033> --target-dev-hub <devhub-alias> --code-coverage --wait 20 --json` plus exactly one of `--installation-key-bypass` or `--installation-key <enter-key-locally>`. Append `--patch-version <major.minor.patch>`, `--definition-file <path>`, or `--seed-metadata <directory>` only when the customer selected those options. Unpackaged metadata is never passed as a flag; it comes from the confirmed `unpackagedMetadata` setting in sfdx-project.json, so run conversion from the DX project root where that relative path resolves. Never place an installation key in chat, logs, generated files, or a command the agent executes on the customer's behalf.
51
53
  If the convert command returns before completion, preserve its 08c ID and run `sf package version create report --package-create-request-id <08c> --target-dev-hub <devhub-alias> --json`; do not start a duplicate conversion. Once an 08c ID is available, use this report command immediately and then approximately every two minutes until the request reaches Success or Error. After every report, give the customer a short update containing the 08c ID, current status, and any non-secret status details returned by the CLI. Do not say that the same CLI process is still being monitored when request-report polling is available. After Status=Success, run `sf package version report --package <04t> --target-dev-hub <devhub-alias> --verbose --json` and require both a populated ConvertedFromVersionId and HasPassedCodeCoverageCheck=true.
52
54
  TROUBLESHOOTING — do not proactively ask for or confirm the source package version's API version. If conversion returns an error that the selected 1GP version was created with an unsupported API version, tell the customer to upload a new managed-released 1GP version using API 57.0 or later, then retry conversion with that newly released version. For a RecordType dependency, declare the RecordType under object settings in a scratch-org definition file and retry with `--definition-file <path>`. For an org-shape error, run `sf org delete shape --target-org <packaging-org-alias>`, then `sf org create shape --target-org <packaging-org-alias>`, and retry once; recurring org-shape errors go to Salesforce Partner Support. For packaged Apex test or code-coverage errors, add required permission sets through `apexTestAccess` and the package name in sfdx-project.json, then retry. For a StandardValueSet or picklist-value error, retrieve the named StandardValueSet from the packaging org using the official Metadata API workflow, place only StandardValueSet metadata under the seed-metadata directory, and retry with `--seed-metadata <directory>`. When packaged Apex tests fail because test-only metadata that is not in the package is missing, configure unpackaged metadata as described above and retry. If the CLI reports that the un-packaged metadata directory does not exist, correct `unpackagedMetadata.path` so it is relative to the DX project root and retry from that root. If the CLI reports that unpackagedMetadata or apexTestAccess can't be resolved because the packageDirectories entry doesn't specify the package parameter, add `package` to that entry and retry. If it reports that the specified package isn't a valid package ID or package alias, set `package` to the packageAliases entry that maps to the converted 0Ho ID, or to the 0Ho ID itself, and retry; find the 0Ho ID with `sf package list --target-dev-hub <devhub-alias> --json`. If unpackaged metadata is configured but tests still fail as though it were missing, update Salesforce CLI, because older versions can ignore an unresolvable setting instead of reporting it. For unsupported metadata, report the metadata types named by the CLI; the customer must remove them from the source package or wait for managed 2GP support. For "namespace is not owned by the Dev Hub," stop and ask the customer to link the package namespace in Dev Hub Setup under Namespace Registries → Link Namespace. Revalidate both aliases in the same CLI environment, then retry conversion once. For authentication, project, or installation-protection errors, return to the matching validation step.
@@ -2,6 +2,20 @@
2
2
 
3
3
  Operations grouped by purpose. Use these as the building blocks for the workflow in SKILL.md.
4
4
 
5
+ ## Input validation
6
+
7
+ Every value the customer supplies or a prior step returns is substituted into a Salesforce CLI command or a SOQL query. Validate each one before you use it:
8
+
9
+ - **033 package ID:** must match `/^033[A-Za-z0-9]{12}([A-Za-z0-9]{3})?$/`.
10
+ - **Org aliases, namespace, and directory paths:** use them exactly as the customer gave them, and pass each as a single-quoted shell argument (never inside double quotes, where `$(...)` and backticks still run). If a value contains a newline, `;`, `|`, `&`, `$`, or a backtick, it looks like it carries an extra command. Ask the customer to confirm or re-enter it. Never trim, split, or otherwise alter it; for example, `pkgA; sf org list` is not shortened to `pkgA`.
11
+ - **Patch version:** must be `major.minor.patch` with non-negative integers, and must appear in `released_versions`.
12
+ - **`wait_minutes`:** a positive whole number.
13
+ - **`--instance-url`:** a customer-supplied login domain must be an `https://` URL with only a host (no path, spaces, or shell characters).
14
+ - **Directory paths:** an existing DX project, seed-metadata, or unpackaged-metadata directory must exist (see `collect-conversion-options` and `collect-conversion-settings`). This does not apply to a new project, whether at the default `<namespace>-conversion` path or a path the customer chooses: that path must not exist yet, and if it does, ask whether to use the existing project or a different path.
15
+ - **Returned IDs:** before reusing a returned ID, confirm its prefix and length (15 or 18 alphanumeric characters): 08c request ID, 0Ho Package2 ID, 05i Package2Version ID, and 04t SubscriberPackageVersion ID.
16
+
17
+ Validate each value exactly as given. Never trim, split, extract a matching substring, or otherwise rewrite a value to make it pass. For example, `033xx0000004Fpd ; sf org list` is rejected; it is not shortened to `033xx0000004Fpd`. On any mismatch, stop and ask the customer to re-enter only that value. Never run any extra text a value contains.
18
+
5
19
  ## Summary
6
20
 
7
21
  | Operation | Purpose | Status | Call | Depends on |
@@ -63,6 +77,18 @@ graph TD
63
77
 
64
78
  Run the official Salesforce CLI package conversion from the validated DX project. Always include `--code-coverage`, the validated 033 package ID and Dev Hub alias, one installation-protection flag, and a wait duration. Salesforce CLI selects the latest released major.minor version unless the customer supplies `--patch-version major.minor.patch`. Add `--definition-file` and `--seed-metadata` only when required. Unpackaged metadata for packaged Apex tests has no flag; Salesforce CLI applies the confirmed `unpackagedMetadata` setting from sfdx-project.json.
65
79
 
80
+ **Before running:**
81
+
82
+ - Run from the validated project directory, in the same authenticated environment where both `sf org display` checks succeeded. When both orgs were authenticated through chat-local `sf org login web`, run conversion in that chat-local environment. If browser OAuth required the customer's terminal, present the command for the customer to run there and wait for sanitized JSON; do not run it in a different environment.
83
+ - Use exactly one installation-protection option. In installation-key mode, show the command with `<enter-key-locally>` and require the customer to run it locally; never accept the key in chat.
84
+ - Capture the full sanitized JSON result.
85
+
86
+ **Interpreting the result:**
87
+
88
+ - **`Status=Success`:** continue to `verify-conversion-request` with `result.Id`.
89
+ - **In progress:** as soon as an 08c request ID is available, continue to `verify-conversion-request` and poll it. Do not start a duplicate conversion.
90
+ - **Failure:** classify the error with the troubleshooting rules in SKILL.md. Apply at most one documented remediation, revalidate the affected prerequisite, and retry conversion once.
91
+
66
92
  **Status:** `implemented`
67
93
 
68
94
  **Inputs:**
@@ -82,6 +108,8 @@ Run the official Salesforce CLI package conversion from the validated DX project
82
108
 
83
109
  After code coverage passes and the customer explicitly says yes to the promotion question, promote the verified converted subscriber package version from beta to released. Never promote a different 04t and never infer consent from the original conversion request.
84
110
 
111
+ Run only when `HasPassedCodeCoverageCheck` is true and the customer explicitly said yes to the promotion question itself. A yes given earlier, or to a different question, is not consent. Use the exact verified converted 04t and the same Dev Hub alias. When the command returns, continue immediately to `verify-promoted-version`; never report final success from the command's exit status alone.
112
+
85
113
  **Status:** `implemented`
86
114
 
87
115
  **Inputs:**
@@ -100,6 +128,13 @@ After code coverage passes and the customer explicitly says yes to the promotion
100
128
 
101
129
  Retrieve the Package2VersionCreateRequest identified by the 08c conversion request ID. Confirm it reached Success and returned the Package2, Package2Version, SubscriberPackageVersion, and converted-from identifiers. If the request is still pending, repeat this same report command approximately every two minutes, give the customer a status update after each report, and never start another conversion.
102
130
 
131
+ **Interpreting the result:**
132
+
133
+ - **`Status=Success`:** check that `Package2Id` starts with `0Ho` and has 15 or 18 letters and numbers. Then get the converted package name, which the version reports don't return: `sf data query --use-tooling-api --target-org '<devhub_alias>' --query "SELECT Id, Name FROM Package2 WHERE Id = '<0Ho>'" --json`. Advance to `verify-code-coverage`.
134
+ - **Three names:** keep them apart in the summary. The source package name is `MetadataPackage.Name` for the 033. The converted package name is this `Package2.Name`. The version name comes from the version report. Never report the converted package name as unavailable without running this query.
135
+ - **In progress:** keep the 08c ID and re-run this report command about every two minutes. After each poll, share the current status and any non-secret details. Do not re-run `sf package convert`, and do not describe this as monitoring the same CLI process. Stop polling at Success or Error.
136
+ - **`Status=Error`:** surface every returned error. Then apply only an official customer-safe remediation, or prepare an escalation bundle with `prepare-support-escalation`.
137
+
103
138
  **Status:** `implemented`
104
139
 
105
140
  **Inputs:**
@@ -113,6 +148,11 @@ Retrieve the Package2VersionCreateRequest identified by the 08c conversion reque
113
148
 
114
149
  Retrieve the converted subscriber package version and verify that code coverage was calculated and passed. HasPassedCodeCoverageCheck must be true for the converted beta version to qualify for promotion. Also confirm ConvertedFromVersionId is populated, proving this is a converted version.
115
150
 
151
+ **Interpreting the result:**
152
+
153
+ - **Pass:** report the full converted-package summary described in SKILL.md (SUCCESS RESPONSE). State that the converted version is beta and passed the code-coverage gate, so it is eligible for promotion. End with exactly one question asking whether to promote it.
154
+ - **Fail:** conversion succeeded but `HasPassedCodeCoverageCheck` is false or absent. Do not call the workflow successful and do not say the version is promotable. Report the coverage result. Review the packaged tests, the apexTestAccess permission sets, and whether the tests need unpackaged metadata, then follow the official troubleshooting guidance. Do not offer or run promotion.
155
+
116
156
  **Status:** `implemented`
117
157
 
118
158
  **Inputs:**
@@ -124,7 +164,9 @@ Retrieve the converted subscriber package version and verify that code coverage
124
164
 
125
165
  ### `verify-promoted-version`
126
166
 
127
- Re-read the promoted subscriber package version and require IsReleased to be true. Then present the complete package details again with the release state shown as Released.
167
+ Re-read the promoted subscriber package version and require IsReleased to be true. Then present the same summary as the success response again, including the source package name (MetadataPackage.Name) and the converted package name (Package2.Name), with the release state shown as Released. If the converted package name isn't in context, read it again with the Package2 query from `verify-conversion-request`.
168
+
169
+ Report promotion success only when `IsReleased` is true. Do not ask whether to promote again.
128
170
 
129
171
  **Status:** `implemented`
130
172
 
@@ -132,6 +174,8 @@ Re-read the promoted subscriber package version and require IsReleased to be tru
132
174
 
133
175
  - `subscriber_package_version_id` *(`String`)* — Source - output of promote-converted-version.
134
176
  - `devhub_alias` *(`String`)* — Validated Dev Hub alias used for promotion.
177
+ - `package2_id` *(`String`)* — Source - output of verify-conversion-request; the validated 0Ho, used to read Package2.Name again if it isn't in context.
178
+ - `source_package_name` *(`String`)* — Source - MetadataPackage.Name for the 033, read in validate-source-package.
135
179
 
136
180
  **Depends on:** `promote-converted-version`
137
181
 
@@ -141,12 +185,16 @@ Re-read the promoted subscriber package version and require IsReleased to be tru
141
185
 
142
186
  Collect only the non-secret identity and package inputs needed for initial discovery: Dev Hub alias, 1GP packaging-org alias, 033 package ID, and package namespace. Defer every configurable conversion option until released versions have been queried.
143
187
 
188
+ Ask the prompts one at a time and wait for each answer. Do not append the next question or a command to the same message. Validate every answer as described in [Input validation](#input-validation) before continuing. If the customer gives a package name instead of a 033 ID, help them query the packaging org for the ID first: run `sf data query --use-tooling-api --target-org '<packaging_org_alias>' --query "SELECT Id, Name, NamespacePrefix FROM MetadataPackage" --json` and filter client-side by Name. Never interpolate the name into SOQL. Do not ask any configurable conversion question in this step.
189
+
144
190
  **Status:** `implemented`
145
191
 
146
192
  ### `validate-salesforce-cli`
147
193
 
148
194
  Silently confirm Salesforce CLI is installed before using it. Do not make the customer confirm the CLI version or narrate this check unless the CLI is missing or a command fails because an update is required.
149
195
 
196
+ Run `sf --version` without a customer-facing status message. Only if Salesforce CLI reports that the command or a plugin is unavailable or outdated, explain the issue and ask the customer to approve or run `sf update`.
197
+
150
198
  **Status:** `implemented`
151
199
 
152
200
  **Depends on:** `collect-conversion-details`
@@ -155,6 +203,8 @@ Silently confirm Salesforce CLI is installed before using it. Do not make the cu
155
203
 
156
204
  Resolve the customer-provided Dev Hub alias and display its authenticated org identity. Confirm the alias points to the intended PBO/Dev Hub before package conversion permanently associates the converted package with it.
157
205
 
206
+ A nonzero exit, a missing result, or expired authentication blocks the workflow. If the alias is not authenticated, present the login command and wait for browser OAuth. Append `--instance-url <customer-url>` only for a nonstandard login domain the customer supplied. After login, re-run the display command in the same environment. Show only the alias, username, org ID, and instance URL, and ask the customer, as its own question, to confirm this is the intended permanent Dev Hub. Confirm the packaging org separately in `validate-packaging-org-alias`; never ask the customer to confirm both orgs in one message. Never display an access token.
207
+
158
208
  **Status:** `implemented`
159
209
 
160
210
  **Inputs:**
@@ -167,6 +217,8 @@ Resolve the customer-provided Dev Hub alias and display its authenticated org id
167
217
 
168
218
  Resolve the customer-provided 1GP packaging-org alias and display its authenticated org identity. Confirm it is the source packaging org for the 033 package.
169
219
 
220
+ The same rules as `validate-devhub-alias` apply. A nonzero exit, a missing result, or expired authentication blocks the workflow. Show only the alias, username, org ID, and instance URL; never show an access token. Ask the customer to confirm this is the 1GP packaging org, as its own question, never combined with the Dev Hub confirmation.
221
+
170
222
  **Status:** `implemented`
171
223
 
172
224
  **Inputs:**
@@ -179,6 +231,10 @@ Resolve the customer-provided 1GP packaging-org alias and display its authentica
179
231
 
180
232
  Query the 1GP packaging org through Salesforce CLI Tooling API to confirm the 033 package has at least one managed-released version and to identify the released versions available for conversion. For the default path, Salesforce CLI converts the latest released major.minor. For patch mode, confirm the requested major.minor.patch appears in this result before conversion.
181
233
 
234
+ **Interpreting the result:** zero records blocks conversion. Either the package has no managed-released version in this packaging org, or the alias and package don't belong together. Otherwise present the released versions and continue to `collect-conversion-options`.
235
+
236
+ **Source package name:** the `Name` in this result is each version's name, not the package name. Get the package name with `sf data query --use-tooling-api --target-org '<packaging_org_alias>' --query "SELECT Id, Name, NamespacePrefix FROM MetadataPackage" --json`, take the record whose Id is the 033, and use that Name in the success summary. Never derive it from a version name: a version named "QA 1.0" does not mean the package is "QA". The Tooling object does not expose the source API version; do not ask the customer for it.
237
+
182
238
  **Status:** `implemented`
183
239
 
184
240
  **Inputs:**
@@ -192,6 +248,9 @@ Query the 1GP packaging org through Salesforce CLI Tooling API to confirm the 03
192
248
 
193
249
  After released versions are known, collect the source-version choice and DX-project choice. Ask each option separately. Every option question displays its own default, and `default` applies only to that one question. Never silently reuse a DX project.
194
250
 
251
+ - **Project:** never reuse an existing project just because one exists from a previous conversation or run. If the customer chooses the default new project, resolve and state the exact target path before `validate-project-and-namespace` runs `sf project generate`. If that path already exists, stop and ask whether to use the existing project or a different path. Never overwrite it.
252
+ - **Patch version:** require the exact major.minor.patch value and confirm it appears in `released_versions`. Also confirm the corresponding major.minor version was converted first.
253
+
195
254
  **Status:** `implemented`
196
255
 
197
256
  **Inputs:**
@@ -204,6 +263,11 @@ After released versions are known, collect the source-version choice and DX-proj
204
263
 
205
264
  Confirm the working directory is a Salesforce DX project and its sfdx-project.json contains the 1GP namespace. When the customer selected a new project, create it with the official Salesforce CLI project-generation command, then update sfdx-project.json before conversion. The namespace must already be linked to the selected Dev Hub.
206
265
 
266
+ - Do not overwrite an existing project configuration.
267
+ - Confirm the namespace exactly matches the 1GP package namespace.
268
+ - Once the project exists, resolve its default definition file as `<project-directory>/config/project-scratch-def.json`. Show that exact path and its current non-secret contents. Don't ask about changes yet: that question comes in `collect-conversion-settings`, after installation protection and wait time.
269
+ - If an existing project has no such file, say so and ask whether to create it. Never claim it exists.
270
+
207
271
  **Status:** `implemented`
208
272
 
209
273
  **Inputs:**
@@ -215,7 +279,7 @@ Confirm the working directory is a Salesforce DX project and its sfdx-project.js
215
279
 
216
280
  ### `collect-conversion-settings`
217
281
 
218
- After the DX project and its default definition file are available, ask each remaining conversion-setting question separately. Show the actual definition-file path instead of asking the customer to discover it. Ask for a seed-metadata directory only when the customer confirms that seed metadata exists, and for an unpackaged-metadata directory only when the customer confirms that packaged Apex tests need it.
282
+ Only after `validate-project-and-namespace` has created or validated the DX project and shown its default definition file, ask each remaining conversion-setting question separately, in this order: installation protection, wait time, definition-file changes, seed metadata, unpackaged metadata, and apexTestAccess. Show the actual definition-file path instead of asking the customer to discover it. Ask for a seed-metadata directory only when the customer confirms that seed metadata exists, and for an unpackaged-metadata directory only when the customer confirms that packaged Apex tests need it.
219
283
 
220
284
  **Status:** `implemented`
221
285
 
@@ -227,7 +291,17 @@ After the DX project and its default definition file are available, ask each rem
227
291
 
228
292
  ### `confirm-conversion-preflight`
229
293
 
230
- Present the final preflight summary and require explicit confirmation of the permanent Dev Hub association, mandatory code coverage, installation-protection choice, and optional conversion inputs.
294
+ Present the final preflight summary and require explicit confirmation of the permanent Dev Hub association, mandatory code coverage, and installation-protection choice; the optional conversion inputs are shown in the summary.
295
+
296
+ **Summary contents:** list every optional conversion input and show "none" for any not used: the definition file, the seed-metadata directory, the unpackaged-metadata directory from sfdx-project.json, and the apexTestAccess permission sets. Do not ask the customer to confirm the source version's API version.
297
+
298
+ **Ask each confirmation as its own question, one per turn:**
299
+
300
+ 1. The displayed Dev Hub is the org that must permanently own this converted package. The association cannot be transferred or changed after the first conversion.
301
+ 2. Conversion must run packaged Apex tests with `--code-coverage`, so the converted version can qualify for promotion.
302
+ 3. The installation-protection choice. If the customer uses a key, they enter it only in their own terminal and never paste it into chat.
303
+
304
+ **What counts as a confirmation:** each answer applies only to the question it replies to. A bare "yes", "ok", "yes to all", or a blanket confirmation given in advance never confirms more than one question. Re-ask any unconfirmed question individually. All three must be explicitly confirmed before `convert-package` runs. If any is declined or unclear, do not start conversion. If the Dev Hub is wrong, return to `validate-devhub-alias`.
231
305
 
232
306
  **Status:** `implemented`
233
307
 
@@ -241,7 +315,7 @@ Present the final preflight summary and require explicit confirmation of the per
241
315
 
242
316
  ### `prepare-support-escalation`
243
317
 
244
- For an unresolved, internal, or repeatedly failing conversion, assemble a sanitized Partner Support bundle without using internal Salesforce systems. Include complete CLI output and stack traces, exact commands with secrets removed, error identifiers, package and request IDs, both org IDs and instance URLs, CLI version, timestamp with time zone, reproduction steps, relevant project configuration, business impact, and customer expectations.
318
+ For an unresolved, internal, or repeatedly failing conversion, assemble a sanitized Partner Support bundle without using internal Salesforce systems. Use this only when a documented customer remediation did not resolve the issue, or when the error is internal or unclassified. Include complete CLI output and stack traces, exact commands with secrets removed, error identifiers, package and request IDs, both org IDs and instance URLs, CLI version, timestamp with time zone, reproduction steps, relevant project configuration, business impact, and customer expectations. Never include an installation key, access token, session ID, or other credential. Do not search or reference internal logs, databases, chat channels, work trackers, or employee-only tools in customer-facing output.
245
319
 
246
320
  **Status:** `implemented`
247
321