@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.
- package/package.json +1 -1
- package/skills/developing-agentforce/README.md +4 -4
- package/skills/developing-agentforce/SKILL.md +37 -37
- package/skills/developing-agentforce/assets/README-legacy.md +8 -8
- package/skills/developing-agentforce/assets/agent-spec-template.md +9 -9
- package/skills/developing-agentforce/assets/agents/README.md +4 -4
- package/skills/developing-agentforce/assets/agents/hello-world.agent +3 -3
- package/skills/developing-agentforce/assets/agents/{multi-topic.agent → multi-subagent.agent} +30 -30
- package/skills/developing-agentforce/assets/agents/order-service.agent +25 -25
- package/skills/developing-agentforce/assets/agents/production-faq.agent +12 -12
- package/skills/developing-agentforce/assets/agents/simple-qa.agent +8 -8
- package/skills/developing-agentforce/assets/agents/verification-gate.agent +19 -19
- package/skills/developing-agentforce/assets/components/apex-action.agent +3 -3
- package/skills/developing-agentforce/assets/components/error-handling.agent +7 -7
- package/skills/developing-agentforce/assets/components/escalation-setup.agent +11 -11
- package/skills/developing-agentforce/assets/components/flow-action.agent +5 -5
- package/skills/developing-agentforce/assets/components/n-ary-conditions.agent +11 -11
- package/skills/developing-agentforce/assets/components/{topic-with-actions.agent → subagent-with-actions.agent} +9 -9
- package/skills/developing-agentforce/assets/deterministic-routing.agent +19 -19
- package/skills/developing-agentforce/assets/escalation-pattern.agent +13 -13
- package/skills/developing-agentforce/assets/flow-action-lookup.agent +3 -3
- package/skills/developing-agentforce/assets/hub-and-spoke.agent +18 -18
- package/skills/developing-agentforce/assets/local-info-agent-annotated.agent +37 -37
- package/skills/developing-agentforce/assets/metadata/genai-function-apex.xml +3 -3
- package/skills/developing-agentforce/assets/metadata/genai-function-flow.xml +1 -1
- package/skills/developing-agentforce/assets/metadata/genai-plugin.xml +10 -10
- package/skills/developing-agentforce/assets/minimal-starter.agent +4 -4
- package/skills/developing-agentforce/assets/patterns/README.md +21 -21
- package/skills/developing-agentforce/assets/patterns/action-callbacks.agent +4 -4
- package/skills/developing-agentforce/assets/patterns/advanced-input-bindings.agent +1 -1
- package/skills/developing-agentforce/assets/patterns/bidirectional-routing.agent +25 -25
- package/skills/developing-agentforce/assets/patterns/critical-input-collection.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/delegation-routing.agent +21 -21
- package/skills/developing-agentforce/assets/patterns/lifecycle-events.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/llm-controlled-actions.agent +5 -5
- package/skills/developing-agentforce/assets/patterns/multi-step-workflow.agent +3 -3
- package/skills/developing-agentforce/assets/patterns/open-gate-routing.agent +59 -58
- package/skills/developing-agentforce/assets/patterns/procedural-instructions.agent +15 -15
- package/skills/developing-agentforce/assets/patterns/prompt-template-action.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/system-instruction-overrides.agent +40 -40
- package/skills/developing-agentforce/assets/prompt-rag-search.agent +9 -9
- package/skills/developing-agentforce/assets/{template-multi-topic.agent → template-multi-subagent.agent} +25 -25
- package/skills/developing-agentforce/assets/{template-single-topic.agent → template-single-subagent.agent} +14 -14
- package/skills/developing-agentforce/assets/verification-gate.agent +16 -16
- package/skills/developing-agentforce/references/action-prompt-templates.md +1 -1
- package/skills/developing-agentforce/references/actions-reference.md +4 -4
- package/skills/developing-agentforce/references/agent-design-and-spec-creation.md +107 -107
- package/skills/developing-agentforce/references/agent-metadata-and-lifecycle.md +5 -5
- package/skills/developing-agentforce/references/agent-script-core-language.md +79 -79
- package/skills/developing-agentforce/references/{agent-topic-map-diagrams.md → agent-subagent-map-diagrams.md} +65 -65
- package/skills/developing-agentforce/references/agent-user-setup.md +2 -2
- package/skills/developing-agentforce/references/agent-validation-and-debugging.md +55 -55
- package/skills/developing-agentforce/references/architecture-patterns.md +33 -33
- package/skills/developing-agentforce/references/deploy-reference.md +1 -1
- package/skills/developing-agentforce/references/discover-reference.md +1 -1
- package/skills/developing-agentforce/references/examples.md +32 -32
- package/skills/developing-agentforce/references/feature-validity.md +3 -3
- package/skills/developing-agentforce/references/instruction-resolution.md +29 -29
- package/skills/developing-agentforce/references/known-issues.md +10 -10
- package/skills/developing-agentforce/references/minimal-examples.md +6 -6
- package/skills/developing-agentforce/references/production-gotchas.md +22 -22
- package/skills/developing-agentforce/references/safety-review-reference.md +2 -2
- package/skills/developing-agentforce/references/scoring-rubric.md +3 -3
- package/skills/observing-agentforce/SKILL.md +8 -8
- package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +2 -2
- package/skills/observing-agentforce/references/improve-reference.md +40 -40
- package/skills/observing-agentforce/references/issue-classification.md +47 -47
- package/skills/observing-agentforce/references/reproduce-reference.md +7 -7
- package/skills/observing-agentforce/references/stdm-queries.md +7 -7
- package/skills/observing-agentforce/references/stdm-schema.md +2 -2
- package/skills/testing-agentforce/SKILL.md +9 -9
- package/skills/testing-agentforce/assets/basic-test-spec.yaml +4 -0
- package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +4 -0
- package/skills/testing-agentforce/assets/standard-test-spec.yaml +8 -4
- package/skills/testing-agentforce/references/batch-testing.md +17 -17
- package/skills/testing-agentforce/references/preview-testing.md +25 -25
- 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. **
|
|
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
|
|
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
|
-
|
|
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
|
|
115
|
-
|
|
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
|
-
|
|
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
|
-
- `
|
|
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.
|
|
206
|
+
### 1. Subagent Routing Verification
|
|
207
207
|
```bash
|
|
208
|
-
# Which
|
|
208
|
+
# Which subagent handled this turn (root-level field)
|
|
209
209
|
jq -r '.topic' "$TRACE"
|
|
210
|
-
# Detailed: which agent/
|
|
210
|
+
# Detailed: which agent/subagent was entered
|
|
211
211
|
jq -r '.plan[] | select(.type == "NodeEntryStateStep") | .data.agent_name' "$TRACE"
|
|
212
212
|
```
|
|
213
|
-
Expected: Correct
|
|
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` -
|
|
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
|
|
311
|
-
- `NO_ACTIONS_IN_TOPIC` - `EnabledToolsStep` shows only guardrail tools; `BeforeReasoningIterationStep.data.action_names[]` shows only `__state_update_action__` entries —
|
|
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
|
|
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
|
|
323
|
-
| NO_ACTIONS_IN_TOPIC | `BeforeReasoningIterationStep` | `.data.action_names[]` shows only `__state_update_action__` —
|
|
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 | `
|
|
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 | `
|
|
335
|
-
| NO_ACTIONS_IN_TOPIC | `
|
|
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 (
|
|
347
|
-
|
|
346
|
+
# Before (subagent not matched)
|
|
347
|
+
subagent order_mgmt:
|
|
348
348
|
description: "Orders"
|
|
349
349
|
|
|
350
350
|
# After (expanded description)
|
|
351
|
-
|
|
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
|
-
|
|
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'
|
|
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
|
|
46
|
+
Track which subagents and actions are tested across both modes:
|
|
47
47
|
|
|
48
48
|
| Dimension | Target | How to measure |
|
|
49
49
|
|-----------|--------|----------------|
|
|
50
|
-
|
|
|
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
|
|
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
|
|
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
|