@salesforce/afv-skills 1.59.0 → 1.60.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 (173) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-architecture-analyze/SKILL.md +66 -17
  3. package/skills/agentforce-architecture-analyze/assets/cli/show_access_token.yaml +4 -7
  4. package/skills/agentforce-architecture-analyze/references/contract.json +1 -1
  5. package/skills/agentforce-architecture-analyze/scripts/emit_env.py +2 -2
  6. package/skills/agentforce-architecture-analyze/scripts/main.py +40 -44
  7. package/skills/agentforce-architecture-analyze/scripts/rest_client.py +11 -3
  8. package/skills/agentforce-architecture-analyze/scripts/sf_cli.py +77 -10
  9. package/skills/agentforce-architecture-analyze/scripts/tests/test_end_to_end_fixture.py +1 -0
  10. package/skills/agentforce-architecture-analyze/scripts/tests/test_flow_children_inflation.py +1 -0
  11. package/skills/agentforce-architecture-analyze/scripts/tests/test_main_pipeline.py +53 -2
  12. package/skills/agentforce-architecture-analyze/scripts/tests/test_resolve_creds.py +184 -36
  13. package/skills/agentforce-architecture-analyze/scripts/tests/test_rest_client.py +17 -0
  14. package/skills/agentforce-architecture-analyze/scripts/tests/test_sf_cli.py +165 -11
  15. package/skills/agentforce-architecture-analyze/scripts/tests/test_skill_md_pipeline_block.py +319 -0
  16. package/skills/agentforce-d360-analyze/SKILL.md +28 -10
  17. package/skills/agentforce-d360-analyze/scripts/dc.py +200 -50
  18. package/skills/agentforce-d360-analyze/scripts/discover_sessions.py +10 -6
  19. package/skills/agentforce-d360-analyze/scripts/fetch_dc.py +22 -6
  20. package/skills/agentforce-d360-analyze/scripts/resolve_session.py +21 -13
  21. package/skills/agentforce-d360-analyze/scripts/tests/test_dc_and_resolve_session.py +298 -76
  22. package/skills/agentforce-d360-analyze/scripts/tests/test_default_target_org.py +432 -0
  23. package/skills/agentforce-d360-analyze/scripts/tests/test_discover_sessions.py +1 -1
  24. package/skills/agentforce-d360-analyze/scripts/tests/test_resolve_session_main.py +9 -3
  25. package/skills/agentforce-d360-analyze/scripts/tests/test_skill_md_prefix_block.py +176 -0
  26. package/skills/consumer-goods-accruals-datakit-deploy/SKILL.md +17 -27
  27. package/skills/consumer-goods-accruals-datakit-deploy/scripts/setup.js +7 -17
  28. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/00-check-prerequisites.js +47 -63
  29. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/01-download-static-resource.js +10 -13
  30. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/02-replace-org-id.js +46 -46
  31. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/03-deploy-metadata.js +4 -21
  32. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/06-create-dataspace.js +58 -82
  33. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/07-deploy-accruals-reports.js +16 -315
  34. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/08-deploy-ui.js +9 -24
  35. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/09-completion.js +44 -44
  36. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/utils.js +11 -63
  37. package/skills/consumer-goods-rtr-datacloud-export-configure/SKILL.md +2 -1
  38. package/skills/consumer-goods-tpe-dashboard-configure/SKILL.md +2 -1
  39. package/skills/consumer-goods-tpe-dashboard-custom-kpi-configure/SKILL.md +2 -1
  40. package/skills/consumer-goods-tpe-datakit-deploy/SKILL.md +2 -1
  41. package/skills/data360-schema-get/SKILL.md +3 -3
  42. package/skills/design-systems-slds-validate/references/report-format.md +1 -1
  43. package/skills/dx-org-manage/SKILL.md +1 -0
  44. package/skills/dx-org-shape-manage/SKILL.md +1 -0
  45. package/skills/dx-org-snapshot-manage/SKILL.md +172 -0
  46. package/skills/dx-org-snapshot-manage/examples/create_error_output.json +16 -0
  47. package/skills/dx-org-snapshot-manage/examples/create_success_output.json +19 -0
  48. package/skills/dx-org-snapshot-manage/examples/delete_output.json +9 -0
  49. package/skills/dx-org-snapshot-manage/examples/get_output.json +19 -0
  50. package/skills/dx-org-snapshot-manage/examples/list_output.json +36 -0
  51. package/skills/dx-org-snapshot-manage/references/cli_flags.md +179 -0
  52. package/skills/dx-org-snapshot-manage/references/snapshot_usage.md +55 -0
  53. package/skills/dx-org-trial-expiration-check/SKILL.md +1 -1
  54. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +2 -2
  55. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +7 -5
  56. package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +11 -11
  57. package/skills/experience-content-media-image-generate/SKILL.md +83 -0
  58. package/skills/experience-content-media-image-generate/scripts/download-image.sh +84 -0
  59. package/skills/external-diagram-mermaid-generate/SKILL.md +12 -12
  60. package/skills/field-service-data-capture-migrate/references/component-mapping.md +1 -1
  61. package/skills/field-service-data-capture-migrate/references/fsm-dc-capability-catalog.md +1 -2
  62. package/skills/field-service-data-capture-migrate/references/known-deploy-errors.md +1 -0
  63. package/skills/field-service-data-capture-migrate/references/transformer-rules.md +1 -1
  64. package/skills/field-service-data-capture-migrate/scripts/transform_flow.py +12 -1
  65. package/skills/field-service-data-capture-migrate/scripts/vendor/build_flow.py +4 -1
  66. package/skills/field-service-setup-orchestrator-get/SKILL.md +0 -1
  67. package/skills/insurance-brokerage-agency-billing-configure/SKILL.md +233 -0
  68. package/skills/insurance-brokerage-agency-billing-configure/references/accounting-setup.md +117 -0
  69. package/skills/insurance-brokerage-agency-billing-configure/references/billing-rules-config.md +237 -0
  70. package/skills/insurance-brokerage-agency-billing-configure/references/billing-settings.md +271 -0
  71. package/skills/insurance-brokerage-agency-billing-configure/references/demo-policy-config.md +138 -0
  72. package/skills/insurance-brokerage-agency-billing-configure/references/org-defaults.md +64 -0
  73. package/skills/insurance-brokerage-agency-billing-configure/references/permissions-config.md +226 -0
  74. package/skills/insurance-brokerage-agency-billing-configure/references/prerequisites.md +142 -0
  75. package/skills/life-sciences-fieldsalesrep-coordinate/SKILL.md +3 -2
  76. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-execution-state-and-recovery.md +3 -3
  77. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md +68 -45
  78. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-visit-creation-data.md +17 -18
  79. package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md +16 -3
  80. package/skills/life-sciences-kam-coordinate/references/stage-5-data-creation-data.md +16 -13
  81. package/skills/marketing-message-test/SKILL.md +194 -0
  82. package/skills/marketing-message-test/references/api-contract.md +333 -0
  83. package/skills/omnistudio-callable-apex-generate/SKILL.md +3 -3
  84. package/skills/omnistudio-datamapper-generate/SKILL.md +6 -6
  85. package/skills/omnistudio-datapacks-deploy/SKILL.md +11 -11
  86. package/skills/omnistudio-dependencies-analyze/SKILL.md +5 -5
  87. package/skills/omnistudio-epc-catalog-generate/SKILL.md +6 -6
  88. package/skills/omnistudio-flexcard-generate/SKILL.md +6 -6
  89. package/skills/omnistudio-integration-procedure-generate/SKILL.md +6 -6
  90. package/skills/omnistudio-omniscript-generate/SKILL.md +6 -5
  91. package/skills/platform-apex-logs-debug/SKILL.md +1 -0
  92. package/skills/platform-metadata-deploy/SKILL.md +1 -0
  93. package/skills/platform-models-api-configure/SKILL.md +5 -5
  94. package/skills/platform-soql-query/SKILL.md +1 -0
  95. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +17 -6
  96. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +107 -192
  97. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/attach-milestone-action.json +6 -6
  98. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +49 -20
  99. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/output-templates.md +4 -4
  100. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +224 -290
  101. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +295 -0
  102. package/skills/service-itsm-incident-priority-configure/SKILL.md +1 -1
  103. package/skills/service-itsm-slack-itservice-configure/SKILL.md +2 -1
  104. package/skills/service-itsm-slack-itservice-configure/references/manage-slack-connection.md +2 -2
  105. package/skills/service-omni-channel-setup-coordinate/SKILL.md +20 -13
  106. package/skills/service-omni-channel-setup-coordinate/scripts/integration-driver.sh +5 -55
  107. package/skills/service-omni-channel-setup-coordinate/scripts/tests/test_omni_contracts.py +0 -38
  108. package/skills/service-omni-command-center-analyze/SKILL.md +2 -3
  109. package/skills/service-omni-command-center-analyze/scripts/analyze.sh +3 -3
  110. package/skills/tableau-next-asset-create/README.md +65 -0
  111. package/skills/tableau-next-asset-create/SKILL.md +409 -0
  112. package/skills/tableau-next-asset-create/references/admin-users.md +149 -0
  113. package/skills/tableau-next-asset-create/references/ai-readiness.md +355 -0
  114. package/skills/tableau-next-asset-create/references/alerts.md +111 -0
  115. package/skills/tableau-next-asset-create/references/build-workflow.md +819 -0
  116. package/skills/tableau-next-asset-create/references/dashboard-authoring.md +302 -0
  117. package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +352 -0
  118. package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +210 -0
  119. package/skills/tableau-next-asset-create/references/data-understanding.md +387 -0
  120. package/skills/tableau-next-asset-create/references/deep-reference-index.md +74 -0
  121. package/skills/tableau-next-asset-create/references/destructive-operations.md +62 -0
  122. package/skills/tableau-next-asset-create/references/edit-dashboard.md +273 -0
  123. package/skills/tableau-next-asset-create/references/edit-visualization.md +529 -0
  124. package/skills/tableau-next-asset-create/references/empty-source-handling.md +104 -0
  125. package/skills/tableau-next-asset-create/references/ingest-and-metric-gotchas.md +638 -0
  126. package/skills/tableau-next-asset-create/references/insight-bundle.md +69 -0
  127. package/skills/tableau-next-asset-create/references/large-flat-file-handling.md +331 -0
  128. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_envelope.json +54 -0
  129. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_shared-widget-fields.json +122 -0
  130. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/add_page.json +29 -0
  131. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/delete_page.json +27 -0
  132. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/discard_dashboard.json +11 -0
  133. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget.json +30 -0
  134. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget_to_page.json +30 -0
  135. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/place_widget_on_page.json +30 -0
  136. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_dashboard.json +16 -0
  137. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_page.json +26 -0
  138. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/rename_page.json +28 -0
  139. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/save_dashboard.json +18 -0
  140. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/undo.json +11 -0
  141. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_button_widget.json +69 -0
  142. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_container_widget.json +88 -0
  143. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_filter_widget.json +146 -0
  144. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_metric_widget.json +78 -0
  145. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_navigation_widget.json +80 -0
  146. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_parameter_widget.json +160 -0
  147. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_text_widget.json +103 -0
  148. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_visualization_widget.json +68 -0
  149. package/skills/tableau-next-asset-create/references/sdm-tool-reference.md +721 -0
  150. package/skills/tableau-next-asset-create/references/semantic-query-and-enrichment.md +355 -0
  151. package/skills/tableau-next-asset-create/references/shared-gates.md +322 -0
  152. package/skills/tableau-next-asset-create/references/sharing-and-promotion.md +306 -0
  153. package/skills/tableau-next-asset-create/references/tasks/ai-readiness-audit.md +51 -0
  154. package/skills/tableau-next-asset-create/references/tasks/analyze-data.md +48 -0
  155. package/skills/tableau-next-asset-create/references/tasks/build-dashboard.md +66 -0
  156. package/skills/tableau-next-asset-create/references/tasks/build-end-to-end.md +73 -0
  157. package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +51 -0
  158. package/skills/tableau-next-asset-create/references/tasks/create-viz.md +58 -0
  159. package/skills/tableau-next-asset-create/references/tasks/edit-dashboard.md +80 -0
  160. package/skills/tableau-next-asset-create/references/tasks/edit-sdm.md +106 -0
  161. package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +40 -0
  162. package/skills/tableau-next-asset-create/references/tasks/enrich-model.md +68 -0
  163. package/skills/tableau-next-asset-create/references/tasks/ingest-flat-file.md +68 -0
  164. package/skills/tableau-next-asset-create/references/tasks/manage-alert.md +35 -0
  165. package/skills/tableau-next-asset-create/references/tasks/profile-dataset.md +47 -0
  166. package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +46 -0
  167. package/skills/tableau-next-asset-create/references/tasks/provision-user.md +39 -0
  168. package/skills/tableau-next-asset-create/references/tasks/query-model.md +92 -0
  169. package/skills/tableau-next-asset-create/references/tasks/review-verified-questions.md +42 -0
  170. package/skills/tableau-next-asset-create/references/tasks/share-asset.md +37 -0
  171. package/skills/tableau-next-asset-create/references/verified-questions.md +125 -0
  172. package/skills/tableau-next-asset-create/references/viz-authoring.md +992 -0
  173. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/predefined-incident-policy.json +0 -102
@@ -0,0 +1,355 @@
1
+ # AI Readiness Reference for Semantic Data Models
2
+
3
+ Load this file when creating or reviewing a semantic model for AI readiness.
4
+ It is the authoritative checklist for all AI readiness requirements that must
5
+ be met before a model is used by Concierge / Agentforce for Analytics.
6
+
7
+ Source: Salesforce Help — "Design an AI-Ready Semantic Model"
8
+ (analytics.tua_ai_sm_design.htm)
9
+
10
+ ## Contents
11
+
12
+ - Why AI Readiness Matters
13
+ - AI Readiness Checklist
14
+ - Description Quality Guide
15
+ - Field-Level Description Quality
16
+ - Label Quality Guide
17
+ - API Name Quality Guide
18
+ - Ambiguity Management
19
+ - Field Type Accuracy
20
+ - businessPreferences Examples
21
+ - businessPreferences read / write tools
22
+
23
+ ---
24
+
25
+ ## Why AI Readiness Matters
26
+
27
+ Agents consume the semantic layer in **priority order**:
28
+ **Metrics first → Calculated fields → Raw fields**
29
+
30
+ A well-enriched metric set matters more to answer quality than raw field
31
+ coverage. Agents interpret fields in the context of the objects they belong
32
+ to — the combination of object name, description, and field label drives
33
+ semantic clarity.
34
+
35
+ ---
36
+
37
+ ## AI Readiness Checklist
38
+
39
+ ### Model Level (`create_semantic_model` / `update_semantic_model`)
40
+
41
+ - [ ] `description` — 1–2 sentences covering the model's goals and primary
42
+ use cases. Agents incorporate model descriptions to reason about content.
43
+ Example: `"Tracks open pipeline opportunities and associated account data
44
+ for sales forecasting and rep performance analysis"`
45
+ - [ ] `agentEnabled: true` — gates whether AI agents can use this model.
46
+ Set explicitly; do not rely on any default.
47
+ - [ ] `categories[]` — product category (`Sales`, `Marketing`, `Commerce`,
48
+ `Service`, or `Other`) where determinable.
49
+ - [ ] `businessPreferences` — domain-specific context statements. At
50
+ minimum describe what the core measure means and any non-obvious
51
+ terminology. **Read** with `get_semantic_model_business_preferences`
52
+ (`includeModelContent=false`). **Write** with
53
+ `update_semantic_model_business_preferences` (full replacement of `# `-
54
+ prefixed lines — see below). Fallback: `update_semantic_model` with the
55
+ same `# `-prefixed-line format. Example:
56
+
57
+ ```text
58
+ # Revenue = sum of Amount on closed-won opportunities only
59
+ # Stage names: 0-Prospecting through 6-Closed Won
60
+ # Region = sales territory, not geographic region
61
+ ```
62
+
63
+ ### Data Object Level (`add_semantic_model_data_object`)
64
+
65
+ - [ ] `description` — what this entity represents and how it is used. For
66
+ custom objects, this is required. For standard Salesforce objects, the
67
+ default is acceptable — only enhance, never contradict.
68
+ Example: `"Active sales opportunities with stage, amount, and close date.
69
+ Used in pipeline forecasting and rep performance analysis."`
70
+ - [ ] `primaryNameField` — the original (pre-suffix) column name that
71
+ identifies records in insight narratives (e.g. `"Name"`, `"Account_Name"`).
72
+ This is the field Concierge uses to name records in generated text
73
+ (e.g. "Acme Corp is the top contributor").
74
+
75
+ ### Calculated Dimension (`add_semantic_model_calculated_dimension`)
76
+
77
+ - [ ] `description` — 1–2 sentences explaining the grouping's purpose and
78
+ usage. Example: `"Fiscal quarter extracted from close date, used for
79
+ quarterly pipeline grouping and period-over-period comparison"`
80
+ - [ ] Unique purpose — only create if this calculation has a clearly
81
+ differentiated analytical purpose not already covered by another field.
82
+ - [ ] Pre-creation check — call `list_semantic_model_calculated_dimensions`
83
+ before creating. If an existing dimension covers the same source field,
84
+ identify how the new one differs before proceeding.
85
+
86
+ ### Calculated Measure (`add_semantic_model_calculated_measure`)
87
+
88
+ - [ ] `description` — what this measure calculates and its business purpose.
89
+ Example: `"Gross margin as a percentage: (Revenue - Cost) / Revenue.
90
+ Used in profitability analysis across product lines."`
91
+ - [ ] `sentiment` — set explicitly (do not rely on server default):
92
+ - `"SentimentTypeUpIsGood"` — higher is better (revenue, margin, win rate)
93
+ - `"SentimentTypeUpIsBad"` — higher is worse (churn, cost, error rate)
94
+ - `"SentimentTypeNone"` — directionless (e.g. a count or ratio with no
95
+ inherent good/bad direction)
96
+ - [ ] Unique purpose — only create if this measure has a clearly
97
+ differentiated analytical purpose.
98
+ - [ ] Pre-creation check — call `list_semantic_model_calculated_measures`
99
+ AND `list_semantic_model_metrics` before creating. A calc measure that
100
+ duplicates a metric creates cross-priority ambiguity (agents see both as
101
+ candidates); decline and point to the existing metric instead.
102
+
103
+ ### Metric (`add_semantic_model_metric`)
104
+
105
+ - [ ] `description` — what this KPI measures and its business context.
106
+ Example: `"Total open pipeline amount, summed across active opportunities
107
+ in Stages 1–5. Used for weekly forecast review."`
108
+ - [ ] `sentiment` (top-level) — `SentimentTypeUpIsGood` or
109
+ `SentimentTypeUpIsBad`
110
+ - [ ] `insightsSettings.sentiment` — mirror the top-level sentiment value
111
+ - [ ] `insightsSettings.identifyingDimension` — REQUIRED; point at the
112
+ grain's primary key. A metric without this **crashes the Tableau Next
113
+ metric UI**.
114
+ - [ ] `insightsSettings.singularNoun` / `insightsSettings.pluralNoun` —
115
+ the business unit name (e.g. `"opportunity"` / `"opportunities"`). These
116
+ appear verbatim in AI-generated insight text.
117
+ - [ ] `insightsSettings.insightsDimensionsReferences` — 2–4 most analytically
118
+ useful dimensions (e.g. region, stage, owner). Tells Concierge which
119
+ dimensions to use for contributor breakdown.
120
+ - [ ] `additionalDimensions[]` — must mirror every field in
121
+ `insightsSettings.identifyingDimension`, `insightsDimensionsReferences`, and
122
+ `filters`. Omitting an insight/identifying dim fails create (`Insight
123
+ dimension (...) is missing from the metric additional dimensions`); omitting
124
+ a filter field makes the metric unqueryable. **Exception: the server rejects
125
+ `Date`-type fields in `additionalDimensions`** (`"Field should have one of
126
+ these data types: Text, Number, Boolean, Email, PhoneNumber, Url"`). Do not
127
+ add Date-type filter fields to `additionalDimensions`.
128
+ - [ ] **Contextual filtering** (optional but recommended for business-scoped
129
+ KPIs) — add `filters` to scope the metric to the correct business context
130
+ (e.g. a "Closed Won Revenue" metric should filter on `Stage = 'Closed Won'`,
131
+ not sum all opportunities). Use `filterLogic` alongside `filters`. Mirror
132
+ every non-Date filter field into `additionalDimensions[]`. Confirmed valid
133
+ filter operators: `GreaterThan`, `Equals`. `GreaterThanOrEqual` and `After`
134
+ are invalid and will be rejected by the server.
135
+ - [ ] **Display formatting** — set `decimalPlace` and currency/unit context
136
+ in the metric description so agents can format answers correctly (e.g.
137
+ `"Expressed in USD, rounded to the nearest dollar"`). The API does not
138
+ enforce display format, but including format context in the description
139
+ produces better AI-generated narratives.
140
+ - [ ] Unique purpose — only create for high-impact, frequently used KPIs.
141
+ Near-identical metrics differing only by a minor filter must be clearly
142
+ differentiated in label, description, and purpose.
143
+
144
+ ### Pre-Handoff (before exposing model to AI users)
145
+
146
+ - [ ] **Similarity scan** — Run the Semantic Model AI Optimization similarity
147
+ scan in Tableau Next's Semantic Model Builder UI. A `modelHealth: Low` result
148
+ indicates overlapping or ambiguous components that agents will struggle to
149
+ differentiate. Resolve by improving descriptions or removing redundant
150
+ components. **Do not declare a model AI-ready without recommending this scan**
151
+ — metadata completeness alone is not sufficient.
152
+
153
+ ---
154
+
155
+ ## Description Quality Guide
156
+
157
+ A good description covers three things:
158
+
159
+ 1. **Business context** — what business process/entity does this represent?
160
+ Example: `"Purchase Date represents the date the invoice was printed or
161
+ sent to the user."`
162
+ 2. **How it is used** — where and how is this field/metric used in analysis?
163
+ Example: `"Used as the default date filter in Purchasing and Costing
164
+ analysis."`
165
+ 3. **Specific data values** — any values with a distinct meaning.
166
+ Example: `"'NA' represents transactions where the purchase was not yet
167
+ confirmed, aligning with Transaction Status = 'Pending'."`
168
+ **When the user provides specific value definitions, always include them
169
+ verbatim in the description.** Do not paraphrase to "values include X, Y,
170
+ Z" without stating what each value means.
171
+
172
+ **Standard vs. Custom fields:**
173
+ - Standard Salesforce objects/fields: default description is acceptable.
174
+ Add context if needed, but never contradict existing known meaning.
175
+ - Custom objects/fields: a clear description is required. It should reflect
176
+ what the data represents, align with industry standards, and explain any
177
+ internal-specific meanings.
178
+
179
+ **Anti-patterns:**
180
+ - Copy-pasted descriptions across similar fields → ambiguity
181
+ - Descriptions that only state the field name → useless
182
+ - Identical descriptions on two fields → agents cannot distinguish them
183
+
184
+ ---
185
+
186
+ ## Field-Level Description Quality
187
+
188
+ Before moving to metrics, do a quick self-review of every business field
189
+ description. For each description, verify it covers **at least two of three**:
190
+
191
+ 1. **Business context** — what business concept does this field represent?
192
+ 2. **How it's used** — where does it appear in analysis?
193
+ 3. **Specific values** — do any values have a distinct meaning?
194
+
195
+ If a description only restates the field name, improve it or ask the user one
196
+ targeted question.
197
+
198
+ **Updating an existing description.** Descriptions (unlike apiNames) are
199
+ editable after creation, so you can help the user fix weak or missing ones in
200
+ place — no delete-and-recreate needed:
201
+ - Dimensions → `update_semantic_model_dimension`
202
+ - Measures → `update_semantic_model_measure`
203
+ - Metrics → `update_semantic_model_metric`
204
+ - Model-level `businessPreferences` →
205
+ `get_semantic_model_business_preferences` then
206
+ `update_semantic_model_business_preferences` (dedicated pair below).
207
+ `agentEnabled` and other model fields → `update_semantic_model`.
208
+ `update_semantic_model` is the fallback for prefs if the dedicated tools
209
+ are unavailable.
210
+
211
+ Send a **sparse** update for dimensions/measures — only the fields you're
212
+ changing (e.g. just `description`), but always echo `isVisible` and
213
+ `dataObjectFieldName`. First read the exact apiName back with the matching
214
+ `list_*` call (`list_semantic_model_dimensions` / `_measures` / `_metrics`);
215
+ a sparse update aimed at an assumed or suffixed name silently misses (see
216
+ gate G3). Prefs write is the opposite: full replacement of the string, not
217
+ sparse.
218
+
219
+ **Anti-patterns to catch:**
220
+ - `"This field contains the region."` → restates the field name → bad
221
+ - Same description on two fields → ambiguity → bad
222
+ - `"Values: A, B, C"` without stating what A/B/C mean → incomplete
223
+
224
+ ---
225
+
226
+ ## Label Quality Guide
227
+
228
+ - The combination of **object name + field label** must unambiguously
229
+ identify the field's role and purpose.
230
+ - Bare labels like `"ID"` or `"Name"` are acceptable on well-named objects
231
+ (e.g. `Customer.ID` is interpretable). On ambiguously named objects, they
232
+ cause confusion.
233
+ - Avoid abbreviations — agents are trained on full words, not internal codes.
234
+ - Never use generic labels like `"Calc1"`, `"Measure2"`, `"Field3"`.
235
+
236
+ ## API Name Quality Guide
237
+
238
+ - **apiNames are immutable after creation** — they cannot be edited in the
239
+ semantic model after the object or field is created. Choose them
240
+ thoughtfully; the only fix for a bad apiName is delete-and-recreate.
241
+ - Choose **descriptive apiNames**, not just syntactically valid ones. An
242
+ apiName like `Gross_Margin_Pct` is more interpretable to agents than `GM1`
243
+ or `Calc3` even if both are valid. The API name is used by agents alongside
244
+ the label.
245
+ - This applies to model apiNames, data object apiNames, and calculated
246
+ field/metric apiNames — all are immutable post-create.
247
+
248
+ ---
249
+
250
+ ## Ambiguity Management
251
+
252
+ Agents analyze the full set of component properties when interpreting a
253
+ semantic model. Ambiguity commonly arises from:
254
+
255
+ - **Overlapping descriptions** — vague or identical descriptions that fail to
256
+ clarify distinct roles. Common cause: copy-pasting.
257
+ - **Similar business context** — same concept appearing in multiple tables
258
+ (e.g. "Customer Region" on Orders Header vs. Order Line). Differentiate in
259
+ description which table's version to use for which analysis.
260
+ - **Similar calculations** — calculated fields with overlapping formulas, or
261
+ metrics differing only by a filter. Agents read formula definitions directly
262
+ and can be confused even when labels are clear.
263
+ - **Synonyms** — two fields with different names representing the same concept
264
+ (e.g. `Revenue` and `Total_Sales` meaning the same thing). Use one; hide or
265
+ remove the other, or describe clearly which is the canonical field. When
266
+ asked to create two fields in the same request with the same or equivalent
267
+ formula, identify one as canonical, decline the other, or ask the user which
268
+ to keep — do not silently create both.
269
+ - **Homonyms** — two fields with the same or similar names representing
270
+ different concepts (e.g. `Date` meaning Purchase Date on one object and
271
+ Transaction Date on another). Disambiguate with object-qualified descriptions
272
+ that clarify which date is meant on each object.
273
+ - **Same object, different purpose** — a generic `Date` field in the model
274
+ used for both Purchase Date and Transaction Date contexts. Split into two
275
+ calculated dimensions with distinct labels and descriptions.
276
+ - **Same object, different granularity** — a fact table that appears twice at
277
+ different grain levels (e.g. Order Lines for detail drill-down vs. an
278
+ aggregated Order Lines for performance). Differentiate them explicitly in
279
+ the object description and label; state which grain each represents.
280
+ - **Island objects** — objects with no relationships to the rest of the model.
281
+ Agents may attempt to query them as if they were connected.
282
+
283
+ **Mitigation:** Run the Semantic Model AI Optimization similarity scan
284
+ periodically. Resolve `modelHealth: Low` before deploying to AI users.
285
+
286
+ ---
287
+
288
+ ## Field Type Accuracy
289
+
290
+ Agentforce for Analytics evaluates eight properties per field when interpreting
291
+ a model: Object Name, Object Description, Field Display Name, Field
292
+ Descriptions, Field Data Type, Field Role, Sample Values, and
293
+ object/field relationships. Ensure each is correct.
294
+
295
+ - **Data type:** Date columns must use `dataType: "Date"` or `"DateTime"`, not
296
+ `"Text"`. Agents cannot perform time-based analysis on dates stored as strings.
297
+ - **Semantic role (measure vs. dimension):** Numeric measures must be classified
298
+ as measures, not dimensions. This signals how agents should apply the field —
299
+ aggregate vs. filter. A numeric field typed as a dimension will not aggregate
300
+ correctly in agent-generated queries.
301
+ - **Sample values:** Agents use sample values to infer the meaning and range of
302
+ a field when descriptions are vague. Ensure the underlying data is populated
303
+ (Step 2 row gate) — agents cannot reason about an empty field.
304
+ - Validate all field mappings before marking a model AI-ready.
305
+
306
+ ---
307
+
308
+ ## businessPreferences Examples
309
+
310
+ The `businessPreferences` field is a single string: **one preference per
311
+ line, each line beginning with `# `** (hash + space), matching the Edit
312
+ Business Preferences UI and the dedicated get/update tools. Do not join
313
+ statements with inline `#` delimiters.
314
+
315
+ ```text
316
+ # Revenue = sum of Amount on closed-won opportunities only
317
+ # Stage names are 0-Prospecting, 1-Qualification, 2-Value Proposition, 3-Id. Decision Makers, 4-Perception Analysis, 5-Proposal/Price Quote, 6-Closed Won
318
+ # Region refers to the sales territory assignment on the Account record, not the billing address geography
319
+ ```
320
+
321
+ Set this via `create_semantic_model` (if the API accepts it at create time)
322
+ or, after creation, via the dedicated read/write pair below. Same `# `-
323
+ prefixed-line format on either path. `update_semantic_model` is the
324
+ fallback if the dedicated tools are unavailable.
325
+
326
+ ## businessPreferences read / write tools
327
+
328
+ Prefer these over `get_semantic_model` / `update_semantic_model` when the
329
+ only change is preferences — they leave the rest of the model untouched.
330
+
331
+ **Read — `get_semantic_model_business_preferences`.** Always pass
332
+ `includeModelContent=false` so only the profile is returned, not the full
333
+ model. Returns `businessPreferences` (a single string: one preference per
334
+ line, each line beginning with `# `, matching the Edit Business Preferences
335
+ UI) and `isBusinessPreferencesInherited` (`true` when the value comes from
336
+ a base model, `false` when this model has its own, **absent** when the
337
+ model extends nothing). Prefer this over `get_semantic_model` when you
338
+ don't need model content. To draft a candidate without saving, use
339
+ `generate_business_preference`, then persist with the dedicated write tool
340
+ below.
341
+
342
+ **Write — `update_semantic_model_business_preferences`.** FULL REPLACEMENT
343
+ of the preferences string, not a merge — GET first, then send back the
344
+ complete new value. Send **only** `businessPreferences` (do not include
345
+ label, description, data objects, etc.). One preference per line, each
346
+ beginning with `# `. Up to 30000 characters. Empty string **clears** all
347
+ preferences; **omitting** the field leaves them unchanged. Writing
348
+ preferences on a model that inherits them overrides the inherited value
349
+ rather than editing the base model — the result has
350
+ `isBusinessPreferencesInherited: false`. Not for changing the model graph
351
+ (`add_semantic_model_*` / `update_semantic_model_*` entity tools).
352
+
353
+ Both tools may double-wrap as
354
+ `{"defaultExc": "<stringified JSON>", "responseCode": <number>}` — parse
355
+ `JSON.parse(response.defaultExc)` for the body.
@@ -0,0 +1,111 @@
1
+ # Data alerts — payloads and gotchas
2
+
3
+ Load this from `tasks/manage-alert.md`. Not a first hop.
4
+
5
+ Ongoing **monitors**, not one-off questions. `analyze_data` answers "why did
6
+ EMEA sales drop"; these tools persist a watch. Do **not** mix the two files.
7
+
8
+ The MCP tools are namespaced per server — names here are bare; use whichever
9
+ server prefix is connected.
10
+
11
+ ## Contents
12
+
13
+ - `create_alert` / `update_alert` — NL monitor; preview then `userConfirmed`
14
+ - `get_alerts` — list / poll / resolve `savedDataAlertId`
15
+ - `delete_alert` — irreversible; same preview ritual
16
+
17
+ Live sidecars **clear** `targetEntityId`, `targetEntityType`, and
18
+ `targetEntityState` before delegation — **do not look up or pin an SDM**.
19
+
20
+ ---
21
+
22
+ ## Shared ritual (create and update)
23
+
24
+ **`conversationContext` (required).** First turn: the user's request as
25
+ plain text, e.g. "alert me when EMEA bookings drop more than 10% week over
26
+ week". On a **follow-up** (after `clarificationNeeded`, or when confirming
27
+ a preview), send the **full prior transcript** as a JSON array of turns in
28
+ chronological order:
29
+
30
+ ```json
31
+ [{"role":"USER","value":"..."},{"role":"AGENT","value":"..."}]
32
+ ```
33
+
34
+ Include your previous question as an `AGENT` turn and the user's reply as
35
+ the last `USER` element. Do **not** send only the latest message on a
36
+ follow-up — the backend needs prior turns to resolve what was agreed.
37
+
38
+ **Preview.** First call returns `confirmationRequired` + `alertSummary`.
39
+ Show that to the user, then retry with `userConfirmed=true`. Do not set
40
+ `userConfirmed` on the first call.
41
+
42
+ **Never display `savedDataAlertId`.** It is an internal id for follow-up
43
+ edits. Share `manageAlertsLink` (when returned) so the user can view, edit,
44
+ or delete the alert in the UI.
45
+
46
+ **Timeout ≠ failure.** The create/edit may still apply in the backend.
47
+ Retrying on a timeout can **duplicate**. Poll `get_alerts` a few times to
48
+ verify; do not immediately re-call create/update.
49
+
50
+ ---
51
+
52
+ ## `create_alert`
53
+
54
+ New monitor from a natural-language description.
55
+
56
+ **Required:** `conversationContext` (above). Do **not** pin
57
+ `targetEntityId` / `targetEntityType` / `targetEntityState`.
58
+
59
+ **Returns:** preview fields on the first call; once created:
60
+ `savedDataAlertId`, `explanatoryReasoning`, and (when present)
61
+ `manageAlertsLink`; or `clarificationNeeded`.
62
+
63
+ **Use when:** the user wants ongoing monitoring of a metric.
64
+
65
+ ---
66
+
67
+ ## `update_alert`
68
+
69
+ **FULL REPLACEMENT** of the alert's configuration, not a merge — anything
70
+ you omit is dropped. The alert keeps its id, subscriptions, and external
71
+ references.
72
+
73
+ **Required:** `savedDataAlertId` from `get_alerts`; `conversationContext` —
74
+ the **complete** desired configuration, not just the delta (e.g. "alert me
75
+ when EMEA bookings drop more than 15% week over week, checked every
76
+ Monday"). Same follow-up transcript rule. Do **not** pin an SDM.
77
+
78
+ **Returns:** `confirmationRequired` + `alertSummary` first (show it, then
79
+ retry with `userConfirmed=true`); `savedDataAlertId` (unchanged) and
80
+ `explanatoryReasoning` once applied; or `clarificationNeeded` if more
81
+ detail is needed or the alert can't be edited this way (delete and
82
+ recreate). Never display `savedDataAlertId`. `manageAlertsLink` is a
83
+ **create** return — do not expect it on update.
84
+
85
+ Confirm the id with `get_alerts` first. Timeout → poll `get_alerts`.
86
+
87
+ ---
88
+
89
+ ## `get_alerts`
90
+
91
+ Retrieve the **caller's** existing Tableau Next data alerts (LEX,
92
+ AgentForce, MCP). Do not supply an owner.
93
+
94
+ **Returns:** items with `id`, `name`, `schedule`, `threshold` / `condition`,
95
+ and delivery destinations.
96
+
97
+ **Use when:** "what alerts do I have", resolve an id before update/delete,
98
+ or poll after a timeout.
99
+
100
+ ---
101
+
102
+ ## `delete_alert`
103
+
104
+ Permanently delete one of the **caller's** alerts by `savedDataAlertId`
105
+ (from `get_alerts`). Irreversible — the alert stops firing and cannot be
106
+ recovered.
107
+
108
+ First call returns `confirmationRequired` + `alertSummary`. Show it, then
109
+ retry with `userConfirmed=true`. Success returns `deletedDataAlertId`.
110
+
111
+ Only the caller's own alerts can be deleted.