afv-library/skills/developing-agentforce/assets/agents/multi-subagent.agent
Steve Hetzel dca920f42e
Complete topic-to-subagent terminology update across skills
Comprehensive update replacing "topic" with "subagent" terminology throughout
the developing-agentforce and testing-agentforce skills to align with Agent
Script's `subagent` block naming.

Key changes:
- "Topic Selector" → "Subagent Router" in all agent templates and docs
- "Topic/action" → "Subagent/action" in documentation
- "Topic map" → "Subagent map" in diagram references
- Updated all architecture documentation to use "subagent" terminology
- Updated 19 .agent template files with new labels and comments
- Updated 8 reference documentation files with consistent terminology

API contract preservation:
- Test spec YAML files preserve "topic" terminology to match Testing Center API
- Added clarifying comments explaining topic/subagent equivalence in YAML files
- Field names like `expectedTopic` unchanged (Salesforce API requirement)

Preserved terms:
- "off-topic" (standard phrase for out-of-scope)
- "expectedTopic" field (Testing Center API)
- "platform topics" (Salesforce guardrail features)

32 files changed, 379 insertions(+), 366 deletions(-)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-24 10:00:40 -06:00

106 lines
3.0 KiB
Plaintext

# Multi-Topic Agent Template
# An agent with multiple conversation topics (hub-and-spoke pattern)
# Users are routed to specialized topics based on their needs
#
# Usage: Replace {{placeholders}} with your values
# Required: agent_name, default_agent_user, agent_label, description
# Required: At least 2 topics with label and description
system:
instructions: "{{SystemInstructions}}"
messages:
welcome: "{{WelcomeMessage}}"
error: "I'm sorry, I encountered an issue. Please try again."
config:
agent_name: "{{AgentApiName}}"
default_agent_user: "{{AgentUser}}"
agent_label: "{{AgentLabel}}"
description: "{{AgentDescription}}"
variables:
EndUserId: linked string
source: @MessagingSession.MessagingEndUserId
description: "Messaging End User ID"
RoutableId: linked string
source: @MessagingSession.Id
description: "Messaging Session ID"
ContactId: linked string
source: @MessagingEndUser.ContactId
description: "Contact ID"
user_intent: mutable string
description: "What the user is trying to accomplish"
language:
default_locale: "en_US"
additional_locales: ""
all_additional_locales: False
start_agent agent_router:
label: "Subagent Router"
description: "Routes users to the appropriate subagent based on their needs"
reasoning:
instructions: ->
| Determine what the user needs help with.
| Route them to the most appropriate subagent.
| If unclear, ask clarifying questions.
actions:
go_to_topic_one: @utils.transition to @subagent.{{topic_one_name}}
go_to_topic_two: @utils.transition to @subagent.{{topic_two_name}}
go_to_topic_three: @utils.transition to @subagent.{{topic_three_name}}
go_to_farewell: @utils.transition to @subagent.farewell
go_to_escalation: @utils.transition to @subagent.escalation
subagent {{topic_one_name}}:
label: "{{TopicOneLabel}}"
description: "{{TopicOneDescription}}"
reasoning:
instructions: ->
| {{TopicOneInstructions}}
actions:
back_to_menu: @utils.transition to @subagent.agent_router
subagent {{topic_two_name}}:
label: "{{TopicTwoLabel}}"
description: "{{TopicTwoDescription}}"
reasoning:
instructions: ->
| {{TopicTwoInstructions}}
actions:
back_to_menu: @utils.transition to @subagent.agent_router
subagent {{topic_three_name}}:
label: "{{TopicThreeLabel}}"
description: "{{TopicThreeDescription}}"
reasoning:
instructions: ->
| {{TopicThreeInstructions}}
actions:
back_to_menu: @utils.transition to @subagent.agent_router
subagent farewell:
label: "Farewell"
description: "Ends the conversation gracefully"
reasoning:
instructions: ->
| Thank the user for reaching out.
| Wish them a great day.
| Let them know they can return anytime.
subagent escalation:
label: "Escalation"
description: "Handles requests to transfer to a live human agent"
reasoning:
instructions: ->
| If the user explicitly asks to speak with a human, escalate.
| Acknowledge the request and transfer gracefully.
actions:
escalate_to_human: @utils.escalate
description: "Escalate to a human agent"