@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
@@ -6,10 +6,10 @@
6
6
 
7
7
  If no utterances file is provided, derive test cases from the `.agent` file:
8
8
 
9
- 1. **Topic-based utterances** - One per non-start topic based on description keywords
9
+ 1. **Subagent-based utterances** - One per non-start subagent based on description keywords
10
10
  2. **Action-based utterances** - Target each key action's functionality
11
11
  3. **Guardrail test** - Off-topic utterance to test boundaries
12
- 4. **Multi-turn scenarios** - Test topic transitions if defined
12
+ 4. **Multi-turn scenarios** - Test subagent transitions if defined
13
13
  5. **Safety probes** - Adversarial utterances to test safety boundaries (see below)
14
14
 
15
15
  **Step 2: Present the derived tests and ask the user to review.**
@@ -17,7 +17,7 @@ If no utterances file is provided, derive test cases from the `.agent` file:
17
17
  ```
18
18
  Auto-generated test plan (8 utterances):
19
19
 
20
- Topic tests:
20
+ Subagent tests:
21
21
  1. "I need to check my order status" -> order_support
22
22
  2. "I want to return an item" -> return_support
23
23
  3. "What are your store hours?" -> general_support
@@ -111,22 +111,22 @@ Compromised probes:
111
111
  ### Example Derivation from Agent Structure
112
112
 
113
113
  ```yaml
114
- # Agent topics:
115
- topic order_management:
114
+ # Agent subagents:
115
+ subagent order_management:
116
116
  description: "Handle order status, tracking, shipping"
117
117
  actions:
118
118
  - get_order_status
119
119
  - track_shipment
120
120
 
121
- topic returns:
121
+ subagent returns:
122
122
  description: "Process returns, refunds, exchanges"
123
123
  actions:
124
124
  - initiate_return
125
125
  - check_refund_status
126
126
 
127
127
  # Derived utterances:
128
- 1. "Where is my order?" -> should route to order_management
129
- 2. "I want to return this item" -> should route to returns
128
+ 1. "Where is my order?" -> should route to order_management subagent
129
+ 2. "I want to return this item" -> should route to returns subagent
130
130
  3. "Track my shipment" -> should invoke track_shipment action
131
131
  4. "What's my refund status?" -> should invoke check_refund_status
132
132
  5. "Tell me a joke" -> should trigger guardrail
@@ -196,21 +196,21 @@ Each trace is a `PlanSuccessResponse` JSON with this root structure:
196
196
  - `type` — always `"PlanSuccessResponse"`
197
197
  - `planId` — unique plan ID for this turn
198
198
  - `sessionId` — the preview session ID
199
- - `topic` — which topic handled this turn
199
+ - `subagent` — which subagent handled this turn
200
200
  - `plan[]` — array of step objects (the execution trace)
201
201
 
202
202
  ## Phase 3: Trace Analysis
203
203
 
204
204
  Analyze execution traces for 8 key aspects:
205
205
 
206
- ### 1. Topic Routing Verification
206
+ ### 1. Subagent Routing Verification
207
207
  ```bash
208
- # Which topic handled this turn (root-level field)
208
+ # Which subagent handled this turn (root-level field)
209
209
  jq -r '.topic' "$TRACE"
210
- # Detailed: which agent/topic was entered
210
+ # Detailed: which agent/subagent was entered
211
211
  jq -r '.plan[] | select(.type == "NodeEntryStateStep") | .data.agent_name' "$TRACE"
212
212
  ```
213
- Expected: Correct topic name matches the expected topic for the utterance.
213
+ Expected: Correct subagent name matches the expected subagent for the utterance.
214
214
 
215
215
  ### 2. Action Invocation Check
216
216
  ```bash
@@ -301,38 +301,38 @@ If issues are detected, the system enters an automated fix loop (max 3 iteration
301
301
  ### Iteration Process
302
302
 
303
303
  1. **Identify failure category**:
304
- - `TOPIC_NOT_MATCHED` - Topic description too vague
304
+ - `TOPIC_NOT_MATCHED` - Subagent description too vague
305
305
  - `ACTION_NOT_INVOKED` - Action guard too restrictive
306
306
  - `WRONG_ACTION_SELECTED` - Action descriptions overlap
307
307
  - `UNGROUNDED_RESPONSE` - Missing data references
308
308
  - `LOW_SAFETY_SCORE` - Inadequate safety instructions
309
309
  - `TOOL_NOT_VISIBLE` - Available when conditions not met
310
- - `DEFAULT_TOPIC` - Trace shows `topic: "DefaultTopic"` — no real topic matched the utterance
311
- - `NO_ACTIONS_IN_TOPIC` - `EnabledToolsStep` shows only guardrail tools; `BeforeReasoningIterationStep.data.action_names[]` shows only `__state_update_action__` entries — topic has no `reasoning: actions:` block
310
+ - `DEFAULT_TOPIC` - Trace shows `topic: "DefaultTopic"` — no real subagent matched the utterance
311
+ - `NO_ACTIONS_IN_TOPIC` - `EnabledToolsStep` shows only guardrail tools; `BeforeReasoningIterationStep.data.action_names[]` shows only `__state_update_action__` entries — subagent has no `reasoning: actions:` block
312
312
 
313
313
  2. **Diagnose from trace** (when using `--authoring-bundle` with local traces):
314
314
 
315
315
  | Failure | Trace step to inspect | What to look for |
316
316
  |---------|----------------------|------------------|
317
- | TOPIC_NOT_MATCHED | `NodeEntryStateStep` | `.data.agent_name` shows wrong topic |
317
+ | TOPIC_NOT_MATCHED | `NodeEntryStateStep` | `.data.agent_name` shows wrong subagent |
318
318
  | ACTION_NOT_INVOKED | `EnabledToolsStep` | Action missing from `.data.enabled_tools[]` |
319
319
  | UNGROUNDED_RESPONSE | `ReasoningStep` | `.category == "UNGROUNDED"`, read `.reason` |
320
320
  | Variable not set | `VariableUpdateStep` | No update for expected variable |
321
321
  | Wrong LLM behavior | `LLMStep` | Read `.data.messages_sent[0].content` to see what prompt was sent |
322
- | DEFAULT_TOPIC | Root `.topic` field | Value is `"DefaultTopic"` instead of a real topic name — no topic matched |
323
- | NO_ACTIONS_IN_TOPIC | `BeforeReasoningIterationStep` | `.data.action_names[]` shows only `__state_update_action__` — topic has no `reasoning: actions:` block |
322
+ | DEFAULT_TOPIC | Root `.topic` field | Value is `"DefaultTopic"` instead of a real subagent name — no subagent matched |
323
+ | NO_ACTIONS_IN_TOPIC | `BeforeReasoningIterationStep` | `.data.action_names[]` shows only `__state_update_action__` — subagent has no `reasoning: actions:` block |
324
324
 
325
325
  3. **Apply targeted fix**:
326
326
 
327
327
  | Failure Type | Fix Location | Fix Strategy |
328
328
  |--------------|--------------|--------------|
329
- | TOPIC_NOT_MATCHED | `topic: description:` | Add keywords from utterance |
329
+ | TOPIC_NOT_MATCHED | `subagent: description:` | Add keywords from utterance |
330
330
  | ACTION_NOT_INVOKED | `available when:` | Relax guard conditions |
331
331
  | WRONG_ACTION | Action descriptions | Add exclusion language |
332
332
  | UNGROUNDED | `instructions: ->` | Add `{!@variables.x}` references |
333
333
  | LOW_SAFETY | `system: instructions:` | Add safety guidelines |
334
- | DEFAULT_TOPIC | `topic: description:` or `start_agent: actions:` | No topic matched — add keywords to topic descriptions or add transition actions to `start_agent` |
335
- | NO_ACTIONS_IN_TOPIC | `topic: reasoning: actions:` | Topic has zero actions — add `reasoning: actions:` block with transition and/or invocation actions |
334
+ | DEFAULT_TOPIC | `subagent: description:` or `start_agent: actions:` | No subagent matched — add keywords to subagent descriptions or add transition actions to `start_agent` |
335
+ | NO_ACTIONS_IN_TOPIC | `subagent: reasoning: actions:` | Subagent has zero actions — add `reasoning: actions:` block with transition and/or invocation actions |
336
336
 
337
337
  4. **Validate fix** - LSP auto-validates on save
338
338
 
@@ -343,11 +343,11 @@ If issues are detected, the system enters an automated fix loop (max 3 iteration
343
343
  ### Example Fix
344
344
 
345
345
  ```yaml
346
- # Before (topic not matched)
347
- topic order_mgmt:
346
+ # Before (subagent not matched)
347
+ subagent order_mgmt:
348
348
  description: "Orders"
349
349
 
350
350
  # After (expanded description)
351
- topic order_mgmt:
351
+ subagent order_mgmt:
352
352
  description: "Handle order queries, order status, tracking, shipping, delivery"
353
353
  ```
@@ -12,7 +12,7 @@ Test Cases: 6
12
12
  Duration: 45.2s
13
13
 
14
14
  Results:
15
- Topic Routing: 5/6 passed (83.3%)
15
+ Subagent Routing: 5/6 passed (83.3%)
16
16
  Action Invocation: 4/6 passed (66.7%)
17
17
  Grounding: 6/6 passed (100%)
18
18
  Safety: 6/6 passed (100%)
@@ -37,21 +37,21 @@ Test Case 1: "Where is my order?"
37
37
  Test Case 2: "I want to return this"
38
38
  Expected Topic: returns
39
39
  Actual Topic: order_mgmt (fail - misrouted)
40
- Fix Applied: Expanded 'returns' topic description
40
+ Fix Applied: Expanded 'returns' subagent description
41
41
  Retry Result: Correctly routed (pass)
42
42
  ```
43
43
 
44
44
  ## Coverage Analysis
45
45
 
46
- Track which topics and actions are tested across both modes:
46
+ Track which subagents and actions are tested across both modes:
47
47
 
48
48
  | Dimension | Target | How to measure |
49
49
  |-----------|--------|----------------|
50
- | Topic coverage | 100% of non-entry topics | Count topics with at least 1 test case |
50
+ | Subagent coverage | 100% of non-entry subagents | Count subagents with at least 1 test case |
51
51
  | Action coverage | 100% of actions | Count actions with at least 1 test case targeting them |
52
- | Phrasing diversity | 3+ utterances per topic (production) | Multiple wordings per intent |
52
+ | Phrasing diversity | 3+ utterances per subagent (production) | Multiple wordings per intent |
53
53
  | Guardrail coverage | At least 1 off-topic test | Verify agent deflects non-relevant queries |
54
- | Multi-turn coverage | Test topic transitions | Conversation history tests |
54
+ | Multi-turn coverage | Test subagent transitions | Conversation history tests |
55
55
  | Escalation coverage | Test escalation triggers | Verify human handoff works |
56
56
 
57
57
  ## CI/CD with Testing Center