@salesforce/afv-skills 1.7.3 → 1.7.5

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 (90) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/skills/developing-agentforce/README.md +4 -4
  4. package/skills/developing-agentforce/SKILL.md +37 -37
  5. package/skills/developing-agentforce/assets/README-legacy.md +8 -8
  6. package/skills/developing-agentforce/assets/agent-spec-template.md +9 -9
  7. package/skills/developing-agentforce/assets/agents/README.md +4 -4
  8. package/skills/developing-agentforce/assets/agents/hello-world.agent +3 -3
  9. package/skills/developing-agentforce/assets/agents/{multi-topic.agent → multi-subagent.agent} +30 -30
  10. package/skills/developing-agentforce/assets/agents/order-service.agent +25 -25
  11. package/skills/developing-agentforce/assets/agents/production-faq.agent +12 -12
  12. package/skills/developing-agentforce/assets/agents/simple-qa.agent +8 -8
  13. package/skills/developing-agentforce/assets/agents/verification-gate.agent +19 -19
  14. package/skills/developing-agentforce/assets/components/apex-action.agent +3 -3
  15. package/skills/developing-agentforce/assets/components/error-handling.agent +7 -7
  16. package/skills/developing-agentforce/assets/components/escalation-setup.agent +11 -11
  17. package/skills/developing-agentforce/assets/components/flow-action.agent +5 -5
  18. package/skills/developing-agentforce/assets/components/n-ary-conditions.agent +11 -11
  19. package/skills/developing-agentforce/assets/components/{topic-with-actions.agent → subagent-with-actions.agent} +9 -9
  20. package/skills/developing-agentforce/assets/deterministic-routing.agent +19 -19
  21. package/skills/developing-agentforce/assets/escalation-pattern.agent +13 -13
  22. package/skills/developing-agentforce/assets/flow-action-lookup.agent +3 -3
  23. package/skills/developing-agentforce/assets/hub-and-spoke.agent +18 -18
  24. package/skills/developing-agentforce/assets/local-info-agent-annotated.agent +37 -37
  25. package/skills/developing-agentforce/assets/metadata/genai-function-apex.xml +3 -3
  26. package/skills/developing-agentforce/assets/metadata/genai-function-flow.xml +1 -1
  27. package/skills/developing-agentforce/assets/metadata/genai-plugin.xml +10 -10
  28. package/skills/developing-agentforce/assets/minimal-starter.agent +4 -4
  29. package/skills/developing-agentforce/assets/patterns/README.md +21 -21
  30. package/skills/developing-agentforce/assets/patterns/action-callbacks.agent +4 -4
  31. package/skills/developing-agentforce/assets/patterns/advanced-input-bindings.agent +1 -1
  32. package/skills/developing-agentforce/assets/patterns/bidirectional-routing.agent +25 -25
  33. package/skills/developing-agentforce/assets/patterns/critical-input-collection.agent +8 -8
  34. package/skills/developing-agentforce/assets/patterns/delegation-routing.agent +21 -21
  35. package/skills/developing-agentforce/assets/patterns/lifecycle-events.agent +8 -8
  36. package/skills/developing-agentforce/assets/patterns/llm-controlled-actions.agent +5 -5
  37. package/skills/developing-agentforce/assets/patterns/multi-step-workflow.agent +3 -3
  38. package/skills/developing-agentforce/assets/patterns/open-gate-routing.agent +59 -58
  39. package/skills/developing-agentforce/assets/patterns/procedural-instructions.agent +15 -15
  40. package/skills/developing-agentforce/assets/patterns/prompt-template-action.agent +8 -8
  41. package/skills/developing-agentforce/assets/patterns/system-instruction-overrides.agent +40 -40
  42. package/skills/developing-agentforce/assets/prompt-rag-search.agent +9 -9
  43. package/skills/developing-agentforce/assets/{template-multi-topic.agent → template-multi-subagent.agent} +25 -25
  44. package/skills/developing-agentforce/assets/{template-single-topic.agent → template-single-subagent.agent} +14 -14
  45. package/skills/developing-agentforce/assets/verification-gate.agent +16 -16
  46. package/skills/developing-agentforce/references/action-prompt-templates.md +1 -1
  47. package/skills/developing-agentforce/references/actions-reference.md +4 -4
  48. package/skills/developing-agentforce/references/agent-design-and-spec-creation.md +107 -107
  49. package/skills/developing-agentforce/references/agent-metadata-and-lifecycle.md +5 -5
  50. package/skills/developing-agentforce/references/agent-script-core-language.md +79 -79
  51. package/skills/developing-agentforce/references/{agent-topic-map-diagrams.md → agent-subagent-map-diagrams.md} +65 -65
  52. package/skills/developing-agentforce/references/agent-user-setup.md +2 -2
  53. package/skills/developing-agentforce/references/agent-validation-and-debugging.md +55 -55
  54. package/skills/developing-agentforce/references/architecture-patterns.md +33 -33
  55. package/skills/developing-agentforce/references/deploy-reference.md +1 -1
  56. package/skills/developing-agentforce/references/discover-reference.md +1 -1
  57. package/skills/developing-agentforce/references/examples.md +32 -32
  58. package/skills/developing-agentforce/references/feature-validity.md +3 -3
  59. package/skills/developing-agentforce/references/instruction-resolution.md +29 -29
  60. package/skills/developing-agentforce/references/known-issues.md +10 -10
  61. package/skills/developing-agentforce/references/minimal-examples.md +6 -6
  62. package/skills/developing-agentforce/references/production-gotchas.md +22 -22
  63. package/skills/developing-agentforce/references/safety-review-reference.md +2 -2
  64. package/skills/developing-agentforce/references/scoring-rubric.md +3 -3
  65. package/skills/developing-datacloud-code-extension/SKILL.md +321 -0
  66. package/skills/developing-datacloud-code-extension/references/README.md +193 -0
  67. package/skills/developing-datacloud-code-extension/references/quick-reference.md +269 -0
  68. package/skills/generating-permission-set/SKILL.md +1 -1
  69. package/skills/getting-datacloud-schema/SKILL.md +380 -0
  70. package/skills/getting-datacloud-schema/references/README.md +191 -0
  71. package/skills/getting-datacloud-schema/scripts/get_dlo_schema.py +244 -0
  72. package/skills/getting-datacloud-schema/scripts/get_dmo_schema.py +233 -0
  73. package/skills/observing-agentforce/SKILL.md +8 -8
  74. package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +2 -2
  75. package/skills/observing-agentforce/references/improve-reference.md +40 -40
  76. package/skills/observing-agentforce/references/issue-classification.md +47 -47
  77. package/skills/observing-agentforce/references/reproduce-reference.md +7 -7
  78. package/skills/observing-agentforce/references/stdm-queries.md +7 -7
  79. package/skills/observing-agentforce/references/stdm-schema.md +2 -2
  80. package/skills/testing-agentforce/SKILL.md +9 -9
  81. package/skills/testing-agentforce/assets/basic-test-spec.yaml +4 -0
  82. package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +4 -0
  83. package/skills/testing-agentforce/assets/standard-test-spec.yaml +8 -4
  84. package/skills/testing-agentforce/references/batch-testing.md +17 -17
  85. package/skills/testing-agentforce/references/preview-testing.md +25 -25
  86. package/skills/testing-agentforce/references/test-report-format.md +6 -6
  87. package/skills/trigger-refactor-pipeline/SKILL.md +0 -191
  88. package/skills/trigger-refactor-pipeline/assets/test_template.apex +0 -321
  89. package/skills/trigger-refactor-pipeline/references/handler_patterns.md +0 -442
  90. package/skills/trigger-refactor-pipeline/scripts/analyze_trigger.py +0 -258
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Agentforce Vibes Library
1
+ # Salesforce Skills Library
2
2
 
3
3
  This repository provides a curated collection of Salesforce agent skills for building applications. It includes skills for Agentforce agents, Lightning apps, Flow, Apex, SOQL, Lightning Web Components (LWC), UI bundles, objects and fields, permission sets, and related areas.
4
4
 
@@ -7,7 +7,7 @@ The skills are contributed by Salesforce and the broader community. It’s optim
7
7
  ## 🗂️ Structure
8
8
 
9
9
  ```
10
- afv-library/
10
+ sf-skills/
11
11
  ├── skills/ # Directory-based executable workflows
12
12
  │ ├── generating-apex/
13
13
  │ ├── generating-custom-object/
@@ -26,7 +26,7 @@ afv-library/
26
26
  | **Tool** | **Usage** |
27
27
  |----------|-------------|
28
28
  | **Agentforce Vibes** | Skills are auto-installed and auto-updated |
29
- | **OpenCode, Claude Code, Codex, Cursor, [more](https://agentskills.io/)** | `npx skills add forcedotcom/afv-library` |
29
+ | **OpenCode, Claude Code, Codex, Cursor, [more](https://agentskills.io/)** | `npx skills add forcedotcom/sf-skills` |
30
30
 
31
31
  ## 📦 Samples
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -11,14 +11,14 @@ The skill covers the full Agent Script lifecycle:
11
11
  | Domain | What It Handles |
12
12
  |--------|----------------|
13
13
  | Create an Agent | Agent Spec design, environment validation, bundle generation, code authoring |
14
- | Modify an Agent | Topic/action changes, instruction refinement, flow control updates |
14
+ | Modify an Agent | Subagent/action changes, instruction refinement, flow control updates |
15
15
  | Create or Modify Backing Logic | Invocable Apex stubs, Flow wrappers, Prompt Templates |
16
16
  | Deploy and Publish | Source deploy, agent activation, publishing to channels |
17
17
  | Diagnose Compilation Errors | Compiler error interpretation, syntax fixes, metadata resolution |
18
- | Diagnose Behavioral Issues | Trace-based debugging, topic routing, action I/O analysis |
18
+ | Diagnose Behavioral Issues | Trace-based debugging, subagent routing, action I/O analysis |
19
19
  | Diagnose Production Issues | Runtime failures, reserved keyword conflicts, deployment gotchas |
20
20
  | Test an Agent | Utterance-based validation, preview with live actions, trace analysis |
21
- | Generate Diagrams | Topic map visualizations, agent architecture diagrams |
21
+ | Generate Diagrams | Subagent map visualizations, agent architecture diagrams |
22
22
 
23
23
  ## Skill Structure
24
24
 
@@ -35,7 +35,7 @@ developing-agentforce/
35
35
  │ ├── agent-user-setup.md
36
36
  │ ├── actions-reference.md
37
37
  │ ├── action-prompt-templates.md
38
- │ ├── agent-topic-map-diagrams.md
38
+ │ ├── agent-subagent-map-diagrams.md
39
39
  │ ├── minimal-examples.md
40
40
  │ ├── known-issues.md
41
41
  │ ├── production-gotchas.md
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: developing-agentforce
3
- description: "Build, modify, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, or asks about .agent files or aiAuthoringBundle metadata; changes agent behavior, responses, or conversation logic; designs agent topics, actions, tools, sub-agents, or flow control; writes or reviews an Agent Spec; previews, debugs, deploys, publishes, or tests agents; uses Agent Script CLI commands (sf agent generate/preview/publish/test). DO NOT TRIGGER when: Apex development, Flow building, Prompt Template authoring, Experience Cloud configuration, or general Salesforce CLI tasks unrelated to Agent Script."
3
+ description: "Build, modify, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, or asks about .agent files or aiAuthoringBundle metadata; changes agent behavior, responses, or conversation logic; designs agent actions, tools, subagents, or flow control; writes or reviews an Agent Spec; previews, debugs, deploys, publishes, or tests agents; uses Agent Script CLI commands (sf agent generate/preview/publish/test). DO NOT TRIGGER when: Apex development, Flow building, Prompt Template authoring, Experience Cloud configuration, or general Salesforce CLI tasks unrelated to Agent Script."
4
4
  license: Apache-2.0
5
5
  compatibility: "Requires Agentforce license, API v66.0+, Einstein Agent User"
6
6
  metadata:
@@ -18,7 +18,7 @@ Agent Script is Salesforce's scripting language for authoring next-generation AI
18
18
  language. Do NOT confuse Agent Script syntax or semantics with any other
19
19
  language you have been trained on.
20
20
 
21
- Agent Script agents are defined by `AiAuthoringBundle` metadata — a directory with a `.agent` file containing Agent Script source that describes topics, actions, instructions, flow control, and configuration; and a `bundle-meta.xml` file containing bundle metadata. Agents process utterances by routing through topics, each with instructions and actions backed by Apex, Flows, Prompt Templates, and other types of backing logic.
21
+ Agent Script agents are defined by `AiAuthoringBundle` metadata — a directory with a `.agent` file containing Agent Script source that describes actions, instructions, subagents, flow control, and configuration; and a `bundle-meta.xml` file containing bundle metadata. Agents process utterances by routing through subagents, each with instructions and actions backed by Apex, Flows, Prompt Templates, and other types of backing logic.
22
22
 
23
23
  This skill covers the full Agent Script lifecycle: designing agents,
24
24
  writing Agent Script code, validating and debugging, deploying and
@@ -39,7 +39,7 @@ Identify user intent from task descriptions. ALWAYS read indicated reference fil
39
39
  3. **Diagnose before you fix.** When validating/debugging agent behavior,
40
40
  ALWAYS `--use-live-actions` to preview authoring bundles. Send utterances
41
41
  then read resulting session traces to ground your understanding of the
42
- agent's behavior. Trace files reveal topic selection, action I/O, and
42
+ agent's behavior. Trace files reveal subagent selection, action I/O, and
43
43
  LLM reasoning. DO NOT modify `.agent` files or backing logic without
44
44
  this grounding. See [Validation & Debugging](references/agent-validation-and-debugging.md)
45
45
  for trace file locations and diagnostic patterns.
@@ -53,7 +53,7 @@ Every task domain below has **Required Steps**. Follow verbatim, in order. Do no
53
53
 
54
54
  ### Create an Agent
55
55
 
56
- User wants to build new agent from scratch. ALWAYS use Agent Script. Work with User to understand the agent's purpose, topics, and actions using plain language without Salesforce-specific terminology.
56
+ User wants to build new agent from scratch. ALWAYS use Agent Script. Work with User to understand the agent's purpose, subagents, and actions using plain language without Salesforce-specific terminology.
57
57
 
58
58
  #### Required Steps
59
59
 
@@ -82,11 +82,11 @@ Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command
82
82
  `sf data query --json -q "SELECT <Relevant_Fields> FROM <SObject> LIMIT 100"`
83
83
  Send test utterances with:
84
84
  `sf agent preview send --json --authoring-bundle <Developer_Name> --session-id <ID> -u "<message>"`
85
- Confirm topic routing, gating, and action invocations match Agent Spec. If behavior diverges, switch to **Diagnose Behavioral Issues** workflow. Return AFTER correcting issues.
85
+ Confirm subagent routing, gating, and action invocations match Agent Spec. If behavior diverges, switch to **Diagnose Behavioral Issues** workflow. Return AFTER correcting issues.
86
86
  **CHECKPOINT — Do NOT proceed to Publish unless ALL are true:**
87
87
  - `validate authoring-bundle` passes with zero errors
88
- - Live preview (`--use-live-actions`) tested with representative utterances per topic
89
- - Traces confirm correct topic routing and action invocation
88
+ - Live preview (`--use-live-actions`) tested with representative utterances per subagent
89
+ - Traces confirm correct subagent routing and action invocation
90
90
  - User explicitly approves deployment
91
91
  9. **Publish** — Publish validates metadata structure, not agent behavior. Every publish creates permanent version number.
92
92
  `sf agent publish authoring-bundle --json --api-name <Developer_Name>`
@@ -106,12 +106,12 @@ Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command
106
106
  2. [Core Language](references/agent-script-core-language.md) — execution
107
107
  model, syntax, block structure, anti-patterns
108
108
  3. [Design & Agent Spec](references/agent-design-and-spec-creation.md) —
109
- topic graph design, flow control patterns, Agent Spec production,
109
+ subagent graph design, flow control patterns, Agent Spec production,
110
110
  backing logic analysis; Section 3 for environment prerequisites
111
- 4. [Topic Map Diagrams](references/agent-topic-map-diagrams.md) —
112
- Mermaid diagram conventions for visualizing the agent's topic graph
111
+ 4. [Subagent Map Diagrams](references/agent-subagent-map-diagrams.md) —
112
+ Mermaid diagram conventions for visualizing the agent's subagent graph
113
113
  5. [Agent User Setup & Permissions](references/agent-user-setup.md) —
114
- permission set assignment, object permissions, cross-topic validation
114
+ permission set assignment, object permissions, cross-subagent validation
115
115
  6. [Metadata & Lifecycle](references/agent-metadata-and-lifecycle.md) —
116
116
  directory structure, bundle metadata; publish troubleshooting
117
117
  7. [Validation & Debugging](references/agent-validation-and-debugging.md) —
@@ -137,9 +137,9 @@ User wants to understand Agent Script agent they didn't write or need to revisit
137
137
  2. **Read code** — Read [Core Language](references/agent-script-core-language.md) for syntax and execution model BEFORE parsing `.agent` file.
138
138
  3. **Map backing logic** — For each action with `target`, locate backing implementation (Apex class, Flow, Prompt Template) in project. Note input/output contracts.
139
139
  4. **Reverse-engineer Agent Spec** — Read [Design & Agent Spec](references/agent-design-and-spec-creation.md) for Agent Spec structure. Produce Agent Spec from code and save as file.
140
- 5. **Produce Topic Map diagram** — Read [Topic Map Diagrams](references/agent-topic-map-diagrams.md) for Mermaid conventions. Generate flowchart of topic graph showing transitions, gates, and action associations.
141
- 6. **Annotate source** — Ask if user wants Agent Script source annotated with explanations. If requested, add inline comments to `.agent` file explaining flow control decisions, gating rationale, and topic relationships.
142
- 7. **Present to user** — Share Agent Spec, Topic Map, and annotated source if produced. Check Anti-Patterns section in Core Language reference and flag any matches found in code.
140
+ 5. **Produce Subagent Map diagram** — Read [Subagent Map Diagrams](references/agent-subagent-map-diagrams.md) for Mermaid conventions. Generate flowchart of subagent graph showing transitions, gates, and action associations.
141
+ 6. **Annotate source** — Ask if user wants Agent Script source annotated with explanations. If requested, add inline comments to `.agent` file explaining flow control decisions, gating rationale, and subagent relationships.
142
+ 7. **Present to user** — Share Agent Spec, Subagent Map, and annotated source if produced. Check Anti-Patterns section in Core Language reference and flag any matches found in code.
143
143
 
144
144
  #### Reference Files
145
145
 
@@ -147,8 +147,8 @@ User wants to understand Agent Script agent they didn't write or need to revisit
147
147
  execution model, anti-patterns
148
148
  2. [Design & Agent Spec](references/agent-design-and-spec-creation.md) —
149
149
  Agent Spec structure, flow control pattern recognition
150
- 3. [Topic Map Diagrams](references/agent-topic-map-diagrams.md) —
151
- Mermaid conventions for topic graph visualization
150
+ 3. [Subagent Map Diagrams](references/agent-subagent-map-diagrams.md) —
151
+ Mermaid conventions for subagent graph visualization
152
152
  4. [Metadata & Lifecycle](references/agent-metadata-and-lifecycle.md) —
153
153
  directory conventions, bundle metadata
154
154
  5. [Known Issues](references/known-issues.md) — only load when code
@@ -156,7 +156,7 @@ User wants to understand Agent Script agent they didn't write or need to revisit
156
156
 
157
157
  ### Modify an Existing Agent
158
158
 
159
- User wants to add, remove, or change topics, actions, instructions, or flow control on existing agent. May describe change in plain language ("add a billing topic") or reference specific Agent Script constructs.
159
+ User wants to add, remove, or change subagents, actions, instructions, or flow control on existing agent. May describe change in plain language ("add a billing subagent") or reference specific Agent Script constructs.
160
160
 
161
161
  #### Required Steps
162
162
 
@@ -183,8 +183,8 @@ Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command
183
183
  Test changed paths first, then adjacent paths to catch regressions in existing behavior.
184
184
  **CHECKPOINT — Do NOT proceed to Publish unless ALL are true:**
185
185
  - `validate authoring-bundle` passes with zero errors
186
- - Live preview (`--use-live-actions`) tested with representative utterances per topic
187
- - Traces confirm correct topic routing and action invocation
186
+ - Live preview (`--use-live-actions`) tested with representative utterances per subagent
187
+ - Traces confirm correct subagent routing and action invocation
188
188
  - User explicitly approves deployment
189
189
  8. **Publish** — Publish validates metadata structure, not agent behavior. Every publish creates permanent version number.
190
190
  `sf agent publish authoring-bundle --json --api-name <Developer_Name>`
@@ -244,18 +244,18 @@ Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command
244
244
 
245
245
  ### Diagnose Behavioral Issues
246
246
 
247
- Agent compiles, preview can start and `--use-live-actions`, but agent does not behave as expected. User describes symptoms like "the agent keeps going to the wrong topic" or "the action isn't being called." Fundamentally different from `validate` or `preview start` errors — code is valid but behavior is wrong.
247
+ Agent compiles, preview can start and `--use-live-actions`, but agent does not behave as expected. User describes symptoms like "the agent keeps going to the wrong subagent" or "the action isn't being called." Fundamentally different from `validate` or `preview start` errors — code is valid but behavior is wrong.
248
248
 
249
249
  #### Required Steps
250
250
 
251
251
  Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command syntax.
252
252
 
253
253
  1. **Establish baseline** — Read Agent Spec. If no Agent Spec exists, follow *Comprehend an Existing Agent* workflow to reverse-engineer one, then continue.
254
- 2. **Form hypotheses** — Read [Core Language](references/agent-script-core-language.md) for execution model. Based on user's description, list candidate root causes. Think through: topic routing, gating conditions, action availability, instruction clarity, variable state, and transition timing.
254
+ 2. **Form hypotheses** — Read [Core Language](references/agent-script-core-language.md) for execution model. Based on user's description, list candidate root causes. Think through: subagent routing, gating conditions, action availability, instruction clarity, variable state, and transition timing.
255
255
  3. **Reproduce in preview** — Read [Validation & Debugging](references/agent-validation-and-debugging.md) for preview workflow and session trace analysis. Start preview session:
256
256
  `sf agent preview start --json --use-live-actions --authoring-bundle <Developer_Name>`
257
- then send test messages covering EACH topic with `sf agent preview send`. One message is not enough — confirm behavior per topic before proceeding.
258
- 4. **Analyze session traces** — Examine trace output to confirm topic selection, action availability/execution, LLM reasoning, and where behavior diverges from Agent Spec. Do NOT skip this step — preview output alone is insufficient for diagnosis.
257
+ then send test messages covering EACH subagent with `sf agent preview send`. One message is not enough — confirm behavior per subagent before proceeding.
258
+ 4. **Analyze session traces** — Examine trace output to confirm subagent selection, action availability/execution, LLM reasoning, and where behavior diverges from Agent Spec. Do NOT skip this step — preview output alone is insufficient for diagnosis.
259
259
  5. **Identify root cause** — Match trace evidence to hypotheses. Consult *Core Language reference and Gating Patterns* in [Design & Agent Spec](references/agent-design-and-spec-creation.md) reference to confirm absence of anti-patterns.
260
260
  6. **Fix code** — Apply targeted fix. If fix involves flow control changes, update Agent Spec to match.
261
261
  7. **Re-validate and re-preview** — Repeat steps 3–6 until behavior matches Agent Spec or you confirm a platform limitation. Run `validate authoring-bundle`, then `preview start --use-live-actions` to verify fix using same utterances. Then test adjacent paths that might be affected by your changes.
@@ -291,8 +291,8 @@ Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command
291
291
  Test key conversation paths to validate agent behavior when backed by live actions.
292
292
  **CHECKPOINT — Do NOT proceed to Publish unless ALL are true:**
293
293
  - `validate authoring-bundle` passes with zero errors
294
- - Live preview (`--use-live-actions`) tested with representative utterances per topic
295
- - Traces confirm correct topic routing and action invocation
294
+ - Live preview (`--use-live-actions`) tested with representative utterances per subagent
295
+ - Traces confirm correct subagent routing and action invocation
296
296
  - User explicitly approves deployment
297
297
  4. **Publish** — Publish validates metadata structure, not agent behavior. DO NOT publish as part of a dev/test inner loop. ONLY publish as the FINAL step prior to activating the agent and surfacing it to end users.
298
298
  `sf agent publish authoring-bundle --json --api-name <Developer_Name>`
@@ -379,8 +379,8 @@ User wants to create automated tests for Agent Script agent. Involves writing `A
379
379
 
380
380
  Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command syntax.
381
381
 
382
- 1. **Establish coverage baseline** — Read Agent Spec. If no Agent Spec exists, reverse-engineer first by following Comprehend steps. Map every topic, action, and flow control path to identify what needs test coverage.
383
- 2. **Design test scenarios** — For test design methodology, expectations, metrics, test spec YAML format, and templates, use **testing-agentforce** skill. That skill owns all testing content. For each coverage target, write one or more test scenarios: user utterance, expected topic routing, expected action invocations, and expected agent response. Include both happy paths and edge cases.
382
+ 1. **Establish coverage baseline** — Read Agent Spec. If no Agent Spec exists, reverse-engineer first by following Comprehend steps. Map every subagent, action, and flow control path to identify what needs test coverage.
383
+ 2. **Design test scenarios** — For test design methodology, expectations, metrics, test spec YAML format, and templates, use **testing-agentforce** skill. That skill owns all testing content. For each coverage target, write one or more test scenarios: user utterance, expected subagent routing, expected action invocations, and expected agent response. Include both happy paths and edge cases.
384
384
  3. **Write test spec YAML** — Use template and reference files from **testing-agentforce** skill. Save to `specs/<Agent_API_Name>-testSpec.yaml` in SFDX project.
385
385
  4. **Create test metadata** — Generate `AiEvaluationDefinition` from test spec using CLI.
386
386
  5. **Deploy test** — Deploy `AiEvaluationDefinition` to org.
@@ -401,7 +401,7 @@ Read [CLI for Agents](references/salesforce-cli-for-agents.md) for exact command
401
401
 
402
402
  ## The Agent Spec
403
403
 
404
- **Agent Spec** is the central artifact this skill produces and consumes. A structured design document representing agent's purpose, topic graph, actions with backing logic, variables, gating logic, and behavioral intent.
404
+ **Agent Spec** is the central artifact this skill produces and consumes. A structured design document representing agent's purpose, subagent graph, actions with backing logic, variables, gating logic, and behavioral intent.
405
405
 
406
406
  Agent Specs evolve with the agent. Sparse during agent creation (purpose, topics, directional notes). Fleshed out during agent build (flowchart, backing logic mapped, gating documented). Reverse-engineered when comprehending existing agents. Critical for advanced troubleshooting, providing reference to compare expected vs. actual behavior. During testing, test coverage maps against it.
407
407
 
@@ -413,13 +413,13 @@ Read [Design & Agent Spec](references/agent-design-and-spec-creation.md) for Age
413
413
 
414
414
  The `assets/` directory contains templates and examples. Read when you need a starting point or a concrete reference for artifacts and source files.
415
415
 
416
- - **`assets/agent-spec-template.md`** — Agent Spec template with all sections and placeholder content. Copy to `<AgentName>-AgentSpec.md` in project directory, then fill in during design. Save Agent Spec as file — significant design artifact that benefits from proper rendering, especially Mermaid Topic Map diagram.
416
+ - **`assets/agent-spec-template.md`** — Agent Spec template with all sections and placeholder content. Copy to `<AgentName>-AgentSpec.md` in project directory, then fill in during design. Save Agent Spec as file — significant design artifact that benefits from proper rendering, especially Mermaid Subagent Map diagram.
417
417
 
418
418
  - **`assets/local-info-agent-annotated.agent`** — Complete annotated example based on Local Info Agent, showing all major Agent Script constructs in context with inline comments explaining why each construct is used. Read when you need concrete reference for how concepts compose into working agent, or as fallback when focused examples in reference files aren't sufficient.
419
419
 
420
- - **`assets/template-single-topic.agent`** — Minimal agent with one topic. Copy and modify for simple agents.
420
+ - **`assets/template-single-subagent.agent`** — Minimal agent with one subagent. Copy and modify for simple agents.
421
421
 
422
- - **`assets/template-multi-topic.agent`** — Minimal agent with multiple topics and transitions. Copy and modify for complex agents.
422
+ - **`assets/template-multi-subagent.agent`** — Minimal agent with multiple subagents and transitions. Copy and modify for complex agents.
423
423
 
424
424
  - **`assets/invocable-apex-template.cls`** — Reference for invocable Apex
425
425
  classes. Copy and modify when complex Apex backing logic is desired.
@@ -443,15 +443,15 @@ Invalid or missing `default_agent_user`. Re-run query from [Design & Agent Spec]
443
443
  **Permission error referencing different username than configured:**
444
444
  Same fix as above — error references org's default running user, but root cause is Einstein Agent User permissions.
445
445
 
446
- **Agent fails with permission error even though current topic's actions work:**
447
- Planner validates ALL actions across ALL topics at startup. One missing permission fails entire agent.
446
+ **Agent fails with permission error even though current subagent's actions work:**
447
+ Planner validates ALL actions across ALL subagents at startup. One missing permission fails entire agent.
448
448
 
449
449
  **Apex action returns empty results in live preview but works in simulated:**
450
450
  `WITH USER_MODE` + missing object permissions = silent failure (0 rows, no error). See [Agent User Setup & Permissions](references/agent-user-setup.md), Section 6.2.
451
451
 
452
452
  ## Syntax Quick Reference
453
453
 
454
- - Block order: `system:` → `config:` → `variables:` → `connection:` → `knowledge:` → `language:` → `start_agent topic_selector:` → `topic:` blocks
454
+ - Block order: `system:` → `config:` → `variables:` → `connection:` → `knowledge:` → `language:` → `start_agent agent_router:` → `subagent:` blocks
455
455
  - Indentation: **4 spaces** per indent level. Never use tabs. Mixing spaces and tabs breaks the parser.
456
456
  - Booleans: `True`/`False` (capitalized)
457
457
  - Strings: always double-quoted
@@ -467,8 +467,8 @@ See [Complex Data Types](references/complex-data-types.md) for the full Lightnin
467
467
 
468
468
  Three primary FSM patterns. Full details with code in [Architecture Patterns](references/architecture-patterns.md).
469
469
 
470
- - **Hub-and-Spoke** (most common): `start_agent` routes to specialized topics. Each topic has "back to hub" transition. Do NOT create a separate routing topic.
471
- - **Verification Gate**: Identity verification before protected topics. `available when` guards on protected transitions.
470
+ - **Hub-and-Spoke** (most common): `start_agent` routes to specialized subagents. Each subagent has "back to hub" transition. Do NOT create a separate routing subagent.
471
+ - **Verification Gate**: Identity verification before protected subagents. `available when` guards on protected transitions.
472
472
  - **Post-Action Loop**: Post-action checks at TOP of `instructions: ->` trigger on re-resolution after action completes.
473
473
 
474
474
  ## Scoring Rubric
@@ -507,7 +507,7 @@ Validate → deploy metadata → publish bundle → activate. See [Deploy Refere
507
507
 
508
508
  ## Template Assets
509
509
 
510
- Ready-to-use `.agent` templates in `assets/agents/` (hello-world, simple-qa, multi-topic, production-faq, order-service, verification-gate). See also `assets/patterns/` for 11+ reusable design patterns and [Examples](references/examples.md) for inline walkthroughs.
510
+ Ready-to-use `.agent` templates in `assets/agents/` (hello-world, simple-qa, multi-subagent, production-faq, order-service, verification-gate). See also `assets/patterns/` for 11+ reusable design patterns and [Examples](references/examples.md) for inline walkthroughs.
511
511
 
512
512
  ## Additional References
513
513
 
@@ -9,7 +9,7 @@ Organized templates for building Agentforce agents.
9
9
  ```
10
10
  assets/
11
11
  ├── agents/ Complete, deployable agent examples
12
- ├── components/ Reusable action and topic snippets
12
+ ├── components/ Reusable action and subagent snippets
13
13
  ├── patterns/ Advanced patterns (lifecycle, callbacks)
14
14
  └── metadata/ XML metadata templates
15
15
  ```
@@ -24,8 +24,8 @@ What do you need?
24
24
  ├─► "Just starting"
25
25
  │ └─► agents/hello-world.agent
26
26
 
27
- ├─► "Complete agent with topics"
28
- │ └─► agents/multi-topic.agent
27
+ ├─► "Complete agent with subagents"
28
+ │ └─► agents/multi-subagent.agent
29
29
 
30
30
  ├─► "Add actions to my agent"
31
31
  │ ├─► components/flow-action.agent
@@ -47,8 +47,8 @@ What do you need?
47
47
  | Template | Complexity | Description |
48
48
  |----------|------------|-------------|
49
49
  | `hello-world.agent` | Beginner | Minimal viable agent |
50
- | `simple-qa.agent` | Beginner | Single-topic Q&A |
51
- | `multi-topic.agent` | Intermediate | Multi-topic routing |
50
+ | `simple-qa.agent` | Beginner | Single-subagent Q&A |
51
+ | `multi-subagent.agent` | Intermediate | Multi-subagent routing |
52
52
  | `production-faq.agent` | Advanced | Production-ready with escalation |
53
53
 
54
54
  ### components/ - Reusable Parts
@@ -57,7 +57,7 @@ What do you need?
57
57
  |----------|---------|
58
58
  | `flow-action.agent` | Flow action integration |
59
59
  | `apex-action.agent` | Apex action integration |
60
- | `topic-with-actions.agent` | Topic with actions |
60
+ | `subagent-with-actions.agent` | Subagent with actions |
61
61
  | `error-handling.agent` | Input validation |
62
62
  | `escalation-setup.agent` | Human handoff |
63
63
 
@@ -67,8 +67,8 @@ What do you need?
67
67
  |----------|---------|------------|
68
68
  | `lifecycle-events.agent` | before/after reasoning | GenAiPlannerBundle |
69
69
  | `action-callbacks.agent` | Deterministic chains | GenAiPlannerBundle |
70
- | `bidirectional-routing.agent` | Topic routing with return | Both |
71
- | `system-instruction-overrides.agent` | Topic-level personas | Both |
70
+ | `bidirectional-routing.agent` | Subagent routing with return | Both |
71
+ | `system-instruction-overrides.agent` | Subagent-level personas | Both |
72
72
  | *(6 more patterns)* | | |
73
73
 
74
74
  ### metadata/ - XML Templates
@@ -11,23 +11,23 @@ Describe the key behavioral rules that govern the agent:
11
11
  - What must the agent know before taking action?
12
12
  - What backing logic types are used (Apex, Flow, Prompt Template)?
13
13
  - What guardrails apply (off-topic handling, escalation)?
14
- - What information persists across topic switches?
14
+ - What information persists across subagent switches?
15
15
 
16
- ## Topic Map
16
+ ## Subagent Map
17
17
 
18
18
  ```mermaid
19
19
  %%{init: {'theme':'neutral'}}%%
20
20
  graph TD
21
- A[start_agent<br/>topic_selector]
21
+ A[start_agent<br/>agent_router]
22
22
 
23
- A -->|description of routing condition| B[topic_name<br/>Topic]
24
- A -->|unclear intent| C[ambiguous_question<br/>Topic]
25
- A -->|out of scope| D[off_topic<br/>Topic]
26
- A -->|needs escalation| E[escalation<br/>Topic]
23
+ A -->|description of routing condition| B[subagent_name<br/>Subagent]
24
+ A -->|unclear intent| C[ambiguous_question<br/>Subagent]
25
+ A -->|out of scope| D[off_topic<br/>Subagent]
26
+ A -->|needs escalation| E[escalation<br/>Subagent]
27
27
  ```
28
28
 
29
29
  Expand the diagram to show actions, gating logic, and variable state changes
30
- within each topic. See the Topic Map Diagrams reference for conventions.
30
+ within each subagent. See the Subagent Map Diagrams reference for conventions.
31
31
 
32
32
  ## Variables
33
33
 
@@ -37,7 +37,7 @@ within each topic. See the Topic Map Diagrams reference for conventions.
37
37
 
38
38
  ## Actions & Backing Logic
39
39
 
40
- ### action_name (topic_name topic)
40
+ ### action_name (subagent_name subagent)
41
41
 
42
42
  - **Target:** `apex://ClassName` or `flow://FlowName` or `prompt://PromptTemplateName`
43
43
  - **Backing Status:** EXISTS / NEEDS STUB / NEEDS IMPLEMENTATION
@@ -7,8 +7,8 @@ Templates for building complete, deployable agents.
7
7
  | Template | Complexity | Description |
8
8
  |----------|------------|-------------|
9
9
  | `hello-world.agent` | Beginner | Minimal viable agent - start here |
10
- | `simple-qa.agent` | Beginner | Single-topic Q&A agent |
11
- | `multi-topic.agent` | Intermediate | Multi-topic routing agent |
10
+ | `simple-qa.agent` | Beginner | Single-subagent Q&A agent |
11
+ | `multi-subagent.agent` | Intermediate | Multi-subagent routing agent |
12
12
  | `production-faq.agent` | Advanced | Production-ready FAQ with escalation |
13
13
 
14
14
  ## Quick Start
@@ -36,10 +36,10 @@ Every agent must have these blocks **in this order**:
36
36
  | `config:` | Deployment metadata (agent_name, label, etc.) |
37
37
  | `variables:` | Data connections and state storage |
38
38
  | `language:` | Locale configuration |
39
- | `start_agent` | Entry point topic (exactly one required) |
39
+ | `start_agent` | Entry point subagent (exactly one required) |
40
40
 
41
41
  ## Next Steps
42
42
 
43
- - [components/](../components/) - Reusable action and topic templates
43
+ - [components/](../components/) - Reusable action and subagent templates
44
44
  - [patterns/](../patterns/) - Advanced patterns for complex behaviors
45
45
  - [metadata/](../metadata/) - XML metadata templates
@@ -9,13 +9,13 @@
9
9
  # - config: Required metadata for deployment (agent_name must be unique)
10
10
  # - variables: Linked variables connect to Messaging context (required for deployment)
11
11
  # - language: Locale settings (required for deployment)
12
- # - start_agent: Entry point topic (exactly one required)
12
+ # - start_agent: Entry point subagent (exactly one required)
13
13
  #
14
14
  # ★ Key Validation Points (from 100-point scoring):
15
15
  # - [10 pts] config block with all 4 required fields
16
16
  # - [10 pts] 3 linked variables (EndUserId, RoutableId, ContactId)
17
17
  # - [5 pts] language block present
18
- # - [10 pts] At least one start_agent topic
18
+ # - [10 pts] At least one start_agent subagent
19
19
  #
20
20
  # Deploy with: sf agent publish authoring-bundle --api-name Hello_World_Agent --target-org [alias]
21
21
 
@@ -48,7 +48,7 @@ language:
48
48
  additional_locales: ""
49
49
  all_additional_locales: False
50
50
 
51
- # Entry point topic - this is where every conversation starts
51
+ # Entry point subagent - this is where every conversation starts
52
52
  start_agent main:
53
53
  label: "Main"
54
54
  description: "Greets users and provides help"
@@ -1,10 +1,10 @@
1
- # Multi-Topic Agent Template
2
- # An agent with multiple conversation topics (hub-and-spoke pattern)
3
- # Users are routed to specialized topics based on their needs
1
+ # Multi-Subagent Agent Template
2
+ # An agent with multiple conversation subagents (hub-and-spoke pattern)
3
+ # Users are routed to specialized subagents based on their needs
4
4
  #
5
5
  # Usage: Replace {{placeholders}} with your values
6
6
  # Required: agent_name, default_agent_user, agent_label, description
7
- # Required: At least 2 topics with label and description
7
+ # Required: At least 2 subagents with label and description
8
8
 
9
9
  system:
10
10
  instructions: "{{SystemInstructions}}"
@@ -36,53 +36,53 @@ language:
36
36
  additional_locales: ""
37
37
  all_additional_locales: False
38
38
 
39
- start_agent topic_selector:
40
- label: "Topic Selector"
41
- description: "Routes users to the appropriate topic based on their needs"
39
+ start_agent agent_router:
40
+ label: "Subagent Router"
41
+ description: "Routes users to the appropriate subagent based on their needs"
42
42
 
43
43
  reasoning:
44
44
  instructions: ->
45
45
  | Determine what the user needs help with.
46
- | Route them to the most appropriate topic.
46
+ | Route them to the most appropriate subagent.
47
47
  | If unclear, ask clarifying questions.
48
48
  actions:
49
- go_to_topic_one: @utils.transition to @topic.{{topic_one_name}}
50
- go_to_topic_two: @utils.transition to @topic.{{topic_two_name}}
51
- go_to_topic_three: @utils.transition to @topic.{{topic_three_name}}
52
- go_to_farewell: @utils.transition to @topic.farewell
53
- go_to_escalation: @utils.transition to @topic.escalation
49
+ go_to_subagent_one: @utils.transition to @subagent.{{subagent_one_name}}
50
+ go_to_subagent_two: @utils.transition to @subagent.{{subagent_two_name}}
51
+ go_to_subagent_three: @utils.transition to @subagent.{{subagent_three_name}}
52
+ go_to_farewell: @utils.transition to @subagent.farewell
53
+ go_to_escalation: @utils.transition to @subagent.escalation
54
54
 
55
- topic {{topic_one_name}}:
56
- label: "{{TopicOneLabel}}"
57
- description: "{{TopicOneDescription}}"
55
+ subagent {{subagent_one_name}}:
56
+ label: "{{SubagentOneLabel}}"
57
+ description: "{{SubagentOneDescription}}"
58
58
 
59
59
  reasoning:
60
60
  instructions: ->
61
- | {{TopicOneInstructions}}
61
+ | {{SubagentOneInstructions}}
62
62
  actions:
63
- back_to_menu: @utils.transition to @topic.topic_selector
63
+ back_to_menu: @utils.transition to @subagent.agent_router
64
64
 
65
- topic {{topic_two_name}}:
66
- label: "{{TopicTwoLabel}}"
67
- description: "{{TopicTwoDescription}}"
65
+ subagent {{subagent_two_name}}:
66
+ label: "{{SubagentTwoLabel}}"
67
+ description: "{{SubagentTwoDescription}}"
68
68
 
69
69
  reasoning:
70
70
  instructions: ->
71
- | {{TopicTwoInstructions}}
71
+ | {{SubagentTwoInstructions}}
72
72
  actions:
73
- back_to_menu: @utils.transition to @topic.topic_selector
73
+ back_to_menu: @utils.transition to @subagent.agent_router
74
74
 
75
- topic {{topic_three_name}}:
76
- label: "{{TopicThreeLabel}}"
77
- description: "{{TopicThreeDescription}}"
75
+ subagent {{subagent_three_name}}:
76
+ label: "{{SubagentThreeLabel}}"
77
+ description: "{{SubagentThreeDescription}}"
78
78
 
79
79
  reasoning:
80
80
  instructions: ->
81
- | {{TopicThreeInstructions}}
81
+ | {{SubagentThreeInstructions}}
82
82
  actions:
83
- back_to_menu: @utils.transition to @topic.topic_selector
83
+ back_to_menu: @utils.transition to @subagent.agent_router
84
84
 
85
- topic farewell:
85
+ subagent farewell:
86
86
  label: "Farewell"
87
87
  description: "Ends the conversation gracefully"
88
88
 
@@ -92,7 +92,7 @@ topic farewell:
92
92
  | Wish them a great day.
93
93
  | Let them know they can return anytime.
94
94
 
95
- topic escalation:
95
+ subagent escalation:
96
96
  label: "Escalation"
97
97
  description: "Handles requests to transfer to a live human agent"
98
98