@salesforce/afv-skills 1.7.3 → 1.7.4

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 (77) hide show
  1. package/package.json +1 -1
  2. package/skills/developing-agentforce/README.md +4 -4
  3. package/skills/developing-agentforce/SKILL.md +37 -37
  4. package/skills/developing-agentforce/assets/README-legacy.md +8 -8
  5. package/skills/developing-agentforce/assets/agent-spec-template.md +9 -9
  6. package/skills/developing-agentforce/assets/agents/README.md +4 -4
  7. package/skills/developing-agentforce/assets/agents/hello-world.agent +3 -3
  8. package/skills/developing-agentforce/assets/agents/{multi-topic.agent → multi-subagent.agent} +30 -30
  9. package/skills/developing-agentforce/assets/agents/order-service.agent +25 -25
  10. package/skills/developing-agentforce/assets/agents/production-faq.agent +12 -12
  11. package/skills/developing-agentforce/assets/agents/simple-qa.agent +8 -8
  12. package/skills/developing-agentforce/assets/agents/verification-gate.agent +19 -19
  13. package/skills/developing-agentforce/assets/components/apex-action.agent +3 -3
  14. package/skills/developing-agentforce/assets/components/error-handling.agent +7 -7
  15. package/skills/developing-agentforce/assets/components/escalation-setup.agent +11 -11
  16. package/skills/developing-agentforce/assets/components/flow-action.agent +5 -5
  17. package/skills/developing-agentforce/assets/components/n-ary-conditions.agent +11 -11
  18. package/skills/developing-agentforce/assets/components/{topic-with-actions.agent → subagent-with-actions.agent} +9 -9
  19. package/skills/developing-agentforce/assets/deterministic-routing.agent +19 -19
  20. package/skills/developing-agentforce/assets/escalation-pattern.agent +13 -13
  21. package/skills/developing-agentforce/assets/flow-action-lookup.agent +3 -3
  22. package/skills/developing-agentforce/assets/hub-and-spoke.agent +18 -18
  23. package/skills/developing-agentforce/assets/local-info-agent-annotated.agent +37 -37
  24. package/skills/developing-agentforce/assets/metadata/genai-function-apex.xml +3 -3
  25. package/skills/developing-agentforce/assets/metadata/genai-function-flow.xml +1 -1
  26. package/skills/developing-agentforce/assets/metadata/genai-plugin.xml +10 -10
  27. package/skills/developing-agentforce/assets/minimal-starter.agent +4 -4
  28. package/skills/developing-agentforce/assets/patterns/README.md +21 -21
  29. package/skills/developing-agentforce/assets/patterns/action-callbacks.agent +4 -4
  30. package/skills/developing-agentforce/assets/patterns/advanced-input-bindings.agent +1 -1
  31. package/skills/developing-agentforce/assets/patterns/bidirectional-routing.agent +25 -25
  32. package/skills/developing-agentforce/assets/patterns/critical-input-collection.agent +8 -8
  33. package/skills/developing-agentforce/assets/patterns/delegation-routing.agent +21 -21
  34. package/skills/developing-agentforce/assets/patterns/lifecycle-events.agent +8 -8
  35. package/skills/developing-agentforce/assets/patterns/llm-controlled-actions.agent +5 -5
  36. package/skills/developing-agentforce/assets/patterns/multi-step-workflow.agent +3 -3
  37. package/skills/developing-agentforce/assets/patterns/open-gate-routing.agent +59 -58
  38. package/skills/developing-agentforce/assets/patterns/procedural-instructions.agent +15 -15
  39. package/skills/developing-agentforce/assets/patterns/prompt-template-action.agent +8 -8
  40. package/skills/developing-agentforce/assets/patterns/system-instruction-overrides.agent +40 -40
  41. package/skills/developing-agentforce/assets/prompt-rag-search.agent +9 -9
  42. package/skills/developing-agentforce/assets/{template-multi-topic.agent → template-multi-subagent.agent} +25 -25
  43. package/skills/developing-agentforce/assets/{template-single-topic.agent → template-single-subagent.agent} +14 -14
  44. package/skills/developing-agentforce/assets/verification-gate.agent +16 -16
  45. package/skills/developing-agentforce/references/action-prompt-templates.md +1 -1
  46. package/skills/developing-agentforce/references/actions-reference.md +4 -4
  47. package/skills/developing-agentforce/references/agent-design-and-spec-creation.md +107 -107
  48. package/skills/developing-agentforce/references/agent-metadata-and-lifecycle.md +5 -5
  49. package/skills/developing-agentforce/references/agent-script-core-language.md +79 -79
  50. package/skills/developing-agentforce/references/{agent-topic-map-diagrams.md → agent-subagent-map-diagrams.md} +65 -65
  51. package/skills/developing-agentforce/references/agent-user-setup.md +2 -2
  52. package/skills/developing-agentforce/references/agent-validation-and-debugging.md +55 -55
  53. package/skills/developing-agentforce/references/architecture-patterns.md +33 -33
  54. package/skills/developing-agentforce/references/deploy-reference.md +1 -1
  55. package/skills/developing-agentforce/references/discover-reference.md +1 -1
  56. package/skills/developing-agentforce/references/examples.md +32 -32
  57. package/skills/developing-agentforce/references/feature-validity.md +3 -3
  58. package/skills/developing-agentforce/references/instruction-resolution.md +29 -29
  59. package/skills/developing-agentforce/references/known-issues.md +10 -10
  60. package/skills/developing-agentforce/references/minimal-examples.md +6 -6
  61. package/skills/developing-agentforce/references/production-gotchas.md +22 -22
  62. package/skills/developing-agentforce/references/safety-review-reference.md +2 -2
  63. package/skills/developing-agentforce/references/scoring-rubric.md +3 -3
  64. package/skills/observing-agentforce/SKILL.md +8 -8
  65. package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +2 -2
  66. package/skills/observing-agentforce/references/improve-reference.md +40 -40
  67. package/skills/observing-agentforce/references/issue-classification.md +47 -47
  68. package/skills/observing-agentforce/references/reproduce-reference.md +7 -7
  69. package/skills/observing-agentforce/references/stdm-queries.md +7 -7
  70. package/skills/observing-agentforce/references/stdm-schema.md +2 -2
  71. package/skills/testing-agentforce/SKILL.md +9 -9
  72. package/skills/testing-agentforce/assets/basic-test-spec.yaml +4 -0
  73. package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +4 -0
  74. package/skills/testing-agentforce/assets/standard-test-spec.yaml +8 -4
  75. package/skills/testing-agentforce/references/batch-testing.md +17 -17
  76. package/skills/testing-agentforce/references/preview-testing.md +25 -25
  77. package/skills/testing-agentforce/references/test-report-format.md +6 -6
@@ -1,7 +1,7 @@
1
- # Multi-Topic Agent Template
1
+ # Multi-Subagent Template
2
2
  # Copy this file to your AiAuthoringBundle directory and rename it to match
3
3
  # your agent's developer_name. Replace all placeholder values with real ones.
4
- # Add, remove, or rename topics as needed.
4
+ # Add, remove, or rename subagents as needed.
5
5
 
6
6
  system:
7
7
  instructions: "You are a helpful assistant. Describe the agent's persona and purpose here."
@@ -27,23 +27,23 @@ language:
27
27
  additional_locales: ""
28
28
  all_additional_locales: False
29
29
 
30
- start_agent topic_selector:
31
- description: "Welcome the user and determine the appropriate topic based on user input"
30
+ start_agent agent_router:
31
+ description: "Welcome the user and determine the appropriate subagent based on user input"
32
32
  reasoning:
33
33
  actions:
34
- go_to_topic_a: @utils.transition to @topic.topic_a
35
- go_to_topic_b: @utils.transition to @topic.topic_b
36
- go_to_topic_c: @utils.transition to @topic.topic_c
37
- go_to_escalation: @utils.transition to @topic.escalation
38
- go_to_off_topic: @utils.transition to @topic.off_topic
34
+ go_to_subagent_a: @utils.transition to @subagent.subagent_a
35
+ go_to_subagent_b: @utils.transition to @subagent.subagent_b
36
+ go_to_subagent_c: @utils.transition to @subagent.subagent_c
37
+ go_to_escalation: @utils.transition to @subagent.escalation
38
+ go_to_off_topic: @utils.transition to @subagent.off_topic
39
39
 
40
- topic topic_a:
41
- label: "Topic A"
42
- description: "Describe what this topic handles"
40
+ subagent subagent_a:
41
+ label: "Subagent A"
42
+ description: "Describe what this subagent handles"
43
43
 
44
44
  reasoning:
45
45
  instructions: ->
46
- | Replace this with instructions for topic A.
46
+ | Replace this with instructions for subagent A.
47
47
 
48
48
  actions:
49
49
  action_a: @actions.action_a
@@ -66,13 +66,13 @@ topic topic_a:
66
66
  is_displayable: True
67
67
  filter_from_agent: False
68
68
 
69
- topic topic_b:
70
- label: "Topic B"
71
- description: "Describe what this topic handles"
69
+ subagent subagent_b:
70
+ label: "Subagent B"
71
+ description: "Describe what this subagent handles"
72
72
 
73
73
  reasoning:
74
74
  instructions: ->
75
- | Replace this with instructions for topic B. This topic demonstrates the gating pattern.
75
+ | Replace this with instructions for subagent B. This subagent demonstrates the gating pattern.
76
76
 
77
77
  actions:
78
78
  # Collect data into a variable first
@@ -102,13 +102,13 @@ topic topic_b:
102
102
  label: "Result"
103
103
  is_displayable: False
104
104
 
105
- topic topic_c:
106
- label: "Topic C"
107
- description: "Describe what this topic handles"
105
+ subagent subagent_c:
106
+ label: "Subagent C"
107
+ description: "Describe what this subagent handles"
108
108
 
109
109
  reasoning:
110
110
  instructions: ->
111
- | Replace this with base instructions for topic C.
111
+ | Replace this with base instructions for subagent C.
112
112
 
113
113
  # Conditional instructions based on variable state
114
114
  if @variables.collected_input != "":
@@ -139,7 +139,7 @@ topic topic_c:
139
139
  is_displayable: True
140
140
  filter_from_agent: False
141
141
 
142
- topic escalation:
142
+ subagent escalation:
143
143
  label: "Escalation"
144
144
  description: "Handles requests from users who want to transfer or escalate their conversation to a live human agent."
145
145
 
@@ -150,11 +150,11 @@ topic escalation:
150
150
  escalate_to_human: @utils.escalate
151
151
  description: "Escalate to a human agent."
152
152
 
153
- topic off_topic:
153
+ subagent off_topic:
154
154
  label: "Off Topic"
155
- description: "Redirect conversation to relevant topics when user request goes off-topic"
155
+ description: "Redirect conversation to relevant subagents when user request goes off-topic"
156
156
 
157
157
  reasoning:
158
158
  instructions: ->
159
159
  | The user request is off-topic. Do not answer general knowledge questions.
160
- Redirect the conversation by asking how you can help with topics this agent supports.
160
+ Redirect the conversation by asking how you can help with the subagents this agent supports.
@@ -1,4 +1,4 @@
1
- # Single-Topic Agent Template
1
+ # Single-Subagent Template
2
2
  # Copy this file to your AiAuthoringBundle directory and rename it to match
3
3
  # your agent's developer_name. Replace all placeholder values with real ones.
4
4
 
@@ -22,21 +22,21 @@ language:
22
22
  additional_locales: ""
23
23
  all_additional_locales: False
24
24
 
25
- start_agent topic_selector:
26
- description: "Welcome the user and determine the appropriate topic based on user input"
25
+ start_agent agent_router:
26
+ description: "Welcome the user and determine the appropriate subagent based on user input"
27
27
  reasoning:
28
28
  actions:
29
- go_to_main: @utils.transition to @topic.main
30
- go_to_escalation: @utils.transition to @topic.escalation
31
- go_to_off_topic: @utils.transition to @topic.off_topic
29
+ go_to_main: @utils.transition to @subagent.main
30
+ go_to_escalation: @utils.transition to @subagent.escalation
31
+ go_to_off_topic: @utils.transition to @subagent.off_topic
32
32
 
33
- topic main:
34
- label: "Main Topic"
35
- description: "Describe what this topic handles. The Atlas Reasoning Engine matches user utterances against this description."
33
+ subagent main:
34
+ label: "Main Subagent"
35
+ description: "Describe what this subagent handles. The Atlas Reasoning Engine matches user utterances against this description."
36
36
 
37
37
  reasoning:
38
38
  instructions: ->
39
- | Replace this with instructions for how the agent should handle requests in this topic.
39
+ | Replace this with instructions for how the agent should handle requests in this subagent.
40
40
  Reference actions with the syntax shown below.
41
41
 
42
42
  actions:
@@ -60,7 +60,7 @@ topic main:
60
60
  is_displayable: True
61
61
  filter_from_agent: False
62
62
 
63
- topic escalation:
63
+ subagent escalation:
64
64
  label: "Escalation"
65
65
  description: "Handles requests from users who want to transfer or escalate their conversation to a live human agent."
66
66
 
@@ -71,11 +71,11 @@ topic escalation:
71
71
  escalate_to_human: @utils.escalate
72
72
  description: "Escalate to a human agent."
73
73
 
74
- topic off_topic:
74
+ subagent off_topic:
75
75
  label: "Off Topic"
76
- description: "Redirect conversation to relevant topics when user request goes off-topic"
76
+ description: "Redirect conversation to relevant subagents when user request goes off-topic"
77
77
 
78
78
  reasoning:
79
79
  instructions: ->
80
80
  | The user request is off-topic. Do not answer general knowledge questions.
81
- Redirect the conversation by asking how you can help with topics this agent supports.
81
+ Redirect the conversation by asking how you can help with the subagents this agent supports.
@@ -2,7 +2,7 @@
2
2
  # ========================================
3
3
  #
4
4
  # This template demonstrates the Verification Gate pattern where users
5
- # must pass through identity verification before accessing sensitive topics.
5
+ # must pass through identity verification before accessing sensitive subagents.
6
6
  #
7
7
  # Pattern: Security gate before protected functionality
8
8
  # Use when: Handling sensitive data, payments, PII access
@@ -56,23 +56,23 @@ start_agent entry:
56
56
  instructions: |
57
57
  Welcome the customer and route to identity verification.
58
58
  actions:
59
- start_verification: @utils.transition to @topic.identity_verification
59
+ start_verification: @utils.transition to @subagent.identity_verification
60
60
  description: "Begin identity verification process"
61
61
 
62
62
  # ============================================================
63
63
  # VERIFICATION GATE (Security Check)
64
64
  # ============================================================
65
65
 
66
- topic identity_verification:
66
+ subagent identity_verification:
67
67
  description: "Verify customer identity before proceeding"
68
68
  reasoning:
69
69
  instructions: ->
70
70
  # SECURITY: Check for lockout FIRST (deterministic)
71
71
  if @variables.failed_attempts >= 3:
72
72
  | Too many failed attempts. Transferring to a human agent.
73
- transition to @topic.escalation
73
+ transition to @subagent.escalation
74
74
 
75
- # Already verified? Proceed to protected topics
75
+ # Already verified? Proceed to protected subagents
76
76
  if @variables.customer_verified == True:
77
77
  | Identity verified! How can I help you today?
78
78
 
@@ -88,11 +88,11 @@ topic identity_verification:
88
88
  set @variables.customer_verified = @outputs.verified
89
89
 
90
90
  # GUARDED: Only visible when verified
91
- go_to_account: @utils.transition to @topic.account_management
91
+ go_to_account: @utils.transition to @subagent.account_management
92
92
  description: "Access account settings"
93
93
  available when @variables.customer_verified == True
94
94
 
95
- go_to_refund: @utils.transition to @topic.refund_processor
95
+ go_to_refund: @utils.transition to @subagent.refund_processor
96
96
  description: "Process a refund request"
97
97
  available when @variables.customer_verified == True
98
98
 
@@ -104,13 +104,13 @@ topic identity_verification:
104
104
  # PROTECTED: Account Management
105
105
  # ============================================================
106
106
 
107
- topic account_management:
107
+ subagent account_management:
108
108
  description: "Manage customer account (requires verification)"
109
109
  reasoning:
110
110
  instructions: ->
111
111
  # SECURITY GATE: Re-check verification
112
112
  if @variables.customer_verified == False:
113
- transition to @topic.identity_verification
113
+ transition to @subagent.identity_verification
114
114
 
115
115
  | Welcome to account management.
116
116
  | What would you like to do with your account?
@@ -122,20 +122,20 @@ topic account_management:
122
122
  update_preferences: @actions.update_preferences
123
123
  description: "Update communication preferences"
124
124
  available when @variables.customer_verified == True
125
- back: @utils.transition to @topic.identity_verification
125
+ back: @utils.transition to @subagent.identity_verification
126
126
  description: "Return to main menu"
127
127
 
128
128
  # ============================================================
129
129
  # PROTECTED: Refund Processor (with Post-Action Pattern)
130
130
  # ============================================================
131
131
 
132
- topic refund_processor:
132
+ subagent refund_processor:
133
133
  description: "Process refund requests (requires verification)"
134
134
  reasoning:
135
135
  instructions: ->
136
136
  # SECURITY GATE: Re-check verification
137
137
  if @variables.customer_verified == False:
138
- transition to @topic.identity_verification
138
+ transition to @subagent.identity_verification
139
139
 
140
140
  # ====================================================
141
141
  # POST-ACTION CHECK (at TOP - triggers on loop)
@@ -145,7 +145,7 @@ topic refund_processor:
145
145
  run @actions.create_crm_case
146
146
  with customer_id = @variables.customer_id
147
147
  with refund_amount = @variables.refund_amount
148
- transition to @topic.success_confirmation
148
+ transition to @subagent.success_confirmation
149
149
 
150
150
  # ====================================================
151
151
  # PRE-LLM: Load churn risk data
@@ -181,14 +181,14 @@ topic refund_processor:
181
181
  # SUCCESS CONFIRMATION
182
182
  # ============================================================
183
183
 
184
- topic success_confirmation:
184
+ subagent success_confirmation:
185
185
  description: "Confirm successful operation"
186
186
  reasoning:
187
187
  instructions: |
188
188
  Great news! Your request has been processed successfully.
189
189
  Is there anything else I can help you with?
190
190
  actions:
191
- new_request: @utils.transition to @topic.identity_verification
191
+ new_request: @utils.transition to @subagent.identity_verification
192
192
  description: "Start a new request"
193
193
  end_conversation: @actions.end_session
194
194
  description: "End the conversation"
@@ -197,7 +197,7 @@ topic success_confirmation:
197
197
  # ESCALATION (Handoff to Human)
198
198
  # ============================================================
199
199
 
200
- topic escalation:
200
+ subagent escalation:
201
201
  description: "Escalate to human agent"
202
202
  reasoning:
203
203
  instructions: |
@@ -50,7 +50,7 @@ actions:
50
50
  Reference the action definition in your `.agent` file:
51
51
 
52
52
  ```agentscript
53
- topic schedule_generation:
53
+ subagent schedule_generation:
54
54
  reasoning:
55
55
  actions:
56
56
  generate_schedule: @actions.Generate_Personalized_Schedule
@@ -146,7 +146,7 @@ Agent Script provides two ways to invoke actions:
146
146
  The LLM automatically selects appropriate actions from those defined in the `reasoning.actions` block:
147
147
 
148
148
  ```agentscript
149
- topic order_management:
149
+ subagent order_management:
150
150
  description: "Handles order inquiries"
151
151
 
152
152
  reasoning:
@@ -355,7 +355,7 @@ public with sharing class CalculateDiscountAction {
355
355
  #### Step 2: Reference DIRECTLY in Agent Script via `apex://`
356
356
 
357
357
  ```yaml
358
- topic discount_calculator:
358
+ subagent discount_calculator:
359
359
  description: "Calculates discount for customer order"
360
360
 
361
361
  # Level 1: Action DEFINITION with target
@@ -494,7 +494,7 @@ public class WrappedAction {
494
494
 
495
495
  The `connection` block enables escalation to human agents via Omni-Channel. Always use `connection messaging:` (singular).
496
496
 
497
- > **Service agents only.** The `connection messaging:` block and `@utils.escalate` are only valid for `AgentforceServiceAgent`. Employee agents (`AgentforceEmployeeAgent`) MUST NOT include a `connection` block or `@utils.escalate` actions — including them causes silent failures or "unknown error" at publish time. For employee agents, use `@utils.transition` to a help topic or an action that creates a support case instead.
497
+ > **Service agents only.** The `connection messaging:` block and `@utils.escalate` are only valid for `AgentforceServiceAgent`. Employee agents (`AgentforceEmployeeAgent`) MUST NOT include a `connection` block or `@utils.escalate` actions — including them causes silent failures or "unknown error" at publish time. For employee agents, use `@utils.transition` to a help subagent or an action that creates a support case instead.
498
498
 
499
499
  ### Basic Syntax
500
500
 
@@ -588,7 +588,7 @@ When building agents with external API integrations, follow this order:
588
588
 
589
589
  | Issue | Cause | Solution |
590
590
  |-------|-------|----------|
591
- | `Tool target 'X' is not an action definition` | Action not defined in topic `actions:` block, or target doesn't exist in org | Define action with `target:` in topic-level `actions:` block; ensure Apex class/Flow is deployed |
591
+ | `Tool target 'X' is not an action definition` | Action not defined in subagent `actions:` block, or target doesn't exist in org | Define action with `target:` in subagent-level `actions:` block; ensure Apex class/Flow is deployed |
592
592
  | `invalid input 'X'` or `invalid output 'X'` | I/O name doesn't match `@InvocableVariable` field name in Apex | Use exact field names from the Apex wrapper class (case-sensitive) |
593
593
  | `Internal Error` with inputs-only action | Action has `inputs:` but no `outputs:` block | Add `outputs:` block — the server-side compiler requires it (see known-issues.md Issue 15) |
594
594
  | `Internal Error` with bare @InvocableMethod | Apex uses `List<String>` without `@InvocableVariable` wrappers | Refactor Apex to use wrapper classes with `@InvocableVariable` annotations |