@salesforce/afv-skills 1.65.1 → 1.66.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 (31) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-offline-experimentation-run/SKILL.md +16 -15
  3. package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +3 -245
  4. package/skills/dx-devops-work-item-manage/SKILL.md +34 -17
  5. package/skills/dx-devops-work-item-manage/examples/common-workflows.md +49 -0
  6. package/skills/dx-devops-work-item-manage/references/commit-api.md +116 -0
  7. package/skills/experience-lwc-widget-assess/SKILL.md +79 -0
  8. package/skills/experience-lwc-widget-migrate/SKILL.md +50 -0
  9. package/skills/platform-role-hierarchy-apply/SKILL.md +177 -0
  10. package/skills/platform-widget-generate/SKILL.md +58 -41
  11. package/skills/platform-widget-generate/references/widget-bundle-validation.md +14 -0
  12. package/skills/service-agentforce-contact-center-coordinate/SKILL.md +1 -1
  13. package/skills/service-agentforce-contact-center-coordinate/references/number_management_api.md +11 -1
  14. package/skills/service-agentforce-contact-center-coordinate/scripts/fetch-numbers.sh +12 -6
  15. package/skills/service-agentforce-contact-center-coordinate/scripts/lib.sh +16 -0
  16. package/skills/service-agentforce-contact-center-coordinate/scripts/procure-number.sh +2 -1
  17. package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +24 -11
  18. package/skills/service-digital-engagement-channel-configure/SKILL.md +25 -14
  19. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +143 -0
  20. package/skills/service-digital-engagement-deployment-configure/SKILL.md +61 -12
  21. package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +14 -5
  22. package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +146 -0
  23. package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +23 -13
  24. package/skills/service-itsm-agentic-setup-incident-management/references/incident-persona-psg.md +7 -6
  25. package/skills/service-itsm-agentic-setup-incident-management/references/incident-preferences.md +9 -10
  26. package/skills/service-itsm-agentic-setup-incident-management/references/major-incident-management.md +6 -6
  27. package/skills/service-itsm-agentic-setup-incident-management/references/service-mgmt-privilege.md +1 -1
  28. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +34 -25
  29. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +1 -1
  30. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +90 -86
  31. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +63 -38
@@ -2,13 +2,10 @@
2
2
  name: service-itsm-agentic-setup-incident-sla-configure
3
3
  description: "End-to-end Incident SLA setup for Service Cloud ITSM — the policy's Business Hours (reuse a named schedule, or create one from described hours or a time zone), MilestoneTypes, an Incident-scoped SLA Policy (SlaProcess), Milestones with criteria, and the Entitlement so Incidents get an EntityMilestone with a computed TargetDate. Use when the user asks to create or set up an Incident SLA policy (predefined or custom, with or without specific business hours), configure SLA milestones on Incidents, set up entitlement processes for ITSM, or enable SLA tracking for incident management. For Incidents, use this instead of the single-step SLA policy, milestone, or activation skills. DO NOT TRIGGER when: the user asks about Case entitlements or Case SLA (not Incident), querying existing SLA policies without setup intent, general Entitlement sObject CRUD unrelated to Incident, or Milestone queries for reporting purposes only."
4
4
  metadata:
5
- version: "3.10"
5
+ version: "3.11"
6
6
  domains: ["Service"]
7
7
  minApiVersion: "67.0"
8
8
  accessCheck: "(UserPermissions.CustomizeApplication) && (IncidentMgmt.orgHasITSMOrgPermission)"
9
- relatedSkills:
10
- - "service-itsm-incident-mgmt-configure"
11
- - "service-itsm-incident-priority-configure"
12
9
  mcpTools:
13
10
  headless-360:
14
11
  tools: ["describe", "discover", "dispatch", "dispatch_readonly"]
@@ -24,11 +21,15 @@ allowed-tools: |
24
21
 
25
22
  # Configuring Incident SLA (End-to-End)
26
23
 
24
+ **First action, before any question to the user:** read the IT Service Enablement gate (Phase 1a) with
25
+ `dispatch_readonly` on `GET /services/data/v68.0/connect/setup/discovery/features`, filtered to the exact
26
+ apiName `service-cloud-itsm-setup`. Ask nothing else until it is `ENABLED`.
27
+
27
28
  Configures a complete **Incident SLA pipeline** for Service Cloud ITSM — the chain deriving an
28
29
  EntityMilestone (with a computed TargetDate) on every Incident with an Entitlement, all via the
29
30
  Salesforce-hosted **`headless-360`** MCP server (org from the OAuth JWT). Requires the org-level
30
31
  **IT Service Management enablement** (the Phase 1a gate) and **SLA Management for IT Service**
31
- setup item (the Phase 1b gate).
32
+ setup item (the Phase 1c gate), plus **Incident Management** (the Phase 1b gate).
32
33
  The custom pipeline (four ordered writes): **MilestoneType** (what you measure) → **SLA Policy**
33
34
  (SlaProcess, Incident-scoped, created inactive, entry/exit criteria) → **Milestone** (time trigger +
34
35
  criteria) → **activate the policy** (`createEntitlement=true`, which auto-provisions the Entitlement —
@@ -42,7 +43,7 @@ verification); the raw **write** operations are **delegated to the approved SLA
42
43
  leaf capabilities** (`csp-sun/MilestoneTypes`, `create-sla-policy`, `create-milestone`,
43
44
  `create-milestone-action`, `activate-sla-policy`, `create-entitlement-criteria`), which own the
44
45
  approved Connect contracts — discover → describe → dispatch each rather than re-deriving its shape here.
45
- The Phase 1b **enable** (+ Versioning) and Phase 4B **seed** writes delegate to
46
+ The Phase 1c **enable** (+ Versioning) and Phase 4B **seed** writes delegate to
46
47
  **`itsm-shakti/SLASettings`** (owns the SLA-Management settings surface) — same discover → describe → dispatch.
47
48
 
48
49
  ## Scope
@@ -51,7 +52,7 @@ The Phase 1b **enable** (+ Versioning) and Phase 4B **seed** writes delegate to
51
52
  activation with its auto-provisioned Entitlement, and — only on an explicit org-wide always-match
52
53
  request — the optional auto-apply criterion) + verifying SLA
53
54
  engagement on Incident records; gating
54
- **SLA Management for IT Service** (Phase 1b); offering the OOB *Standard Support for Incidents*
55
+ **SLA Management for IT Service** (Phase 1c); offering the OOB *Standard Support for Incidents*
55
56
  policy vs a custom one (Phase 2, Incident only) — all via `headless-360` MCP.
56
57
  - **Out of scope**: Case SLA/entitlements; Assignment Rules; Escalation Rules; Notification
57
58
  Rules; general Entitlement CRUD not related to Incident SLA; SLA reporting.
@@ -89,8 +90,7 @@ from `{status_code, body}`. Full route table with request/response shapes: `refe
89
90
  ## Clarifying Questions
90
91
 
91
92
  Ask only what you cannot infer from context (pre-populate; note "(from conversation)"). **Resolve the
92
- Phase 1a and Phase 1b gates first, in that order.** Then: **which org?** (`headless-360` binds to the current OAuth session —
93
- confirm before mutating); **milestone strategy?** (Phase 3b); **milestone criteria?** (default
93
+ Phase 1a gate, then the Phase 1b Incident Management gate, then the Phase 1c gate, first and in that order.** Then: (`headless-360` binds to the current OAuth session, so do not ask which org); **milestone strategy?** (Phase 3b); **milestone criteria?** (default
94
94
  `Status != Closed` + pattern-specific filters). **Do not ask for an Account** — Incident has no
95
95
  Account field; engagement is per-Incident via `EntitlementId`. **Business Hours:** ask only when the
96
96
  user's choice is ambiguous or the org has none (Phase 3a step 4); never ask on the Predefined path.
@@ -110,17 +110,26 @@ before executing.** Phase index and their non-negotiable gates:
110
110
 
111
111
  - **Before you start — Reuse session state** only from a successful `dispatch_readonly` this session on this
112
112
  org, unwritten since; a user statement is never cache-eligible.
113
- - **Phase 1a — IT Service Management gate** (`service-cloud-itsm-setup`). `NOT_ENABLED` → one ack
114
- (reversible) → direct enable → re-read.
115
- - **Phase 1b — SLA Management gate.** SLA Management **and** the permanent SLA Versioning switch — two
116
- writes, two separate acks (master, then permanence); delegate to `itsm-shakti/SLASettings`.
113
+ - **Phase 1a — IT Service Management gate** (`service-cloud-itsm-setup`). Exact `ENABLED` continues.
114
+ Exact `NOT_ENABLED` with no blocked reasons → ask “IT Service Enablement is off — enable it now?” via `AskUserQuestion` (Yes/No, never plain text; No halts) → delegate to
115
+ the `IncidentMgmt` SOR with that confirmation → use its verify step before continuing. Missing,
116
+ error, blocked, or any other status halts and points to Setup.
117
+ - **Phase 1b — Incident Management gate** (`service-cloud-itsm-incident`). Exact `ENABLED` continues; `NOT_AVAILABLE` → HALT; exact
118
+ `NOT_ENABLED` with no blocked reasons → its own Yes/No “Incident Management is off — enable it now?” via `AskUserQuestion`, delegate to the
119
+ `IncidentMgmt` SOR (MCP steps, never `Skill`), verify exact `ENABLED`; No halts.
120
+ - **Phase 1c — SLA Management gate.** SLA Management **and** the permanent SLA Versioning switch — two
121
+ writes; delegate to `itsm-shakti/SLASettings`. Read both flags first. If either is off, ask with
122
+ `AskUserQuestion` before ANY write, as two separate questions: **Q1** “SLA Management for IT Service
123
+ is off — enable it now?” (Yes/No; only when SLA Management is off), then **Q2** the SLA Versioning
124
+ permanence ack (Enable / Stop; exact wording in `references/mcp-invocation.md`). Never merge them, never
125
+ preview later steps before each is answered, and never treat a Yes at Phase 1a/1b or the original
126
+ request as consent; any No → HALT.
117
127
  - **Phase 2 — Predefined vs Custom** (Incident only). Detect the seeded policy first; read the live
118
128
  `Incident.Priority` picklist before the fork (custom values → recommend Custom); warn if the
119
129
  priority matrix is off (only the default tier fires); Business Hours note only if the user
120
130
  specified hours. Predefined → 4B → 5 (if asked) → 6 → **STOP**;
121
131
  Custom → 3a → 3b → 3c → 4A → 5 (if asked) → 6.
122
- - **Phase 3a — Preflight.** Master Incident Mgmt (`service-cloud-itsm-incident`; `NOT_AVAILABLE` →
123
- HALT, `NOT_ENABLED` → one ack + delegate), `discover`/`describe` the SLA ops, Incident describe,
132
+ - **Phase 3a — Preflight.** Step 1 only reuses the Phase 1b Incident Management result; then `discover`/`describe` the SLA ops, Incident describe,
124
133
  resolve Business Hours, idempotency probe. No Account. `401`/`403`/`404` → halt with the raw error.
125
134
  - **Phase 3b — Milestone strategy** per `examples/milestone-patterns.md`.
126
135
  - **Phase 3c — Confirm** the full plan (Business Hours by name, every milestone) before any write.
@@ -139,15 +148,15 @@ before executing.** Phase index and their non-negotiable gates:
139
148
 
140
149
  | Constraint | Rationale |
141
150
  |-----------|-----------|
142
- | Gate **IT Service Management enablement** first (Phase 1a, before Phase 1b) — exact apiName `service-cloud-itsm-setup`, never a look-alike; `NOT_ENABLED` → tell the user plainly + a single ack to enable (reversible) or stop; the enable write is dispatched **directly** (no owning SOR exists yet) and re-read to confirm | Higher-level org gate sits above every ITSM feature, including the Master Incident Mgmt pref below |
143
- | Gate **SLA Management** first (Phase 1b) — **two separate writes** (SLA Management, then the one-way **SLA Versioning**); **two separate acks (master, then permanence) — never merged**; decline/blocked/verify-fail → **HALT**; re-read + report real state | Versioning is irreversible; writes don't confirm state |
151
+ | Gate **IT Service Management enablement** (Phase 1a), then **Incident Management** (Phase 1b, its own Yes/No) before Phase 1c — exact apiNames only, never a look-alike; rules as in the phase list above | Higher-level org gate sits above every ITSM feature |
152
+ | Gate **SLA Management** first (Phase 1c) — **two separate writes** (SLA Management, then the one-way **SLA Versioning**); **two separate `AskUserQuestion`s before any write (Q1 SLA Management Yes/No, then Q2 permanence) — never merged, never inferred from an earlier gate's Yes**; decline/blocked/verify-fail → **HALT**; re-read + report real state | Versioning is irreversible; writes don't confirm state |
144
153
  | Offer **predefined (OOB)** first (Phase 2, Incident only); detect before seed; if chosen, seed → verify → **STOP** (no custom upsell) | OOB seed isn't idempotent — re-seed duplicates |
145
154
  | `discover` + `describe` before any mutation | Catches a missing SLA surface / disabled Incident Mgmt early |
146
155
  | Ask (`AskUserQuestion`) the milestone strategy — never silently default to Single | Real ITSM policies have >1 milestone |
147
156
  | Reuse one MilestoneType per shared name; a distinct one per distinct concern | Runtime keys milestones by MilestoneType |
148
157
  | Multi-milestone: halt on any milestone-create failure (no half-attached policy) | Partial attach diverges from the confirmed plan |
149
158
  | Priority-tiered: reconcile every `Priority` value against the live picklist before dispatch — drop/rename standard rows that don't match **and add a milestone for each custom active value** the org added | Server accepts any string → an unknown value is a dead milestone; a custom value with no milestone gets no SLA |
150
- | **Delegate every write to its approved SLA leaf** (`MilestoneTypes`, `create-sla-policy`, `create-milestone`, `create-milestone-action`, `activate-sla-policy`, `create-entitlement-criteria`) — the skill decides inputs, the leaf owns the contract. Scoped inline exceptions (no served owning SOR yet): the Phase 1a enable and the Phase 4A step 1 Business Hours create | Single contract-owner per write; the skill re-deriving Connect shapes drifts from the served leaves |
159
+ | **Delegate every owned write** — prerequisite feature enables to the `IncidentMgmt` SOR; SLA writes to their approved SLA leaves (`MilestoneTypes`, `create-sla-policy`, `create-milestone`, `create-milestone-action`, `activate-sla-policy`, `create-entitlement-criteria`). The Phase 4A step 1 Business Hours create remains inline because no served SOR owns it | Single contract-owner per write; re-deriving an owned contract here would drift from its served owner |
151
160
  | **Business Hours** (Custom): honor a named schedule, described calendar, or time zone (time zone only → ask 24×7 (recommended) or custom hours; reuse a match, else create one after the Phase 3c confirm); zero active → offer a 24×7 create. Never set `IsDefault` or modify an existing record. Predefined: the seeder always uses the org default — warn only if the user specified hours | Default 24×7 or the customer's own calendar; `BusinessHours` is not API-deletable, so creates are confirmed first |
152
161
  | **Custom flow**: activation provisions the auto-Entitlement (`activate-sla-policy`: `isActive` + `createEntitlement` as **QUERY params**) — matching Incidents then engage **per-Incident via `EntitlementId`** (**not** a manual sObject Entitlement, and no Account). An org-wide auto-apply criterion via `create-entitlement-criteria` is **optional** — only on an explicit always-match request, never by default. **OOB seed path**: one seeder call (`save-selected-options`, lowercase `selectedOptions`) provisions the entire active bundle incl. the Entitlement — no per-leaf calls, no manual `POST /sobjects/Entitlement`, no activate PATCH | Custom: one call activates **and** provisions, so a manual `POST /sobjects/Entitlement` would duplicate it. OOB: the platform seeder builds and activates the whole default bundle server-side, so the skill neither rebuilds it leaf-by-leaf nor provisions the Entitlement by hand |
153
162
  | **No record Id in any message** (see Output contract, incl. reused artifacts); `AskUserQuestion` labels customer-facing (no "demo"/internal defaults) | Leaked Ids / internal framing look unprofessional to the customer |
@@ -159,10 +168,10 @@ Additional API quirks: `references/mcp-invocation.md`.
159
168
 
160
169
  ## Verification Checklist
161
170
 
162
- - [ ] **IT Service Management enablement gated (Phase 1a)** — exact apiName `service-cloud-itsm-setup` read `ENABLED` via live read, or the user explicitly acked an enable (reversible) that a re-read confirms; declined / unexpected status → **HALTED** before Phase 1b.
163
- - [ ] **SLA Management gated (Phase 1b)** — SLA Management + SLA Versioning both on (two separate writes), only after the **permanence ack** (separate from the master ack); reported state = a re-read, not the write. Declined / blocked / verify-fail → **HALTED** before Phase 2/3a, no artifacts.
171
+ - [ ] **IT Service Management enablement gated (Phase 1a)** — exact apiName `service-cloud-itsm-setup` read exact `ENABLED`, or exact `NOT_ENABLED` with no blocked reasons received one Yes/No enable question delegated to the `IncidentMgmt` SOR and its verify step confirmed exact `ENABLED`; declined, blocked, missing, error, or unexpected status → **HALTED** before Phase 1b.
172
+ - [ ] **Incident Management gated (Phase 1b)** — exact `service-cloud-itsm-incident` `ENABLED` via live read, or delegated to the `IncidentMgmt` SOR after its own Yes/No when `NOT_ENABLED` (`NOT_AVAILABLE` → HALT); its verify step confirmed `ENABLED` — not a user assertion, not a look-alike.
173
+ - [ ] **SLA Management gated (Phase 1c)** — SLA Management + SLA Versioning both on (two separate writes), only after Q1 (SLA Management Yes/No) and the separate Q2 **permanence ack**, each asked via `AskUserQuestion`; reported state = a re-read, not the write. Declined / blocked / verify-fail → **HALTED** before Phase 2/3a, no artifacts.
164
174
  - [ ] **Predefined vs Custom offered (Phase 2)** — with the feature ON, OOB *Standard Support for Incidents* offered first; if present, reported not re-seeded; if chosen, seeded (2 MilestoneTypes + 6 milestones + Entitlement), verified, **no** custom offer after.
165
- - [ ] Master Incident Mgmt pref (exact `service-cloud-itsm-incident`) `ENABLED` via live read, or delegated when `NOT_ENABLED` (`NOT_AVAILABLE` → HALT) — not a user assertion, not a look-alike.
166
175
  - [ ] `discover`/`describe` confirmed the SLA Connect ops.
167
176
  - [ ] Incident describe returned 200 with `EntitlementId`, `SlaStartDate`, `SlaExitDate`.
168
177
  - [ ] Active Business Hours resolved and named in the confirmed plan — the user's named schedule / a matching calendar / the org default / a user-selected record, or a create (described calendar or 24×7 when none exist) confirmed at Phase 3c, then SOQL-verified active. Predefined: the seeded policy's Business Hours reported by name (or "none").
@@ -171,7 +180,7 @@ Additional API quirks: `references/mcp-invocation.md`.
171
180
  - [ ] Writes **delegated to the SLA leaves** in order — the four core writes: MilestoneType(s) → Policy → Milestone(s) → activate + auto-Entitlement (the optional org-wide auto-apply criterion only if explicitly requested); any milestone-create failure halted (no partial attach). Trivial on no-op.
172
181
  - [ ] **Milestone actions (Phase 5)** — if requested, attached to **every** named milestone; each confirmed from `body.success` + `actionMappings`, not the `201`; full set narrated before write.
173
182
  - [ ] SLA Policy verified via SOQL, not the create response (no-op: the Phase-3a read is the verification).
174
- - [ ] Test Incident has ≥1 EntityMilestone on the **correct tier** with a `TargetDate` (the engagement proof; Priority matched for Priority-tiered); expected milestone(s) present. Matrix off / still order-1 after one retry → reported "other tiers not checked" + pointed to `service-itsm-incident-priority-configure`, no recreate loop. `SlaStartDate` populated confirms it too, but may be null when the Entitlement is auto-applied via criteria — not a failure. Skip on no-op.
183
+ - [ ] Test Incident has ≥1 EntityMilestone on the **correct tier** with a `TargetDate` (the engagement proof; Priority matched for Priority-tiered); expected milestone(s) present. Matrix off / still order-1 after one retry → reported "other tiers not checked" + pointed to the Priority Matrix setting in Setup, no recreate loop. `SlaStartDate` populated confirms it too, but may be null when the Entitlement is auto-applied via criteria — not a failure. Skip on no-op.
175
184
  - [ ] **No record Id in any message** — interim narration *and* final report; artifacts by name, test Incident by `IncidentNumber` (see Output contract).
176
185
  - [ ] Before/after + summary shown; no-op states the pre-existing config verbatim + "no changes made".
177
186
 
@@ -198,6 +207,6 @@ Use the `examples/output-templates.md` templates; fill placeholders as-is. The s
198
207
 
199
208
  ## Related Skills
200
209
 
201
- The priority matrix (Impact × Urgency → Priority) is separate — `service-itsm-incident-priority-configure`;
202
- if a Priority-tiered strategy is requested but `Incident.Priority` lacks values, direct the user there
203
- first. Other ITSM flows (Major Incident Mgmt, custom fields) are out of scope.
210
+ The priority matrix (Impact × Urgency → Priority) is separate and not configured here;
211
+ if a Priority-tiered strategy is requested but `Incident.Priority` lacks values, direct the user to the
212
+ Priority Matrix setting in Setup first. Other ITSM flows (Major Incident Mgmt, custom fields) are out of scope.
@@ -243,4 +243,4 @@ never a re-seed).
243
243
  | Priority-tiered needs a Priority | The test Incident in Phase 6 must derive a `Priority` value matching one of the milestones — otherwise no EntityMilestone spawns. `Priority` is not directly insertable — set `Impact` and `Urgency` so the org's matrix derives the target Priority (see `references/mcp-invocation.md` → Verify SLA engagement) — subject to the Phase 6 step 2 stopping rule. |
244
244
  | Multi-milestone partial-failure | If milestone #2 of N fails to attach, halt and surface the raw error. Do NOT continue attaching #3..N — the policy will be half-configured. |
245
245
  | `order` field | Numeric 1..N. Not load-bearing for runtime evaluation (all milestones fire independently), but controls display order in the UI. |
246
- | Priority-tiered + Priority Matrix skill | `Incident.Priority` is derived from the Impact × Urgency matrix only when the matrix is **on** (`IncPriorityMatrixEnabled`); when it is off, every Incident gets the org's default priority, so only that tier's milestone fires. `service-itsm-incident-priority-configure` turns the matrix on and configures the mapping — run it first (see `references/mcp-invocation.md` → Priority matrix flag). |
246
+ | Priority-tiered + Priority Matrix | `Incident.Priority` is derived from the Impact × Urgency matrix only when the matrix is **on** (`IncPriorityMatrixEnabled`); when it is off, every Incident gets the org's default priority, so only that tier's milestone fires. The Priority Matrix setting in Setup turns the matrix on and configures the mapping — do that first (see `references/mcp-invocation.md` → Priority matrix flag). |
@@ -18,9 +18,9 @@ skill never handles credentials or an org alias — everything is derived from t
18
18
  - [Response envelope](#response-envelope)
19
19
  - [Routes](#routes)
20
20
  - [Phase 1a — IT Service Management enablement gate](#phase-1a--it-service-management-enablement-gate)
21
- - [Phase 1b — SLA Management for IT Service prerequisite gate](#phase-1b--sla-management-for-it-service-prerequisite-gate)
21
+ - [Phase 1b — Incident Management prerequisite gate (direct read)](#phase-1b--incident-management-prerequisite-gate-direct-read)
22
+ - [Phase 1c — SLA Management for IT Service prerequisite gate](#phase-1c--sla-management-for-it-service-prerequisite-gate)
22
23
  - [Discovery — always run first](#discovery--always-run-first)
23
- - [Preflight A — Master Incident Management pref (direct read)](#preflight-a--master-incident-management-pref-direct-read)
24
24
  - [Preflight B — SLA fields on the Incident sObject](#preflight-b--sla-fields-on-the-incident-sobject)
25
25
  - [Resolve Business Hours](#resolve-business-hours)
26
26
  - [Create MilestoneType](#create-milestonetype)
@@ -41,7 +41,7 @@ singly wrapped:
41
41
  { "status_code": 200, "body": <REST/Connect response> }
42
42
  ```
43
43
 
44
- Read `body`. The `/headless/invoke/platform/slasettings/…` routes (Phases 1b, 2 and 4B) return the
44
+ Read `body`. The `/headless/invoke/platform/slasettings/…` routes (Phases 1c, 2 and 4B) return the
45
45
  same shape: the invoke envelope is unwrapped before the response reaches you, so read `body` for
46
46
  them too.
47
47
 
@@ -51,10 +51,10 @@ them too.
51
51
 
52
52
  | Method + path | Purpose |
53
53
  |---------------|---------|
54
- | `GET /headless/invoke/platform/slasettings/get-sla-management-permission` | Phase 1b — read whether SLA Management is on (composite: Entitlements + Simplified SLA Setup + Pause Milestone). Delegated to `itsm-shakti/SLASettings` |
55
- | `PATCH /headless/invoke/platform/slasettings/set-sla-management-permission` | Phase 1b — turn SLA Management on (`isEnabled:true`; flips the three prefs atomically; requires Entitlements already on or it throws). **Reversible.** Delegated to `itsm-shakti/SLASettings` |
56
- | `GET /headless/invoke/platform/slasettings/get-sla-versioning-permission` | Phase 1b — read whether SLA Versioning is on. Delegated to `itsm-shakti/SLASettings` |
57
- | `PATCH /headless/invoke/platform/slasettings/set-sla-versioning-permission` | Phase 1b — turn SLA Versioning on (`isEnabled:true`). **Separate write; permanent / one-way** — the controller refuses to disable it. Delegated to `itsm-shakti/SLASettings` |
54
+ | `GET /headless/invoke/platform/slasettings/get-sla-management-permission` | Phase 1c — read whether SLA Management is on (composite: Entitlements + Simplified SLA Setup + Pause Milestone). Delegated to `itsm-shakti/SLASettings` |
55
+ | `PATCH /headless/invoke/platform/slasettings/set-sla-management-permission` | Phase 1c — turn SLA Management on (`isEnabled:true`; flips the three prefs atomically; requires Entitlements already on or it throws). **Reversible.** Delegated to `itsm-shakti/SLASettings` |
56
+ | `GET /headless/invoke/platform/slasettings/get-sla-versioning-permission` | Phase 1c — read whether SLA Versioning is on. Delegated to `itsm-shakti/SLASettings` |
57
+ | `PATCH /headless/invoke/platform/slasettings/set-sla-versioning-permission` | Phase 1c — turn SLA Versioning on (`isEnabled:true`). **Separate write; permanent / one-way** — the controller refuses to disable it. Delegated to `itsm-shakti/SLASettings` |
58
58
  | `GET /services/data/v{version}/setup/org/preferences/IncPriorityMatrixEnabled` | Phase 2 / 6 — is the Impact × Urgency priority matrix on? Read-only warning, not a gate |
59
59
  | `GET /services/data/v{version}/sobjects/Incident/describe` | Preflight — Incident Management on + SLA fields present |
60
60
  | `GET /services/data/v{version}/query` | SOQL reads (BusinessHours, SlaProcess, EntityMilestone) via `query_params.q` |
@@ -81,10 +81,10 @@ org-resolved version is always at or above that floor.
81
81
 
82
82
  ## Phase 1a — IT Service Management enablement gate
83
83
 
84
- **New, higher-level org gate — resolve before Phase 1b and before Preflight A below.** "IT Service
84
+ **New, higher-level org gate — resolve first. Phase 1b (the Incident Management gate) follows immediately, before Phase 1c.** "IT Service
85
85
  Management" (apiName `service-cloud-itsm-setup`) is a higher-level org gate that sits
86
- above every per-feature ITSM master toggle, including Master Incident Management (Preflight A). Read
87
- via the same Setup Discovery Connect API used by Preflight A:
86
+ above every per-feature ITSM master toggle, including Master Incident Management (Phase 1b). Read
87
+ via the same Setup Discovery Connect API used by Phase 1b:
88
88
 
89
89
  ```json
90
90
  mcp__headless-360__dispatch_readonly({
@@ -94,35 +94,77 @@ mcp__headless-360__dispatch_readonly({
94
94
  ```
95
95
 
96
96
  Filter `body.features[]` client-side to the element where `apiName == "service-cloud-itsm-setup"` —
97
- the **exact** apiName, never a look-alike. Read its `status`. It has two states:
98
- `ENABLED` / `NOT_ENABLED` — no `NOT_AVAILABLE`. Treat any unexpected status
99
- value conservatively, the same as a halt.
97
+ the **exact** apiName, never a look-alike. Only the exact status `ENABLED` passes immediately.
98
+ Only exact `NOT_ENABLED` with no blocked reasons is eligible for confirmed enablement.
100
99
 
101
100
  **Status → action:**
102
101
 
103
- - `ENABLED` → proceed to Phase 1b.
104
- - `NOT_ENABLED` → tell the user plainly that IT Service Management is not enabled, then dispatch a
105
- single `AskUserQuestion`: enable it now (note it's **reversible** — it can be disabled again later)
106
- or stop.
107
- - **Enable** →
108
- ```json
109
- mcp__headless-360__dispatch({
110
- "url": "/services/data/v{version}/connect/setup/discovery/feature/service-cloud-itsm-setup/enable",
111
- "method": "POST"
112
- })
113
- ```
114
- Success returns `201` with `{"success": true}`. If it 4xxs, or the re-read below doesn't
115
- confirm `ENABLED`, halt, surface the raw error, and point to Setup as the manual fallback. There
116
- is **no owning SOR** to delegate this write to yet (unlike Preflight A's master pref, which
117
- delegates to `service-itsm-incident-mgmt-configure`) — dispatch it directly here as a scoped,
118
- temporary exception to this skill's "delegate every write" rule; swap for a delegate once a
119
- dedicated SOR for `service-cloud-itsm-setup` exists. Re-read to confirm `status == "ENABLED"`
120
- before continuing.
121
- - **Stop** → halt, point to Setup for manual enablement.
102
+ - `ENABLED` → continue to Phase 1b (the Incident Management gate), then Phase 1c.
103
+ - Exact `NOT_ENABLED` with no blocked reasons → ask every time, never as plain text, with a single
104
+ `AskUserQuestion` (single-select, exactly two options: Yes and No): **“IT Service Enablement is off —
105
+ enable it now?”** The options are exactly “Yes” and “No”, with no other text in the question
106
+ or options. Do not preview later steps before it is answered.
107
+ - **Yes** → delegate to the `IncidentMgmt` SOR, explicitly stating that the user already
108
+ confirmed this exact change in this conversation so the delegate does not ask again. Run
109
+ `read-itsm-setup-feature-status`, `enable-itsm-setup-feature`, and
110
+ `verify-itsm-setup-feature-status`. The delegate owns the empty-body POST and the read-back.
111
+ If blocked reasons are present, the call fails, the entry is missing, or the verify step does
112
+ not read exact `ENABLED`, halt, surface the raw error or blocked reasons, and point to Setup.
113
+ Delegating means the MCP tools, not a Claude Code skill: `describe` the `IncidentMgmt` SOR, read
114
+ its steps by `id`, and `dispatch` each step exactly as the SOR defines it. Never call `Skill` for
115
+ it and never invent an enable URL.
116
+ - **No** → halt, point to Setup for manual enablement.
117
+ - Missing entry, error, blocked reasons, or any other status → halt and point to Setup; do not
118
+ ask to enable and do not delegate.
122
119
 
123
120
  ---
124
121
 
125
- ## Phase 1b — SLA Management for IT Service prerequisite gate
122
+ ## Phase 1b — Incident Management prerequisite gate (direct read)
123
+
124
+ The master ITSM Incident Management pref is exposed on the **Setup Discovery Connect API**
125
+ under `apiName = service-cloud-itsm-incident`. The setup-org-preferences endpoint does not
126
+ expose the master (`IncidentMgmtEnabled` / `ITSMIncidentMgmtEnabled` both 404) — read via
127
+ Setup Discovery instead.
128
+
129
+ ```json
130
+ mcp__headless-360__dispatch_readonly({
131
+ "url": "/services/data/v{version}/connect/setup/discovery/features",
132
+ "method": "GET"
133
+ })
134
+ ```
135
+
136
+ The endpoint returns the full feature catalog (~763 entries, ~1.1 MB) and does not honor
137
+ `?apiName=` server-side. Filter `body.features[]` client-side to the element where
138
+ `apiName == "service-cloud-itsm-incident"` — the **exact** apiName. Read its `status`
139
+ (`ENABLED` / `NOT_ENABLED` / `NOT_AVAILABLE`).
140
+
141
+ > **Never substitute a look-alike.** The catalog also contains `service-cloud-incident-management`
142
+ > — that is **generic Service Cloud Incident Management** (built on Case Management, so its
143
+ > `dependencyStatuses` chain through `service-cloud-case-management` → Support Settings Default Case
144
+ > Owner + Automated Case User). It is **not** the ITSM master this skill targets, and enabling it
145
+ > (plus its Case chain) does **not** unlock ITSM Incident SLA. If `service-cloud-itsm-incident` is
146
+ > absent or `NOT_AVAILABLE`, do **not** fall back to it — halt (see below).
147
+
148
+ **Status → action** (never auto-enable the master as an implied SLA dependency):
149
+
150
+ - `ENABLED` → proceed.
151
+ - `NOT_AVAILABLE` (ITSM Incident Management license/entitlement not present on the org) → **halt and
152
+ surface it** — the master cannot be enabled here, so there is no ack and no delegate. This is the
153
+ correct terminal outcome on an unlicensed org (do not pursue Case Management / generic Incident
154
+ Management as a workaround).
155
+ - `NOT_ENABLED` → get an explicit `AskUserQuestion` ack first (per `references/workflow.md` Phase 1b), phrased
156
+ as the delegate's own confirm payload — `Master Incident Management: NOT_ENABLED → ENABLED` — then
157
+ delegate to the `IncidentMgmt` SOR, stating that the user already confirmed this exact change
158
+ in this conversation. That "yes" **is** the delegate's confirm-to-write (same change, same session,
159
+ nothing written in between), so do **not** ask a second time. Run the delegate's
160
+ `read-itsm-incident-feature-status`, `enable-itsm-incident-feature`, and
161
+ `verify-itsm-incident-feature-status` steps, and require exact `ENABLED` before continuing. If the
162
+ user declines, halt — every downstream SLA artifact depends on the master being on.
163
+ Delegating means the MCP tools, not a Claude Code skill: `describe` the `IncidentMgmt` SOR, read
164
+ its steps by `id`, and `dispatch` each step exactly as the SOR defines it. Never call `Skill` for
165
+ it and never invent an enable URL.
166
+
167
+ ## Phase 1c — SLA Management for IT Service prerequisite gate
126
168
 
127
169
  **SLA Management for IT Service reads as fully enabled only when BOTH sub-settings are on —
128
170
  Simplified SLA Setup AND SLA Versioning.** In Setup it shows **In Progress** while either is off. Both
@@ -219,14 +261,17 @@ accept and conflates the two. Do **not** offer a "versioning-off" path (none exi
219
261
  the reads, not a fixed script.
220
262
 
221
263
  - If **both** SLA Management and Versioning are already on → skip the acks; the gate passes.
222
- - **Q1 — master prerequisite (only if master Incident Mgmt is `NOT_ENABLED`):** ask to enable it
223
- first. It's **reversible** — present it as a prerequisite with **no** permanence warning. Offer
224
- **Enable** or **Stop — make no changes**. A declined master → HALT.
225
- - **Q2 — enable + permanence ack (a distinct question, after the master is on):** if SLA Management
226
- and/or Versioning are off → ask, in customer terms: completing SLA Management setup turns on **SLA
227
- Management** and, as a separate step, **SLA Versioning**, which **can't be turned off once enabled**
228
- — SLA Management itself can be turned off again later, but that will **not** turn Versioning back
229
- off; Versioning is permanent. Offer **Enable** or **Stop — make no changes**.
264
+ - **Q1 — SLA Management enable (only if SLA Management reads off), asked before the first write:** ask
265
+ **“SLA Management for IT Service is off — enable it now?”** (single-select, exactly two options: Yes and
266
+ No; never plain text; the options are exactly “Yes” and “No”, with no other text; ask every time and do
267
+ not preview later steps before it is answered). Present it as reversible with **no** permanence
268
+ warning. A No → HALT, point to Setup, make no changes. Incident Management was already asked at Phase 1b
269
+ and its Yes does not cover this write.
270
+ - **Q2 — permanence ack (a distinct question, asked before the Versioning write and after Q1 is verified):**
271
+ if Versioning is off → ask via `AskUserQuestion`, in customer terms: enabling **SLA Versioning** **can't
272
+ be turned off once enabled** — SLA Management itself can be turned off again later, but that will
273
+ **not** turn Versioning back off; Versioning is permanent. Offer **Enable** or **Stop — make no
274
+ changes**. Ask it even when the user already said “enable SLA”.
230
275
  - **Any decline — including a request to enable SLA Management but *not* Versioning — means HALT.**
231
276
  The gate needs Versioning on, and there is no way to honor "SLA Management without Versioning" as a
232
277
  completed gate; enable **no further** writes and do not proceed to SLA/milestone setup (a reversible
@@ -267,47 +312,6 @@ does not index this surface — direct the user to Setup and stop.
267
312
 
268
313
  ---
269
314
 
270
- ## Preflight A — Master Incident Management pref (direct read)
271
-
272
- The master ITSM Incident Management pref is exposed on the **Setup Discovery Connect API**
273
- under `apiName = service-cloud-itsm-incident`. The setup-org-preferences endpoint does not
274
- expose the master (`IncidentMgmtEnabled` / `ITSMIncidentMgmtEnabled` both 404) — read via
275
- Setup Discovery instead.
276
-
277
- ```json
278
- mcp__headless-360__dispatch_readonly({
279
- "url": "/services/data/v{version}/connect/setup/discovery/features",
280
- "method": "GET"
281
- })
282
- ```
283
-
284
- The endpoint returns the full feature catalog (~763 entries, ~1.1 MB) and does not honor
285
- `?apiName=` server-side. Filter `body.features[]` client-side to the element where
286
- `apiName == "service-cloud-itsm-incident"` — the **exact** apiName. Read its `status`
287
- (`ENABLED` / `NOT_ENABLED` / `NOT_AVAILABLE`).
288
-
289
- > **Never substitute a look-alike.** The catalog also contains `service-cloud-incident-management`
290
- > — that is **generic Service Cloud Incident Management** (built on Case Management, so its
291
- > `dependencyStatuses` chain through `service-cloud-case-management` → Support Settings Default Case
292
- > Owner + Automated Case User). It is **not** the ITSM master this skill targets, and enabling it
293
- > (plus its Case chain) does **not** unlock ITSM Incident SLA. If `service-cloud-itsm-incident` is
294
- > absent or `NOT_AVAILABLE`, do **not** fall back to it — halt (see below).
295
-
296
- **Status → action** (never auto-enable the master as an implied SLA dependency):
297
-
298
- - `ENABLED` → proceed.
299
- - `NOT_AVAILABLE` (ITSM Incident Management license/entitlement not present on the org) → **halt and
300
- surface it** — the master cannot be enabled here, so there is no ack and no delegate. This is the
301
- correct terminal outcome on an unlicensed org (do not pursue Case Management / generic Incident
302
- Management as a workaround).
303
- - `NOT_ENABLED` → get an explicit `AskUserQuestion` ack first (per `references/workflow.md` Phase 3a step 1), phrased
304
- as the delegate's own confirm payload — `Master Incident Management: NOT_ENABLED → ENABLED` — then
305
- delegate to `service-itsm-incident-mgmt-configure` inline, which writes
306
- `POST .../setup/discovery/feature/service-cloud-itsm-incident/enable`. That "yes" **is** the
307
- delegate's confirm-to-write (same change, same session, nothing written in between) — do **not**
308
- ask the user a second time. Re-read this step to verify `status == "ENABLED"` before continuing. If
309
- the user declines, halt — every downstream SLA artifact depends on the master being on.
310
-
311
315
  ## Preflight B — SLA fields on the Incident sObject
312
316
 
313
317
  ```json
@@ -321,7 +325,7 @@ Confirm `body.fields[]` includes `EntitlementId`, `SlaStartDate`, and `SlaExitDa
321
325
  describe 404s or the fields are missing, Entitlement Management is not enabled for Incident —
322
326
  stop and direct the user to **Setup → Incident Management / Entitlement Settings**. This is
323
327
  a **secondary sanity check on the SLA-field surface**, not the master-pref state signal;
324
- Preflight A above is the master-state signal.
328
+ Phase 1b is the master-state signal.
325
329
 
326
330
  The response is large (~86 KB). If your host truncates it, filter with a grep-style search rather
327
331
  than reading the whole body — you only need to confirm those three field names exist.
@@ -712,8 +716,8 @@ mcp__headless-360__dispatch_readonly({
712
716
 
713
717
  `false` → the Impact × Urgency matrix is off and every Incident gets the org's default priority, so a
714
718
  priority-tiered policy (the predefined one, or Custom Priority-tiered) only fires that tier's
715
- milestones. Warn the user and point to `service-itsm-incident-priority-configure`; never enable the
716
- matrix from this skill (that skill owns the write). Read-only — not a gate.
719
+ milestones. Warn the user and point to the Priority Matrix setting in Setup; never enable the
720
+ matrix from this skill. Read-only — not a gate.
717
721
 
718
722
  ---
719
723
 
@@ -778,7 +782,7 @@ if the org's matrix mapped your `Impact`/`Urgency` to a different Priority, adju
778
782
  input derives the default priority. If the flag is `true` but the derived `Priority` is still the
779
783
  order-1 tier after one adjustment, stop. Either way report: the SLA engages (the `EntityMilestone` +
780
784
  `TargetDate`), the other tiers were **not** checked, why, and that
781
- `service-itsm-incident-priority-configure` configures the matrix. Never loop on recreates.
785
+ the matrix is configured in Setup (Priority Matrix). Never loop on recreates.
782
786
 
783
787
  ---
784
788
 
@@ -11,34 +11,65 @@ tools. Call shapes / templates / response envelope / gotchas live in `references
11
11
  Each Phase 3a read carries a **skip-if-already-known** clause: skip only when the same fact was
12
12
  produced **this session** by a successful `dispatch_readonly` on the current org and unwritten since —
13
13
  a user statement is never cache-eligible. Cacheable: IT Service Management enablement (Phase 1a,
14
- only if `ENABLED`), master Incident Mgmt pref (step 1, only if
15
- `ENABLED`), SLA feature + Versioning (Phase 1b), Incident describe (3, incl. the `Incident.Priority`
14
+ only if `ENABLED`), master Incident Mgmt pref (Phase 1b, only if
15
+ `ENABLED`), SLA feature + Versioning (Phase 1c), Incident describe (3, incl. the `Incident.Priority`
16
16
  picklist), the priority-matrix flag (Phase 2 step 2), `BusinessHoursId` (4), SLA Connect ops (2). (Step 5 resolves no Account — Incident has
17
17
  none.) **When in doubt, re-check.**
18
18
 
19
19
  ## Phase 1a — IT Service Management enablement gate
20
20
 
21
- **Resolve this gate first, before Phase 1b and before the Master Incident Mgmt pref below.**
21
+ **Resolve this gate first. The Incident Management gate (Phase 1b) is resolved immediately after it and before Phase 1c.**
22
22
  "IT Service Management" (`service-cloud-itsm-setup`) is a higher-level org gate — it sits above every per-feature ITSM master toggle, including Master
23
23
  Incident Management. Read via the Setup Discovery Connect API
24
- (`GET .../connect/setup/discovery/features`), filtered client-side to the **exact** apiName
25
- `service-cloud-itsm-setup` — never a look-alike. It has two states, `ENABLED` /
26
- `NOT_ENABLED` (no `NOT_AVAILABLE` — treat any unexpected value as a halt).
27
-
28
- - `ENABLED` → proceed to Phase 1b.
29
- - `NOT_ENABLED` → tell the user plainly that IT Service Management is not enabled, then a single
30
- `AskUserQuestion`: enable it now (note it's **reversible** — it can be disabled again later) or
31
- stop.
32
- - **Enable** → dispatch the enable route **directly** — there is no owning SOR to delegate this
33
- write to yet (unlike the Master Incident Mgmt gate below, which delegates to
34
- `service-itsm-incident-mgmt-configure`); this is a scoped, temporary exception to "delegate
35
- every write," flagged for a future delegate swap once a dedicated SOR exists. Halt and surface
36
- the raw error on any failure. Re-read to confirm `ENABLED` before continuing.
37
- - **Stop** → halt, point to Setup for manual enablement.
24
+ (`GET /services/data/v{version}/connect/setup/discovery/features`, using the org's full API version with its
25
+ minor such as v68.0; if the read fails, stop and do not retry other version strings), filtered client-side to the **exact** apiName
26
+ `service-cloud-itsm-setup` — never a look-alike. Exact `ENABLED` passes immediately. Only exact
27
+ `NOT_ENABLED` with no blocked reasons is eligible for confirmed enablement.
28
+
29
+ - `ENABLED` → continue to Phase 1b (Incident Management gate), then Phase 1c.
30
+ - Exact `NOT_ENABLED` with no blocked reasons → ask every time, never as plain text, with a single
31
+ `AskUserQuestion` (single-select, exactly two options: Yes and No): **“IT Service Enablement is off —
32
+ enable it now?”** The options are exactly “Yes” and “No”, with no other text in the question
33
+ or options. Do not preview later steps before it is answered.
34
+ - **Yes** → delegate to the `IncidentMgmt` SOR, explicitly stating that the user already
35
+ confirmed this exact change in this conversation so it does not ask again. Run its
36
+ `read-itsm-setup-feature-status`, `enable-itsm-setup-feature`, and
37
+ `verify-itsm-setup-feature-status` steps. Halt on blocked reasons, an error, a missing entry, or
38
+ any verify result other than exact `ENABLED`.
39
+ Delegating means the MCP tools, not a Claude Code skill: `describe` the `IncidentMgmt` SOR, read
40
+ its steps by `id`, and `dispatch` each step exactly as the SOR defines it. Never call `Skill` for
41
+ it and never invent an enable URL.
42
+ - **No** → halt, point to Setup for manual enablement.
43
+ - Missing entry, error, blocked reasons, or any other status → halt and point to Setup; do not ask
44
+ to enable and do not delegate.
38
45
 
39
46
  Shapes: `references/mcp-invocation.md` (Phase 1a).
40
47
 
41
- ## Phase 1b — SLA Management for IT Service prerequisite gate
48
+ ## Phase 1b — Incident Management prerequisite gate
49
+
50
+ **Resolve this gate right after Phase 1a and before Phase 1c; it is a separate question from the SLA Management acks.**
51
+ `service-cloud-itsm-incident` is the master ITSM Incident Management pref that every Incident SLA artifact
52
+ depends on. Read via the same Setup Discovery Connect API as Phase 1a, filtered client-side to the
53
+ **exact** apiName `service-cloud-itsm-incident` — never a look-alike (`service-cloud-incident-management`
54
+ is generic Case-based Incident Management, not our target). Skip the read only when the cache clause in
55
+ “Before you start” applies. Read `status`:
56
+
57
+ - `ENABLED` → continue to Phase 1c.
58
+ - `NOT_AVAILABLE` (license missing) → **halt and surface it** — cannot be enabled here, no delegate/ack.
59
+ - `NOT_ENABLED` (empty blocked reasons) → ask “Incident Management is off — enable it now?” every time with a single
60
+ `AskUserQuestion` (single-select, exactly two options: Yes and No), never as plain text, and never auto-enable as an
61
+ implied SLA dependency.
62
+ - **Yes** → delegate to the `IncidentMgmt` SOR, stating that the user already confirmed this exact change so it must
63
+ not ask again. Run its `read-itsm-incident-feature-status`, `enable-itsm-incident-feature` and
64
+ `verify-itsm-incident-feature-status` steps; require exact `ENABLED`. Delegating means the MCP tools, not a Claude
65
+ Code skill: `describe` the `IncidentMgmt` SOR, read its steps by `id`, and `dispatch` each step exactly as the SOR
66
+ defines it. Never call `Skill` for it and never invent an enable URL.
67
+ - **No** → halt and point to Setup; every SLA artifact depends on the master being on.
68
+ - Blocked reasons, error, missing entry or any other status → halt with a plain explanation and no question.
69
+
70
+ Full shape + why setup-org-preferences 404s here: `references/mcp-invocation.md` (Phase 1b).
71
+
72
+ ## Phase 1c — SLA Management for IT Service prerequisite gate
42
73
 
43
74
  **Resolve this gate first, on its own. Reads are safe up front; confirm the org before any write.**
44
75
  "SLA Management for IT Service" is enabled only when **both** Simplified SLA Setup **and** SLA
@@ -50,13 +81,15 @@ settings surface) — discover → describe → dispatch rather than re-deriving
50
81
  Shapes / preconditions / `enableBlockedReasons` / ack wording: `references/mcp-invocation.md`.
51
82
 
52
83
  - **Read both** (`dispatch_readonly`); proceed to Phase 2 **only when both are on**.
53
- - **On an OFF org, read the master license first** (Phase 3a step 1, `service-cloud-itsm-incident`):
54
- `NOT_AVAILABLE` → **HALT** — don't flip the permanent Versioning switch where Incident SLA can't run.
55
- - **Two separate `AskUserQuestion` acks — never merge.** (a) master Incident Mgmt `NOT_ENABLED` → ask
56
- to enable it first (reversible, no permanence warning). (b) a *distinct* permanence ack: completing
57
- the gate also turns on **SLA Versioning** (a **separate** write), which **can't be turned off** (SLA
58
- Management disables later but Versioning stays on). Offer **enable**/**stop** — no "versioning-off";
59
- a bare "enable SLA" is **not** consent.
84
+ - **The master license was already resolved in Phase 1b** (`service-cloud-itsm-incident`): `NOT_AVAILABLE` halted there, so
85
+ the permanent Versioning switch is never flipped where Incident SLA can't run.
86
+ - **Two separate `AskUserQuestion`s before any write — never merge, never skip.** (Q1) SLA Management
87
+ off → ask “SLA Management for IT Service is off — enable it now?” (Yes/No, no permanence warning; skip
88
+ only when SLA Management already reads on). (Q2) a *distinct* permanence ack: completing the gate also
89
+ turns on **SLA Versioning** (a **separate** write), which **can't be turned off** (SLA Management
90
+ disables later but Versioning stays on). Offer **enable**/**stop** — no "versioning-off". A Yes at
91
+ Phase 1a/1b, a bare "enable SLA" or the original request is **not** consent for either write; do not
92
+ preview later steps before each question is answered. Incident Management was already asked at Phase 1b.
60
93
  - **Decline (b), non-empty `enableBlockedReasons`, or a re-read mismatch → HALT** — enable no SLA
61
94
  Mgmt/Versioning, don't proceed to Phase 2/3a (a reversible master enable from (a) stands). **After
62
95
  any write, re-read both and report the REAL state** — never trust `201`/`204`.
@@ -65,7 +98,7 @@ Shapes / preconditions / `enableBlockedReasons` / ack wording: `references/mcp-i
65
98
 
66
99
  Once the gate passes, offer the OOB policy **before** any custom-flow questions. **Incident only.**
67
100
 
68
- 1. **Prerequisite + detect.** Confirm master Incident Mgmt pref `ENABLED` (Phase 3a step 1). Then
101
+ 1. **Prerequisite + detect.** Confirm master Incident Mgmt pref `ENABLED` (Phase 1b). Then
69
102
  `dispatch_readonly` `GET /headless/invoke/platform/slasettings` (get-existing-checkbox-states) —
70
103
  its lowercase-keyed map's `incident` value is the authoritative "is the OOB default seeded?"
71
104
  answer (this is the seeder's own dedup read; it maps to display name **"Standard Support for
@@ -93,7 +126,7 @@ Once the gate passes, offer the OOB policy **before** any custom-flow questions.
93
126
  matrix flag). The predefined policy is priority-tiered, and with the matrix **off** every Incident
94
127
  gets the org's default priority, so only that tier's milestones fire. If it is off, say so plainly
95
128
  in the fork prompt (when the fork is skipped, on the Priority-tiered option of the strategy
96
- question instead) and point to `service-itsm-incident-priority-configure` to turn it on. This is a
129
+ question instead) and point to the Priority Matrix setting in Setup to turn it on. This is a
97
130
  warning, not a gate — never enable the matrix from this skill.
98
131
  **Business Hours note (only when the user specified hours).** The seeder takes **no** Business Hours
99
132
  input — it always attaches the org's active **default** Business Hours (`IsDefault = true`), or none
@@ -120,15 +153,7 @@ Once the gate passes, offer the OOB policy **before** any custom-flow questions.
120
153
 
121
154
  **On any `401` / `403` / `404` from a step below, halt and surface the raw error** — the org/client is misconfigured. `401` → MCP auth (ECA/token). `403` → user perm OR ITSM Incident Management license/pref missing. `404` → `headless-360` not activated OR Entitlement Management not enabled for Incident.
122
155
 
123
- 1. **Master Incident Management pref — direct read** *(skip conditions in “Before you start”)*.
124
- `dispatch_readonly` `GET .../connect/setup/discovery/features`, filter `features[]` to the **exact**
125
- `apiName == "service-cloud-itsm-incident"` — never a look-alike (`service-cloud-incident-management`
126
- is generic Case-based Incident Management, not our target). Read `status`: `ENABLED` → proceed;
127
- `NOT_AVAILABLE` (license missing) → **halt and surface it** — cannot be enabled here, no delegate/ack;
128
- `NOT_ENABLED` → **explicit `AskUserQuestion` ack first (never auto-enable as an implied SLA
129
- dependency)**, then delegate to `service-itsm-incident-mgmt-configure` inline — that ack is the
130
- delegate's confirm-to-write, so never ask twice — and re-read; if declined, halt — every SLA artifact below depends on the master being on. Full shape + why
131
- setup-org-preferences 404s here: `references/mcp-invocation.md` (Preflight A).
156
+ 1. **Master Incident Management pref** — already gated in Phase 1b; reuse that result. Do not re-ask or re-read unless a write happened since *(skip conditions in “Before you start”)*.
132
157
  2. **Discover the Connect operations** — *(skip if already verified this session — see “Before you start”)*.
133
158
  `mcp__headless-360__discover(query="sla-management milestone")` to confirm the SLA Management
134
159
  Connect API is indexed, then `mcp__headless-360__describe(id=<operation_id>)`
@@ -212,7 +237,7 @@ selection expands to N creates in Phase 4A step 4 (one delegation per milestone,
212
237
 
213
238
  ## Phase 3c — Confirm before mutating
214
239
 
215
- 1. **Confirm the plan** — present the resolved config (target **org**, **SLA Policy** name,
240
+ 1. **Confirm the plan** — print the plan as text in the reply **first**, then ask; the `AskUserQuestion` must never refer to a plan that has not already been shown. Present the resolved config (target **org**, **SLA Policy** name,
216
241
  **Business Hours: `<name>`** (and, if Phase 3a step 4 planned a create, its time zone + weekly windows and
217
242
  that it will be **created** — a new record this skill does not remove later), the **engagement model** (per-Incident via `EntitlementId` — **no
218
243
  Account**, since Incident has no Account field), and the **full per-milestone list** — never
@@ -348,7 +373,7 @@ IST business-hours note: `references/mcp-invocation.md` (Milestone Actions).
348
373
  but the derived `Priority` is still the order-1 tier after **one** `Impact`/`Urgency` adjustment,
349
374
  stop creating test Incidents. Either way, report that the SLA engages but the other tiers were not
350
375
  checked, say why (matrix off / matrix maps these inputs to that tier), and point to
351
- `service-itsm-incident-priority-configure`. Narrate by `IncidentNumber`, never the Id.
376
+ the Priority Matrix setting in Setup. Narrate by `IncidentNumber`, never the Id.
352
377
  3. **Verify engagement + tiering** — SOQL that an `EntityMilestone` landed on the **correct tier**
353
378
  (a Moderate/Low Incident → the 240/960 tier, NOT 30/120) with a `TargetDate` — that row is the
354
379
  reliable engagement proof. `Incident.SlaStartDate` is populated when you set `EntitlementId` at