@salesforce/afv-skills 1.65.1 → 1.67.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 (71) hide show
  1. package/package.json +2 -4
  2. package/skills/agentforce-offline-experimentation-run/SKILL.md +29 -43
  3. package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +3 -245
  4. package/skills/commerce-react-storefront-create/SKILL.md +350 -0
  5. package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +2 -2
  6. package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +28 -16
  7. package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +18 -1
  8. package/skills/dx-devops-work-item-manage/SKILL.md +34 -17
  9. package/skills/dx-devops-work-item-manage/examples/common-workflows.md +49 -0
  10. package/skills/dx-devops-work-item-manage/references/commit-api.md +116 -0
  11. package/skills/education-cloud-domain-configure/SKILL.md +21 -23
  12. package/skills/education-cloud-domain-configure/references/dependent-features.md +9 -0
  13. package/skills/education-cloud-domain-configure/references/domain-features.md +15 -0
  14. package/skills/education-cloud-domain-configure/references/gotchas-extended.md +8 -0
  15. package/skills/education-cloud-domain-configure/references/setup-widgets.md +123 -0
  16. package/skills/experience-lwc-widget-assess/SKILL.md +79 -0
  17. package/skills/experience-lwc-widget-migrate/SKILL.md +50 -0
  18. package/skills/experience-search-coordinate/SKILL.md +2 -2
  19. package/skills/experience-search-coordinate/references/media-route.md +30 -4
  20. package/skills/experience-ui-bundle-features-generate/SKILL.md +1 -1
  21. package/skills/experience-ui-bundle-mfa-configure/SKILL.md +1 -1
  22. package/skills/platform-metadata-deploy/README.md +1 -1
  23. package/skills/platform-metadata-deploy/SKILL.md +114 -15
  24. package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +3 -4
  25. package/skills/platform-metadata-deploy/references/orchestration.md +2 -3
  26. package/skills/platform-role-hierarchy-apply/SKILL.md +177 -0
  27. package/skills/platform-value-set-generate/SKILL.md +19 -19
  28. package/skills/platform-widget-generate/SKILL.md +59 -68
  29. package/skills/platform-widget-generate/examples/formulas.json +19 -2
  30. package/skills/platform-widget-generate/examples/localized-labels.json +57 -0
  31. package/skills/platform-widget-generate/references/widget-actions.md +29 -0
  32. package/skills/platform-widget-generate/references/widget-bundle-validation.md +15 -0
  33. package/skills/platform-widget-generate/references/widget-formulas.md +24 -7
  34. package/skills/platform-widget-generate/references/widget-gotchas.md +10 -0
  35. package/skills/platform-widget-generate/references/widget-labels.md +78 -0
  36. package/skills/platform-widget-generate/references/widget-styling.md +12 -0
  37. package/skills/sales-call-scoring-configure/SKILL.md +17 -10
  38. package/skills/sales-call-scoring-configure/scripts/enable-call-scoring.sh +55 -33
  39. package/skills/service-agentforce-contact-center-coordinate/SKILL.md +1 -1
  40. package/skills/service-agentforce-contact-center-coordinate/references/number_management_api.md +11 -1
  41. package/skills/service-agentforce-contact-center-coordinate/scripts/fetch-numbers.sh +12 -6
  42. package/skills/service-agentforce-contact-center-coordinate/scripts/lib.sh +16 -0
  43. package/skills/service-agentforce-contact-center-coordinate/scripts/procure-number.sh +2 -1
  44. package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +24 -11
  45. package/skills/service-digital-engagement-channel-configure/SKILL.md +29 -16
  46. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +13 -2
  47. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +143 -0
  48. package/skills/service-digital-engagement-deployment-configure/SKILL.md +65 -79
  49. package/skills/service-digital-engagement-deployment-configure/assets/esd_web_update_template.xml +83 -8
  50. package/skills/service-digital-engagement-deployment-configure/examples/esd_web_prechat_fields.xml +74 -0
  51. package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +26 -7
  52. package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +13 -78
  53. package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +145 -0
  54. package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +245 -0
  55. package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +166 -112
  56. package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +61 -37
  57. package/skills/service-itsm-agentic-setup-incident-management/references/audit-tracking.md +42 -0
  58. package/skills/service-itsm-agentic-setup-incident-management/references/broadcast-communications.md +23 -0
  59. package/skills/service-itsm-agentic-setup-incident-management/references/email-to-incident.md +23 -0
  60. package/skills/service-itsm-agentic-setup-incident-management/references/incident-dashboards.md +25 -0
  61. package/skills/service-itsm-agentic-setup-incident-management/references/incident-persona-psg.md +30 -145
  62. package/skills/service-itsm-agentic-setup-incident-management/references/incident-preferences.md +32 -137
  63. package/skills/service-itsm-agentic-setup-incident-management/references/major-incident-management.md +32 -155
  64. package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +45 -0
  65. package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +32 -0
  66. package/skills/service-itsm-agentic-setup-incident-management/references/service-mgmt-privilege.md +30 -140
  67. package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +110 -0
  68. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +34 -25
  69. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +1 -1
  70. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +90 -86
  71. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +63 -38
@@ -28,9 +28,18 @@ Creates `MessagingChannel` metadata XML for Salesforce Messaging for In-App and
28
28
 
29
29
  ---
30
30
 
31
+ ## Entry points and transport
32
+
33
+ - **Delegated** (`context.calledFrom == "service-onboarding"`): use the approved `values`, ask nothing, and return `failed` naming any missing required key. **Standalone** (no `context`): run Clarifying Questions.
34
+ - **Transport A** (primary): headless-360 MCP `dispatch` / `dispatch_readonly` on `/headless/metadata`. **Transport B**: the `sf` commands below, only where a probe shows Transport A unavailable.
35
+
36
+ Details: `references/onboarding_contract.md` (§1 entry points, §2 transport, §3 pre-scan, §5 result).
37
+
38
+ ---
39
+
31
40
  ## Clarifying Questions
32
41
 
33
- Before generating, ask the user if not already clear:
42
+ Before generating, ask the user if not already clear (standalone only):
34
43
 
35
44
  - What is the channel name / label? (used for `masterLabel` and file name)
36
45
  - What routing type? (Omni-Channel Flow, Omni-Channel Queue, User, or Agentforce Service Agent)
@@ -80,19 +89,21 @@ All steps are sequential. Do not skip or reorder.
80
89
 
81
90
  1. **Verify org API version** — run `scripts/check-api-version.sh 67.0 <org-alias>` and report any errors it returns. If the script fails, generate a `sfdx-project.json` in the metadata output folder with `"sourceApiVersion": "67.0"`.
82
91
 
83
- 2. **Collect inputs** — confirm the channel label, routing type, routing target, and verification settings from the user per Clarifying Questions above.
92
+ 2. **Collect inputs** — standalone: per Clarifying Questions. Delegated: from `values`. Then probe transport with a read-only `GET` of `MessagingChannel` (contract §2).
84
93
 
85
94
  3. **Determine file name** — run `scripts/normalize-channel-name.sh "<LABEL>"` and surface any errors it returns.
86
95
 
87
- 4. **Verify routing target exists** — query the org to confirm the referenced routing target exists:
96
+ 3a. **Pre-scan** — `GET` `MessagingChannel` by the step 3 name (contract §3): none → create; matches and active → no write, `already-configured`, skip to Phase 4; matches but inactive → activate only (step 15); differs → announce each change, then write the full document (standalone: ask first).
97
+
98
+ 4. **Verify routing target exists** — skip when step 3a ended in `already-configured` or activate-only, so a re-run never creates a queue. Query the org to confirm the referenced routing target exists:
88
99
  - For Queue: `sf data query --query "SELECT Id, DeveloperName FROM Group WHERE Type='Queue' AND DeveloperName='<QUEUE_NAME>'" --target-org <org-alias>`
89
100
  - For Flow: `sf data query --query "SELECT Id, ApiName FROM FlowDefinitionView WHERE ApiName='<FLOW_NAME>' AND IsActive=true" --target-org <org-alias>`
90
101
  - For User: `sf data query --query "SELECT Id, Username FROM User WHERE Id='<USER_ID>' AND IsActive=true" --target-org <org-alias>`
91
102
  - For ASA: `sf data query --query "SELECT Id, DeveloperName FROM BotDefinition WHERE DeveloperName='<BOT_NAME>'" --target-org <org-alias>`
92
103
  - Also verify the fallback queue exists (required for Flow, User, and ASA routing)
93
104
 
94
- If any target is not found, inform the user and ask whether to create it. If the user confirms:
95
- - For Queue: generate a `.queue-meta.xml` with `MessagingSession` as the `queueSobject` type and deploy it before the channel. **A new queue is unusable for routing without a `QueueRoutingConfig` — a channel deployed against a queue with none fails at session-start with "Agents are not available. Try again later," even though the channel itself deploys and activates cleanly.** Immediately after the queue deploys, resolve or create its routing config by following `service-agentforce-channel-configure`'s `references/queue-resolution.md` Step 4 — do not defer this to a later skill invocation, since this may be the only place a newly created queue is ever touched.
105
+ If any target is not found: standalone — inform the user and ask whether to create it. Delegated — return `failed` naming the missing target; never create it. If the standalone user confirms creating:
106
+ - For Queue: generate a `.queue-meta.xml` with `MessagingSession` as the `queueSobject` type and deploy it before the channel. **A new queue needs a `QueueRoutingConfig`, or sessions fail with "Agents are not available. Try again later" even though the channel deploys and activates.** Right after the queue deploys, resolve or create one per `service-agentforce-channel-configure`'s `references/queue-resolution.md` Step 4 — do not defer it.
96
107
  - For Flow/User/ASA: inform the user that the flow, user, or bot must be created separately (out of scope for this skill)
97
108
 
98
109
  5. **Read the channel settings reference** — load `references/channel_settings.md` to understand all available configuration options and their valid values.
@@ -110,10 +121,7 @@ All steps are sequential. Do not skip or reorder.
110
121
  | User | `User` | `sessionHandlerUser` + `sessionHandlerQueue` (fallback) |
111
122
  | Agentforce Service Agent | `AgentforceServiceAgent` | `sessionHandlerQueue` (fallback) + `sessionHandlerAsa` (bot dev name — required, see v67 note below) |
112
123
 
113
- > **v67 note — `<sessionHandlerAsa>` is required in the XML, not rejected.** Confirmed on a v67.0 org: omitting `<sessionHandlerAsa>` causes the deploy to fail with "Missing required Agentforce Service Agent." Include it and the deploy binds `SessionHandlerId` automatically — no post-deploy Data API PATCH needed.
114
- > 1. **Verify the bot is Active before channel creation.** The Metadata API rejects binding with "Only active Agentforce Service Agents are supported." Run `sf agent activate -o <org> --api-name <BotDevName>` and confirm `BotVersion.Status = Active` first.
115
- > 2. Deploy the XML with `<sessionHandlerType>AgentforceServiceAgent</sessionHandlerType>`, `<sessionHandlerQueue>` (fallback), and `<sessionHandlerAsa>{BotDevName}</sessionHandlerAsa>`.
116
- > 3. Verify: `sf data query -o <org> -q "SELECT SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName='<ChannelDevName>'" --json` — both must be non-null after the deploy, with no separate PATCH step.
124
+ > **v67 note — `<sessionHandlerAsa>` is required** (omitting it fails with "Missing required Agentforce Service Agent"); the deploy then binds `SessionHandlerId`, no PATCH needed. The bot must be Active first: run `sf agent activate -o <org> --api-name <BotDevName>` and confirm `BotVersion.Status = Active`.
117
125
 
118
126
  8. **Apply user verification** — if enabled, set `embeddedConfig.authMode` to `Auth` and include `<messagingAuthorizations>`. If not enabled, set `embeddedConfig.authMode` to `UnAuth` and omit `<messagingAuthorizations>`.
119
127
 
@@ -136,27 +144,27 @@ All steps are sequential. Do not skip or reorder.
136
144
 
137
145
  11. **Apply standard parameters** — if the user needs standard pre-chat fields, generate `<standardParameters>` elements with `parameterType`. If the channel uses Flow-based routing and the user specifies flow variable mappings, include `<actionParameterMappings>` with `actionParameterName` to map each parameter to a flow input variable.
138
146
 
139
- 12. **Apply custom parameters** — if the user needs pre-chat data collection, generate `<customParameters>` elements with `name`, `masterLabel`, `parameterDataType`, `externalParameterName`, and `maxLength`. If the channel uses Flow-based routing and the user specifies flow variable mappings, include `<actionParameterMappings>` with `actionParameterName` to map each parameter to a flow input variable.
147
+ 12. **Apply custom parameters** — if the user needs pre-chat data collection, generate `<customParameters>` elements with `name`, `masterLabel`, `parameterDataType`, `externalParameterName`, and `maxLength`. Always set `parameterDataType` to `String` — the channel accepts no other value (the field's actual type, including Checkbox/Number/dropdown, is set at the deployment level via `formFieldType`, not here). If the channel uses Flow-based routing and the user specifies flow variable mappings, include `<actionParameterMappings>` with `actionParameterName` to map each parameter to a flow input variable.
140
148
 
141
149
  13. **Generate the file** — produce the `.messagingChannel-meta.xml` file following the template structure. Place at the path the user specifies, or default to the project's metadata source path under `messagingChannels/`.
142
150
 
143
151
  ### Phase 3 — Deploy and Activate
144
152
 
145
- 14. **Deploy the channel** — deploy the generated `.messagingChannel-meta.xml` file to the target org:
153
+ 14. **Write the channel** — Transport A: `POST` to create, `PUT` the **full** document to update (a minimal PUT drops `embeddedConfig`); check `results[].success`, then re-`GET`. Transport B:
146
154
  ```bash
147
155
  sf project deploy start --source-dir <path-to-messagingChannels-folder> --target-org <org-alias>
148
156
  ```
149
157
 
150
- 15a. **ASA routing only — verify the bind landed.** Skip this step for Queue, Flow, and User routing types. Because `<sessionHandlerAsa>` was included in the deployed XML (step 7), the deploy itself binds `SessionHandlerId` — no separate Data API PATCH is needed.
158
+ 15a. **ASA routing only — verify the bind landed** (skip for Queue, Flow, User):
151
159
 
152
160
  ```bash
153
161
  sf data query -o <org> --json \
154
162
  -q "SELECT SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName='<CHANNEL_DEV_NAME>'"
155
163
  ```
156
164
 
157
- Both `SessionHandlerId` and `FallbackQueueId` must be non-null. If either is null, confirm `<sessionHandlerAsa>` and `<sessionHandlerQueue>` were both present in the deployed XML and that the bot was Active before the deploy.
165
+ Both must be non-null; if not, check both handler elements were in the XML and the bot was Active before the deploy.
158
166
 
159
- 15. **Activate the channel** — after successful deployment, activate the messaging channel:
167
+ 15. **Activate the channel** — after a successful write, activate the messaging channel (`IsActive` is not part of the metadata). Transport A: sObject update `{"IsActive": true}` through `dispatch`. Transport B:
160
168
  ```bash
161
169
  sf data update record --sobject MessagingChannel --where "DeveloperName='<CHANNEL_NAME>'" --values "IsActive=true" --target-org <org-alias>
162
170
  ```
@@ -165,7 +173,9 @@ All steps are sequential. Do not skip or reorder.
165
173
 
166
174
  16. **Verify against checklist** — confirm all items in the Verification Checklist below pass before presenting output.
167
175
 
168
- 17. **Present output** — show the generated file to the user with a summary of configured settings and confirm activation status. Offer next steps:
176
+ 17. **Report** — delegated: return the contract §5 result and stop. Standalone: continue.
177
+
178
+ 18. **Present output** (standalone) — show the generated file to the user with a summary of configured settings and confirm activation status. Offer next steps:
169
179
  - **Automated responses** — ask if the user wants to configure `<automatedResponses>` (OptOutConfirmation, HelpResponse). If yes, generate elements with `autoResponseContentType: TextResponse`, `language`, and XML-escaped `response` text, then redeploy.
170
180
 
171
181
  ---
@@ -206,7 +216,9 @@ All steps are sequential. Do not skip or reorder.
206
216
  | "Only active Agentforce Service Agents are supported" on deploy | Bot is inactive — run `sf agent activate` before deploying |
207
217
  | Flow or ASA routing fails without fallback queue | `sessionHandlerQueue` is mandatory when `sessionHandlerType` is `Flow` or `AgentforceServiceAgent` |
208
218
  | JWT verification not working | Connected app and certificate must be configured for the org |
209
- | Custom parameters not collected | `name` must be unique per channel; `parameterDataType` defaults to `Text` |
219
+ | Custom parameters not collected | `name` must be unique per channel |
220
+ | `<customParameters>` deploy fails: "bad value for restricted picklist field" | `parameterDataType` was set to something other than `String`. Channel custom parameters are always `String`; set the field's actual type (Number, Checkbox, dropdown) at the deployment level, not here |
221
+ | Removing a custom parameter: "can't be deleted as it is referenced elsewhere" | **Check before deploying, not after.** Every deployment on this channel whose pre-chat form uses the param must first drop that field and be published (user-approved); remove the param's `actionParameterMappings` in a separate deploy first. See `references/channel_settings.md` §Removing a Custom Parameter |
210
222
  | Automated responses not showing | Use exact `type` values (`OptOutConfirmation`, `HelpResponse`); XML-escape special characters |
211
223
  | Channel deployed but messages not routing | Channel must be activated after deployment — it defaults to inactive |
212
224
  | "You can't enable Session-Based Chat for verified users" | Set `isSynchronousChatEnabled` to `false` for Auth channels — session-based chat is only valid for UnAuth |
@@ -278,6 +290,7 @@ File structure follows the template in `assets/messaging_channel_template.xml`.
278
290
 
279
291
  | File | When to read |
280
292
  |------|-------------|
293
+ | `references/onboarding_contract.md` | Delegated mode (`context.calledFrom == "service-onboarding"`), org writes (transport), module registration |
281
294
  | `assets/messaging_channel_template.xml` | Before generating — use as the starting structure |
282
295
  | `references/channel_settings.md` | When configuring channel options beyond defaults |
283
296
  | `scripts/check-api-version.sh` | Phase 1 — verify org API version meets the passed minimum (67.0) |
@@ -196,11 +196,13 @@ Repeatable element — one block per pre-chat field for data collection.
196
196
  |-------|------|----------|-------------|
197
197
  | `name` | String | Yes | Unique API name for the parameter |
198
198
  | `masterLabel` | String | Yes | Display label shown to agent/user |
199
- | `parameterDataType` | Enum | Yes | `String`, `Number`, `Boolean` |
199
+ | `parameterDataType` | String | Yes | **Always `String`** — see note below |
200
200
  | `externalParameterName` | String | Yes | External mapping name for the parameter |
201
- | `maxLength` | Integer | No | Max chars for Text type (default 255) |
201
+ | `maxLength` | Integer | No | Max chars (default 255) |
202
202
  | `actionParameterMappings` | Object | No | Maps this parameter to an Omni-Channel Flow action input variable |
203
203
 
204
+ > **`parameterDataType` is always `String`.** Every channel custom parameter deploys as `String`, regardless of the field's logical type. The metadata field's declared type is the broad `FlowDataType` enum (`Apex`, `Boolean`, `Currency`, `Date`, `DateTime`, `Multipicklist`, `Number`, `Picklist`, `SObject`, `String`, `Time`), but `MessagingChannel` restricts it at deploy time to `String` only — any other value fails with *"bad value for restricted picklist field."* The parameter's actual data type (Number, Checkbox/Boolean, dropdown, etc.) is not set on the channel; it is chosen at the **deployment** level in the pre-chat New Custom Parameter screen — i.e. via the Embedded Service form field's `formFieldType` (see `service-digital-engagement-deployment-configure`).
205
+
204
206
  ### Action Parameter Mappings
205
207
 
206
208
  When the channel uses Flow-based routing, `actionParameterMappings` maps a custom parameter to a flow input variable so the value collected from the user is passed into the routing flow.
@@ -222,6 +224,15 @@ When the channel uses Flow-based routing, `actionParameterMappings` maps a custo
222
224
  </customParameters>
223
225
  ```
224
226
 
227
+ ### Removing a Custom Parameter
228
+
229
+ A parameter still used by a pre-chat form can't be deleted ("can't be deleted as it is referenced elsewhere"). Several deployments can share one channel, so **check every deployment before writing**: retrieve all `EmbeddedServiceConfig` and find each one whose `<messagingChannel>` is this channel and whose form has `<formField>` = the param `name`. Don't use a failed channel deploy to find them.
230
+
231
+ 1. If another deployment the user didn't mention still uses the param, stop and ask; changing it is outside the request.
232
+ 2. Each referencing deployment: remove the field (via `service-digital-engagement-deployment-configure`) and publish it after the user approves.
233
+ 3. If the param has `actionParameterMappings`, deploy the channel with the mapping removed first.
234
+ 4. Deploy the channel without that parameter's `<customParameters>` block; keep every other parameter.
235
+
225
236
  ---
226
237
 
227
238
  ## Automated Responses (`<automatedResponses>`)
@@ -0,0 +1,143 @@
1
+ # Onboarding contract — delegated mode, transport, pre-scan, registration
2
+
3
+ Read this when the invocation carries a `context` object, before any org write, or when registering the skill in an
4
+ onboarding module. It implements the Feature Setup Skill Guidelines (Conversational Onboarding, Service Cloud) for
5
+ this skill. The sibling `service-digital-engagement-deployment-configure` has the same structure.
6
+
7
+ ## 1. Two entry points, one write procedure
8
+
9
+ | | Delegated | Standalone |
10
+ |---|---|---|
11
+ | Detected by | `context.calledFrom == "service-onboarding"` | no `context` object |
12
+ | Values come from | `values` in the payload — already approved in the plan table | you ask, using the defaults in SKILL.md |
13
+ | Questions | none. A missing required key is a caller bug: stop and return `failed` naming the key. Never default a value the admin did not approve | the Clarifying Questions in SKILL.md |
14
+ | Wording | `discoveryMode == "guided"` → plain business language (§4). `"pickAreas"` → Salesforce terminology | Salesforce terminology (the Clarifying Questions as written) |
15
+ | Ends with | the structured result in section 5 | a plain-language summary of the same outcome |
16
+
17
+ Delegated payload:
18
+
19
+ ```json
20
+ {
21
+ "values": {
22
+ "channelLabel": "Acme Support Chat",
23
+ "routingType": "Queue",
24
+ "routingTarget": "Support_Queue",
25
+ "fallbackQueue": null,
26
+ "userVerification": true
27
+ },
28
+ "context": { "calledFrom": "service-onboarding", "discoveryMode": "guided" }
29
+ }
30
+ ```
31
+
32
+ Required `values`: `channelLabel`, `routingType`, `routingTarget`; `fallbackQueue` is required when `routingType` is
33
+ `Flow`, `User` or `AgentforceServiceAgent`. `userVerification` defaults to `true`, matching SKILL.md. Every other
34
+ channel setting uses the SKILL.md defaults unless a key is supplied.
35
+
36
+ Missing routing target, delegated: return `failed`, `errorMessage` = "<Flow|User|Bot|Queue> <name> not found". Never
37
+ create one — queues come from the `queues` feature this one depends on.
38
+
39
+ ## 2. Transport — `/headless/metadata` first, `sf` CLI as fallback
40
+
41
+ **Transport A (primary): the headless-360 MCP `dispatch` / `dispatch_readonly` tools** against the synchronous
42
+ Metadata-CRUD route, fully-qualified: `/services/data/vXX.0/headless/metadata/<Type>?type=<Type>&fullName=<Name>`.
43
+
44
+ - `GET` = read (`dispatch_readonly`) → `{type, fullName, xmlRep}`. `POST` = create-only; re-POSTing an existing
45
+ `fullName` returns `DUPLICATE_VALUE`. `PUT` = update. On writes the body must carry `type`, `fullName` **and** `xmlRep`.
46
+ - Response is synchronous: `{results:[{success, errors[], ...}]}`. HTTP 200 can still be a failure — inner `success` wins.
47
+ - **Create once, then update.** Never re-run `POST` for a later change.
48
+ - **A minimal PUT silently drops inline blocks.** On `MessagingChannel`, a PUT that omitted `embeddedConfig` cleared
49
+ it while `automatedResponses` and `messagingKeywords` survived. Always GET → modify → PUT the **full** document.
50
+ Re-GET after the PUT and diff.
51
+ - Activation is not metadata: `IsActive` is absent from the `MessagingChannel` representation. Activate with an
52
+ sObject update (`{"IsActive": true}`) through `dispatch`, or `sf data update record` on Transport B.
53
+ - Use the same `dispatch` tool for the probe and the write. `sf api request rest` / `curl` carry the `sf` CLI's separate
54
+ credential, which can be expired while the MCP token is valid — a REST URL called through the CLI is **not** Transport A.
55
+ - Metadata references Flow/Queue by **API name** (`sessionHandlerFlow`, `sessionHandlerQueue`), not by runtime Id.
56
+
57
+ **Probe per type, per operation — never infer from another type.** Run a read-only `GET` for each type you are about
58
+ to touch (`MessagingChannel`; and `Queue` if you must create one).
59
+
60
+ | Probe result | Meaning | Action |
61
+ |---|---|---|
62
+ | `xmlRep` returned, or "Metadata not found" style error | type is onboarded | Transport A |
63
+ | `UNSUPPORTED_OPERATION` for the type or verb | not onboarded for that verb | Transport B for that call only |
64
+ | auth / connection error | MCP unavailable | Transport B; say so |
65
+
66
+ **Transport B (fallback): `sf` CLI** — `sf project deploy start` and `sf data query` / `sf data update record` as in
67
+ SKILL.md. Use only when the probe says Transport A is unavailable for that type/verb.
68
+
69
+ Routing-target existence checks (Queue, Flow, User, Bot) are SOQL: `dispatch_readonly` on the REST query endpoint first; `sf data query` only if that call returns a path/route error.
70
+
71
+ ## 3. Pre-scan (idempotency)
72
+
73
+ Run before any write, both modes. `GET` `MessagingChannel` by `fullName` = the normalized channel name.
74
+
75
+ | Finding | Outcome |
76
+ |---|---|
77
+ | No such channel | not set up → create (`POST`) |
78
+ | Exists, and every targeted setting equals the target (routing type and target, fallback queue, `authMode`, plus each supplied key) **and** `IsActive = true` | **already configured** — no write, return `already-configured` |
79
+ | Exists, matches, but `IsActive = false` | only activate; do not rewrite the metadata |
80
+ | Exists, some targeted setting differs | **drift** — announce each change ("routing: Queue A → Queue B"), then write the full document. Standalone: ask for a yes first. Delegated: the plan approval covers it |
81
+ | Exists but was created by Connect `channel/setup` (defaults populated: opt-out/help keywords, `embeddedConfig`) | you now own the whole document: GET, modify only targeted fields, PUT the full result |
82
+
83
+ Standalone, channel exists: offer exactly three choices — no change / override / add to existing.
84
+
85
+ ## 4. Questions in the admin's language (guided mode)
86
+
87
+ Ask about the outcome; state the default with each; keep it to a handful.
88
+
89
+ | Instead of | Ask |
90
+ |---|---|
91
+ | "Routing type: Queue, Flow, User or Agentforce Service Agent?" | "When a customer starts a chat, who should get it first: a team (queue), a specific person, or your AI agent? (Default: a team.)" |
92
+ | "Fallback queue developer name?" | "If that person or agent isn't available, which team should the chat go to?" |
93
+ | "Enable User Verification (JWT)?" | "Will customers be signed in to your site when they chat, so you know who they are? (Default: yes.)" Yes → Auth mode; setting up the signing keys is a separate step |
94
+ | "Pre-chat form / custom parameters" | "What should we ask customers before the chat starts? (Default: name and email.)" |
95
+ | "`isAbandonedChatsEnabled`, `chatAbandonmentTimeout`…" | Not asked; use the SKILL.md defaults |
96
+
97
+ ## 5. Result returned to the coordinator
98
+
99
+ ```json
100
+ {
101
+ "status": "success | already-configured | failed",
102
+ "errorMessage": "<empty unless failed>",
103
+ "outputs": {
104
+ "channelName": "Acme_Support_Chat",
105
+ "messagingChannelId": "<id or null>",
106
+ "isActive": true
107
+ }
108
+ }
109
+ ```
110
+
111
+ `status` and `errorMessage` are the contract. `outputs` is always returned; it is an addition to the documented shape.
112
+ On `failed`: `errorMessage` names the failed step and the platform error; stop; do not retry.
113
+
114
+ ## 6. Registration entry (draft for the onboarding team to place in a module)
115
+
116
+ ```yaml
117
+ - id: messagingChannel
118
+ title: "Customer messaging channel"
119
+ description: "Create and switch on the channel that receives customer chats from your website or app, and decide who answers first (a team, a person, or an AI agent)."
120
+ delegateSkill: service-digital-engagement-channel-configure
121
+ dependsOn: [queues]
122
+ revisionOwner: service-digital-engagement-channel-configure
123
+ # org perms: confirm exact names with Digital Engagement licensing (not yet confirmed)
124
+ values:
125
+ channelLabel: { from: signal.messagingChannelName, default: "<company> Support Chat" }
126
+ routingType: { from: signal.messagingRouting, default: "Queue" }
127
+ routingTarget: { from: signal.messagingRoutingTarget }
128
+ fallbackQueue: { from: signal.messagingFallbackQueue }
129
+ userVerification: { from: signal.messagingSignedIn, default: true }
130
+ writes: "MessagingChannel (Metadata CRUD); IsActive via sObject update"
131
+ gating:
132
+ irreversible: false
133
+ note: "Reversible by deactivating the channel. Pre-chat form fields can be deactivated but the form cannot be fully deleted; removing a channel custom parameter needs the form field removed and the deployment republished first."
134
+ validate:
135
+ check: check-messaging-channel
136
+ passWhen: "GET MessagingChannel fullName=<normalized name> returns the targeted sessionHandlerType and target and the intended authMode; SOQL SELECT IsActive, SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName=<name> returns IsActive=true, and non-null SessionHandlerId/FallbackQueueId where the routing type requires them"
137
+ alternative: "Setup > Messaging Settings > New Channel > Messaging for In-App and Web; choose routing, then activate."
138
+ ```
139
+
140
+ Open items for the onboarding team: the `signal.*` keys do not exist in `onboarding-state.schema.json` yet
141
+ (`channels` allows only email/web); `userVerification: true` makes an Auth channel, which also needs the
142
+ user-verification step before signed-in customers can chat — decide if that is its own feature; the coordinator must
143
+ accept `outputs`; org perm names are not yet confirmed.
@@ -23,19 +23,29 @@ Configures `EmbeddedServiceConfig` metadata for Salesforce Messaging for In-App
23
23
  ## Scope
24
24
 
25
25
  - **In scope**: Creating new Embedded Service Deployments (API, Mobile, Web types) via Connect API; updating existing deployments with forms, branding, channel settings, and features via Metadata API; generating `EmbeddedServiceConfig` XML for updates
26
- - **Out of scope**: Creating the messaging channel itself (use `service-digital-engagement-channel-configure`), publishing deployments (Connect API post-step), creating Experience Sites (Connect API prerequisite for Web type)
26
+ - **Out of scope**: Creating the messaging channel itself (use `service-digital-engagement-channel-configure`), generating the website code snippet (offered only as a next step, see `references/code_snippet.md`), creating Experience Sites (Connect API prerequisite for Web type)
27
+
28
+ ---
29
+
30
+ ## Entry points and transport
31
+
32
+ - **Delegated** (`context.calledFrom == "service-onboarding"`): use the approved `values`, ask nothing, and return `failed` naming any missing required key. **Standalone** (no `context`): run Clarifying Questions.
33
+ - **Transport A** (primary): headless-360 MCP `dispatch` / `dispatch_readonly` on `/services/data/vXX.0/headless/metadata`. **Transport B**: the `sf` commands below, only where a probe shows Transport A unavailable. Exception: Web create always uses the `sf` CLI (step 17a).
34
+
35
+ Details: `references/onboarding_contract.md` (§1 entry points, §2 transport, §3 pre-scan, §5 result).
27
36
 
28
37
  ---
29
38
 
30
39
  ## Clarifying Questions
31
40
 
32
- Before generating, ask the user if not already clear:
41
+ Before generating, ask the user if not already clear (standalone only):
33
42
 
34
43
  - **Create or update?** Are you creating a new deployment or updating an existing one?
35
44
  - **Deployment type?** API (headless), Mobile (native apps), or Web (browser widget)?
36
45
  - **Channel name?** What is the `channelPlatformKey` of the messaging channel to associate?
37
46
  - For **create**: What should the deployment be named?
38
47
  - For **update**: What features to configure? (pre-chat forms, business hours, T&C, UI toggles)
48
+ - For **pre-chat** (if requested): the questions in `references/prechat_forms.md` §Inputs to Gather
39
49
  - For **update (Web)**: What is the Experience Site name? Branding overrides needed?
40
50
 
41
51
  ---
@@ -46,13 +56,13 @@ Gather or infer before proceeding:
46
56
 
47
57
  - **Operation**: `create` or `update`
48
58
  - **Deployment type**: `API`, `Mobile`, or `Web`
49
- - **Deployment name**: Used for `masterLabel` and the API name
59
+ - **Deployment name**: Used as `masterLabel`. Derive the API name (`fullName` / `DeveloperName`, Connect `name`) from it: replace each run of characters other than letters and digits with `_`, then trim leading/trailing `_` (`Acme Support Chat` → `Acme_Support_Chat`). The result must match `^[a-zA-Z][a-zA-Z0-9_]*$`. Use the API name for every lookup and write
50
60
  - **Channel name**: The `channelPlatformKey` of the associated messaging channel
51
61
 
52
62
  For **update** operations additionally:
53
63
  - **Site name** (Web only): The Experience Site name (format `ESW_<name>_<timestamp>`)
54
64
  - **Branding name** (optional): Reference to existing `BrandingSet`
55
- - **Pre-chat form fields** (optional): Field names and required status
65
+ - **Pre-chat form fields** (optional): see `references/prechat_forms.md` §Inputs to Gather
56
66
  - **Business hours** (optional): Name of existing `BusinessHours` record
57
67
 
58
68
  Defaults unless specified:
@@ -69,23 +79,21 @@ All steps are sequential. Do not skip or reorder. Branch based on the operation
69
79
 
70
80
  1. **Verify org API version** — run `scripts/check-api-version.sh 67.0 <org-alias>` and report any errors it returns. If the script fails, generate a `sfdx-project.json` in the metadata output folder with `"sourceApiVersion": "67.0"`.
71
81
 
72
- 2. **Determine operation** — ask whether the user wants to create a new deployment or update an existing one.
82
+ 2. **Determine operation** — standalone: ask whether the user wants to create a new deployment or update an existing one. Delegated: taken from `values.operation`, then confirmed by the pre-scan (step 4a).
83
+
84
+ 3. **Collect inputs** — standalone: per Clarifying Questions. Delegated: from `values` (`deploymentName`, `deploymentType`, `channelName` required).
73
85
 
74
- 3. **Collect inputs** — gather deployment name, type, and channel name per Clarifying Questions above.
86
+ 3a. **Probe transport** — read-only `GET` of `EmbeddedServiceConfig` (contract §2).
75
87
 
76
88
  4. **Read deployment settings reference** — load `references/deployment_settings.md` to understand all available configuration options.
77
89
 
90
+ 4a. **Pre-scan** — look up the deployment by its derived API name (contract §3): none → `create` (Phase 2A); matches → no write, `already-configured`, skip to Phase 3; differs → `update` (Phase 2B), announce each change (standalone: ask first); linked to a different channel → standalone: ask before repointing, delegated: `failed`. Standalone, deployment exists: offer exactly three choices — no change / override / add to existing.
91
+
78
92
  ### Phase 2A — Create New Deployment
79
93
 
80
94
  Use this path when the operation is `create`.
81
95
 
82
- 5. **Determine API method by type**:
83
-
84
- | Deployment Type | Creation Method | Prerequisites |
85
- |----------------|-----------------|---------------|
86
- | API | Metadata API deploy | Channel must exist |
87
- | Mobile | Metadata API deploy | Channel must exist |
88
- | Web | Connect API | Channel must exist + Experience Site required |
96
+ 5. **Determine API method by type** — API/Mobile: Metadata API deploy. Web: Connect API (creates the Experience Site). All types need the channel to exist.
89
97
 
90
98
  6. **For API/Mobile types** — read the template `assets/esd_api_mobile_template.xml` and generate the `EmbeddedServiceConfig` XML with:
91
99
  - `deploymentType` set to `API` or `Mobile`
@@ -96,86 +104,71 @@ Use this path when the operation is `create`.
96
104
 
97
105
  8. **Generate output** — produce the `.EmbeddedServiceConfig-meta.xml` file (for API/Mobile) or Connect API instructions (for Web).
98
106
 
99
- 9. **Present output and next steps** — show the generated file and summarize what was configured. Recommend as next steps:
100
- - **Publish** the deployment via Connect API to make it live:
101
- ```bash
102
- sf api request rest "/services/data/v67.0/connect/embeddedservice/embeddedserviceconfig/publish/<EMBEDDED_SERVICE_CONFIG_ID>" -X POST -o <org-alias>
103
- ```
104
- To obtain the `EMBEDDED_SERVICE_CONFIG_ID`:
105
- ```bash
106
- sf data query --query "SELECT Id FROM EmbeddedServiceConfig WHERE DeveloperName = '<DEPLOYMENT_NAME>'" --target-org <org-alias>
107
- ```
108
- - **Generate code snippet** for integration — see `references/code_snippet.md`
107
+ 9. **Present output and next steps** — as in step 17.
109
108
 
110
109
  ### Phase 2B — Update Existing Deployment (Metadata API)
111
110
 
112
111
  Use this path when the operation is `update`.
113
112
 
114
- 10. **Retrieve the existing deployment** — retrieve the current `EmbeddedServiceConfig` metadata from the org before making changes:
113
+ 10. **Retrieve the existing deployment** — take the current `EmbeddedServiceConfig` from the org before making changes. Transport A: the `xmlRep` from the step 3a/4a `GET`. Transport B:
115
114
  ```bash
116
115
  sf project retrieve start --metadata EmbeddedServiceConfig:<DEPLOYMENT_NAME> --target-org <org-alias>
117
116
  ```
118
- Use the retrieved file as the starting structure. If retrieval is not possible, load `assets/esd_web_update_template.xml` as a fallback reference.
117
+ Use it as the starting structure — the update is always a **full document** (see Rules). If retrieval is not possible, load `assets/esd_web_update_template.xml` as a fallback reference.
119
118
 
120
- 11. **Apply messaging channel settings** — configure `<embeddedServiceMessagingChannel>` with:
121
- - `messagingChannel` — the channel's `channelPlatformKey`
122
- - `shouldShowAgentforceTagline` — Agentforce branding
123
- - `shouldShowDeliveryReceipts` — delivery receipts
124
- - `shouldShowEmojiSelection` — emoji picker
125
- - `shouldShowReadReceipts` — read receipts
126
- - `shouldShowTypingIndicators` — typing indicators
127
- - `shouldStartNewLineOnEnter` — Enter key behavior
128
- - `isChatInvitationCustomizable` / `isInvitationEnabled` — chat invitation settings
119
+ 11. **Apply messaging channel settings** — in `<embeddedServiceMessagingChannel>` set `messagingChannel` (the channel's `channelPlatformKey`) and the UI toggles (`shouldShow*`, `shouldStartNewLineOnEnter`, invitation flags). Include every boolean, even when `false`; full list in `references/deployment_settings.md`. Leave each `shouldShow*` / `shouldStartNewLineOnEnter` at its retrieved value (default `false` if nothing was retrieved); set one to `true` only when the user explicitly asks for that feature — never infer it from an example.
129
120
 
130
- 12. **Apply pre-chat forms** — if the user needs pre-chat data collection, generate `<embeddedServiceForms>` with `<embeddedServiceFormFields>` elements containing `embeddedServiceFormFieldName` and `isRequired`.
121
+ 12. **Apply pre-chat forms** — pre-chat is OFF by default: omit `<embeddedServiceForms>` unless the user asks to collect data before the conversation. If they do, **read `references/prechat_forms.md` first** and follow it (field attributes, hidden fields, ChoiceList, `displayNameFormat`, deactivate vs. remove).
122
+ - **Before generating**, run the checks in its §Validating and Remediating Prerequisites against the *retrieved* channel. Channel fixes go through `service-digital-engagement-channel-configure`; never hand-edit the channel here.
123
+ - Delta to graft onto a base deployment: `examples/esd_web_prechat_fields.xml`.
131
124
 
132
125
  13. **Apply branding customization** (Web only) — a BrandingSet is automatically created with defaults when the deployment is created via Connect API. If the user wants to override specific branding properties (colors, fonts, dimensions), read `references/branding_and_tooling.md` for the Tooling API steps to update individual properties.
133
126
 
134
- 14. **Apply invitation** (Web only) — if the user wants the widget to proactively invite visitors based on conditions:
135
- - Set `isInvitationEnabled` to `true` in `<embeddedServiceMessagingChannel>`
136
- - Generate repeatable `<embdMsgChannelInvitationConditions>` elements with `sequence`, `conditionType`, `operand`, `value`, and optionally `customVariableName`
137
- - Update the `formula` field in `<embeddedServiceMessagingChannel>` to reference the condition sequences (e.g., `1 AND 2`, `1 OR 2`). The formula must be updated whenever conditions are added or removed to stay in sync with the `sequence` numbers
138
- - See `references/deployment_settings.md` for available condition types and operators
127
+ 14. **Apply invitation** (Web only) — set `isInvitationEnabled` to `true`, add `<embdMsgChannelInvitationConditions>` (fields and operators in `references/deployment_settings.md`), and keep `formula` (e.g. `1 AND 2`) in sync with the condition `sequence` numbers whenever conditions change.
139
128
 
140
129
  15. **Apply additional settings**:
141
130
  - `isTermsAndConditionsEnabled` / `isTermsAndConditionsRequired` — T&C in pre-chat
142
- - **Do NOT update `site`** — the site name is auto-generated during creation and must never be modified
131
+ - `site` — Web: the retrieved value, unchanged (see Rules); omit for API/Mobile
143
132
 
144
133
  16. **Generate the file** — produce the `.EmbeddedServiceConfig-meta.xml` file at the path the user specifies, or default to `EmbeddedServiceConfig/` in the project's metadata source path.
145
134
 
146
135
  17. **Present output and next steps** — show the generated file and summarize what was configured. Recommend as next steps:
147
- - **Publish** the deployment via Connect API to make changes live:
148
- ```bash
149
- sf api request rest "/services/data/v67.0/connect/embeddedservice/embeddedserviceconfig/publish/<EMBEDDED_SERVICE_CONFIG_ID>" -X POST -o <org-alias>
150
- ```
151
- To obtain the `EMBEDDED_SERVICE_CONFIG_ID`:
152
- ```bash
153
- sf data query --query "SELECT Id FROM EmbeddedServiceConfig WHERE DeveloperName = '<DEPLOYMENT_NAME>'" --target-org <org-alias>
154
- ```
136
+ - **Publish** (Web) — only after the user approves, per step 17c
155
137
  - **Generate code snippet** for integration — see `references/code_snippet.md`
156
138
 
139
+ ### Phase 2C — Apply to the org
140
+
141
+ Runs for both Phase 2A and 2B, except when the pre-scan returned `already-configured`. Standalone: confirm before writing. Delegated: the plan approval is the confirmation; still announce each write.
142
+
143
+ 17a. **Write the deployment** —
144
+ - Web create: Connect API (see `references/connect_api_creation.md`) via `sf api request rest` — always, not `dispatch` (MCP `dispatch` fails with `INTERNAL_ERROR` during site creation).
145
+ - API/Mobile create: Transport A `POST` `EmbeddedServiceConfig` (body carries `type`, `fullName`, `xmlRep`); Transport B `sf project deploy start`.
146
+ - Update: Transport A `PUT` of the **full** document; Transport B `sf project deploy start`.
147
+ Check `results[].success`, not just HTTP status. On failure stop and report the step — no silent retry.
148
+
149
+ 17b. **Re-read and diff** — `GET` the component again and confirm every intended field landed and no inline block (`embeddedServiceMessagingChannel`, forms) was dropped.
150
+
151
+ 17c. **Publish (Web only) — never automatic.** Publishing makes the changes live to customers; the deploy only saves a draft. After 17b, stop: summarize what changed, give the plain Setup link `<instanceUrl>/lightning/setup/EmbeddedServiceDeployments/<EmbeddedServiceConfigId>/view` so the user can review the draft, and ask whether to publish now. Publish only on an explicit yes in that turn (a "publish" in the original request does not count). Then `dispatch` `POST` on the fully-qualified publish path; if it returns a path/route error, or on Transport B, run the `sf` publish command from `references/connect_api_creation.md`. Delegated: do not publish; return `published: false`. Note: a Web create via Connect API publishes by itself (`isPublishSuccess: true`); say so in the plan before creating.
152
+
157
153
  ### Phase 3 — Validate
158
154
 
159
155
  18. **Verify against checklist** — confirm all items in the Verification Checklist below pass.
160
156
 
157
+ 19. **Report** — delegated: return the contract §5 result. Standalone: the same outcome in plain language.
158
+
161
159
  ---
162
160
 
163
161
  ## Rules / Constraints
164
162
 
165
163
  | Constraint | Rationale |
166
164
  |-----------|-----------|
167
- | Always retrieve existing deployment before updating | Ensures current settings are preserved and only intended changes are applied |
168
165
  | `deploymentType` must be `API`, `Mobile`, or `Web` | Platform rejects other values |
169
- | Never update the `site` field on a Web deployment | Site name is auto-generated at creation and must not be changed |
170
- | Web deployments cannot be created via Metadata API | Circular dependency between Network and CustomSite — use Connect API |
166
+ | Web updates must include `site`, set to the retrieved value unchanged | Site (`ESW_<name>_<timestamp>`) is auto-generated at creation; the platform rejects a missing or changed value |
171
167
  | `embeddedServiceMessagingChannelName` must reference an existing channel | Deployment fails if channel doesn't exist |
172
- | `site` field required for Web type updates | Web widget must be associated with an Experience Site |
173
- | BrandingSet is auto-created with defaults by Connect API | To override branding properties, use Tooling API — see `references/branding_and_tooling.md` |
174
- | Pre-chat form fields must reference valid channel custom parameters | ChoiceList fields need the parameter deployed on the channel first |
175
168
  | File extension is `.EmbeddedServiceConfig-meta.xml` | Metadata API uses this specific extension |
176
169
  | Do not hardcode file paths — respect `sfdx-project.json` package directories | Customer orgs customize source paths |
177
- | Never include deploy/push commands in generated output | This skill produces artifacts only |
178
- | Publish step (Connect API) required after Web ESD updates | Changes are not live until published |
170
+ | Do not embed deploy/push commands inside generated files or artifacts | Artifacts stay portable; in-session writes happen in Phase 2C through the chosen transport |
171
+ | Update with the full retrieved document, never a minimal PUT | Omitted inline blocks can be silently cleared by the update |
179
172
 
180
173
  ---
181
174
 
@@ -183,16 +176,11 @@ Use this path when the operation is `update`.
183
176
 
184
177
  | Issue | Resolution |
185
178
  |-------|------------|
186
- | Web ESD creation fails via Metadata API | Web type requires Connect API for initial creation; use Metadata API only for updates |
187
- | Site name not found | Site must exist before Web ESD update; format is `ESW_<name>_<timestamp>` |
188
179
  | Branding overrides not applied | Use Tooling API to update individual BrandingSet properties after the deployment is created |
189
- | Pre-chat ChoiceList not showing | ChoiceList requires two-step deploy: create ChoiceList first, then assign to form field |
190
- | Changes not appearing in widget | Web ESDs must be published via Connect API after any update |
191
- | `embeddedServiceFlowConfig.enabled` error | Set to `false` unless you specifically need embedded flows (not routing flows) |
192
- | reCAPTCHA configuration rejected | reCAPTCHA is `@HideInWsdl` — must use Tooling API |
193
- | Business hours not taking effect | Only updating existing business hours works; creation is managed separately |
194
- | Deploy fails with "required field missing" or "upsert failed null" | All attributes are mandatory: boolean fields in `embeddedServiceMessagingChannel` (include all even with default `false`), and all form field attributes (`formField`, `formFieldType`, `isHidden`, `isRequired`, `displayOrder`, `messagingChannelParameterType`) |
195
- | Standard pre-chat field not found | Use `_` prefix for standard fields in `formField`: `_FirstName`, `_LastName`, `_Email`, `_Subject` |
180
+ | Pre-chat form, field, ChoiceList, or `displayNameFormat` issues | See the Gotchas table in `references/prechat_forms.md` |
181
+ | Changes not appearing in widget | The deploy is a draft until published (step 17c) |
182
+ | `sf api request rest` fails ("No 'mode' found", "Nonexistent flag: --url") | See `references/connect_api_creation.md` §Publishing After Updates |
183
+ | Deploy fails with "required field missing" or "upsert failed null" | All attributes are mandatory: boolean fields in `embeddedServiceMessagingChannel` (include all even with default `false`), and all pre-chat form field attributes |
196
184
 
197
185
  ---
198
186
 
@@ -208,7 +196,7 @@ Use this path when the operation is `update`.
208
196
  ### Web Type Checks
209
197
  - [ ] Is `site` populated with the Experience Site name?
210
198
  - [ ] If branding is configured, does `embeddedServiceBrandingName` reference an existing BrandingSet?
211
- - [ ] Are pre-chat form field names valid (match channel custom parameters)?
199
+ - [ ] Pre-chat (if configured): does every item in the `references/prechat_forms.md` Verification Checklist pass?
212
200
  - [ ] If `isInvitationEnabled` is `true`, is `formula` populated and consistent with all `sequence` numbers in `<embdMsgChannelInvitationConditions>`?
213
201
 
214
202
  ### API/Mobile Type Checks
@@ -216,17 +204,15 @@ Use this path when the operation is `update`.
216
204
  - [ ] Is `deploymentType` correctly set to `API` or `Mobile`?
217
205
 
218
206
  ### Post-Deploy Checks
219
- - [ ] Is user reminded to publish (Connect API) for Web deployments?
220
- - [ ] Is user reminded to activate components (Tooling API) if messaging components were deployed?
207
+ - [ ] Web: did you stop before publishing, give the review link, and publish only after the user's explicit yes? Is the user reminded to activate any deployed messaging components (Tooling API)?
221
208
 
222
209
  ---
223
210
 
224
211
  ## Output Expectations
225
212
 
226
213
  Deliverables:
227
- - **For API/Mobile create**: `<source-path>/EmbeddedServiceConfig/<DeploymentName>.EmbeddedServiceConfig-meta.xml`
228
- - **For Web create**: Connect API payload and instructions (no XML file)
229
- - **For update**: `<source-path>/EmbeddedServiceConfig/<DeploymentName>.EmbeddedServiceConfig-meta.xml`
214
+ - **API/Mobile create, and any update**: `<source-path>/EmbeddedServiceConfig/<DeploymentName>.EmbeddedServiceConfig-meta.xml`
215
+ - **Web create**: Connect API payload and instructions (no XML file)
230
216
 
231
217
  File structure follows the templates in `assets/`.
232
218
 
@@ -237,6 +223,7 @@ File structure follows the templates in `assets/`.
237
223
  | Need | Delegate to |
238
224
  |------|-------------|
239
225
  | Creating the messaging channel | `service-digital-engagement-channel-configure` skill |
226
+ | Channel custom parameters, flow-variable mappings, or Queue → Omni-Flow routing | `service-digital-engagement-channel-configure` skill (pass the retrieved channel; see step 12) |
240
227
  | Creating Omni-Channel routing flows | `automation-flow-generate` skill |
241
228
  | Creating permission sets for agents | `platform-permission-set-generate` skill |
242
229
 
@@ -246,13 +233,12 @@ File structure follows the templates in `assets/`.
246
233
 
247
234
  | File | When to read |
248
235
  |------|-------------|
249
- | `assets/esd_api_mobile_template.xml` | Before generating API or Mobile type deployments |
250
- | `assets/esd_web_update_template.xml` | Before generating Web type updates |
251
- | `references/deployment_settings.md` | When configuring deployment options beyond defaults |
252
- | `references/connect_api_creation.md` | When creating Web type deployments (Connect API required) |
236
+ | `references/onboarding_contract.md` | Pre-scan (§3, both modes); delegated mode (`context.calledFrom == "service-onboarding"`), org writes (transport), module registration |
237
+ | `assets/esd_api_mobile_template.xml`, `assets/esd_web_update_template.xml` | Before generating API/Mobile deployments and Web updates, respectively |
238
+ | `references/deployment_settings.md` | When configuring deployment options beyond defaults; less common gotchas (embedded flow, reCAPTCHA, business hours) |
239
+ | `references/prechat_forms.md` | Whenever pre-chat is requested — inputs, field rules, ChoiceList, `displayNameFormat`, deactivate vs. remove, pre-chat gotchas and checklist |
240
+ | `references/connect_api_creation.md` | When creating Web type deployments (Connect API required); publish command and ID query |
253
241
  | `references/branding_and_tooling.md` | When user asks about branding configuration |
254
242
  | `references/code_snippet.md` | When user wants the JavaScript embed code snippet for their website |
255
243
  | `scripts/check-api-version.sh` | Phase 1 — verify org API version meets the passed minimum (67.0) |
256
- | `examples/esd_api.xml` | To verify output for API type deployment |
257
- | `examples/esd_mobile.xml` | To verify output for Mobile type deployment |
258
- | `examples/esd_web_full.xml` | To verify output for fully configured Web deployment |
244
+ | `examples/esd_api.xml`, `esd_mobile.xml`, `esd_web_full.xml`, `esd_web_prechat_fields.xml` | To verify output per type; the pre-chat file is a forms delta to graft onto `esd_web_full.xml` |