@salesforce/afv-skills 1.40.0 → 1.41.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 (136) hide show
  1. package/package.json +1 -1
  2. package/skills/automation-flow-generate/SKILL.md +32 -43
  3. package/skills/experience-portal-create/SKILL.md +497 -0
  4. package/skills/experience-portal-create/assets/report-template.md +30 -0
  5. package/skills/experience-portal-create/references/mcp-invocation.md +288 -0
  6. package/skills/experience-portal-create/references/post-creation-activate-publish.md +165 -0
  7. package/skills/experience-portal-create/references/templates.md +253 -0
  8. package/skills/experience-ui-bundle-features-generate/SKILL.md +5 -1
  9. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +2 -0
  10. package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -0
  11. package/skills/platform-datamask-run/SKILL.md +345 -0
  12. package/skills/platform-datamask-run/references/api-surface.md +130 -0
  13. package/skills/platform-datamask-run/references/policy-authoring.md +185 -0
  14. package/skills/platform-datamask-run/references/run-and-abort.md +116 -0
  15. package/skills/platform-datamask-run/scripts/poll-job.sh +115 -0
  16. package/skills/platform-dataspace-access-configure/SKILL.md +51 -3
  17. package/skills/platform-dataspace-access-configure/scripts/inspect-dataspace-scopes.sh +56 -0
  18. package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +1 -0
  19. package/skills/platform-sandbox-configure/SKILL.md +17 -2
  20. package/skills/platform-trial-org-create/SKILL.md +175 -0
  21. package/skills/platform-trial-org-create/examples/create_request.json +9 -0
  22. package/skills/platform-trial-org-create/examples/error_response.json +41 -0
  23. package/skills/platform-trial-org-create/examples/success_response.json +27 -0
  24. package/skills/platform-trial-org-create/references/error_codes.md +42 -0
  25. package/skills/platform-trial-org-create/references/signup_request_fields.md +69 -0
  26. package/skills/platform-trial-org-create/scripts/create_signup_request.sh +175 -0
  27. package/skills/platform-trial-org-create/scripts/get_signup_request.sh +155 -0
  28. package/skills/platform-widget-generate/SKILL.md +47 -6
  29. package/skills/platform-widget-generate/examples/conditional.json +3 -3
  30. package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
  31. package/skills/platform-widget-generate/examples/single-object.json +2 -2
  32. package/skills/platform-widget-generate/references/widget-bundle-layout.md +1 -1
  33. package/skills/service-agentforce-channel-configure/SKILL.md +271 -0
  34. package/skills/service-agentforce-channel-configure/references/agent-wiring.md +97 -0
  35. package/skills/service-agentforce-channel-configure/references/channel-branch-email.md +145 -0
  36. package/skills/service-agentforce-channel-configure/references/channel-branch-voice.md +69 -0
  37. package/skills/service-agentforce-channel-configure/references/channel-types.md +61 -0
  38. package/skills/service-agentforce-channel-configure/references/live-traffic-gate.md +86 -0
  39. package/skills/service-agentforce-channel-configure/references/queue-resolution.md +135 -0
  40. package/skills/service-agentforce-channel-configure/references/routing-flow.md +384 -0
  41. package/skills/service-catalog-template-deploy/SKILL.md +310 -0
  42. package/skills/service-catalog-template-deploy/references/cli-invocation.md +258 -0
  43. package/skills/service-catalog-template-deploy/scripts/activate-verify.mjs +164 -0
  44. package/skills/service-catalog-template-deploy/scripts/build-deploy-payload.mjs +94 -0
  45. package/skills/service-catalog-template-deploy/scripts/resolve-template.mjs +331 -0
  46. package/skills/service-catalog-template-search/SKILL.md +212 -0
  47. package/skills/service-catalog-template-search/references/cli-invocation.md +128 -0
  48. package/skills/service-catalog-template-search/scripts/classify-catalog.mjs +205 -0
  49. package/skills/service-concierge-portal-generate/SKILL.md +126 -0
  50. package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +1428 -0
  51. package/skills/service-digital-engagement-channel-configure/SKILL.md +46 -6
  52. package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +2 -1
  53. package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +4 -1
  54. package/skills/service-helpagent-coordinate/README.md +8 -2
  55. package/skills/service-helpagent-coordinate/SKILL.md +126 -130
  56. package/skills/service-helpagent-coordinate/assets/help-agent-spec.md +70 -53
  57. package/skills/service-helpagent-coordinate/references/agent-script.md +571 -457
  58. package/skills/service-helpagent-coordinate/references/channel-voice.md +38 -9
  59. package/skills/service-helpagent-coordinate/references/channel-web-chat.md +173 -49
  60. package/skills/service-helpagent-coordinate/references/output-report-format.md +126 -0
  61. package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +153 -0
  62. package/skills/service-itsm-agentic-setup-agentforce-coordinate/examples/output-templates.md +79 -0
  63. package/skills/service-itsm-agentic-setup-agentforce-coordinate/scripts/verify-child-verdict.mjs +35 -0
  64. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +271 -0
  65. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/references/cli-invocation.md +265 -0
  66. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/classify-enable-plan.mjs +220 -0
  67. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/classify-final-report.mjs +102 -0
  68. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/record-enable-result.mjs +73 -0
  69. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +206 -0
  70. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/references/cli-invocation.md +194 -0
  71. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/scripts/classify-readiness.mjs +223 -0
  72. package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +45 -7
  73. package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +45 -5
  74. package/skills/service-itsm-agentic-setup-configure/SKILL.md +116 -0
  75. package/skills/service-itsm-agentic-setup-configure/examples/output-templates.md +64 -0
  76. package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +158 -0
  77. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/cli-invocation.md +361 -0
  78. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/error-taxonomy.md +44 -0
  79. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/reactivation.md +66 -0
  80. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/report-format.md +66 -0
  81. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/specialized-templates.md +148 -0
  82. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/workflow-detail.md +169 -0
  83. package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/build-create-body.mjs +116 -0
  84. package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/classify-agent-existence.mjs +185 -0
  85. package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/classify-preflight.mjs +168 -0
  86. package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/create-scratch-dir.mjs +58 -0
  87. package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/render-report.mjs +197 -0
  88. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +186 -0
  89. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/action-availability.md +51 -0
  90. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/cli-invocation.md +345 -0
  91. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/error-taxonomy.md +44 -0
  92. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/reactivation.md +63 -0
  93. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/report-format.md +44 -0
  94. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/workflow-detail.md +149 -0
  95. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/build-create-body.mjs +110 -0
  96. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-action-availability.mjs +201 -0
  97. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-activate-result.mjs +135 -0
  98. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-agent-existence.mjs +194 -0
  99. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-preflight.mjs +158 -0
  100. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/create-scratch-dir.mjs +58 -0
  101. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/render-report.mjs +191 -0
  102. package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +133 -0
  103. package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +71 -0
  104. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +308 -0
  105. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/attach-milestone.json +23 -0
  106. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +193 -0
  107. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/output-templates.md +57 -0
  108. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +394 -0
  109. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +266 -0
  110. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/cli-invocation.md +106 -0
  111. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/helper-contracts.md +142 -0
  112. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/permset-topology.md +82 -0
  113. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-action-surface.mjs +137 -0
  114. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-assignment-state.mjs +99 -0
  115. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-permset-availability.mjs +120 -0
  116. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/resolve-target-user.mjs +86 -0
  117. package/skills/service-itsm-agentic-setup-uel-user-create/SKILL.md +284 -0
  118. package/skills/service-itsm-agentic-setup-uel-user-create/references/mcp-invocation.md +302 -0
  119. package/skills/service-itsm-channels-coordinate/SKILL.md +472 -0
  120. package/skills/service-itsm-incident-mgmt-configure/SKILL.md +212 -0
  121. package/skills/service-itsm-incident-mgmt-configure/references/mcp-invocation.md +225 -0
  122. package/skills/service-itsm-incident-priority-configure/SKILL.md +53 -12
  123. package/skills/service-itsm-swarming-configure/SKILL.md +212 -0
  124. package/skills/service-itsm-teams-configure/SKILL.md +395 -0
  125. package/skills/service-itsm-teams-configure/references/azure-credential-population.md +213 -0
  126. package/skills/service-itsm-teams-configure/references/gotchas.md +23 -0
  127. package/skills/service-itsm-teams-coordinate/SKILL.md +175 -0
  128. package/skills/service-itsm-teams-coordinate/examples/output-templates.md +85 -0
  129. package/skills/service-itsm-teams-debug/SKILL.md +144 -0
  130. package/skills/service-itsm-teams-debug/references/configuration-checklists.md +277 -0
  131. package/skills/service-itsm-teams-debug/references/report-generation.md +95 -0
  132. package/skills/service-itsm-teams-employee-agent-configure/SKILL.md +139 -0
  133. package/skills/service-itsm-teams-employee-agent-configure/assets/Teams_AgentForce.EmbeddedServiceConfig-meta.xml +43 -0
  134. package/skills/service-itsm-teams-employee-agent-configure/references/teams-embedded-employee-agent.md +480 -0
  135. package/skills/service-itsm-teams-itdesk-configure/SKILL.md +232 -0
  136. package/skills/service-itsm-teams-itservice-configure/SKILL.md +391 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -2,9 +2,13 @@
2
2
  name: automation-flow-generate
3
3
  description: "Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as \"when a record is created\", \"trigger daily at\", \"send an email when\", \"update the field when\", \"automate\", \"workflow\", or \"flow XML/metadata\". This is the only skill for Salesforce Flow generation."
4
4
  metadata:
5
- version: "1.0"
5
+ version: "1.1"
6
6
  domains: ["Automation"]
7
7
  minApiVersion: "60.0"
8
+ mcpTools:
9
+ metadata-experts:
10
+ tools: ["execute_metadata_action"]
11
+ semver: ">=1.0.0"
8
12
  ---
9
13
 
10
14
  ## Goal
@@ -27,15 +31,6 @@ Use this skill when you need to:
27
31
  ## Overview
28
32
  Salesforce Flows are powerful automation tools that enable complex business process automation without code. Flows can collect and process data through interactive screens, execute logic and calculations, manipulate records, call external services, and trigger based on various events. Flow types include Screen Flows (user-guided), Autolaunched Flows (background processing), Record-Triggered Flows (database events) and Scheduled Flows (time-based).
29
33
 
30
- ## Purpose
31
- - Automate complex business processes with declarative logic and branching
32
- - Guide users through multi-step data collection and decision workflows via Screen Flows
33
- - Perform CRUD operations on Salesforce records automatically
34
- - Execute background processing and integrations via Autolaunched Flows
35
- - React to record changes in real-time with Record-Triggered Flows
36
- - Schedule recurring tasks and batch operations with Scheduled Flows
37
- - Create reusable, maintainable automation that admins can modify without code
38
-
39
34
  ## Flow Generation Pipeline
40
35
 
41
36
  **MANDATORY: You MUST follow this exact 3-step pipeline. No exceptions. No shortcuts. No skipping steps. Do NOT manually create flow metadata XML or attempt to generate flow metadata outside of this pipeline. Do NOT attempt to use any other tool, API, or method to generate flow metadata. This pipeline is the ONLY supported way to generate flows. Any deviation will produce invalid or broken metadata.**
@@ -201,6 +196,26 @@ When no custom objects needed:
201
196
  - NEVER use string `"[]"` - this is incorrect
202
197
  - NEVER use text descriptions - only structured object metadata
203
198
 
199
+ ## Flow Pattern Guidance
200
+
201
+ The pipeline selects flow elements from your `userPrompt`. Vague prompts lead the pipeline to pick wrong structures, producing metadata that fails deployment. When the request matches one of the patterns below, make the intent explicit in the `userPrompt` you pass to Step 1 and Step 2 so the pipeline selects the correct elements.
202
+
203
+ ### Scheduled flows ("daily", "weekly", "every Sunday", "runs once a week at 10PM")
204
+
205
+ A recurring, time-based flow is a **Scheduled** flow. The schedule lives on the **start element**: `triggerType` is `Scheduled` and a `<schedule>` block holds `<frequency>` (e.g. `Weekly`), `<startDate>`, and `<startTime>`. Do NOT expect `startDate`/`startTime` on a `FlowScheduledPath` element — a scheduled flow's cadence is on `<start><schedule>`, not a scheduled path.
206
+
207
+ To select records for a scheduled flow, put the record criteria in the **start element's filters** (with `<object>` and `<filters>` on `<start>`), which runs the flow once per matching record with `$Record` bound to each. Prefer this over adding a Loop that re-queries and iterates the same object — a start-filtered scheduled flow does not need a Loop to walk the triggering object's records.
208
+
209
+ When the prompt says "runs once a week / every Sunday / daily at a time", the `userPrompt` should state: scheduled trigger, the frequency, the start time, and the record filter on the triggering object.
210
+
211
+ ### Counting related records ("count all related X", "number of X")
212
+
213
+ To store a count of records, use a **single** assignment element with `<operator>AssignCount</operator>`, assigning from the collection (the record-lookup result) into a Number variable. Do NOT emit two assignment elements for one count, and do NOT give two assignment elements the same `name` — duplicate assignment names, or two assignments doing one logical count, fail deployment. One lookup → one `AssignCount` assignment → one record update.
214
+
215
+ ### Do not invent actions the prompt did not request
216
+
217
+ Generate only the elements the prompt asks for. If a prompt names a trigger but not an action (e.g. "create a flow for when a record is created" with no stated behavior), do NOT add a Chatter post, email, or other action that was not requested. An unrequested action such as a `chatterPost` produces metadata that references undefined types and fails deployment. When the requested behavior is genuinely absent, generate the minimal valid trigger without inventing side effects.
218
+
204
219
  ### MANDATORY: Multiple Flows = Multiple Separate Pipelines
205
220
 
206
221
  **FIRST: Before calling any pipeline step, check if the user's request contains multiple flows. If it does, you MUST split it into separate single-flow prompts. Each flow gets its own 3-step pipeline with its own `userPrompt` that describes ONLY that one flow.**
@@ -335,40 +350,14 @@ Call repeatedly with the same `operationId` until `isComplete` is `true` or erro
335
350
  ```
336
351
  Call repeatedly with the same `operationId` until `isComplete` is `true` or errors are returned. A flow can have any number of elements, so expect multiple iterations. When `isComplete` is `true`, extract the flow metadata from the `result` field. Use `"requestSource": "A4V"` to get flow metadata in XML format.
337
352
 
338
- ## Mandatory Best Practices
339
- - **ALWAYS** follow the 3-step pipeline: fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration. This is the ONLY way to generate flow metadata. There are no alternatives.
340
- - Do NOT manually create flow metadata XML, JSON, or any other format outside of this pipeline.
341
- - **When the user explicitly requests fixes to validation or deployment errors** in an already-generated flow XML, you ARE permitted to make targeted manual edits to the XML to resolve those errors. This is the only exception to the "no manual metadata" rule.
342
- - Do NOT attempt to "optimize" by skipping steps or combining steps. Each step is atomic and required.
343
- - **NEVER** skip any step in the pipeline. All 3 steps are required.
344
- - **NEVER** try to generate flow metadata without calling all 3 steps.
345
- - **NEVER** deviate from this pipeline under any circumstance — even if you think you know the flow structure.
346
- - For single flow requests: you MUST use the user prompt as `userPrompt`.
347
- - For multiple flow requests: you MUST run a separate 3-step pipeline for each flow **SEQUENTIALLY (one after another, NEVER in parallel)**, and you MUST execute ALL of them — do NOT stop after the first flow.
348
- - You MUST put flow requirements in `userPrompt`, NOT in `inflightMetadata`.
349
- - `inflightMetadata` is ONLY for custom object/field metadata from local project (see above). No exceptions.
350
- - Step 3 MUST be called in a loop with the same `operationId` from Step 2 until `isComplete` is `true` or errors are returned. A flow can have any number of elements — do NOT stop early, do NOT pause to ask the user if they want to continue, regardless of how many iterations it takes.
351
- - You MUST only extract the flow metadata from the `result` field when `isComplete` is `true`.
352
-
353
353
  ## CRITICAL Verification Checklist (MUST VERIFY BEFORE AND AFTER EVERY FLOW GENERATION)
354
354
 
355
355
  **Failure to follow this checklist exactly will result in broken or missing flow metadata.**
356
356
 
357
- - [ ] **Pipeline**: ALL 3 steps are called in strict order (fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration). No step is skipped.
358
- - [ ] **No manual metadata**: Flow metadata is NOT manually created, modified, or generated outside of this pipeline by any means
359
- - [ ] **No deviation**: No alternative tools, APIs, or methods were used instead of or alongside this pipeline
360
- - [ ] **userPrompt** contains a **single** flow prompt. If user requested multiple flows, the request was split and each pipeline received a separate `userPrompt` describing only one flow
361
- - [ ] **userPrompt** is passed consistently to both Step 1 and Step 2 (same value)
362
- - [ ] **inflightMetadata** is ARRAY data type (NOT string)
363
- - [ ] **inflightMetadata** is `[]` when no custom objects needed
364
- - [ ] **inflightMetadata** contains structured objects extracted by scanning the local sfdx project for relevant custom objects/fields
365
- - [ ] **inflightMetadata** does NOT contain `"[]"` (string) - must be `[]` (array)
366
- - [ ] **inflightMetadata** does NOT contain text descriptions or instructions
367
- - [ ] **groundingMetadata** from Step 1 output is passed directly to Step 2 input (it is already a string — do NOT serialize it again)
368
- - [ ] **operationId** from Step 2 output is passed to Step 3 input
369
- - [ ] **requestSource** should be set to `"A4V"` always
370
- - [ ] **Step 3** is called in a loop with the same `operationId` from Step 2 until `isComplete` is `true` or errors are returned — **no pausing, no asking the user to continue, no matter how many iterations**
371
- - [ ] **Multi-flow**: Each flow's full pipeline is completed before starting the next flow's pipeline (no interleaving)
372
- - [ ] **result** field is used to extract the XML flow metadata only when `isComplete` is `true`
373
- - [ ] **No additions to XML**: NO elements, attributes, or properties were added that were not present in the original pipeline output. Nothing was inserted (no `<label>`, `<description>`, or any other node). The final XML must be identical to what the pipeline returned.
374
- - [ ] **Error fix exception**: If the user explicitly requested fixes to validation/deployment errors, targeted manual edits to the XML are permitted and the "No additions to XML" / "No manual metadata" constraints do not apply to those edits.
357
+ - [ ] **Pipeline**: ALL 3 steps are called in strict order (fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration). No step is skipped, combined, or replaced by another tool/API. This pipeline is the ONLY way to generate flow metadata.
358
+ - [ ] **No manual metadata**: Flow metadata is NOT created, modified, or generated outside the pipeline, and no elements/attributes were added to the returned XML (no `<label>`, `<description>`, or any other node). The final XML must be identical to what the pipeline returned. **Exception:** if the user explicitly requested fixes to validation/deployment errors in already-generated XML, targeted manual edits are permitted.
359
+ - [ ] **userPrompt** contains a **single** flow prompt (multi-flow requests are split, one `userPrompt` each), holds the flow requirements (NOT `inflightMetadata`), and is passed identically to Step 1 and Step 2.
360
+ - [ ] **inflightMetadata** is ARRAY data type (NOT the string `"[]"`), is `[]` when no custom objects are needed, and otherwise holds structured object/field metadata scanned from the local sfdx project — never text descriptions.
361
+ - [ ] **groundingMetadata** from Step 1 output is passed directly to Step 2 input (already a string — do NOT serialize it again).
362
+ - [ ] **Step 3** is called in a loop with the same `operationId` from Step 2, `requestSource` always `"A4V"`, until `isComplete` is `true` or errors are returned — no pausing, no asking the user to continue, no matter how many iterations. Extract the XML from `result` only when `isComplete` is `true`.
363
+ - [ ] **Multi-flow**: Each flow's full pipeline is completed before starting the next, SEQUENTIALLY (never in parallel, never interleaved), and ALL requested flows are generated — do NOT stop after the first.
@@ -0,0 +1,497 @@
1
+ ---
2
+ name: experience-portal-create
3
+ description: "Create / provision / set up a NEW Digital Experience (Communities) / Experience Cloud site — employee service, IT support, help desk, HR, customer, and partner portals — via the headless-360 MCP site-creation APIs. Use whenever a user asks to create/provision/set up a portal, site, or community, e.g.: 'create an employee service portal', 'create an IT Support Portal', 'create an Agentforce Employee Center', including wiring MIAW (Messaging for In-App/Web) at create. This is the site-CREATION skill and OWNS provisioning a new Aura OR LWR Experience Builder site from scratch — trigger it even when the user says 'Experience Builder site' or 'LWR site', as long as a NEW site is wanted. It always writes a portal-creation report as its final step (never ad hoc via CLI) and never makes a legacy Tabs+Visualforce site. DO NOT TRIGGER only for modifying an EXISTING site's pages/routes/theme/branding/guest-access metadata (experience-lwr-site-generate), existing-site customization (experience-ui-bundle), CMS, Commerce."
4
+ metadata:
5
+ version: "1.0"
6
+ domains: ["Experience"]
7
+ minApiVersion: "67.0"
8
+ relatedSkills:
9
+ - "experience-lwr-site-generate"
10
+ mcpTools:
11
+ headless-360:
12
+ tools: ["describe", "discover", "dispatch", "dispatch_readonly"]
13
+ semver: ">=1.0.0"
14
+ cliTools:
15
+ - tool: ["sf"]
16
+ semver: ">=2.0.0"
17
+ allowed-tools: |
18
+ Read AskUserQuestion Bash
19
+ mcp__headless-360__discover
20
+ mcp__headless-360__describe
21
+ mcp__headless-360__dispatch
22
+ mcp__headless-360__dispatch_readonly
23
+ ---
24
+
25
+ # Create Digital Experience Portal
26
+
27
+ Create a new Digital Experience (formerly Communities) portal/site in Salesforce. Supports employee service portals, partner portals (PRM), and general customer communities.
28
+
29
+ **Every operation runs through the headless-360 MCP server** (`mcp__headless-360__discover` →
30
+ `mcp__headless-360__describe` → `mcp__headless-360__dispatch` / `mcp__headless-360__dispatch_readonly`).
31
+ Do **not** use the Salesforce CLI (its `api request`, `data query`, or `org open` subcommands), the project-codey MCP
32
+ server, raw `curl`, or any other HTTP client — `dispatch`/`dispatch_readonly` is the only way this
33
+ skill talks to the org. See `references/mcp-invocation.md` for the exact call shapes.
34
+
35
+ ## Scope
36
+
37
+ - **In scope**: Creating Digital Experience sites via the headless-360 Connect API dispatcher. Portal type selection. Basic configuration (name, URL, templates). Self-service portals with embedded service configs. **Making the site reachable end to end** — activating the Network (`status: Live`), adding member profiles, and publishing the Experience Builder pages (see `references/post-creation-activate-publish.md`).
38
+ - **Out of scope**: Deep post-creation customization (page layout/component authoring in Builder). Content authoring. Branding beyond initial setup. Individual per-user record management (membership is added at the profile/permission-set level, not per user).
39
+
40
+ ---
41
+
42
+ ## Execution model (read first)
43
+
44
+ Every org call is a **dispatch**: `mcp__headless-360__dispatch_readonly(url, method: "GET", queryParams)`
45
+ for reads, `mcp__headless-360__dispatch(url, method, body)` for writes; read `status_code` + `body` from
46
+ the response. To resolve the endpoint for a portal type, use `mcp__headless-360__discover(query=...)` and
47
+ `mcp__headless-360__describe(id=...)` as needed. Connect API create/list operations for Experience Cloud
48
+ are not always indexed by `discover`/`describe` — when a lookup returns nothing, dispatch the well-known
49
+ versioned Connect API path directly (see `references/mcp-invocation.md`) rather than concluding the
50
+ capability is missing.
51
+
52
+ **Critical: paths must include the full `/services/data/vXX.0/...` prefix** (e.g.
53
+ `"/services/data/v67.0/connect/communities"`) — unlike some other dispatchers, headless-360 does
54
+ **not** resolve or inject the API version for you. A path without the version prefix returns
55
+ `400 ROUTE_NOT_FOUND`. Copy the path verbatim from a `discover`/`describe` result when available;
56
+ otherwise use the version shown in this skill's examples (`v67.0` at time of writing) and adjust if
57
+ the org runs a different version. Full details, response envelope, job-monitoring, and gotchas live
58
+ in `references/mcp-invocation.md`.
59
+
60
+ ---
61
+
62
+ ## Clarifying Questions
63
+
64
+ Before proceeding, determine:
65
+
66
+ 1. **Portal type?**
67
+ - Employee Service / ITSM / HR / help desk → **prefer the `Agentforce Employee Center` Aura template** via the communities API (richest employee experience; Agentforce-ready). Use the self-service API instead when MIAW must be wired in at creation time and a guest ESD exists.
68
+ - Partner Portal (PRM) → requires PRM feature enabled
69
+ - Customer Community → general community creation (Aura or LWR Experience Builder template)
70
+
71
+ 2. **Basic settings (required for all types):**
72
+ - Portal name?
73
+ - URL prefix? (must be alphanumeric only, no hyphens or spaces)
74
+ - Description (optional)
75
+
76
+ 3. **For Employee Service / Self-Service portals:**
77
+ - `siteType`? → default `AURA` (Aura Experience Builder + Builder). Use `LWR` only if the user explicitly wants a Lightning Web Runtime site. **Never** create a Salesforce Tabs + Visualforce ("VF Template") site — those are legacy and have no Builder.
78
+ - MIAW / Embedded Service Deployment ID(s)? These wire Messaging for In-App and Web into the portal at creation time. A **guest** ESD config is required by the self-service API; an **authenticated-user** ESD config is optional. If the user hasn't created an Embedded Service Deployment yet, point them to Setup → Embedded Service Deployments first.
79
+
80
+ 4. **For Partner portals only:**
81
+ - PRM template name? (check org-specific templates)
82
+
83
+ ---
84
+
85
+ ## Required Inputs
86
+
87
+ ### Employee Service / Self-Service Portals (`POST /connect/self-service/site`):
88
+ - `siteName` (required) - portal name
89
+ - `guestEmbeddedServiceConfigId` (required) - Embedded Service Deployment (MIAW) config ID for **guest** users
90
+ - `embeddedServiceConfigId` (optional) - Embedded Service Deployment (MIAW) config ID for **authenticated** users
91
+ - `siteType` (optional) - `AURA` (default) or `LWR`. Produces an Experience Builder site. Do **not** use Visualforce.
92
+ - `enableForGuest` (optional) - whether guest (unauthenticated) users can access the site
93
+ - `contentDocumentId` (optional) - ContentDocument ID of a logo image to wire into the site's branding set
94
+ - `brandColors` (optional) - array of RGBA colors targeting `action`, `link`, `border`, `text`, `pageBackground`
95
+
96
+ > This API sets the URL path prefix automatically from the site name. There is no `templateName` — the framework is chosen with `siteType` (Aura/LWR), never Visualforce.
97
+
98
+ ### Partner Portals (PRM):
99
+ - `siteName` (required)
100
+ - `siteUrlPrefix` (required)
101
+ - `prmTemplate` (required)
102
+ - `siteDesc` (optional)
103
+
104
+ ### General Communities (`POST /connect/communities`):
105
+ - `name` (required)
106
+ - `urlPathPrefix` (required) - alphanumeric only, no hyphens
107
+ - `templateName` (required) - an **Experience Builder** template. Aura: `Agentforce Employee Center` (preferred for employee service), `Employee Portal`, `Customer Service`, `Help Center`, `Customer Account Portal`, `Partner Central`, `Build Your Own`. LWR: `Build Your Own (LWR)`, `Microsite (LWR)`. Validate the exact string via `GET /connect/communities/templates` (see below). Do **not** use `Salesforce Tabs + Visualforce` ("VF Template") — it is a legacy Visualforce site with no Builder.
108
+ - `description` (optional)
109
+
110
+ ---
111
+
112
+ ## Workflow
113
+
114
+ ### Step 1: Determine API Based on Portal Type
115
+
116
+ 1. **Employee Service / Self-Service** → `POST /connect/self-service/site`
117
+ - Creates an **Aura** (or LWR) Experience Builder site — never Visualforce
118
+ - Wires MIAW (Embedded Service Deployment) into the site at creation time
119
+ - Prerequisites: `CustomizeApplication` permission; org has self-service site-creation API access; a guest Embedded Service Deployment exists
120
+
121
+ 2. **Partner (PRM)** → `POST /connect/prm/setup/sites`
122
+ - Prerequisites: `CommonPrmEnabled` feature
123
+
124
+ 3. **General Community** → `POST /connect/communities`
125
+ - Uses an Experience Builder `templateName` (Aura or LWR) — never `Salesforce Tabs + Visualforce`
126
+ - Prerequisites: Manage Communities permission (`ManageNetworks`)
127
+
128
+ ---
129
+
130
+ ### Step 2: Create Portal (By Type)
131
+
132
+ #### Option A: Employee Service / Self-Service Portal
133
+
134
+ Use the self-service site API. It creates an **Aura Experience Builder** site (with the Builder option) by deploying CustomSite, Network, and ExperienceBundle metadata, then wires MIAW into the site via the given Embedded Service Deployment (ESD) config IDs. This is the correct path for ITSM / IT help desk / employee self-service portals.
135
+
136
+ **API Call** (via `mcp__headless-360__dispatch`):
137
+ ```text
138
+ method: "POST"
139
+ url: "/services/data/v67.0/connect/self-service/site"
140
+ body:
141
+ {
142
+ "siteName": "<portal-name>",
143
+ "siteType": "AURA",
144
+ "guestEmbeddedServiceConfigId": "<guest-ESD-config-id>",
145
+ "embeddedServiceConfigId": "<auth-ESD-config-id>",
146
+ "enableForGuest": true
147
+ }
148
+ ```
149
+ Poll with `GET /services/data/v67.0/connect/self-service/site/status/{jobId}` via `mcp__headless-360__dispatch_readonly`.
150
+
151
+ - `siteType` defaults to `AURA` (Aura Experience Builder + Builder). Pass `LWR` only if the user explicitly asks for a Lightning Web Runtime site. Never create a Visualforce site.
152
+ - `guestEmbeddedServiceConfigId` is **required** — it is the MIAW Embedded Service Deployment config ID for guest users. `embeddedServiceConfigId` (authenticated users) is optional. If the user has no Embedded Service Deployment yet, have them create one first (Setup → Embedded Service Deployments), or use the MIAW/embedded-service setup skill.
153
+ - Optional branding: `contentDocumentId` (logo) and `brandColors` (array of `{ "type": "action|link|border|text|pageBackground", "color": { "r": 0-255, "g": 0-255, "b": 0-255, "a": 0-1 } }`).
154
+
155
+ **Response:**
156
+ ```json
157
+ {
158
+ "success": true,
159
+ "siteName": "IT Support Portal",
160
+ "urlPathPrefix": "itsupport",
161
+ "siteUrl": "https://domain.my.site.com/itsupport",
162
+ "jobId": "708...",
163
+ "status": "Queued"
164
+ }
165
+ ```
166
+
167
+ **On success**, report `Success:` — the portal creation started (Aura + Experience Builder); give the
168
+ name, framework (Aura), `jobId`, and `status`, and note it is provisioning in the background
169
+ (Network, CustomSite, ExperienceBundle metadata + the Embedded Service/MIAW deployment). Next: monitor
170
+ the job (see 'Background Job Monitoring'), then complete Step 3 (Activate → Add Members → Publish).
171
+
172
+ **On failure**, report `Failure:` with the `{error}` — see the "Common Errors" section for the causes
173
+ (missing/invalid `guestEmbeddedServiceConfigId`, duplicate name/URL prefix, org lacks self-service
174
+ site-creation API access, missing `CustomizeApplication`) and their resolutions.
175
+
176
+ ---
177
+
178
+ #### Option B: Partner Portal (PRM)
179
+
180
+ **API Call** (via `mcp__headless-360__dispatch`):
181
+ ```text
182
+ method: "POST"
183
+ url: "/services/data/v67.0/connect/prm/setup/sites"
184
+ body:
185
+ {
186
+ "siteName": "<name>",
187
+ "siteUrlPrefix": "<url-prefix>",
188
+ "siteDesc": "<description>",
189
+ "prmTemplate": "<template-name>"
190
+ }
191
+ ```
192
+ Synchronous — no job polling.
193
+
194
+ **Response:**
195
+ ```json
196
+ {
197
+ "networkId": "0DB..."
198
+ }
199
+ ```
200
+
201
+ **On success**, report `Success:` — the partner portal was created; give the name, `networkId`,
202
+ `siteUrlPrefix`, and `prmTemplate`. Next: find it at Setup → Digital Experiences → All Sites (by
203
+ Network ID), then complete Step 3 (Activate → Add Members → Publish).
204
+
205
+ **On failure**, report `Failure:` — see "Common Errors" (org lacks PRM/`CommonPrmEnabled`, invalid PRM
206
+ template name, duplicate name/URL prefix). PRM templates: Setup → Digital Experiences → Settings →
207
+ Partner Templates.
208
+
209
+ ---
210
+
211
+ #### Option C: General Community
212
+
213
+ **First, discover valid templates** (required — accepted `templateName` strings vary by org edition/version), via `mcp__headless-360__dispatch_readonly`:
214
+ ```text
215
+ method: "GET"
216
+ url: "/services/data/v67.0/connect/communities/templates"
217
+ ```
218
+ Response: `{ "templates": [ { "publisher": "Salesforce", "templateName": "Employee Portal" }, … ], "total": N }`. Use a returned `templateName` verbatim. Prefer an **Experience Builder** template (Aura or LWR). Never use `Salesforce Tabs + Visualforce`.
219
+
220
+ **API Call** (via `mcp__headless-360__dispatch`):
221
+ ```text
222
+ method: "POST"
223
+ url: "/services/data/v67.0/connect/communities"
224
+ body:
225
+ {
226
+ "name": "<name>",
227
+ "urlPathPrefix": "<url-prefix>",
228
+ "description": "<description>",
229
+ "templateName": "Agentforce Employee Center"
230
+ }
231
+ ```
232
+ The body accepts only `{name, description, templateName, templateParams, urlPathPrefix}` — omit `templateParams` unless you need template-specific config.
233
+
234
+ For an **employee service / ITSM / HR portal**, prefer the **`Agentforce Employee Center`** template when the org's live template list includes it — it ships IT/HR ticketing, a self-service catalog, a knowledge base, and an Agentforce-ready experience. Fall back to `Employee Portal` (then `Customer Service`) for a plainer, non-Agentforce site. Other options by use case: `Help Center` (Aura knowledge/deflection), `Customer Account Portal` (Aura authenticated account self-service), `Partner Central` (Aura PRM), or `Build Your Own (LWR)` for a modern blank LWR site.
235
+
236
+ > **Agentforce Employee Center is two layers.** This `POST /connect/communities` call provisions the **site** only. The embedded **Agentforce conversational assistant** is a separate step — create the internal employee agent from its shipped template (`EmployeeCopilot__AgentforceEmployeeAgent`) via `PATCH /services/data/v67.0/headless/invoke/einstein/genai-agentbuilder/create-copilot-from-template` (`copilotContext.company` is **required**), then activate it and wire it to the site. This skill provisions the site and points the user to that step; full Agentforce setup is out of scope. See `references/templates.md`.
237
+
238
+ **Response:**
239
+ ```json
240
+ {
241
+ "jobId": "08P...",
242
+ "message": "Your site is almost ready. To track the site creation status, query the BackgroundOperation object and enter the jobId as the Id.",
243
+ "name": "Customer Community"
244
+ }
245
+ ```
246
+
247
+ **On success**, report `Success:` — community creation started; give the name, `jobId`, and
248
+ `message`. Next: monitor the job (see 'Background Job Monitoring'), then complete Step 3 (Activate →
249
+ Add Members → Publish).
250
+
251
+ **On failure**, report `Failure:` — see "Common Errors" (invalid `templateName` — run
252
+ `GET /services/data/v67.0/connect/communities/templates` and use a returned value verbatim; duplicate
253
+ name/URL prefix; missing Manage Communities permission).
254
+
255
+ ---
256
+
257
+ ### Step 3: Make the Site Reachable — Activate, Add Members, Publish
258
+
259
+ **Creation only provisions the site** — it comes back `UnderConstruction`, admin-only, with
260
+ unpublished pages, so its URL is **not reachable** yet (the #1 "my portal doesn't work" cause).
261
+ Complete three steps, in order: (1) **Activate** — deploy the `Network` metadata with
262
+ `<status>Live</status>`; (2) **Add members** — add the target **profile(s)** to
263
+ `networkMemberGroups` (membership is profile-based, not per user; e.g. **`Unified Employee`** — a
264
+ Profile, not a UserRole) and redeploy (combinable with step 1); (3) **Publish** —
265
+ `sf community publish --name "<Site Name>"`, then poll the returned `jobId` on `BackgroundOperation`
266
+ until `Complete`. Then confirm `status: Live` and give the user the **login URL**
267
+ (`.../<prefix>/login`), not the bare prefix.
268
+
269
+ > **Tooling exception:** activate/members use the **Metadata API** (`Network` deploy) and publish
270
+ > uses **`sf community publish`** — there is no Connect API for these (`PATCH /connect/communities`
271
+ > returns 405). This is the one place the skill uses tools other than headless-360; Step 3 reads
272
+ > still go through headless-360.
273
+
274
+ **Exact commands, XML, verification queries, and gotchas: `references/post-creation-activate-publish.md`.**
275
+
276
+ ---
277
+
278
+ ### Step 4: Write the Portal Creation Report (always — final step)
279
+
280
+ **Always finish by writing a `report.md` summarizing what was done** — this is the skill's final,
281
+ non-optional action, whether the create call succeeded, is still provisioning, or failed. Write it to
282
+ the working/output directory as `report.md`.
283
+
284
+ The report must:
285
+ - Start with the heading `# Portal Creation Report`.
286
+ - State the **portal name**, the **API used** (`self-service/site`, `communities`, or `prm`) and
287
+ **why** (e.g. "no guest ESD present → communities API"), the **framework** (Aura / LWR), and the
288
+ **template** or `siteType` chosen.
289
+ - Give the **dispatched request** (path + key body fields) and the **response** (`jobId` /
290
+ `networkId` / `siteUrl` / `status`, or the error).
291
+ - List the **remaining Step 3 work** (Activate → Add Members → Publish) and, for employee-service
292
+ sites, note that the **embedded Agentforce agent is a separate follow-up step**.
293
+ - End with the sentinel line, exactly:
294
+ `Task completed: portal creation dispatched — see report.md`
295
+
296
+ **Copy the template at `assets/report-template.md`** and fill in the portal-specific values.
297
+
298
+ ---
299
+
300
+ ## Template Recommendations
301
+
302
+ All recommendations produce **Experience Builder** sites (Aura or LWR). Never recommend `Salesforce Tabs + Visualforce` ("VF Template") — it is legacy and has no Builder.
303
+
304
+ | Use Case | API | Framework | Template / `siteType` |
305
+ |----------|-----|-----------|-----------------------|
306
+ | Employee service / ITSM / HR / help desk (richest; Agentforce-ready) | `communities` | Aura | `Agentforce Employee Center` |
307
+ | Employee service / help desk (MIAW at creation, guest ESD exists) | `self-service/site` | Aura | `siteType: AURA` (+ MIAW ESD config) |
308
+ | Employee service / help desk (plainer, no Agentforce) | `communities` | Aura | `Employee Portal` (fallback `Customer Service`) |
309
+ | Customer support / self-service community | `communities` | Aura | `Customer Service` |
310
+ | Knowledge base / case deflection | `communities` | Aura | `Help Center` |
311
+ | Authenticated account self-service | `communities` | Aura | `Customer Account Portal` |
312
+ | Partner portal (with PRM) | `prm/setup/sites` | Aura | Org-specific PRM template |
313
+ | Partner portal / channel (no PRM) | `communities` | Aura | `Partner Central` |
314
+ | Modern blank / headless-friendly site | `communities` | LWR | `Build Your Own (LWR)` |
315
+
316
+ **Modern recommendations:**
317
+ - For **employee service / ITSM / HR** portals, prefer the **`Agentforce Employee Center`** Aura template via the communities API — it ships the fullest employee experience (ticketing, catalog, knowledge, Agentforce-ready). The conversational assistant is a separate agent step (`EmployeeCopilot__AgentforceEmployeeAgent`). Use the **self-service site API** (`siteType: AURA`) instead when the portal needs MIAW wired in at creation time and a guest Embedded Service Deployment exists; use `Employee Portal` for a plainer, non-Agentforce site.
318
+ - For **customer communities**, use the **`Customer Service`** template (Aura, mobile-responsive) via the communities API.
319
+
320
+ See `references/templates.md` for complete template documentation.
321
+
322
+ ---
323
+
324
+ ## Background Job Monitoring
325
+
326
+ Portal creation is asynchronous (except PRM which is synchronous). Poll through
327
+ `mcp__headless-360__dispatch_readonly`.
328
+
329
+ **Self-service site path** — use the dedicated typed status route (preferred):
330
+ ```text
331
+ method: "GET"
332
+ url: "/services/data/v67.0/connect/self-service/site/status/{jobId}"
333
+ ```
334
+ Returns `{success, siteName, urlPathPrefix, siteUrl, error, jobId, status}`.
335
+
336
+ **Communities path** — query `BackgroundOperation` via the **regular** REST query endpoint,
337
+ **not** `/tooling/query`:
338
+ ```text
339
+ method: "GET"
340
+ url: "/services/data/v67.0/query"
341
+ queryParams: { "q": "SELECT Id, Status FROM BackgroundOperation WHERE Id = '<jobId>'" }
342
+ ```
343
+
344
+ > **Tooling vs. regular query (verified gotcha):** `BackgroundOperation` is **not** a valid Tooling
345
+ > API sObject through this dispatcher — `GET /services/data/vXX.0/tooling/query` with that SOQL
346
+ > returns `400 INVALID_TYPE "sObject type 'BackgroundOperation' is not supported."`. Use the plain
347
+ > `/services/data/vXX.0/query` endpoint instead; it succeeds with the same SOQL string.
348
+
349
+ > **Column discipline:** on `BackgroundOperation`, select only `Id` and `Status`. `JobType`,
350
+ > `CompletedDate`, and `NumErrors` are **not** columns on this object and return `INVALID_FIELD`.
351
+ > Use the SOQL string above exactly.
352
+
353
+ **Job statuses:**
354
+ - `Queued` / `Scheduled` — waiting to start
355
+ - `InProgress` / `Running` — executing
356
+ - `Complete` — finished successfully
357
+ - `Error` — failed (check the `error` field on the status route)
358
+
359
+ ---
360
+
361
+ ## Verification
362
+
363
+ After creation completes:
364
+
365
+ 1. **API (primary):** `mcp__headless-360__dispatch_readonly(url: "/services/data/v67.0/connect/communities", method: "GET")` lists all Experience Cloud sites. Find the new one and confirm `siteAsContainerEnabled: true` (Experience Builder — Aura/LWR) and a non-null `builderUrl`, and that `templateName` is **not** `Salesforce Tabs + Visualforce`. `siteAsContainerEnabled: false` means a legacy Visualforce site — the bug this skill exists to avoid.
366
+ 2. **Setup UI (optional):** Setup → Digital Experiences → All Sites. The **Framework** column should show **Aura** (or LWR) — not Visualforce — with a **Builder** workspace link.
367
+ 3. **Test URL:** Use `siteUrl` from the response (portal will be inactive initially).
368
+
369
+ **Note:** Portal must be activated and published before external users can access it.
370
+
371
+ ---
372
+
373
+ ## Rules / Constraints
374
+
375
+ | Constraint | Rationale |
376
+ |---|---|
377
+ | Portal creation is asynchronous | Deploys metadata and provisions resources in background |
378
+ | Site names must be unique | Each portal needs distinct name within org |
379
+ | URL prefixes must be unique | URL paths cannot conflict |
380
+ | URL prefixes must be alphanumeric | No hyphens, spaces, or special characters allowed |
381
+ | PRM requires PRM feature | Gated by licensing and org config |
382
+ | Created portals start inactive | Must manually activate/publish after creation |
383
+ | Paths must include the API version prefix | `dispatch`/`dispatch_readonly` do not inject `/services/data/vXX.0` — omitting it returns `400 ROUTE_NOT_FOUND` |
384
+
385
+ ---
386
+
387
+ ## Prerequisites by Type
388
+
389
+ ### Employee Service / Self-Service:
390
+ - `CustomizeApplication` permission
391
+ - Communities/Digital Experience enabled
392
+ - Org has self-service site-creation API access enabled
393
+ - A **guest** Embedded Service Deployment (MIAW) config exists (its ID is required); optionally an authenticated-user ESD config
394
+
395
+ ### Partner (PRM):
396
+ - Org has `CommonPrmEnabled`
397
+ - Portal creation permissions
398
+ - Valid PRM template name
399
+
400
+ ### General Community:
401
+ - Manage Communities permission (`ManageNetworks`)
402
+ - Communities/Digital Experience enabled
403
+ - Valid template name
404
+
405
+ ---
406
+
407
+ ## Common Errors
408
+
409
+ ### Invalid URL prefix:
410
+ "The URL can only contain alphanumeric characters. Remove hyphens, spaces, or special characters (e.g., 'employeeservice' not 'employee-service') and try a different prefix."
411
+
412
+ ### Invalid template name (general community path):
413
+ "The specified template does not exist.
414
+
415
+ **Resolution:**
416
+ - Run `GET /services/data/v67.0/connect/communities/templates` and use a returned `templateName` verbatim
417
+ - Prefer an Experience Builder template: `Agentforce Employee Center` (employee service), `Employee Portal`, `Customer Service`, `Help Center`, `Customer Account Portal`, `Partner Central`, `Build Your Own`, `Build Your Own (LWR)`
418
+ - Template names are case-sensitive — match exactly
419
+ - Do NOT use `Salesforce Tabs + Visualforce` ("VF Template") — it is a legacy Visualforce site with no Builder"
420
+
421
+ ### Missing guest Embedded Service config (self-service path):
422
+ "The self-service site API requires a guest Embedded Service Deployment config ID.
423
+
424
+ **Resolution:**
425
+ - Create an Embedded Service Deployment (MIAW) at Setup → Embedded Service Deployments, or use the MIAW/embedded-service setup skill
426
+ - Pass its config ID as `guestEmbeddedServiceConfigId` (and optionally `embeddedServiceConfigId` for authenticated users)"
427
+
428
+ ### PRM not enabled:
429
+ "This org doesn't have Partner Relationship Management (PRM) enabled.
430
+
431
+ **Options:**
432
+ 1. Contact Salesforce to enable PRM feature
433
+ 2. Create a general community with the `Partner Central` template instead (via Communities API)"
434
+
435
+ ### Duplicate name/URL:
436
+ "A portal with this name or URL prefix already exists (the communities API returns `400 INVALID_INPUT` — `Enter a different name. That one already exists.`).
437
+
438
+ **Check existing portals:** `mcp__headless-360__dispatch_readonly(url: "/services/data/v67.0/connect/communities", method: "GET")` and scan the `name` / `urlPathPrefix` fields.
439
+
440
+ Choose a different name or URL prefix."
441
+
442
+ ### Missing permissions:
443
+ "You don't have permission to create portals.
444
+
445
+ **Required permissions:**
446
+ - Self-service portals: `CustomizeApplication`
447
+ - General communities: `ManageNetworks` (Manage Communities)
448
+
449
+ Contact your Salesforce admin to request these permissions."
450
+
451
+ ### Route not found (missing version prefix):
452
+ "`400 ROUTE_NOT_FOUND` on a path that otherwise matches this skill's documentation. Confirm the `url` includes the full `/services/data/vXX.0/...` prefix — `dispatch`/`dispatch_readonly` require it verbatim and won't add it for you. If a specific version 404s, try the version shown in a recent `discover`/`describe` result for that org."
453
+
454
+ ---
455
+
456
+ ## Related Operations
457
+
458
+ **After creation:**
459
+ - Activate portal — Setup → Digital Experiences → All Sites → Activate
460
+ - Configure branding — Customize colors, logo, theme
461
+ - Add pages/components — Use Experience Builder
462
+ - Set up user access — Profiles, permission sets, sharing rules
463
+ - Publish portal — Make accessible to external users
464
+
465
+ **Manage existing:**
466
+ - List portals — `mcp__headless-360__dispatch_readonly(url: "/services/data/v67.0/connect/communities", method: "GET")`
467
+ - Update settings — Network Tooling API or Metadata API
468
+ - Deactivate — Via Setup UI
469
+
470
+ ---
471
+
472
+ ## Important Notes
473
+
474
+ 1. **Creation is asynchronous** (except PRM) and only provisions — APIs return a job ID and the portal comes back `UnderConstruction`, member-less, and unpublished, so its URL is **not reachable** until you complete Step 3 (Activate → Add Members → Publish; see `references/post-creation-activate-publish.md`).
475
+ 2. **URL prefix becomes the site path** — `https://<domain>.my.site.com/<prefix>` (serve/login at `.../<prefix>/login`, not the bare prefix).
476
+ 3. **Embedded Service / MIAW configs must pre-exist** — This skill does not create Embedded Service Deployments. Create them separately at Setup → Embedded Service Deployments (or via the MIAW/embedded-service setup skill), then pass the config IDs to the self-service site API. For general communities, MIAW is added post-creation via an Embedded Service component in Experience Builder.
477
+ 4. **Template names are case-sensitive** — Verify available templates in your org before attempting creation.
478
+ 7. **discover/describe may not resolve a specific Connect API operation by id** — the headless-360 corpus indexes many operations as multi-step SORs rather than single endpoints, and some standard Connect API writes (e.g. `POST /connect/communities`) are not individually indexed. Do not conclude the capability is missing; dispatch the well-known, versioned Connect API path directly (documented in this skill).
479
+
480
+ ---
481
+
482
+ ## Reference Documentation
483
+
484
+ - `references/mcp-invocation.md` — **Read every session.** Exact `mcp__headless-360__*` call shapes, the version-prefix requirement, response envelope, job monitoring, `BackgroundOperation` column/endpoint discipline, and gotchas.
485
+ - `references/templates.md` — Available templates, template parameters, selection guide.
486
+ - `references/post-creation-activate-publish.md` — Step 3 (activate, add members, publish) to make the site reachable: the Metadata-API + `sf community publish` paths, the 405-on-PATCH gotcha, `NetworkMemberGroup` column discipline, and the login-URL note.
487
+ - `assets/report-template.md` — Step 4 `report.md` template to copy (heading, required fields, sentinel).
488
+
489
+ ---
490
+
491
+ ## API Type Classification
492
+
493
+ **Site creation** is dispatched through `mcp__headless-360__dispatch` / `mcp__headless-360__dispatch_readonly` (never project-codey or raw HTTP). All paths include the `/services/data/vXX.0` prefix. **Post-creation (Step 3) is the one exception:** activating the Network and adding members use the **Metadata API** (`sf project deploy start --metadata Network:...`), and publishing uses **`sf community publish`** — there is no Connect API for these (a `PATCH /connect/communities/<id>` returns 405). Reads/verification for Step 3 still go through headless-360. Creation paths:
494
+
495
+ - **Self-service portal:** Connect API `POST /services/data/vXX.0/connect/self-service/site` — asynchronous (poll `GET /services/data/vXX.0/connect/self-service/site/status/{jobId}`)
496
+ - **PRM portal:** Connect API `POST /services/data/vXX.0/connect/prm/setup/sites` — synchronous
497
+ - **General community:** Connect API `POST /services/data/vXX.0/connect/communities` — asynchronous (poll `BackgroundOperation` via `GET /services/data/vXX.0/query`, not `/tooling/query`)
@@ -0,0 +1,30 @@
1
+ # Portal Creation Report — template
2
+
3
+ The skill's final action (Step 4) is always to write `report.md`. It must start with the heading
4
+ `# Portal Creation Report`, cover the portal name, the API used and why, the framework/template, the
5
+ dispatched request + response, the remaining Step 3 work, and end with the exact sentinel line
6
+ `Task completed: portal creation dispatched — see report.md`.
7
+
8
+ Skeleton:
9
+
10
+ ```markdown
11
+ # Portal Creation Report
12
+
13
+ - **Portal name:** IT Support Portal
14
+ - **API:** POST /services/data/v67.0/connect/communities — chosen because no guest Embedded Service
15
+ Deployment exists (self-service/site requires one).
16
+ - **Framework / template:** Aura — Agentforce Employee Center
17
+
18
+ ## Dispatched
19
+ POST /services/data/v67.0/connect/communities
20
+ { "name": "IT Support Portal", "urlPathPrefix": "itsupport", "templateName": "Agentforce Employee Center" }
21
+
22
+ ## Response
23
+ { "jobId": "08P...", "status": "Queued" }
24
+
25
+ ## Remaining
26
+ - Step 3: Activate (Network status Live) → Add Members (profiles) → Publish (`sf community publish`).
27
+ - Embedded Agentforce agent is a separate follow-up step (not created by this call).
28
+
29
+ Task completed: portal creation dispatched — see report.md
30
+ ```