@salesforce/afv-skills 1.6.9 → 1.7.1

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 (94) hide show
  1. package/README.md +28 -23
  2. package/package.json +1 -1
  3. package/skills/developing-agentforce/README.md +112 -0
  4. package/skills/{agentforce-development → developing-agentforce}/SKILL.md +109 -16
  5. package/skills/{agentforce-development → developing-agentforce}/assets/agents/README.md +2 -2
  6. package/skills/developing-agentforce/assets/agents/order-service.agent +272 -0
  7. package/skills/developing-agentforce/assets/agents/verification-gate.agent +280 -0
  8. package/skills/{agentforce-development → developing-agentforce}/assets/bundle-meta.xml +1 -1
  9. package/skills/{agentforce-development → developing-agentforce}/references/actions-reference.md +20 -0
  10. package/skills/{agentforce-development → developing-agentforce}/references/agent-design-and-spec-creation.md +1 -1
  11. package/skills/{agentforce-development → developing-agentforce}/references/agent-metadata-and-lifecycle.md +3 -3
  12. package/skills/{agentforce-development → developing-agentforce}/references/agent-script-core-language.md +40 -3
  13. package/skills/{agentforce-development → developing-agentforce}/references/agent-user-setup.md +60 -57
  14. package/skills/{agentforce-development → developing-agentforce}/references/agent-validation-and-debugging.md +22 -20
  15. package/skills/developing-agentforce/references/architecture-patterns.md +158 -0
  16. package/skills/developing-agentforce/references/complex-data-types.md +57 -0
  17. package/skills/developing-agentforce/references/deploy-reference.md +134 -0
  18. package/skills/developing-agentforce/references/discover-reference.md +102 -0
  19. package/skills/developing-agentforce/references/examples.md +350 -0
  20. package/skills/developing-agentforce/references/feature-validity.md +43 -0
  21. package/skills/developing-agentforce/references/instruction-resolution.md +545 -0
  22. package/skills/{agentforce-development → developing-agentforce}/references/known-issues.md +18 -18
  23. package/skills/{agentforce-development → developing-agentforce}/references/production-gotchas.md +24 -3
  24. package/skills/developing-agentforce/references/safety-review-reference.md +145 -0
  25. package/skills/{agentforce-development → developing-agentforce}/references/salesforce-cli-for-agents.md +9 -7
  26. package/skills/developing-agentforce/references/scaffold-reference.md +153 -0
  27. package/skills/developing-agentforce/references/scoring-rubric.md +24 -0
  28. package/skills/{agentforce-development → developing-agentforce}/references/version-history.md +2 -2
  29. package/skills/generating-flow/SKILL.md +3 -1
  30. package/skills/observing-agentforce/SKILL.md +368 -0
  31. package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +1262 -0
  32. package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls-meta.xml +5 -0
  33. package/skills/observing-agentforce/references/improve-reference.md +359 -0
  34. package/skills/observing-agentforce/references/issue-classification.md +220 -0
  35. package/skills/observing-agentforce/references/reproduce-reference.md +131 -0
  36. package/skills/observing-agentforce/references/stdm-queries.md +381 -0
  37. package/skills/observing-agentforce/references/stdm-schema.md +189 -0
  38. package/skills/testing-agentforce/SKILL.md +335 -0
  39. package/skills/testing-agentforce/assets/basic-test-spec.yaml +59 -0
  40. package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +101 -0
  41. package/skills/testing-agentforce/assets/standard-test-spec.yaml +123 -0
  42. package/skills/testing-agentforce/references/action-execution.md +241 -0
  43. package/skills/testing-agentforce/references/batch-testing.md +274 -0
  44. package/skills/testing-agentforce/references/preview-testing.md +353 -0
  45. package/skills/testing-agentforce/references/test-report-format.md +160 -0
  46. package/skills/testing-agentforce/references/troubleshooting.md +73 -0
  47. /package/skills/{agentforce-development → developing-agentforce}/assets/README-legacy.md +0 -0
  48. /package/skills/{agentforce-development → developing-agentforce}/assets/agent-spec-template.md +0 -0
  49. /package/skills/{agentforce-development → developing-agentforce}/assets/agents/hello-world.agent +0 -0
  50. /package/skills/{agentforce-development → developing-agentforce}/assets/agents/multi-topic.agent +0 -0
  51. /package/skills/{agentforce-development → developing-agentforce}/assets/agents/production-faq.agent +0 -0
  52. /package/skills/{agentforce-development → developing-agentforce}/assets/agents/production-faq.bundle-meta.xml +0 -0
  53. /package/skills/{agentforce-development → developing-agentforce}/assets/agents/simple-qa.agent +0 -0
  54. /package/skills/{agentforce-development → developing-agentforce}/assets/apex/models-api-queueable.cls +0 -0
  55. /package/skills/{agentforce-development → developing-agentforce}/assets/components/apex-action.agent +0 -0
  56. /package/skills/{agentforce-development → developing-agentforce}/assets/components/error-handling.agent +0 -0
  57. /package/skills/{agentforce-development → developing-agentforce}/assets/components/escalation-setup.agent +0 -0
  58. /package/skills/{agentforce-development → developing-agentforce}/assets/components/flow-action.agent +0 -0
  59. /package/skills/{agentforce-development → developing-agentforce}/assets/components/n-ary-conditions.agent +0 -0
  60. /package/skills/{agentforce-development → developing-agentforce}/assets/components/topic-with-actions.agent +0 -0
  61. /package/skills/{agentforce-development → developing-agentforce}/assets/deterministic-routing.agent +0 -0
  62. /package/skills/{agentforce-development → developing-agentforce}/assets/escalation-pattern.agent +0 -0
  63. /package/skills/{agentforce-development → developing-agentforce}/assets/flow-action-lookup.agent +0 -0
  64. /package/skills/{agentforce-development → developing-agentforce}/assets/hub-and-spoke.agent +0 -0
  65. /package/skills/{agentforce-development → developing-agentforce}/assets/invocable-apex-template.cls +0 -0
  66. /package/skills/{agentforce-development → developing-agentforce}/assets/local-info-agent-annotated.agent +0 -0
  67. /package/skills/{agentforce-development → developing-agentforce}/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +0 -0
  68. /package/skills/{agentforce-development → developing-agentforce}/assets/metadata/genai-function-apex.xml +0 -0
  69. /package/skills/{agentforce-development → developing-agentforce}/assets/metadata/genai-function-flow.xml +0 -0
  70. /package/skills/{agentforce-development → developing-agentforce}/assets/metadata/genai-plugin.xml +0 -0
  71. /package/skills/{agentforce-development → developing-agentforce}/assets/metadata/http-callout-flow.flow-meta.xml +0 -0
  72. /package/skills/{agentforce-development → developing-agentforce}/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +0 -0
  73. /package/skills/{agentforce-development → developing-agentforce}/assets/minimal-starter.agent +0 -0
  74. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/README.md +0 -0
  75. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/action-callbacks.agent +0 -0
  76. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/advanced-input-bindings.agent +0 -0
  77. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/bidirectional-routing.agent +0 -0
  78. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/critical-input-collection.agent +0 -0
  79. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/delegation-routing.agent +0 -0
  80. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/lifecycle-events.agent +0 -0
  81. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/llm-controlled-actions.agent +0 -0
  82. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/multi-step-workflow.agent +0 -0
  83. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/open-gate-routing.agent +0 -0
  84. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/procedural-instructions.agent +0 -0
  85. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/prompt-template-action.agent +0 -0
  86. /package/skills/{agentforce-development → developing-agentforce}/assets/patterns/system-instruction-overrides.agent +0 -0
  87. /package/skills/{agentforce-development → developing-agentforce}/assets/prompt-rag-search.agent +0 -0
  88. /package/skills/{agentforce-development → developing-agentforce}/assets/template-multi-topic.agent +0 -0
  89. /package/skills/{agentforce-development → developing-agentforce}/assets/template-single-topic.agent +0 -0
  90. /package/skills/{agentforce-development → developing-agentforce}/assets/verification-gate.agent +0 -0
  91. /package/skills/{agentforce-development → developing-agentforce}/references/action-prompt-templates.md +0 -0
  92. /package/skills/{agentforce-development → developing-agentforce}/references/agent-access-guide.md +0 -0
  93. /package/skills/{agentforce-development → developing-agentforce}/references/agent-topic-map-diagrams.md +0 -0
  94. /package/skills/{agentforce-development → developing-agentforce}/references/minimal-examples.md +0 -0
@@ -0,0 +1,350 @@
1
+ # Complete Agent Examples
2
+
3
+ > Extracted from SKILL.md Sections 9 + 10. This file is loaded on demand when complete agent examples are needed.
4
+
5
+ ## Minimal Service Agent
6
+
7
+ This is the absolute minimum for a deployable service agent:
8
+
9
+ ```
10
+ system:
11
+ instructions: "You are a helpful customer service agent."
12
+ messages:
13
+ welcome: "Hello! How can I help you today?"
14
+ error: "Something went wrong. Please try again."
15
+
16
+ config:
17
+ developer_name: "MinimalAgent"
18
+ agent_label: "Minimal Agent"
19
+ description: "A minimal service agent"
20
+ default_agent_user: "agent@00dxx000001234.ext"
21
+
22
+ variables:
23
+ EndUserId: linked string
24
+ source: @MessagingSession.MessagingEndUserId
25
+ description: "Messaging End User ID"
26
+ visibility: "External"
27
+ RoutableId: linked string
28
+ source: @MessagingSession.Id
29
+ description: "Messaging Session ID"
30
+ visibility: "External"
31
+ ContactId: linked string
32
+ source: @MessagingEndUser.ContactId
33
+ description: "Contact ID"
34
+ visibility: "External"
35
+
36
+ language:
37
+ default_locale: "en_US"
38
+ additional_locales: ""
39
+ all_additional_locales: False
40
+
41
+ start_agent topic_selector:
42
+ description: "Begin the onboarding flow"
43
+
44
+ topic greeting:
45
+ label: "Greeting"
46
+ description: "Greet users and provide help"
47
+ reasoning:
48
+ instructions: ->
49
+ | Welcome the user warmly.
50
+ | Ask how you can help them today.
51
+ ```
52
+
53
+ Companion `bundle-meta.xml` (MUST be this exact content -- no extra fields):
54
+ ```xml
55
+ <?xml version="1.0" encoding="UTF-8"?>
56
+ <AiAuthoringBundle xmlns="http://soap.sforce.com/2006/04/metadata">
57
+ <bundleType>AGENT</bundleType>
58
+ </AiAuthoringBundle>
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Minimal Employee Agent
64
+
65
+ Employee agents differ from service agents in their config, variables, and connection blocks. This example shows a 2-topic IT Knowledge agent deployed to internal employees.
66
+
67
+ ```
68
+ system:
69
+ instructions: |
70
+ You are an AI-powered IT assistant for Acme Corp employees.
71
+ Help employees find answers to common IT questions and
72
+ look up knowledge articles.
73
+ You are an AI assistant, not a human.
74
+ messages:
75
+ welcome: "Hi! I'm the IT Help assistant. What can I help you with?"
76
+ error: "Something went wrong. Please try again."
77
+
78
+ config:
79
+ developer_name: "IT_Knowledge_Agent"
80
+ agent_label: "IT Knowledge Agent"
81
+ description: "Internal IT knowledge base assistant for employees"
82
+ agent_type: "AgentforceEmployeeAgent"
83
+ # NOTE: No default_agent_user — employee agents run as the logged-in user.
84
+ # No connection messaging: block — employee agents have no messaging channel.
85
+ # No MessagingSession linked variables — those are service-agent-only.
86
+
87
+ variables:
88
+ search_query: mutable string = ""
89
+ description: "Current search query"
90
+ article_id: mutable string = ""
91
+ description: "Selected knowledge article ID"
92
+
93
+ language:
94
+ default_locale: "en_US"
95
+ additional_locales: ""
96
+ all_additional_locales: False
97
+
98
+ start_agent topic_selector:
99
+ description: "Route employees to the right IT support topic"
100
+ reasoning:
101
+ instructions: |
102
+ You are a router only. Do NOT answer questions directly.
103
+ Always use a transition action to route immediately.
104
+ - IT questions, troubleshooting, how-to -> use to_knowledge
105
+ - Password reset, account access -> use to_account
106
+ actions:
107
+ to_knowledge: @utils.transition to @topic.knowledge_search
108
+ description: "Search IT knowledge base"
109
+ to_account: @utils.transition to @topic.account_support
110
+ description: "Account and password help"
111
+
112
+ topic knowledge_search:
113
+ label: "Knowledge Search"
114
+ description: "Search and retrieve IT knowledge articles"
115
+
116
+ actions:
117
+ search_articles:
118
+ description: "Search knowledge base for articles"
119
+ target: "apex://ITKnowledge.searchArticles"
120
+ inputs:
121
+ query: string
122
+ description: "Search query"
123
+ outputs:
124
+ articles: string
125
+ description: "Matching articles as JSON"
126
+ is_displayable: True
127
+
128
+ reasoning:
129
+ instructions: ->
130
+ if @variables.article_id != "":
131
+ | Found article {!@variables.article_id}. Here are the details.
132
+
133
+ | Search the knowledge base using the search_articles action.
134
+ | Present results clearly. Do not fabricate article content.
135
+
136
+ actions:
137
+ search: @actions.search_articles
138
+ description: "Search knowledge base"
139
+ with query = ...
140
+ set @variables.search_query = @outputs.articles
141
+
142
+ back: @utils.transition to @topic.topic_selector
143
+ description: "Route to a different topic"
144
+
145
+ topic account_support:
146
+ label: "Account Support"
147
+ description: "Help with password resets and account access"
148
+
149
+ actions:
150
+ reset_password:
151
+ description: "Initiate password reset for employee"
152
+ target: "flow://IT_Password_Reset"
153
+ inputs:
154
+ employee_email: string
155
+ description: "Employee email address"
156
+ outputs:
157
+ status: string
158
+ description: "Reset status"
159
+ is_displayable: True
160
+
161
+ reasoning:
162
+ instructions: ->
163
+ | I can help with password resets and account access.
164
+ | Ask for the employee's email, then use the reset_password action.
165
+
166
+ actions:
167
+ reset: @actions.reset_password
168
+ description: "Reset employee password"
169
+ with employee_email = ...
170
+
171
+ # NOTE: No @utils.escalate — employee agents cannot escalate to
172
+ # human agents via messaging. Use a transition or case-creation
173
+ # action instead.
174
+ back: @utils.transition to @topic.topic_selector
175
+ description: "Route to a different topic"
176
+ ```
177
+
178
+ **What's deliberately absent (vs. service agents):**
179
+ - No `default_agent_user` in config (agent runs as logged-in employee)
180
+ - No `connection messaging:` block (no messaging channel)
181
+ - No `EndUserId`/`RoutableId`/`ContactId` linked variables (no `@MessagingSession`)
182
+ - No `@utils.escalate` action (requires `connection messaging:`)
183
+
184
+ ---
185
+
186
+ ## Multi-Topic Agent with Actions
187
+
188
+ ```
189
+ system:
190
+ instructions: |
191
+ You are a customer service agent for TechCorp.
192
+ Be professional, concise, and solution-oriented.
193
+ Always verify the customer before sensitive operations.
194
+ messages:
195
+ welcome: "Welcome to TechCorp Support! How can I assist you?"
196
+ error: "I apologize for the issue. Please try again."
197
+
198
+ config:
199
+ developer_name: "TechCorpAgent"
200
+ agent_label: "TechCorp Support Agent"
201
+ description: "Handles order inquiries, returns, and general support"
202
+ default_agent_user: "einstein@00dxx000001234.ext"
203
+
204
+ variables:
205
+ EndUserId: linked string
206
+ source: @MessagingSession.MessagingEndUserId
207
+ description: "Messaging End User ID"
208
+ visibility: "External"
209
+ RoutableId: linked string
210
+ source: @MessagingSession.Id
211
+ description: "Messaging Session ID"
212
+ visibility: "External"
213
+ ContactId: linked string
214
+ source: @MessagingEndUser.ContactId
215
+ description: "Contact ID"
216
+ visibility: "External"
217
+ order_id: mutable string = ""
218
+ description: "Current order being discussed"
219
+ order_status: mutable string = ""
220
+ description: "Status of the current order"
221
+ is_verified: mutable boolean = False
222
+ description: "Customer verification status"
223
+ case_id: mutable string = ""
224
+ description: "Created case ID"
225
+
226
+ language:
227
+ default_locale: "en_US"
228
+ additional_locales: ""
229
+ all_additional_locales: False
230
+
231
+ start_agent topic_selector:
232
+ description: "Route customers to the right support topic"
233
+ reasoning:
234
+ instructions: |
235
+ You are a router only. Do NOT answer questions or provide help directly.
236
+ Always use a transition action to route to the correct topic immediately.
237
+ - Order status or tracking -> use to_orders
238
+ - Returns or refunds -> use to_returns
239
+ - General questions -> use to_general
240
+ Never attempt to help the customer yourself. Always route.
241
+ actions:
242
+ to_orders: @utils.transition to @topic.order_support
243
+ description: "Check order status or tracking"
244
+ to_returns: @utils.transition to @topic.return_support
245
+ description: "Process a return or refund"
246
+ to_general: @utils.transition to @topic.general_support
247
+ description: "General questions and support"
248
+
249
+ topic order_support:
250
+ label: "Order Support"
251
+ description: "Handle order status and tracking inquiries"
252
+
253
+ actions:
254
+ get_order:
255
+ description: "Look up order by ID"
256
+ target: "flow://Get_Order_Status"
257
+ inputs:
258
+ order_id: string
259
+ description: "Order ID"
260
+ outputs:
261
+ status: string
262
+ description: "Order status"
263
+ is_displayable: True
264
+ tracking_url: string
265
+ description: "Tracking URL"
266
+ is_displayable: True
267
+
268
+ reasoning:
269
+ instructions: ->
270
+ if @variables.order_status != "":
271
+ | Order {!@variables.order_id} status: {!@variables.order_status}
272
+
273
+ | What is your order number? I will look it up for you.
274
+ | Use the get_order action to retrieve order details.
275
+ | Do not guess order status -- always use the action result.
276
+
277
+ actions:
278
+ lookup: @actions.get_order
279
+ description: "Look up order"
280
+ with order_id = ...
281
+ set @variables.order_id = @outputs.order_id
282
+ set @variables.order_status = @outputs.status
283
+
284
+ back: @utils.transition to @topic.topic_selector
285
+ description: "Route to a different topic"
286
+
287
+ topic return_support:
288
+ label: "Return Support"
289
+ description: "Handle returns and refund requests"
290
+
291
+ actions:
292
+ initiate_return:
293
+ description: "Start a return process"
294
+ target: "flow://Initiate_Return"
295
+ inputs:
296
+ order_id: string
297
+ description: "Order ID for the return"
298
+ reason: string
299
+ description: "Reason for return"
300
+ outputs:
301
+ return_id: string
302
+ description: "Return authorization ID"
303
+ is_displayable: True
304
+
305
+ reasoning:
306
+ instructions: ->
307
+ | I can help with your return request.
308
+ | Please provide your order number and the reason for the return.
309
+ | Use the initiate_return action to start the process -- do not fabricate return IDs.
310
+
311
+ actions:
312
+ start_return: @actions.initiate_return
313
+ description: "Start a return"
314
+ with order_id = ...
315
+ with reason = ...
316
+ set @variables.case_id = @outputs.return_id
317
+
318
+ back: @utils.transition to @topic.topic_selector
319
+ description: "Route to a different topic"
320
+
321
+ after_reasoning:
322
+ if @variables.case_id != "":
323
+ transition to @topic.confirmation
324
+
325
+ topic general_support:
326
+ label: "General Support"
327
+ description: "Handle general support questions"
328
+ reasoning:
329
+ instructions: |
330
+ Help the customer with general questions.
331
+ If the question is about orders or returns, route appropriately.
332
+ actions:
333
+ escalate_now: @utils.escalate
334
+ description: "Transfer to human agent"
335
+ back: @utils.transition to @topic.topic_selector
336
+ description: "Route to a different topic"
337
+
338
+ topic confirmation:
339
+ label: "Confirmation"
340
+ description: "Confirm the completed action"
341
+ reasoning:
342
+ instructions: ->
343
+ | Your request has been processed. Reference: {!@variables.case_id}
344
+ | Is there anything else I can help with?
345
+ actions:
346
+ new_request: @utils.transition to @topic.topic_selector
347
+ description: "Start a new request"
348
+ end_chat: @actions.end_conversation
349
+ description: "End the conversation"
350
+ ```
@@ -0,0 +1,43 @@
1
+ <!-- Parent: adlc-author/SKILL.md -->
2
+
3
+ # Feature Validity by Context
4
+
5
+ > **Key distinction**: Many action metadata properties are valid on **action definitions with targets** (`flow://`, `apex://`) but NOT on **utility actions** (`@utils.transition`).
6
+
7
+ | Feature | On `@utils.transition` | On action definitions with `target:` | Notes |
8
+ |---------|------------------------|---------------------------------------|-------|
9
+ | `label:` on topics | ❌ | ✅ | Valid on topic blocks |
10
+ | `label:` on actions | ❌ | ✅ | Valid on Level 1 action definitions |
11
+ | `label:` on I/O fields | ❌ | ✅ | Valid on inputs/outputs |
12
+ | `require_user_confirmation:` | ❌ | ✅ | Compiles; runtime no-op |
13
+ | `include_in_progress_indicator:` | ❌ | ✅ | Shows spinner during action execution |
14
+ | `progress_indicator_message:` | ❌ | ✅ | Works on both `flow://` and `apex://` |
15
+ | `output_instructions:` | ❌ | ❓ Untested | Not tested on target-backed actions |
16
+ | `always_expect_input:` | ❌ | ❌ | NOT implemented anywhere |
17
+
18
+ **What works on `@utils.transition` actions:**
19
+ ```yaml
20
+ actions:
21
+ go_next: @utils.transition to @topic.next
22
+ description: "Navigate to next topic" # ✅ ONLY description works
23
+ ```
24
+
25
+ **What works on action definitions with `target:`:**
26
+ ```yaml
27
+ actions:
28
+ process_order:
29
+ label: "Process Order" # ✅ Display label
30
+ description: "Process the customer's order" # ✅ LLM description
31
+ require_user_confirmation: True # ✅ Compiles (runtime issue)
32
+ include_in_progress_indicator: True # ✅ Shows spinner
33
+ progress_indicator_message: "Processing..." # ✅ Custom spinner message
34
+ inputs:
35
+ order_id: string
36
+ label: "Order ID" # ✅ I/O display label
37
+ description: "The order identifier"
38
+ outputs:
39
+ status: string
40
+ label: "Order Status" # ✅ I/O display label
41
+ description: "Current order status"
42
+ target: "apex://OrderProcessor"
43
+ ```