@salesforce/afv-skills 1.7.2 → 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 (78) 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/generating-custom-lightning-type/SKILL.md +12 -3
  65. package/skills/observing-agentforce/SKILL.md +8 -8
  66. package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +2 -2
  67. package/skills/observing-agentforce/references/improve-reference.md +40 -40
  68. package/skills/observing-agentforce/references/issue-classification.md +47 -47
  69. package/skills/observing-agentforce/references/reproduce-reference.md +7 -7
  70. package/skills/observing-agentforce/references/stdm-queries.md +7 -7
  71. package/skills/observing-agentforce/references/stdm-schema.md +2 -2
  72. package/skills/testing-agentforce/SKILL.md +9 -9
  73. package/skills/testing-agentforce/assets/basic-test-spec.yaml +4 -0
  74. package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +4 -0
  75. package/skills/testing-agentforce/assets/standard-test-spec.yaml +8 -4
  76. package/skills/testing-agentforce/references/batch-testing.md +17 -17
  77. package/skills/testing-agentforce/references/preview-testing.md +25 -25
  78. package/skills/testing-agentforce/references/test-report-format.md +6 -6
@@ -1,34 +1,34 @@
1
1
  # Bidirectional Routing Pattern
2
- # Navigate to a specialist topic and return with results
2
+ # Navigate to a specialist subagent and return with results
3
3
  #
4
4
  # ★ When To Use This Pattern:
5
- # - Main topic needs specialized processing then returns
5
+ # - Main subagent needs specialized processing then returns
6
6
  # - "Consult a specialist" pattern (like asking an expert)
7
7
  # - Complex workflows where you leave, do work, then come back
8
- # - Alternative to cramming everything into one topic
8
+ # - Alternative to cramming everything into one subagent
9
9
  #
10
10
  # ★ Key Insight:
11
11
  # Standard transitions (@utils.transition) are one-way.
12
12
  # For round-trip routing, store the "return address" in a variable.
13
- # The specialist topic transitions back when done.
13
+ # The specialist subagent transitions back when done.
14
14
  #
15
15
  # ★ Architecture Decision:
16
16
  # Use this when you want separation of concerns:
17
- # - Main topic: Orchestration and user interaction
18
- # - Specialist topic: Focused, complex processing
17
+ # - Main subagent: Orchestration and user interaction
18
+ # - Specialist subagent: Focused, complex processing
19
19
  #
20
20
  # This is a PARTIAL template - integrate into a complete agent file
21
21
 
22
22
  variables:
23
23
  # ... standard linked variables ...
24
- return_topic: mutable string = ""
25
- description: "Topic to return to after specialist consultation"
24
+ return_subagent: mutable string = ""
25
+ description: "Subagent to return to after specialist consultation"
26
26
  specialist_result: mutable string = ""
27
- description: "Result from specialist topic"
27
+ description: "Result from specialist subagent"
28
28
  consultation_status: mutable string = ""
29
29
  description: "Status of specialist consultation"
30
30
 
31
- # Main orchestration topic
31
+ # Main orchestration subagent
32
32
  start_agent main_hub:
33
33
  label: "Main Hub"
34
34
  description: "Central hub that routes to specialists and handles results"
@@ -46,17 +46,17 @@ start_agent main_hub:
46
46
  | Consultation status: {!@variables.consultation_status}
47
47
  actions:
48
48
  # Route to pricing specialist (store return address first)
49
- consult_pricing: @utils.transition to @topic.pricing_specialist
49
+ consult_pricing: @utils.transition to @subagent.pricing_specialist
50
50
  available when @variables.consultation_status != "in_progress"
51
51
 
52
52
  # Route to technical specialist
53
- consult_technical: @utils.transition to @topic.technical_specialist
53
+ consult_technical: @utils.transition to @subagent.technical_specialist
54
54
  available when @variables.consultation_status != "in_progress"
55
55
 
56
- end_conversation: @utils.transition to @topic.farewell
56
+ end_conversation: @utils.transition to @subagent.farewell
57
57
 
58
- # Pricing specialist topic
59
- topic pricing_specialist:
58
+ # Pricing specialist subagent
59
+ subagent pricing_specialist:
60
60
  label: "Pricing Specialist"
61
61
  description: "Handles complex pricing calculations and returns results"
62
62
 
@@ -78,7 +78,7 @@ topic pricing_specialist:
78
78
  # Mark consultation as in progress when entering
79
79
  before_reasoning:
80
80
  set @variables.consultation_status = "in_progress"
81
- set @variables.return_topic = "main_hub"
81
+ set @variables.return_subagent = "main_hub"
82
82
 
83
83
  reasoning:
84
84
  instructions: ->
@@ -93,14 +93,14 @@ topic pricing_specialist:
93
93
  set @variables.specialist_result = @outputs.final_price
94
94
 
95
95
  # Return to main hub with results
96
- return_with_results: @utils.transition to @topic.main_hub
96
+ return_with_results: @utils.transition to @subagent.main_hub
97
97
 
98
98
  # Mark consultation complete when leaving
99
99
  after_reasoning:
100
100
  set @variables.consultation_status = "completed"
101
101
 
102
- # Technical specialist topic
103
- topic technical_specialist:
102
+ # Technical specialist subagent
103
+ subagent technical_specialist:
104
104
  label: "Technical Specialist"
105
105
  description: "Handles technical troubleshooting and returns results"
106
106
 
@@ -119,7 +119,7 @@ topic technical_specialist:
119
119
 
120
120
  before_reasoning:
121
121
  set @variables.consultation_status = "in_progress"
122
- set @variables.return_topic = "main_hub"
122
+ set @variables.return_subagent = "main_hub"
123
123
 
124
124
  reasoning:
125
125
  instructions: ->
@@ -132,12 +132,12 @@ topic technical_specialist:
132
132
  with symptoms=...
133
133
  set @variables.specialist_result = @outputs.diagnosis
134
134
 
135
- return_with_results: @utils.transition to @topic.main_hub
135
+ return_with_results: @utils.transition to @subagent.main_hub
136
136
 
137
137
  after_reasoning:
138
138
  set @variables.consultation_status = "completed"
139
139
 
140
- topic farewell:
140
+ subagent farewell:
141
141
  label: "Farewell"
142
142
  description: "Ends the conversation"
143
143
 
@@ -148,9 +148,9 @@ topic farewell:
148
148
  # ★ Alternative: Simple one-way transitions (when you don't need to return)
149
149
  #
150
150
  # If the specialist doesn't need to return results to a coordinator,
151
- # use simple transitions without the return_topic pattern:
151
+ # use simple transitions without the return_subagent pattern:
152
152
  #
153
- # go_orders: @utils.transition to @topic.orders
154
- # go_billing: @utils.transition to @topic.billing
153
+ # go_orders: @utils.transition to @subagent.orders
154
+ # go_billing: @utils.transition to @subagent.billing
155
155
  #
156
156
  # The bidirectional pattern adds complexity - only use when needed.
@@ -23,7 +23,7 @@
23
23
  # - Workflows that REQUIRE a specific ID (account, order, case, etc.)
24
24
  # - When slot filling has been unreliable
25
25
  # - When invalid input causes downstream failures
26
- # - Multi-topic agents where input must persist across transitions
26
+ # - Multi-subagent agents where input must persist across transitions
27
27
  #
28
28
  # This is a COMPLETE template - customize for your use case
29
29
 
@@ -74,8 +74,8 @@ language:
74
74
  additional_locales: ""
75
75
  all_additional_locales: False
76
76
 
77
- # ★ ENTRY POINT: Input Collection Topic
78
- # This topic's ONLY job is to collect and validate the critical input
77
+ # ★ ENTRY POINT: Input Collection Subagent
78
+ # This subagent's ONLY job is to collect and validate the critical input
79
79
  start_agent input_collector:
80
80
  label: "Input Collector"
81
81
  description: "Collects and validates the account ID before allowing research"
@@ -127,7 +127,7 @@ start_agent input_collector:
127
127
  | ✅ Account ID validated: {!@variables.account_id}
128
128
  | Account Name: {!@variables.account_name}
129
129
  |
130
- | Transition to research topic to begin analysis.
130
+ | Transition to research subagent to begin analysis.
131
131
 
132
132
  if @variables.collection_attempts > 2 and @variables.account_id_validated == False:
133
133
  | ❌ Multiple validation failures.
@@ -148,11 +148,11 @@ start_agent input_collector:
148
148
 
149
149
  # ★ PATTERN 4: Null Guard Pattern
150
150
  # Transition ONLY available when input is validated
151
- go_research: @utils.transition to @topic.research
151
+ go_research: @utils.transition to @subagent.research
152
152
  available when @variables.account_id_validated == True
153
153
 
154
- # ★ RESEARCH TOPIC: Only accessible after input is validated
155
- topic research:
154
+ # ★ RESEARCH SUBAGENT: Only accessible after input is validated
155
+ subagent research:
156
156
  label: "Account Research"
157
157
  description: "Performs research on the validated account"
158
158
 
@@ -194,7 +194,7 @@ topic research:
194
194
  available when @variables.research_summary == ""
195
195
 
196
196
  # Return to collector for new account
197
- new_account: @utils.transition to @topic.input_collector
197
+ new_account: @utils.transition to @subagent.input_collector
198
198
  available when @variables.research_summary != ""
199
199
 
200
200
  # ═══════════════════════════════════════════════════════════════════════════
@@ -1,21 +1,21 @@
1
- # Topic Delegation vs Transition Pattern
1
+ # Subagent Delegation vs Transition Pattern
2
2
  # Understanding the difference between delegation and permanent handoffs
3
3
  #
4
4
  # ★ KEY CONCEPTS:
5
5
  #
6
- # DELEGATION (@topic.* syntax):
7
- # - Syntax: action_name: @topic.topic_name
8
- # - Control CAN return to the calling topic
6
+ # DELEGATION (@subagent.* syntax):
7
+ # - Syntax: action_name: @subagent.subagent_name
8
+ # - Control CAN return to the calling subagent
9
9
  # - Use for: consulting specialists, sub-tasks, getting help
10
10
  #
11
11
  # TRANSITION (@utils.transition syntax):
12
- # - Syntax: action_name: @utils.transition to @topic.topic_name
12
+ # - Syntax: action_name: @utils.transition to @subagent.subagent_name
13
13
  # - PERMANENT handoff - control does NOT return
14
14
  # - Use for: menu navigation, workflow stages, permanent routing
15
15
  #
16
16
  # ★ When To Use Each:
17
17
  # DELEGATION: "Consult an expert then continue here"
18
- # TRANSITION: "Go to this topic and stay there"
18
+ # TRANSITION: "Go to this subagent and stay there"
19
19
  #
20
20
  # ★ Implementation Note:
21
21
  # If delegation syntax doesn't work in your deployment method,
@@ -25,20 +25,20 @@
25
25
  # This is a PARTIAL template - integrate into a complete agent file
26
26
 
27
27
  # ═══════════════════════════════════════════════════════════════
28
- # PATTERN 1: Topic Delegation (can return)
28
+ # PATTERN 1: Subagent Delegation (can return)
29
29
  # ═══════════════════════════════════════════════════════════════
30
30
 
31
31
  # Delegation syntax in reasoning.actions:
32
32
  #
33
33
  # reasoning:
34
34
  # actions:
35
- # # Delegation - specialist CAN return control to this topic
36
- # consult_expert: @topic.specialist_topic
35
+ # # Delegation - specialist CAN return control to this subagent
36
+ # consult_expert: @subagent.specialist_subagent
37
37
  # description: "Consult specialist for complex questions"
38
38
  # available when @variables.needs_expert_help == True
39
39
  #
40
- # The specialist topic processes the request and control returns
41
- # to the original topic when done.
40
+ # The specialist subagent processes the request and control returns
41
+ # to the original subagent when done.
42
42
 
43
43
  # ═══════════════════════════════════════════════════════════════
44
44
  # PATTERN 2: Transition (permanent handoff)
@@ -48,11 +48,11 @@
48
48
  #
49
49
  # reasoning:
50
50
  # actions:
51
- # # Transition - permanent move to orders topic
52
- # go_orders: @utils.transition to @topic.orders
51
+ # # Transition - permanent move to orders subagent
52
+ # go_orders: @utils.transition to @subagent.orders
53
53
  #
54
- # Control moves to orders topic and STAYS there.
55
- # User continues in that topic until another transition occurs.
54
+ # Control moves to orders subagent and STAYS there.
55
+ # User continues in that subagent until another transition occurs.
56
56
 
57
57
  # ═══════════════════════════════════════════════════════════════
58
58
  # PATTERN 3: Manual Bidirectional (fallback pattern)
@@ -62,17 +62,17 @@
62
62
  # See: bidirectional-routing.agent for full implementation
63
63
 
64
64
  variables:
65
- return_topic: mutable string = ""
66
- description: "Topic to return to after specialist"
65
+ return_subagent: mutable string = ""
66
+ description: "Subagent to return to after specialist"
67
67
  specialist_result: mutable string = ""
68
68
  description: "Result from specialist consultation"
69
69
 
70
70
  # Before going to specialist, store return address:
71
- # set @variables.return_topic = "main_hub"
72
- # go_specialist: @utils.transition to @topic.specialist
71
+ # set @variables.return_subagent = "main_hub"
72
+ # go_specialist: @utils.transition to @subagent.specialist
73
73
 
74
74
  # In specialist, transition back when done:
75
- # return_home: @utils.transition to @topic.main_hub
75
+ # return_home: @utils.transition to @subagent.main_hub
76
76
 
77
77
  # ═══════════════════════════════════════════════════════════════
78
78
  # COMPARISON TABLE
@@ -80,7 +80,7 @@ variables:
80
80
  #
81
81
  # | Feature | Delegation | Transition |
82
82
  # |----------------------|-------------------|-------------------------|
83
- # | Syntax | @topic.name | @utils.transition to |
83
+ # | Syntax | @subagent.name | @utils.transition to |
84
84
  # | Returns to caller? | YES | NO |
85
85
  # | Use in actions: | YES | YES |
86
86
  # | Use in lifecycle: | NO | YES (bare syntax) |
@@ -15,7 +15,7 @@
15
15
  # ★ CRITICAL SYNTAX RULES for Lifecycle Blocks:
16
16
  # 1. Use "transition to" NOT "@utils.transition to" for transitions
17
17
  # 2. The pipe (|) command is NOT supported in lifecycle blocks
18
- # 3. after_reasoning may NOT run if a transition occurs mid-topic
18
+ # 3. after_reasoning may NOT run if a transition occurs mid-subagent
19
19
  # 4. `run` has inconsistent runtime behavior in lifecycle blocks —
20
20
  # reliable primitives are `set`, `if`/`else`, `transition to`
21
21
  #
@@ -40,9 +40,9 @@ variables:
40
40
  current_context: mutable string = ""
41
41
  description: "Refreshed context for current turn"
42
42
 
43
- topic conversation:
43
+ subagent conversation:
44
44
  label: "Conversation"
45
- description: "Main conversation topic with lifecycle tracking"
45
+ description: "Main conversation subagent with lifecycle tracking"
46
46
 
47
47
  actions:
48
48
  get_timestamp:
@@ -67,8 +67,8 @@ topic conversation:
67
67
  inputs:
68
68
  turn_number: number
69
69
  description: "Which turn this is"
70
- topic_name: string
71
- description: "Current topic"
70
+ subagent_name: string
71
+ description: "Current subagent"
72
72
  outputs:
73
73
  logged: boolean
74
74
  description: "Whether log succeeded"
@@ -87,7 +87,7 @@ topic conversation:
87
87
  # ★ CORRECT: Use "transition to" (not @utils.transition to) in lifecycle blocks
88
88
  # Example: Route away if session expired
89
89
  # if @variables.session_expired == True:
90
- # transition to @topic.session_expired
90
+ # transition to @subagent.session_expired
91
91
 
92
92
  # Refresh context before every turn
93
93
  run @actions.refresh_context
@@ -105,14 +105,14 @@ topic conversation:
105
105
  |
106
106
  | Respond helpfully using the refreshed context above.
107
107
  actions:
108
- end_conversation: @utils.transition to @topic.farewell
108
+ end_conversation: @utils.transition to @subagent.farewell
109
109
 
110
110
  # ★ after_reasoning: Runs AFTER each reasoning step
111
111
  after_reasoning:
112
112
  # Log analytics for each turn
113
113
  run @actions.log_turn
114
114
  with turn_number=@variables.turn_count
115
- with topic_name="conversation"
115
+ with subagent_name="conversation"
116
116
 
117
117
  # Update last activity timestamp
118
118
  run @actions.get_timestamp
@@ -27,7 +27,7 @@ variables:
27
27
  action_taken: mutable string
28
28
  description: "Last action taken by agent"
29
29
 
30
- topic order_assistance:
30
+ subagent order_assistance:
31
31
  label: "Order Assistance"
32
32
  description: "Helps customers with order-related questions"
33
33
 
@@ -122,9 +122,9 @@ topic order_assistance:
122
122
  available when @variables.has_order_id == True
123
123
  available when @variables.order_status != "shipped"
124
124
 
125
- # Topic transitions
126
- go_help: @utils.transition to @topic.general_help
127
- go_escalation: @utils.transition to @topic.escalation
125
+ # Subagent transitions
126
+ go_help: @utils.transition to @subagent.general_help
127
+ go_escalation: @utils.transition to @subagent.escalation
128
128
  available when @variables.needs_human == True
129
129
 
130
130
  # ★ Insight: When to Use Each Method
@@ -150,7 +150,7 @@ topic order_assistance:
150
150
  # ★ Example: Action Callback Pattern (Deterministic Chaining)
151
151
  # Use "run" for guaranteed follow-up actions after a primary action
152
152
 
153
- topic checkout:
153
+ subagent checkout:
154
154
  label: "Checkout"
155
155
  description: "Handles order checkout"
156
156
 
@@ -22,10 +22,10 @@
22
22
  # This is a COMPLETE template - customize for your use case
23
23
  #
24
24
  # ★ Step Guard Pattern (Feb 2026 Community Best Practice):
25
- # - The topic selector re-evaluates on EVERY user utterance
25
+ # - The subagent router re-evaluates on EVERY user utterance
26
26
  # - Without a step guard, follow-up messages ("my email is X") get re-routed
27
27
  # - The `if @variables.current_step > 1:` guard in start_agent forces
28
- # re-entry to the current workflow, bypassing LLM topic selection
28
+ # re-entry to the current workflow, bypassing LLM subagent selection
29
29
  # - Reset current_step to 1 when the workflow completes
30
30
 
31
31
  system:
@@ -168,7 +168,7 @@ start_agent onboarding:
168
168
  reasoning:
169
169
  instructions: ->
170
170
  # ★ STEP GUARD — Force re-entry if workflow in progress
171
- # This prevents the topic selector from re-routing the user
171
+ # This prevents the subagent router from re-routing the user
172
172
  # mid-workflow when they provide follow-up information
173
173
  if @variables.current_step > 1:
174
174
  | Continuing your account setup...