@salesforce/afv-skills 1.1.0 → 1.3.0
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 +6 -5
- package/skills/accessing-webapp-data/SKILL.md +178 -0
- package/skills/agentforce-development/SKILL.md +427 -0
- package/skills/agentforce-development/assets/README-legacy.md +89 -0
- package/skills/agentforce-development/assets/agent-spec-template.md +90 -0
- package/skills/agentforce-development/assets/agents/README.md +45 -0
- package/skills/agentforce-development/assets/agents/hello-world.agent +60 -0
- package/skills/agentforce-development/assets/agents/multi-topic.agent +105 -0
- package/skills/agentforce-development/assets/agents/production-faq.agent +101 -0
- package/skills/agentforce-development/assets/agents/production-faq.bundle-meta.xml +4 -0
- package/skills/agentforce-development/assets/agents/simple-qa.agent +72 -0
- package/skills/agentforce-development/assets/apex/models-api-queueable.cls +225 -0
- package/skills/agentforce-development/assets/bundle-meta.xml +23 -0
- package/skills/agentforce-development/assets/components/apex-action.agent +52 -0
- package/skills/agentforce-development/assets/components/error-handling.agent +58 -0
- package/skills/agentforce-development/assets/components/escalation-setup.agent +169 -0
- package/skills/agentforce-development/assets/components/flow-action.agent +66 -0
- package/skills/agentforce-development/assets/components/n-ary-conditions.agent +110 -0
- package/skills/agentforce-development/assets/components/topic-with-actions.agent +40 -0
- package/skills/agentforce-development/assets/deterministic-routing.agent +166 -0
- package/skills/agentforce-development/assets/escalation-pattern.agent +209 -0
- package/skills/agentforce-development/assets/flow-action-lookup.agent +115 -0
- package/skills/agentforce-development/assets/hub-and-spoke.agent +104 -0
- package/skills/agentforce-development/assets/invocable-apex-template.cls +187 -0
- package/skills/agentforce-development/assets/local-info-agent-annotated.agent +355 -0
- package/skills/agentforce-development/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +109 -0
- package/skills/agentforce-development/assets/metadata/genai-function-apex.xml +92 -0
- package/skills/agentforce-development/assets/metadata/genai-function-flow.xml +57 -0
- package/skills/agentforce-development/assets/metadata/genai-plugin.xml +72 -0
- package/skills/agentforce-development/assets/metadata/http-callout-flow.flow-meta.xml +348 -0
- package/skills/agentforce-development/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +136 -0
- package/skills/agentforce-development/assets/minimal-starter.agent +42 -0
- package/skills/agentforce-development/assets/patterns/README.md +254 -0
- package/skills/agentforce-development/assets/patterns/action-callbacks.agent +178 -0
- package/skills/agentforce-development/assets/patterns/advanced-input-bindings.agent +141 -0
- package/skills/agentforce-development/assets/patterns/bidirectional-routing.agent +156 -0
- package/skills/agentforce-development/assets/patterns/critical-input-collection.agent +244 -0
- package/skills/agentforce-development/assets/patterns/delegation-routing.agent +89 -0
- package/skills/agentforce-development/assets/patterns/lifecycle-events.agent +127 -0
- package/skills/agentforce-development/assets/patterns/llm-controlled-actions.agent +184 -0
- package/skills/agentforce-development/assets/patterns/multi-step-workflow.agent +282 -0
- package/skills/agentforce-development/assets/patterns/open-gate-routing.agent +286 -0
- package/skills/agentforce-development/assets/patterns/procedural-instructions.agent +273 -0
- package/skills/agentforce-development/assets/patterns/prompt-template-action.agent +188 -0
- package/skills/agentforce-development/assets/patterns/system-instruction-overrides.agent +293 -0
- package/skills/agentforce-development/assets/prompt-rag-search.agent +131 -0
- package/skills/agentforce-development/assets/template-multi-topic.agent +160 -0
- package/skills/agentforce-development/assets/template-single-topic.agent +81 -0
- package/skills/agentforce-development/assets/verification-gate.agent +208 -0
- package/skills/agentforce-development/references/action-prompt-templates.md +164 -0
- package/skills/agentforce-development/references/actions-reference.md +592 -0
- package/skills/agentforce-development/references/agent-access-guide.md +72 -0
- package/skills/agentforce-development/references/agent-design-and-spec-creation.md +1010 -0
- package/skills/agentforce-development/references/agent-metadata-and-lifecycle.md +575 -0
- package/skills/agentforce-development/references/agent-script-core-language.md +1218 -0
- package/skills/agentforce-development/references/agent-topic-map-diagrams.md +323 -0
- package/skills/agentforce-development/references/agent-user-setup.md +526 -0
- package/skills/agentforce-development/references/agent-validation-and-debugging.md +803 -0
- package/skills/agentforce-development/references/known-issues.md +353 -0
- package/skills/agentforce-development/references/minimal-examples.md +67 -0
- package/skills/agentforce-development/references/production-gotchas.md +279 -0
- package/skills/agentforce-development/references/salesforce-cli-for-agents.md +393 -0
- package/skills/agentforce-development/references/version-history.md +23 -0
- package/skills/building-webapp-data-visualization/SKILL.md +72 -0
- package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
- package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
- package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
- package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
- package/skills/building-webapp-react-components/SKILL.md +96 -0
- package/skills/building-webapp-react-components/implementation/component.md +78 -0
- package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
- package/skills/building-webapp-react-components/implementation/page.md +93 -0
- package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
- package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
- package/skills/configuring-webapp-metadata/SKILL.md +158 -0
- package/skills/creating-webapp/SKILL.md +141 -0
- package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
- package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
- package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
- package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -4
- package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -5
- package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
- package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
- package/skills/generating-custom-tab/SKILL.md +154 -0
- package/skills/generating-experience-lwr-site/SKILL.md +196 -0
- package/skills/generating-experience-lwr-site/docs/bootstrap-template-byo-lwr.md +224 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-brandingSet.md +131 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-route.md +232 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-themeLayout.md +141 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-view.md +233 -0
- package/skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md +42 -0
- package/skills/generating-experience-lwr-site/docs/handle-component-and-region-ids.md +27 -0
- package/skills/generating-experience-lwr-site/docs/handle-ui-components.md +215 -0
- package/skills/generating-experience-react-site/SKILL.md +67 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
- package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
- package/skills/{salesforce-flow → generating-flow}/SKILL.md +3 -3
- package/skills/generating-fragment/SKILL.md +117 -0
- package/skills/generating-lightning-app/SKILL.md +423 -0
- package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
- package/skills/generating-permission-set/SKILL.md +174 -0
- package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
- package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
- package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
- package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
- package/skills/installing-webapp-features/SKILL.md +210 -0
- package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
- package/skills/switching-org/SKILL.md +28 -0
- package/skills/using-webapp-graphql/SKILL.md +324 -0
- package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
- package/skills/apex-class/SKILL.md +0 -253
- package/skills/apex-class/examples/AccountDeduplicationBatch.cls +0 -148
- package/skills/apex-class/examples/AccountSelector.cls +0 -193
- package/skills/apex-class/examples/AccountService.cls +0 -201
- package/skills/apex-class/templates/abstract.cls +0 -128
- package/skills/apex-class/templates/batch.cls +0 -125
- package/skills/apex-class/templates/domain.cls +0 -102
- package/skills/apex-class/templates/dto.cls +0 -108
- package/skills/apex-class/templates/exception.cls +0 -51
- package/skills/apex-class/templates/interface.cls +0 -25
- package/skills/apex-class/templates/queueable.cls +0 -92
- package/skills/apex-class/templates/schedulable.cls +0 -75
- package/skills/apex-class/templates/selector.cls +0 -92
- package/skills/apex-class/templates/service.cls +0 -69
- package/skills/apex-class/templates/utility.cls +0 -97
- package/skills/apex-test-class/SKILL.md +0 -101
- package/skills/apex-test-class/references/assertion-patterns.md +0 -209
- package/skills/apex-test-class/references/async-testing.md +0 -276
- package/skills/apex-test-class/references/mocking-patterns.md +0 -219
- package/skills/apex-test-class/references/test-data-factory.md +0 -176
- package/skills/deployment-readiness-check/SKILL.md +0 -257
- package/skills/deployment-readiness-check/assets/deployment_checklist.md +0 -286
- package/skills/deployment-readiness-check/references/rollback_procedures.md +0 -308
- package/skills/deployment-readiness-check/scripts/check_metadata.sh +0 -207
- package/skills/salesforce-custom-tab/SKILL.md +0 -78
- package/skills/salesforce-experience-site/SKILL.md +0 -178
- package/skills/salesforce-fragment/SKILL.md +0 -42
- package/skills/salesforce-lightning-app-build/SKILL.md +0 -254
- package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
- package/skills/salesforce-web-app-feature/SKILL.md +0 -70
- package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
- package/skills/salesforce-web-application/SKILL.md +0 -34
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Agent Script Templates
|
|
2
|
+
|
|
3
|
+
Organized templates for building Agentforce agents.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Directory Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
assets/
|
|
11
|
+
├── agents/ Complete, deployable agent examples
|
|
12
|
+
├── components/ Reusable action and topic snippets
|
|
13
|
+
├── patterns/ Advanced patterns (lifecycle, callbacks)
|
|
14
|
+
└── metadata/ XML metadata templates
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
What do you need?
|
|
23
|
+
│
|
|
24
|
+
├─► "Just starting"
|
|
25
|
+
│ └─► agents/hello-world.agent
|
|
26
|
+
│
|
|
27
|
+
├─► "Complete agent with topics"
|
|
28
|
+
│ └─► agents/multi-topic.agent
|
|
29
|
+
│
|
|
30
|
+
├─► "Add actions to my agent"
|
|
31
|
+
│ ├─► components/flow-action.agent
|
|
32
|
+
│ └─► components/apex-action.agent
|
|
33
|
+
│
|
|
34
|
+
├─► "Advanced patterns"
|
|
35
|
+
│ └─► patterns/ (see patterns/README.md)
|
|
36
|
+
│
|
|
37
|
+
└─► "XML metadata"
|
|
38
|
+
└─► metadata/
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Template Inventory
|
|
44
|
+
|
|
45
|
+
### agents/ - Complete Agents
|
|
46
|
+
|
|
47
|
+
| Template | Complexity | Description |
|
|
48
|
+
|----------|------------|-------------|
|
|
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 |
|
|
52
|
+
| `production-faq.agent` | Advanced | Production-ready with escalation |
|
|
53
|
+
|
|
54
|
+
### components/ - Reusable Parts
|
|
55
|
+
|
|
56
|
+
| Template | Purpose |
|
|
57
|
+
|----------|---------|
|
|
58
|
+
| `flow-action.agent` | Flow action integration |
|
|
59
|
+
| `apex-action.agent` | Apex action integration |
|
|
60
|
+
| `topic-with-actions.agent` | Topic with actions |
|
|
61
|
+
| `error-handling.agent` | Input validation |
|
|
62
|
+
| `escalation-setup.agent` | Human handoff |
|
|
63
|
+
|
|
64
|
+
### patterns/ - Advanced (see patterns/README.md)
|
|
65
|
+
|
|
66
|
+
| Template | Purpose | Deployment |
|
|
67
|
+
|----------|---------|------------|
|
|
68
|
+
| `lifecycle-events.agent` | before/after reasoning | GenAiPlannerBundle |
|
|
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 |
|
|
72
|
+
| *(6 more patterns)* | | |
|
|
73
|
+
|
|
74
|
+
### metadata/ - XML Templates
|
|
75
|
+
|
|
76
|
+
| Template | Purpose |
|
|
77
|
+
|----------|---------|
|
|
78
|
+
| `bundle-meta.xml` | AiAuthoringBundle metadata |
|
|
79
|
+
| `genai-function-*.xml` | Action metadata |
|
|
80
|
+
| `genai-plugin.xml` | Plugin grouping |
|
|
81
|
+
| `*-prompt-template.xml` | PromptTemplate |
|
|
82
|
+
| `http-callout-flow.xml` | Flow template |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Related Documentation
|
|
87
|
+
|
|
88
|
+
- [SKILL.md](../SKILL.md) - Main skill reference
|
|
89
|
+
- [references/](../references/) - Detailed documentation
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Agent Spec: Agent_API_Name
|
|
2
|
+
|
|
3
|
+
## Purpose & Scope
|
|
4
|
+
|
|
5
|
+
Describe the agent's purpose in 1-2 sentences. What does it help users do?
|
|
6
|
+
What domain does it operate in?
|
|
7
|
+
|
|
8
|
+
## Behavioral Intent
|
|
9
|
+
|
|
10
|
+
Describe the key behavioral rules that govern the agent:
|
|
11
|
+
- What must the agent know before taking action?
|
|
12
|
+
- What backing logic types are used (Apex, Flow, Prompt Template)?
|
|
13
|
+
- What guardrails apply (off-topic handling, escalation)?
|
|
14
|
+
- What information persists across topic switches?
|
|
15
|
+
|
|
16
|
+
## Topic Map
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
%%{init: {'theme':'neutral'}}%%
|
|
20
|
+
graph TD
|
|
21
|
+
A[start_agent<br/>topic_selector]
|
|
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]
|
|
27
|
+
```
|
|
28
|
+
|
|
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.
|
|
31
|
+
|
|
32
|
+
## Variables
|
|
33
|
+
|
|
34
|
+
- `variable_name` (mutable type = default) — What this variable tracks.
|
|
35
|
+
Set by: which action or utility. Read by: which topics for gating or
|
|
36
|
+
conditional instructions.
|
|
37
|
+
|
|
38
|
+
## Actions & Backing Logic
|
|
39
|
+
|
|
40
|
+
### action_name (topic_name topic)
|
|
41
|
+
|
|
42
|
+
- **Target:** `apex://ClassName` or `flow://FlowName` or `prompt://PromptTemplateName`
|
|
43
|
+
- **Backing Status:** EXISTS / NEEDS STUB / NEEDS IMPLEMENTATION
|
|
44
|
+
|
|
45
|
+
#### Inputs
|
|
46
|
+
|
|
47
|
+
| Name | Type | Required | Source |
|
|
48
|
+
|------|------|----------|--------|
|
|
49
|
+
| property_id | string | Yes | User input |
|
|
50
|
+
| max_results | integer | No | Defaults to 10 |
|
|
51
|
+
|
|
52
|
+
#### Outputs
|
|
53
|
+
|
|
54
|
+
| Name | Type | Visible to User? | Source | Notes |
|
|
55
|
+
|------|------|-------------------|--------|-------|
|
|
56
|
+
| property | object | Yes | `Property__c` | Complete property details |
|
|
57
|
+
| related_applications | list[object] | Yes | `Application__c` | Records for this property |
|
|
58
|
+
| active_listing | boolean | Yes | `Listing__c` | Listing status |
|
|
59
|
+
| hasData | boolean | No | Computed | Internal empty-result flag |
|
|
60
|
+
|
|
61
|
+
> **"Visible to User?"** maps to `filter_from_agent` in the `.agent` file: Yes → `filter_from_agent: False`, No → `filter_from_agent: True`.
|
|
62
|
+
|
|
63
|
+
#### Stubbing Requirement
|
|
64
|
+
|
|
65
|
+
If NEEDS STUB:
|
|
66
|
+
|
|
67
|
+
- Apex class name and inner class wrappers needed
|
|
68
|
+
- `complex_data_type_name` for each `object`/`list[object]` output
|
|
69
|
+
- Key queries or computation logic the stub must implement
|
|
70
|
+
|
|
71
|
+
Repeat for each action.
|
|
72
|
+
|
|
73
|
+
## Gating Logic
|
|
74
|
+
|
|
75
|
+
- `action_name` visibility: `available when @variables.variable_name != ""`
|
|
76
|
+
— Rationale for why this gate exists.
|
|
77
|
+
|
|
78
|
+
List all gating conditions with their rationale.
|
|
79
|
+
|
|
80
|
+
## Architecture Pattern
|
|
81
|
+
|
|
82
|
+
State the architecture pattern: hub-and-spoke, chain, hybrid, etc.
|
|
83
|
+
Describe the routing strategy and how topics relate to each other.
|
|
84
|
+
|
|
85
|
+
## Agent Configuration
|
|
86
|
+
|
|
87
|
+
- **developer_name:** `Agent_API_Name`
|
|
88
|
+
- **agent_label:** `Agent Display Name`
|
|
89
|
+
- **agent_type:** `AgentforceEmployeeAgent` or `AgentforceServiceAgent` — state the reasoning based on prompt signals (e.g., "accessible by employees" → Employee, "customer-facing channel" → Service)
|
|
90
|
+
- **default_agent_user:** Required for `AgentforceServiceAgent`. Forbidden for `AgentforceEmployeeAgent`. If specified, MUST be **user name**. MUST NEVER be **user ID**. User MUST have `Einstein Agent` license.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Complete Agent Templates
|
|
2
|
+
|
|
3
|
+
Templates for building complete, deployable agents.
|
|
4
|
+
|
|
5
|
+
## Learning Path
|
|
6
|
+
|
|
7
|
+
| Template | Complexity | Description |
|
|
8
|
+
|----------|------------|-------------|
|
|
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 |
|
|
12
|
+
| `production-faq.agent` | Advanced | Production-ready FAQ with escalation |
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
1. Copy a template to your SFDX project:
|
|
17
|
+
```bash
|
|
18
|
+
mkdir -p force-app/main/default/aiAuthoringBundles/My_Agent
|
|
19
|
+
cp hello-world.agent force-app/main/default/aiAuthoringBundles/My_Agent/My_Agent.agent
|
|
20
|
+
cp ../metadata/bundle-meta.xml force-app/main/default/aiAuthoringBundles/My_Agent/My_Agent.bundle-meta.xml
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Validate and deploy:
|
|
24
|
+
```bash
|
|
25
|
+
sf agent validate authoring-bundle --api-name My_Agent --target-org your-org
|
|
26
|
+
sf agent publish authoring-bundle --api-name My_Agent --target-org your-org
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Required Blocks
|
|
30
|
+
|
|
31
|
+
Every agent must have these blocks **in this order**:
|
|
32
|
+
|
|
33
|
+
| Block | Purpose |
|
|
34
|
+
|-------|---------|
|
|
35
|
+
| `system:` | Agent personality and default messages |
|
|
36
|
+
| `config:` | Deployment metadata (agent_name, label, etc.) |
|
|
37
|
+
| `variables:` | Data connections and state storage |
|
|
38
|
+
| `language:` | Locale configuration |
|
|
39
|
+
| `start_agent` | Entry point topic (exactly one required) |
|
|
40
|
+
|
|
41
|
+
## Next Steps
|
|
42
|
+
|
|
43
|
+
- [components/](../components/) - Reusable action and topic templates
|
|
44
|
+
- [patterns/](../patterns/) - Advanced patterns for complex behaviors
|
|
45
|
+
- [metadata/](../metadata/) - XML metadata templates
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Hello World Agent
|
|
2
|
+
# The minimal viable Agentforce agent - start here!
|
|
3
|
+
#
|
|
4
|
+
# This template shows the absolute minimum structure required for a working agent.
|
|
5
|
+
# Use this as your starting point when learning Agent Script.
|
|
6
|
+
#
|
|
7
|
+
# ★ Why This Structure?
|
|
8
|
+
# - system: Sets agent personality and default messages
|
|
9
|
+
# - config: Required metadata for deployment (agent_name must be unique)
|
|
10
|
+
# - variables: Linked variables connect to Messaging context (required for deployment)
|
|
11
|
+
# - language: Locale settings (required for deployment)
|
|
12
|
+
# - start_agent: Entry point topic (exactly one required)
|
|
13
|
+
#
|
|
14
|
+
# ★ Key Validation Points (from 100-point scoring):
|
|
15
|
+
# - [10 pts] config block with all 4 required fields
|
|
16
|
+
# - [10 pts] 3 linked variables (EndUserId, RoutableId, ContactId)
|
|
17
|
+
# - [5 pts] language block present
|
|
18
|
+
# - [10 pts] At least one start_agent topic
|
|
19
|
+
#
|
|
20
|
+
# Deploy with: sf agent publish authoring-bundle --api-name Hello_World_Agent --target-org [alias]
|
|
21
|
+
|
|
22
|
+
system:
|
|
23
|
+
instructions: "You are a friendly assistant. Greet users warmly and help them."
|
|
24
|
+
messages:
|
|
25
|
+
welcome: "Hello! I'm here to help. What can I do for you today?"
|
|
26
|
+
error: "I'm sorry, something went wrong. Please try again."
|
|
27
|
+
|
|
28
|
+
config:
|
|
29
|
+
agent_name: "Hello_World_Agent"
|
|
30
|
+
default_agent_user: "your.user@company.com"
|
|
31
|
+
agent_label: "Hello World Agent"
|
|
32
|
+
description: "A minimal example agent to learn Agent Script basics"
|
|
33
|
+
|
|
34
|
+
variables:
|
|
35
|
+
# Linked variables (required) - Connect to Salesforce Messaging context
|
|
36
|
+
EndUserId: linked string
|
|
37
|
+
source: @MessagingSession.MessagingEndUserId
|
|
38
|
+
description: "Messaging End User ID"
|
|
39
|
+
RoutableId: linked string
|
|
40
|
+
source: @MessagingSession.Id
|
|
41
|
+
description: "Messaging Session ID"
|
|
42
|
+
ContactId: linked string
|
|
43
|
+
source: @MessagingEndUser.ContactId
|
|
44
|
+
description: "Contact ID"
|
|
45
|
+
|
|
46
|
+
language:
|
|
47
|
+
default_locale: "en_US"
|
|
48
|
+
additional_locales: ""
|
|
49
|
+
all_additional_locales: False
|
|
50
|
+
|
|
51
|
+
# Entry point topic - this is where every conversation starts
|
|
52
|
+
start_agent main:
|
|
53
|
+
label: "Main"
|
|
54
|
+
description: "Greets users and provides help"
|
|
55
|
+
|
|
56
|
+
reasoning:
|
|
57
|
+
instructions: ->
|
|
58
|
+
| Welcome the user warmly.
|
|
59
|
+
| Ask how you can help them today.
|
|
60
|
+
| Be friendly and conversational.
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
|
4
|
+
#
|
|
5
|
+
# Usage: Replace {{placeholders}} with your values
|
|
6
|
+
# Required: agent_name, default_agent_user, agent_label, description
|
|
7
|
+
# Required: At least 2 topics with label and description
|
|
8
|
+
|
|
9
|
+
system:
|
|
10
|
+
instructions: "{{SystemInstructions}}"
|
|
11
|
+
messages:
|
|
12
|
+
welcome: "{{WelcomeMessage}}"
|
|
13
|
+
error: "I'm sorry, I encountered an issue. Please try again."
|
|
14
|
+
|
|
15
|
+
config:
|
|
16
|
+
agent_name: "{{AgentApiName}}"
|
|
17
|
+
default_agent_user: "{{AgentUser}}"
|
|
18
|
+
agent_label: "{{AgentLabel}}"
|
|
19
|
+
description: "{{AgentDescription}}"
|
|
20
|
+
|
|
21
|
+
variables:
|
|
22
|
+
EndUserId: linked string
|
|
23
|
+
source: @MessagingSession.MessagingEndUserId
|
|
24
|
+
description: "Messaging End User ID"
|
|
25
|
+
RoutableId: linked string
|
|
26
|
+
source: @MessagingSession.Id
|
|
27
|
+
description: "Messaging Session ID"
|
|
28
|
+
ContactId: linked string
|
|
29
|
+
source: @MessagingEndUser.ContactId
|
|
30
|
+
description: "Contact ID"
|
|
31
|
+
user_intent: mutable string
|
|
32
|
+
description: "What the user is trying to accomplish"
|
|
33
|
+
|
|
34
|
+
language:
|
|
35
|
+
default_locale: "en_US"
|
|
36
|
+
additional_locales: ""
|
|
37
|
+
all_additional_locales: False
|
|
38
|
+
|
|
39
|
+
start_agent topic_selector:
|
|
40
|
+
label: "Topic Selector"
|
|
41
|
+
description: "Routes users to the appropriate topic based on their needs"
|
|
42
|
+
|
|
43
|
+
reasoning:
|
|
44
|
+
instructions: ->
|
|
45
|
+
| Determine what the user needs help with.
|
|
46
|
+
| Route them to the most appropriate topic.
|
|
47
|
+
| If unclear, ask clarifying questions.
|
|
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
|
|
54
|
+
|
|
55
|
+
topic {{topic_one_name}}:
|
|
56
|
+
label: "{{TopicOneLabel}}"
|
|
57
|
+
description: "{{TopicOneDescription}}"
|
|
58
|
+
|
|
59
|
+
reasoning:
|
|
60
|
+
instructions: ->
|
|
61
|
+
| {{TopicOneInstructions}}
|
|
62
|
+
actions:
|
|
63
|
+
back_to_menu: @utils.transition to @topic.topic_selector
|
|
64
|
+
|
|
65
|
+
topic {{topic_two_name}}:
|
|
66
|
+
label: "{{TopicTwoLabel}}"
|
|
67
|
+
description: "{{TopicTwoDescription}}"
|
|
68
|
+
|
|
69
|
+
reasoning:
|
|
70
|
+
instructions: ->
|
|
71
|
+
| {{TopicTwoInstructions}}
|
|
72
|
+
actions:
|
|
73
|
+
back_to_menu: @utils.transition to @topic.topic_selector
|
|
74
|
+
|
|
75
|
+
topic {{topic_three_name}}:
|
|
76
|
+
label: "{{TopicThreeLabel}}"
|
|
77
|
+
description: "{{TopicThreeDescription}}"
|
|
78
|
+
|
|
79
|
+
reasoning:
|
|
80
|
+
instructions: ->
|
|
81
|
+
| {{TopicThreeInstructions}}
|
|
82
|
+
actions:
|
|
83
|
+
back_to_menu: @utils.transition to @topic.topic_selector
|
|
84
|
+
|
|
85
|
+
topic farewell:
|
|
86
|
+
label: "Farewell"
|
|
87
|
+
description: "Ends the conversation gracefully"
|
|
88
|
+
|
|
89
|
+
reasoning:
|
|
90
|
+
instructions: ->
|
|
91
|
+
| Thank the user for reaching out.
|
|
92
|
+
| Wish them a great day.
|
|
93
|
+
| Let them know they can return anytime.
|
|
94
|
+
|
|
95
|
+
topic escalation:
|
|
96
|
+
label: "Escalation"
|
|
97
|
+
description: "Handles requests to transfer to a live human agent"
|
|
98
|
+
|
|
99
|
+
reasoning:
|
|
100
|
+
instructions: ->
|
|
101
|
+
| If the user explicitly asks to speak with a human, escalate.
|
|
102
|
+
| Acknowledge the request and transfer gracefully.
|
|
103
|
+
actions:
|
|
104
|
+
escalate_to_human: @utils.escalate
|
|
105
|
+
description: "Escalate to a human agent"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Simple FAQ Agent
|
|
2
|
+
# A minimal working example of an Agentforce agent
|
|
3
|
+
# Uses pure LLM reasoning without external actions
|
|
4
|
+
#
|
|
5
|
+
# Deploy with: sf agent publish authoring-bundle --api-name Simple_FAQ_Agent --target-org [alias]
|
|
6
|
+
|
|
7
|
+
system:
|
|
8
|
+
instructions: "You are a helpful FAQ assistant for our company. Answer questions accurately and concisely. If you don't know the answer, say so honestly. Never share sensitive or confidential information. Keep responses friendly and professional."
|
|
9
|
+
messages:
|
|
10
|
+
welcome: "Hello! I'm your FAQ assistant. How can I help you today?"
|
|
11
|
+
error: "I'm sorry, I encountered an issue. Please try again."
|
|
12
|
+
|
|
13
|
+
config:
|
|
14
|
+
agent_name: "Simple_FAQ_Agent"
|
|
15
|
+
default_agent_user: "agent.user@company.com"
|
|
16
|
+
agent_label: "Simple FAQ Agent"
|
|
17
|
+
description: "A minimal FAQ agent that answers common questions using AI"
|
|
18
|
+
|
|
19
|
+
variables:
|
|
20
|
+
EndUserId: linked string
|
|
21
|
+
source: @MessagingSession.MessagingEndUserId
|
|
22
|
+
description: "Messaging End User ID"
|
|
23
|
+
RoutableId: linked string
|
|
24
|
+
source: @MessagingSession.Id
|
|
25
|
+
description: "Messaging Session ID"
|
|
26
|
+
ContactId: linked string
|
|
27
|
+
source: @MessagingEndUser.ContactId
|
|
28
|
+
description: "Contact ID"
|
|
29
|
+
user_question: mutable string
|
|
30
|
+
description: "The user's current question"
|
|
31
|
+
conversation_topic: mutable string
|
|
32
|
+
description: "The current topic being discussed"
|
|
33
|
+
question_count: mutable number
|
|
34
|
+
description: "Number of questions answered in this session"
|
|
35
|
+
|
|
36
|
+
language:
|
|
37
|
+
default_locale: "en_US"
|
|
38
|
+
additional_locales: ""
|
|
39
|
+
all_additional_locales: False
|
|
40
|
+
|
|
41
|
+
start_agent topic_selector:
|
|
42
|
+
label: "Topic Selector"
|
|
43
|
+
description: "Routes incoming questions to the FAQ handler"
|
|
44
|
+
|
|
45
|
+
reasoning:
|
|
46
|
+
instructions: ->
|
|
47
|
+
| Listen to the user's question and determine how to help.
|
|
48
|
+
| If the question is about a specific topic, note it.
|
|
49
|
+
| Route to the FAQ handler for processing.
|
|
50
|
+
actions:
|
|
51
|
+
handle_faq: @utils.transition to @topic.faq_handler
|
|
52
|
+
end_conversation: @utils.transition to @topic.farewell
|
|
53
|
+
|
|
54
|
+
topic faq_handler:
|
|
55
|
+
label: "FAQ Handler"
|
|
56
|
+
description: "Handles frequently asked questions and provides helpful answers"
|
|
57
|
+
|
|
58
|
+
reasoning:
|
|
59
|
+
instructions: ->
|
|
60
|
+
| Answer the user's question based on your knowledge.
|
|
61
|
+
| Be helpful, accurate, and concise.
|
|
62
|
+
| Keep responses under 3-4 sentences when possible.
|
|
63
|
+
| If you need more information, ask clarifying questions.
|
|
64
|
+
|
|
|
65
|
+
| Common topics you can help with:
|
|
66
|
+
| - Business hours and location
|
|
67
|
+
| - Return and refund policies
|
|
68
|
+
| - Shipping information
|
|
69
|
+
| - Product questions
|
|
70
|
+
| - Account and billing
|
|
71
|
+
|
|
|
72
|
+
| If the question is outside your knowledge:
|
|
73
|
+
| - Acknowledge you don't have that information
|
|
74
|
+
| - Suggest contacting customer support
|
|
75
|
+
| - Offer to help with something else
|
|
76
|
+
actions:
|
|
77
|
+
new_question: @utils.transition to @topic.topic_selector
|
|
78
|
+
end_conversation: @utils.transition to @topic.farewell
|
|
79
|
+
escalate: @utils.transition to @topic.escalation
|
|
80
|
+
|
|
81
|
+
topic farewell:
|
|
82
|
+
label: "Farewell"
|
|
83
|
+
description: "Ends the conversation politely"
|
|
84
|
+
|
|
85
|
+
reasoning:
|
|
86
|
+
instructions: ->
|
|
87
|
+
| Thank the user for their questions.
|
|
88
|
+
| Wish them a great day.
|
|
89
|
+
| Let them know they can return anytime for more help.
|
|
90
|
+
|
|
91
|
+
topic escalation:
|
|
92
|
+
label: "Escalation"
|
|
93
|
+
description: "Handles requests to speak with a human agent"
|
|
94
|
+
|
|
95
|
+
reasoning:
|
|
96
|
+
instructions: ->
|
|
97
|
+
| If the user wants to speak with a human, escalate gracefully.
|
|
98
|
+
| Acknowledge their request and transfer the conversation.
|
|
99
|
+
actions:
|
|
100
|
+
escalate_to_human: @utils.escalate
|
|
101
|
+
description: "Transfer to a human agent"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Simple Q&A Agent Template
|
|
2
|
+
# A minimal agent that handles basic questions using LLM reasoning only
|
|
3
|
+
# No external actions - just conversational AI
|
|
4
|
+
#
|
|
5
|
+
# Usage: Replace {{placeholders}} with your values
|
|
6
|
+
# Required: agent_name, default_agent_user, agent_label, description
|
|
7
|
+
|
|
8
|
+
system:
|
|
9
|
+
instructions: "{{SystemInstructions}}"
|
|
10
|
+
messages:
|
|
11
|
+
welcome: "{{WelcomeMessage}}"
|
|
12
|
+
error: "I'm sorry, I encountered an issue. Please try again."
|
|
13
|
+
|
|
14
|
+
config:
|
|
15
|
+
agent_name: "{{AgentApiName}}"
|
|
16
|
+
default_agent_user: "{{AgentUser}}"
|
|
17
|
+
agent_label: "{{AgentLabel}}"
|
|
18
|
+
description: "{{AgentDescription}}"
|
|
19
|
+
|
|
20
|
+
variables:
|
|
21
|
+
EndUserId: linked string
|
|
22
|
+
source: @MessagingSession.MessagingEndUserId
|
|
23
|
+
description: "Messaging End User ID"
|
|
24
|
+
RoutableId: linked string
|
|
25
|
+
source: @MessagingSession.Id
|
|
26
|
+
description: "Messaging Session ID"
|
|
27
|
+
ContactId: linked string
|
|
28
|
+
source: @MessagingEndUser.ContactId
|
|
29
|
+
description: "Contact ID"
|
|
30
|
+
user_query: mutable string
|
|
31
|
+
description: "The user's current question or request"
|
|
32
|
+
|
|
33
|
+
language:
|
|
34
|
+
default_locale: "en_US"
|
|
35
|
+
additional_locales: ""
|
|
36
|
+
all_additional_locales: False
|
|
37
|
+
|
|
38
|
+
start_agent topic_selector:
|
|
39
|
+
label: "Topic Selector"
|
|
40
|
+
description: "Routes incoming requests to the Q&A handler"
|
|
41
|
+
|
|
42
|
+
reasoning:
|
|
43
|
+
instructions: ->
|
|
44
|
+
| Listen to the user's question.
|
|
45
|
+
| Route to the Q&A handler for processing.
|
|
46
|
+
actions:
|
|
47
|
+
handle_question: @utils.transition to @topic.qa_handler
|
|
48
|
+
end_conversation: @utils.transition to @topic.farewell
|
|
49
|
+
|
|
50
|
+
topic qa_handler:
|
|
51
|
+
label: "Q&A Handler"
|
|
52
|
+
description: "Handles questions and provides answers"
|
|
53
|
+
|
|
54
|
+
reasoning:
|
|
55
|
+
instructions: ->
|
|
56
|
+
| Answer the user's question based on your knowledge.
|
|
57
|
+
| Be helpful, accurate, and concise.
|
|
58
|
+
| Keep responses clear and easy to understand.
|
|
59
|
+
| If you need more information, ask clarifying questions.
|
|
60
|
+
actions:
|
|
61
|
+
new_question: @utils.transition to @topic.topic_selector
|
|
62
|
+
end_conversation: @utils.transition to @topic.farewell
|
|
63
|
+
|
|
64
|
+
topic farewell:
|
|
65
|
+
label: "Farewell"
|
|
66
|
+
description: "Ends the conversation gracefully"
|
|
67
|
+
|
|
68
|
+
reasoning:
|
|
69
|
+
instructions: ->
|
|
70
|
+
| Thank the user for their questions.
|
|
71
|
+
| Wish them a great day.
|
|
72
|
+
| Let them know they can return anytime for more help.
|