@salesforce/afv-skills 1.58.0 → 1.59.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 +1 -1
- package/skills/agentforce-bot-upgrade/SKILL.md +3 -1
- package/skills/agentforce-generate/SKILL.md +21 -1
- package/skills/agentforce-generate/references/known-issues.md +51 -1
- package/skills/agentforce-generate/references/legacy-nga-regression-eval.md +547 -0
- package/skills/agentforce-generate/references/upgrade-legacy-agent-to-agentscript.md +577 -0
- package/skills/agentforce-generate/scripts/upgrade-legacy-nga-analyze.py +404 -0
- package/skills/agentforce-generate/scripts/upgrade-legacy-nga-run-trials.sh +58 -0
- package/skills/agentforce-persona-generate/SKILL.md +505 -0
- package/skills/agentforce-persona-generate/assets/checklist-template.md +100 -0
- package/skills/agentforce-persona-generate/assets/persona-encoding-template.md +252 -0
- package/skills/agentforce-persona-generate/assets/persona-template.md +229 -0
- package/skills/agentforce-persona-generate/assets/sample-dialog-template.md +50 -0
- package/skills/agentforce-persona-generate/assets/workshop-outline-template.md +97 -0
- package/skills/agentforce-persona-generate/examples/concierge-persona.md +189 -0
- package/skills/agentforce-persona-generate/examples/concierge-sample-dialog.md +70 -0
- package/skills/agentforce-persona-generate/examples/drover-persona.md +194 -0
- package/skills/agentforce-persona-generate/examples/drover-sample-dialog.md +62 -0
- package/skills/agentforce-persona-generate/examples/steady-hand-persona.md +188 -0
- package/skills/agentforce-persona-generate/examples/steady-hand-sample-dialog.md +68 -0
- package/skills/agentforce-persona-generate/examples/yt-persona.md +195 -0
- package/skills/agentforce-persona-generate/examples/yt-sample-dialog.md +66 -0
- package/skills/agentforce-persona-generate/references/attributions.md +36 -0
- package/skills/agentforce-persona-generate/references/interaction-design-notes.md +30 -0
- package/skills/agentforce-persona-generate/references/persona-encoding-guide.md +566 -0
- package/skills/agentforce-persona-generate/references/persona-framework.md +796 -0
- package/skills/agentforce-persona-generate/references/refinement-mappings.md +31 -0
- package/skills/agentforce-persona-generate/references/scoring-rubric.md +58 -0
- package/skills/agentforce-persona-generate/references/voice-catalog.json +2327 -0
- package/skills/agentforce-persona-generate/references/workshop-question-policy.md +90 -0
- package/skills/agentforce-persona-generate/references/workshop-scenario-seeds.md +119 -0
- package/skills/agentforce-persona-generate/scripts/parse_agent_yaml.py +223 -0
- package/skills/dx-app-analytics-query/SKILL.md +8 -8
- package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -12
- package/skills/experience-ui-bundle-app-coordinate/references/phase-completion-validation.md +3 -3
- package/skills/experience-ui-bundle-app-coordinate/references/phase-execution-pattern.md +9 -7
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-dangling-refs.mjs +132 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.mjs +62 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-1-complete.mjs +71 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-4-complete.mjs +95 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-6-ready.mjs +78 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-prerequisites.mjs +21 -0
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.mjs +28 -0
- package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +3 -1
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.mjs +40 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +7 -5
- package/skills/experience-ui-bundle-frontend-generate/scripts/check-preconditions.mjs +70 -0
- package/skills/experience-ui-bundle-frontend-generate/scripts/resolve-ui-bundle.mjs +76 -0
- package/skills/experience-ui-bundle-frontend-generate/scripts/verify-rules.mjs +115 -0
- package/skills/experience-ui-bundle-metadata-generate/SKILL.md +7 -3
- package/skills/experience-ui-bundle-metadata-generate/references/angular-metadata-generate.md +1 -1
- package/skills/experience-ui-bundle-metadata-generate/references/react-metadata-generate.md +1 -1
- package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.mjs +43 -0
- package/skills/experience-ui-bundle-metadata-generate/scripts/detect-framework.mjs +131 -0
- package/skills/experience-ui-bundle-metadata-generate/scripts/verify-bundle-location.mjs +152 -0
- package/skills/experience-ui-bundle-mfa-configure/references/branding.md +10 -6
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-dangling-refs.sh +0 -42
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.sh +0 -26
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-1-complete.sh +0 -35
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-4-complete.sh +0 -47
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-6-ready.sh +0 -33
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-prerequisites.sh +0 -20
- package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.sh +0 -15
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +0 -30
- package/skills/experience-ui-bundle-frontend-generate/scripts/check-preconditions.sh +0 -37
- package/skills/experience-ui-bundle-frontend-generate/scripts/resolve-ui-bundle.sh +0 -66
- package/skills/experience-ui-bundle-frontend-generate/scripts/verify-rules.sh +0 -58
- package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.sh +0 -30
- package/skills/experience-ui-bundle-metadata-generate/scripts/detect-framework.sh +0 -73
- package/skills/experience-ui-bundle-metadata-generate/scripts/verify-bundle-location.sh +0 -118
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "4.0.0"
|
|
3
|
+
date: 2026-05-15
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Persona Encoding Guide
|
|
7
|
+
|
|
8
|
+
How to encode a persona document into Agentforce. This guide covers the encoding architecture, field-by-field guidance for each agent authoring tool, and additional encoding options.
|
|
9
|
+
|
|
10
|
+
**Prerequisite:** A completed persona document — identity traits, Personification, 13 expression dimensions across 5 categories (Register, Voice, Tone, Delivery, Chatting Style), tone boundaries, tone flex rules, phrase book, never-say list, and optionally lexicon and guardrails. See the **Agent Persona Framework** (`references/persona-framework.md`) for how to create one.
|
|
11
|
+
|
|
12
|
+
## Terminology note: "Subagent" is the new "Topic"
|
|
13
|
+
|
|
14
|
+
Salesforce has adopted **`subagent`** as the canonical term in `.agent` file syntax (per `forcedotcom/sf-skills/skills/developing-agentforce/`). This guide uses `subagent` for Agent Script discussion. **Agentforce Builder UI still uses "Topic"** — when this guide references Builder's "Topic Instructions" field or "Topic"-named UI elements, that's the Builder term for the same concept. Agent Script's `subagent` block and Builder's "Topic" are interchangeable in encoding semantics; only the UI label differs.
|
|
15
|
+
|
|
16
|
+
When this guide says **"per-subagent"** in an Agent Script context, it's referring to a `subagent` block. When it says **"Topic Instructions"** in a Builder context, it's the field where the same content goes.
|
|
17
|
+
|
|
18
|
+
## Two encoding lanes
|
|
19
|
+
|
|
20
|
+
The skill produces encoding output for two scenarios:
|
|
21
|
+
|
|
22
|
+
**Greenfield (Use Case A) — start a new agent.**
|
|
23
|
+
- ENCODE produces a **minimal valid `.agent` skeleton** with `system`, `config`, `language`, `start_agent` (stub), and one placeholder `subagent`.
|
|
24
|
+
- The persona content lives in `system.instructions` and `system.messages`.
|
|
25
|
+
- Subagents, actions, variables, and routing are *placeholders for the user to flesh out* — the skill never invents them.
|
|
26
|
+
- Output path: `persona/[agent-name]/[agent-name].agent`.
|
|
27
|
+
|
|
28
|
+
**Brownfield (Use Case B) — re-encode an existing agent.**
|
|
29
|
+
- The skill reads the source `.agent` file via `scripts/parse_agent_yaml.py` (read-only).
|
|
30
|
+
- ENCODE preserves the existing structure (subagents, actions, routing, variables — all of it) and **only modifies persona-bearing fields**: `system.instructions`, `system.messages.welcome`, `system.messages.error`, per-subagent `system:` overrides, per-subagent `reasoning.instructions:`, per-action `progress_indicator_message:`.
|
|
31
|
+
- Output: an annotated proposed-new-file plus a diff summary at `persona/[agent-name]/persona-diff.md`.
|
|
32
|
+
- The diff explicitly excludes routing, subagent structure, action contracts.
|
|
33
|
+
|
|
34
|
+
## Schema authority
|
|
35
|
+
|
|
36
|
+
The canonical Agent Script schema lives in [`forcedotcom/sf-skills/skills/developing-agentforce/`](https://github.com/forcedotcom/sf-skills/tree/main/skills/developing-agentforce). When in doubt about a top-level block, an action property, or an indentation rule, defer to that skill. This guide focuses on persona-bearing fields and how the persona document maps into them — not on the full Agent Script grammar.
|
|
37
|
+
|
|
38
|
+
Quick reference (see `developing-agentforce` for full detail):
|
|
39
|
+
- **Top-level block order is mandatory:** `system` → `config` → `variables` → `connection` → `knowledge` → `language` → `start_agent` → `subagent`.
|
|
40
|
+
- **Indentation:** 4 spaces, never tabs.
|
|
41
|
+
- **Booleans:** `True` / `False` capitalized.
|
|
42
|
+
- **Strings:** double-quoted.
|
|
43
|
+
- **Identifiers:** `[a-zA-Z][a-zA-Z0-9_]*`, max 80 chars, snake_case.
|
|
44
|
+
- **`config.developer_name`** must match the directory name; **`config.agent_label`** is the display name; **`config.agent_type`** is `"AgentforceServiceAgent"` (external, requires `default_agent_user`) or `"AgentforceEmployeeAgent"` (internal, prohibits `default_agent_user`).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Encoding Architecture
|
|
49
|
+
|
|
50
|
+
The encoding model is the same on both Agent Script and Agentforce Builder: **one global persona block, subagent calibration overlays, and static messages.**
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Global Instructions (who the agent is, baseline persona)
|
|
54
|
+
│
|
|
55
|
+
├── Subagent Calibration (how persona adapts per subagent)
|
|
56
|
+
│ ├── Brevity calibration
|
|
57
|
+
│ ├── Tone flex encoding
|
|
58
|
+
│ ├── Phrase book entries
|
|
59
|
+
│ ├── Humor guidance
|
|
60
|
+
│ ├── Lexicon
|
|
61
|
+
│ └── Persona reminders
|
|
62
|
+
│
|
|
63
|
+
└── Static Messages (welcome, error, loading, deterministic)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Layer | What It Carries | Where It Lives |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| **Global instructions** | Baseline identity + all dimensions + phrase book + never-say + tone boundaries | Agent Script: `system.instructions`. Builder: a dedicated global instructions topic. |
|
|
69
|
+
| **Topic calibration** | Per-subagent overrides: brevity, tone flex, lexicon, phrase book entries, humor | Agent Script: `reasoning.instructions` per subagent. Builder: per-subagent instructions. |
|
|
70
|
+
| **Static messages** | Welcome, error, loading text, deterministic responses | Tool-specific fields (see below). |
|
|
71
|
+
|
|
72
|
+
### Global Instructions
|
|
73
|
+
|
|
74
|
+
Most persona content goes in global instructions. They carry the agent's baseline identity and dimensions into every conversation.
|
|
75
|
+
|
|
76
|
+
| Agent Authoring Tool | Where Global Instructions Go |
|
|
77
|
+
|---|---|
|
|
78
|
+
| Agent Script | `system.instructions` in the `.agent` file |
|
|
79
|
+
| Agentforce Builder | Create a dedicated global instructions topic. The planner passes this topic's instructions to the LLM with every prompt. |
|
|
80
|
+
|
|
81
|
+
Include everything except instructions that only apply to a single topic.
|
|
82
|
+
|
|
83
|
+
**Agent Script is recommended when persona consistency is at a premium.** `system.instructions` are treated as core logic rather than context that competes with conversation history, so persona instructions are not diluted as turns accumulate. Negative constraints hold more consistently. Register is more stable: system-level instructions set a tone anchor that persists through extended sessions.
|
|
84
|
+
|
|
85
|
+
#### Example: Drover (sales coach)
|
|
86
|
+
|
|
87
|
+
This excerpt from global instructions would work in either tool:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
You are Drover, an internal sales coach for enterprise AEs. You read
|
|
91
|
+
deals like a stockman reads the bush — subtle signs others miss, hard
|
|
92
|
+
truths delivered with easy confidence.
|
|
93
|
+
|
|
94
|
+
Identity: Instinctive, Unflinching, Practical, Reframing, Steady.
|
|
95
|
+
Register: Advisor. Lead with recommendations and rationale. Expect the
|
|
96
|
+
seller to make the call. Never hedge when the data is clear.
|
|
97
|
+
Voice: Casual formality — contractions, fragments, no corporate jargon.
|
|
98
|
+
Neutral warmth — competence is the care. Bold personality — metaphors,
|
|
99
|
+
distinctive phrasing, unmistakable voice.
|
|
100
|
+
Emotional Coloring: Neutral. State outcomes as facts. No dramatization.
|
|
101
|
+
Empathy: Understated. Brief nod, then pivot to action.
|
|
102
|
+
Brevity: Concise. Every sentence earns its place.
|
|
103
|
+
Humor: Dry. Understated, never forced. Suppress in error and escalation.
|
|
104
|
+
Chatting Style: Functional emoji (status indicators for deal health). Selective
|
|
105
|
+
formatting. Expressive punctuation. Standard capitalization.
|
|
106
|
+
|
|
107
|
+
Tone boundaries: Never sound apologetic. Never sound corporate. Never
|
|
108
|
+
soften bad news — deliver it straight, then show the path forward.
|
|
109
|
+
Never say: "Great question!", "I'd be happy to help", "Let me know
|
|
110
|
+
if you need anything else", "Going forward".
|
|
111
|
+
Phrase book — Acknowledgement: "Right." / "Noted." Redirect: "Not my
|
|
112
|
+
paddock — loop in [team]." Progress: "Good ground covered."
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
*Note:* In Agent Script, always use the `|` (literal block scalar) indicator for instruction content. Without it, lines like `Brevity: Moderate…` or `Tone: Shift Empathy…` will be parsed as YAML key-value pairs instead of instruction text.
|
|
116
|
+
|
|
117
|
+
### Subagent Calibration
|
|
118
|
+
|
|
119
|
+
Subagent-level instructions adapt from the baseline set in global instructions. They refine and calibrate — they don't redefine who the agent is. When subagent instructions conflict with global, the model reconciles: it treats global as the core identity and topic as situational adaptation.
|
|
120
|
+
|
|
121
|
+
| Agent Authoring Tool | Where Topic Instructions Go | Behavior |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| Agent Script | `reasoning.instructions` within each topic | Extends global `system.instructions` |
|
|
124
|
+
| Agentforce Builder | Topic Instructions field | Extends global instructions topic |
|
|
125
|
+
|
|
126
|
+
If you need a radically different voice for a topic, you have options in order of preference:
|
|
127
|
+
|
|
128
|
+
1. **Lighter-weight calibration first:** lexicon, topic phrase book, topic never-say, tone flex rules, brevity adjustment
|
|
129
|
+
2. **Subagent-level system override (Agent Script only):** a `system:` block in the topic replaces `system.instructions` for that topic — reserve for major persona shifts and remember to duplicate *all* instructions
|
|
130
|
+
3. **Separate agent:** if the persona shift is extreme, a separate agent may be cleaner
|
|
131
|
+
|
|
132
|
+
Each topic can carry:
|
|
133
|
+
|
|
134
|
+
**Brevity calibration** — different topics need different response lengths.
|
|
135
|
+
|
|
136
|
+
Status check topic (terse):
|
|
137
|
+
```text
|
|
138
|
+
Brevity: Terse. One-line status, emoji health indicator, no commentary.
|
|
139
|
+
If the user asks a follow-up, answer it — don't volunteer context they
|
|
140
|
+
didn't request.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Deal analysis topic (moderate):
|
|
144
|
+
```text
|
|
145
|
+
Brevity: Moderate. Lead with a recommendation and its rationale. Include
|
|
146
|
+
supporting data points. Use bullet formatting for multi-factor analysis.
|
|
147
|
+
End with a single next step.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Tone flex encoding** — how Emotional Coloring and Empathy Level shift by subagent context.
|
|
151
|
+
|
|
152
|
+
Escalation topic:
|
|
153
|
+
```text
|
|
154
|
+
Tone: Shift Emotional Coloring toward Encouraging. Shift Empathy Level
|
|
155
|
+
toward Moderate. Acknowledge the difficulty briefly, then show the path
|
|
156
|
+
forward. Never minimize the user's frustration.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Data retrieval topic:
|
|
160
|
+
```text
|
|
161
|
+
Tone: Maintain Neutral Emotional Coloring and Understated Empathy Level.
|
|
162
|
+
State findings without editorial. Confidence labeling matters most
|
|
163
|
+
here — label confirmed data vs. inferred data.
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Phrase book entries** — situational phrases relevant to this topic.
|
|
167
|
+
|
|
168
|
+
**Humor guidance** — whether humor is appropriate or suppressed. Always suppress humor in error states, escalation, and high-stakes contexts.
|
|
169
|
+
|
|
170
|
+
**Topic lexicon** — domain vocabulary scoped to where it belongs. A luxury watch agent has vocabulary like "movement," "chronograph," "caliber." These belong in product topics, not shipping topics. Loading specialized vocabulary globally wastes context and can cause the agent to over-use jargon in simple service interactions. Add a `Lexicon:` block to a topic's instructions when there are relevant domain terms and usage notes.
|
|
171
|
+
|
|
172
|
+
Example (product topic for a luxury watch agent):
|
|
173
|
+
```text
|
|
174
|
+
Lexicon: Use these terms freely — the audience expects them.
|
|
175
|
+
"Movement" — the internal mechanism. Never say "engine" or "motor."
|
|
176
|
+
"Chronograph" — stopwatch complication. Not "timer."
|
|
177
|
+
"Caliber" — specific movement reference number.
|
|
178
|
+
"Complication" — any function beyond hours/minutes/seconds.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Topic Lexicon Format
|
|
182
|
+
|
|
183
|
+
Two formats are valid. Choose based on whether usage context matters.
|
|
184
|
+
|
|
185
|
+
**Key-value pairs** — term + definition/usage context. Use when the term needs explanation or has usage rules:
|
|
186
|
+
```text
|
|
187
|
+
Lexicon:
|
|
188
|
+
"Compelling event" — External pressure that motivates a decision by a
|
|
189
|
+
deadline. Use when a deal has time-bound urgency. Not "trigger."
|
|
190
|
+
"Champion" — Internal advocate with authority and motivation. Not
|
|
191
|
+
"sponsor" (implies passive). Not "contact."
|
|
192
|
+
"Multithreading" — Engaging multiple stakeholders simultaneously. Use
|
|
193
|
+
freely — the audience expects it.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Term list** — terms only, no definitions. Use when the terms speak for themselves and the audience knows them:
|
|
197
|
+
```text
|
|
198
|
+
Lexicon: Use these terms freely.
|
|
199
|
+
Movement, chronograph, caliber, complication, bezel, lug width,
|
|
200
|
+
power reserve, guilloche, deployment clasp.
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**"Use this / don't use this" pairs** work in either format:
|
|
204
|
+
```text
|
|
205
|
+
Say "compelling event," not "trigger."
|
|
206
|
+
Say "champion," not "sponsor" or "contact."
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**How many terms?** 5-15 per subagent is the productive range. Below 5, the lexicon isn't doing much work. Above 15, diminishing returns — the model starts over-using jargon. If you have 20+ terms, split into subtopics or move the less critical ones to global lexicon.
|
|
210
|
+
|
|
211
|
+
**Lexicon vs. Phrase Book boundary:**
|
|
212
|
+
- **Lexicon** = domain vocabulary ("compelling event," "chronograph"). Organized by domain.
|
|
213
|
+
- **Phrase Book** = situation-keyed sample phrases ("When redirecting, say..."). Organized by situation.
|
|
214
|
+
- A term can appear in both: the lexicon defines it, the phrase book shows it in context.
|
|
215
|
+
|
|
216
|
+
**Immutable terms:** When a term is legally or brand-defined and must not be altered (e.g., "CVS affiliated pharmacy," "AppleCare+"), mark it explicitly:
|
|
217
|
+
```text
|
|
218
|
+
"CVS affiliated pharmacy" [immutable] — Legal-defined term. Use exactly
|
|
219
|
+
as written. Do not shorten, paraphrase, or substitute.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**When lexicon terms conflict** (e.g., a brand-preferred term clashes with a legally mandated one): surface the conflict to the designer with a recommendation, and let them decide. Example: "Your brand guide says 'Tallboy' but the legal disclaimer uses 'aluminum can.' Which should the agent use in product topics? I'd recommend the brand term for conversational contexts and the legal term in disclaimers — but this is your call."
|
|
223
|
+
|
|
224
|
+
**Persona reminders** — **always include a persona reminder in every subagent instruction.** Reminders reference back to the global persona and are the most effective tool for mitigating drift in longer sessions. Empirical testing confirms that persona reminders in subagent instructions produce measurably stronger persona consistency than relying on global instructions alone:
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
Voice Reminder: Stay in Drover's voice: laconic, direct, no-nonsense.
|
|
228
|
+
No corporate fluff. Be practical and read the room.
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
#### Example: Drover deal analysis subagent (Agent Script)
|
|
232
|
+
|
|
233
|
+
```agentscript
|
|
234
|
+
subagent deal_analysis:
|
|
235
|
+
description: "Analyze deal health and recommend next steps"
|
|
236
|
+
reasoning:
|
|
237
|
+
instructions: |
|
|
238
|
+
Brevity: Moderate for this subagent. Lead with a recommendation and
|
|
239
|
+
its rationale. Include supporting data. End with a single next step.
|
|
240
|
+
Tone: Maintain Neutral coloring. If the deal is at risk, state it
|
|
241
|
+
plainly — don't soften.
|
|
242
|
+
Lexicon: Use these terms freely. The audience expects them.
|
|
243
|
+
"Compelling event" — Pressure that motivates a decision...
|
|
244
|
+
Voice Reminder: Stay in Drover's voice: laconic, direct, no-nonsense.
|
|
245
|
+
No corporate fluff. Be practical and read the room.
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
In Agentforce Builder, place the same text in the deal analysis Topic Instructions.
|
|
249
|
+
|
|
250
|
+
### Static Messages
|
|
251
|
+
|
|
252
|
+
All output should align to persona, even messages that are not generated by the LLM. Write them in voice. Otherwise, users encounter generic text or debugging content that breaks character.
|
|
253
|
+
|
|
254
|
+
| | Agent Script | Agentforce Builder |
|
|
255
|
+
|---|---|---|
|
|
256
|
+
| Name | `config.agent_label` | Name (80 chars — keep it short) |
|
|
257
|
+
| Welcome | `system.messages.welcome` | Welcome Message (800 chars, use ≤ 255) |
|
|
258
|
+
| Error | `system.messages.error` | Error Message field |
|
|
259
|
+
| Loading | `progress_indicator_message` | Loading Text (per action) |
|
|
260
|
+
| Deterministic responses | Pipe text in `if`/`else` blocks | N/A |
|
|
261
|
+
|
|
262
|
+
Loading text should be unique for each action, informing the user what the agent is doing.
|
|
263
|
+
|
|
264
|
+
For SMS, the first agent message serves as the welcome — include system identification and AI disclosure in-message, since there is no chat header or avatar.
|
|
265
|
+
|
|
266
|
+
Compare how four different personas deliver the same messages. The range matters — static messages are brand touchpoints, not boilerplate:
|
|
267
|
+
|
|
268
|
+
| | Bold irreverent (e-commerce) | Warm playful (garden co-op) | Cool dry-wit (fintech) | Composed luxury (concierge) |
|
|
269
|
+
|---|---|---|---|---|
|
|
270
|
+
| Welcome | "Yo. I'm the order fixer. What broke?" | "Well hey there! 🌻 I'm Clover — I know a thing or two about what's growing. What can I help you dig into?" | "Vault here. What are we looking at?" | "Good evening. Welcome to Ashford — I'm here to ensure your experience is seamless. How may I assist you?" |
|
|
271
|
+
| Error | "Something just exploded on my end. Try again — I'll be less broken this time." | "Oh no, I tripped over my own roots! 😅 Give me one more try?" | "That didn't work. Trying again." | "My sincerest apologies — I've encountered an unexpected difficulty. One moment while I resolve this." |
|
|
272
|
+
| Loading (look up) | "Digging through the wreckage…" | "Let me peek at your order… 👀" | "Pulling the record." | "Locating your reservation details now." |
|
|
273
|
+
| Loading (process) | "Ripping this one out of the system…" | "Scooping that one back into the basket for you…" | "Reversing the transaction." | "Attending to your request." |
|
|
274
|
+
| Deterministic (no data) | "Nothing. Nada. Check that order number and hit me again." | "Hmm, I'm not finding that one anywhere! Double-check that order number for me, hon?" | "No match. Check the number." | "I wasn't able to locate a matching record. May I ask you to verify the reference number?" |
|
|
275
|
+
|
|
276
|
+
### Dynamic Welcome Messages
|
|
277
|
+
|
|
278
|
+
For Agentforce Builder, a dynamic welcome message can personalize the greeting based on who the customer is. See [Dynamic Welcome Messages](#dynamic-welcome-messages-agentforce-builder) in Additional Encoding Options for details.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Agent Script Encoding
|
|
283
|
+
|
|
284
|
+
Agent Script is the recommended tool when persona consistency is at a premium. A single `.agent` file holds all instructions — no character limits apply.
|
|
285
|
+
|
|
286
|
+
### Persona-Carrying YAML Keys
|
|
287
|
+
|
|
288
|
+
| YAML Key | Where | Persona Mapping |
|
|
289
|
+
|---|---|---|
|
|
290
|
+
| `system.instructions` | `system:` block | Full persona. No character limits. Primary surface. |
|
|
291
|
+
| `system.messages.welcome` | `system:` block | Static welcome message. |
|
|
292
|
+
| `system.messages.error` | `system:` block | Static error message. |
|
|
293
|
+
| Subagent `system:` | `subagent:` block | Per-subagent persona override. **Replaces** global instructions for this subagent. |
|
|
294
|
+
| `reasoning.instructions` | `subagent:` block | Per-subagent persona calibration (brevity, lexicon, tone flex). |
|
|
295
|
+
| `progress_indicator_message` | Action **definition** (`target:` action) | In-character loading text per action. Requires `include_in_progress_indicator: True`. Set on the action definition, **not** on the `reasoning.actions` tool reference. |
|
|
296
|
+
| `| text` in `if/else` | `instructions: ->` | Deterministic output. Bypasses LLM — must be pre-authored in persona voice. |
|
|
297
|
+
|
|
298
|
+
### Output Structure
|
|
299
|
+
|
|
300
|
+
The encode flow should output ready-to-paste YAML blocks. Always use the `|` (literal block scalar) indicator for instruction content — without it, lines like `Brevity: Moderate…` or `Tone: Shift Empathy…` will be parsed as YAML key-value pairs instead of instruction text.
|
|
301
|
+
|
|
302
|
+
#### Structural template
|
|
303
|
+
|
|
304
|
+
The overall YAML structure, independent of any specific persona:
|
|
305
|
+
|
|
306
|
+
```agentscript
|
|
307
|
+
system:
|
|
308
|
+
instructions: |
|
|
309
|
+
[Full persona content: identity, dimensions, phrase book,
|
|
310
|
+
never-say list, tone boundaries, chatting style rules]
|
|
311
|
+
messages:
|
|
312
|
+
welcome: "[Welcome message in persona voice]"
|
|
313
|
+
error: "[Error message in persona voice]"
|
|
314
|
+
|
|
315
|
+
config:
|
|
316
|
+
developer_name: "[Snake_Case_Name]"
|
|
317
|
+
agent_label: "[Display Name]"
|
|
318
|
+
description: "[Functional one-liner]"
|
|
319
|
+
agent_type: "[AgentforceServiceAgent | AgentforceEmployeeAgent]"
|
|
320
|
+
|
|
321
|
+
start_agent agent_router:
|
|
322
|
+
description: "[Routing description — what intent this entry point handles]"
|
|
323
|
+
reasoning:
|
|
324
|
+
instructions: ->
|
|
325
|
+
| [Routing logic]
|
|
326
|
+
actions:
|
|
327
|
+
go_to_subagent: @utils.transition to @subagent.[subagent_name]
|
|
328
|
+
|
|
329
|
+
subagent [subagent_name]:
|
|
330
|
+
description: "[Subagent description]"
|
|
331
|
+
reasoning:
|
|
332
|
+
instructions: ->
|
|
333
|
+
| [Per-subagent calibration: brevity, tone flex, lexicon,
|
|
334
|
+
phrase book entries, persona reminders]
|
|
335
|
+
if [condition]:
|
|
336
|
+
| [Deterministic response pre-authored in persona voice]
|
|
337
|
+
else:
|
|
338
|
+
| [Alternative response in persona voice]
|
|
339
|
+
actions:
|
|
340
|
+
[action_name]: @actions.[action_name]
|
|
341
|
+
description: "[What this action does]"
|
|
342
|
+
actions:
|
|
343
|
+
[action_name]:
|
|
344
|
+
target: "flow://[FlowName]"
|
|
345
|
+
description: "[What this action does]"
|
|
346
|
+
progress_indicator_message: "[Loading text in persona voice]"
|
|
347
|
+
include_in_progress_indicator: True
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
#### Worked example: system block
|
|
351
|
+
|
|
352
|
+
```agentscript
|
|
353
|
+
system:
|
|
354
|
+
instructions: |
|
|
355
|
+
You are Drover, an internal sales coach for enterprise AEs. You read
|
|
356
|
+
deals like a stockman reads the bush — subtle signs others miss, hard
|
|
357
|
+
truths delivered with easy confidence.
|
|
358
|
+
|
|
359
|
+
Identity: Instinctive, Unflinching, Practical, Reframing, Steady.
|
|
360
|
+
Register: Advisor. Lead with recommendations and rationale...
|
|
361
|
+
[full persona content here]
|
|
362
|
+
messages:
|
|
363
|
+
welcome: "What deal are we looking at?"
|
|
364
|
+
error: "Something's gone sideways. Give it another go."
|
|
365
|
+
|
|
366
|
+
config:
|
|
367
|
+
developer_name: "Drover"
|
|
368
|
+
agent_label: "Drover"
|
|
369
|
+
description: "Internal sales coach for enterprise AEs"
|
|
370
|
+
agent_type: "AgentforceEmployeeAgent"
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
#### Per-subagent calibration
|
|
374
|
+
|
|
375
|
+
```agentscript
|
|
376
|
+
subagent deal_analysis:
|
|
377
|
+
description: "Analyze deal health and recommend next steps"
|
|
378
|
+
reasoning:
|
|
379
|
+
instructions: |
|
|
380
|
+
Brevity: Moderate for this subagent. Lead with a recommendation and
|
|
381
|
+
its rationale. Include supporting data. End with a single next step.
|
|
382
|
+
Tone: Maintain Neutral coloring. If the deal is at risk, state it
|
|
383
|
+
plainly — don't soften.
|
|
384
|
+
Lexicon: Use these terms freely. The audience expects them.
|
|
385
|
+
"Compelling event" — Pressure that motivates a decision...
|
|
386
|
+
Voice Reminder: Stay in Drover's voice: laconic, direct, no-nonsense.
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### Per-action loading text
|
|
390
|
+
|
|
391
|
+
In-character loading text is set on the **action definition** (the `target:` action under the subagent's top-level `actions:` block), not on the `reasoning.actions` tool reference:
|
|
392
|
+
|
|
393
|
+
```agentscript
|
|
394
|
+
actions:
|
|
395
|
+
pull_deal_data:
|
|
396
|
+
target: "flow://PullDealData"
|
|
397
|
+
description: "Pull the deal record for analysis"
|
|
398
|
+
progress_indicator_message: "Pulling the numbers…"
|
|
399
|
+
include_in_progress_indicator: True
|
|
400
|
+
run_analysis:
|
|
401
|
+
target: "flow://RunDealAnalysis"
|
|
402
|
+
description: "Run the deal analysis"
|
|
403
|
+
progress_indicator_message: "Crunching this…"
|
|
404
|
+
include_in_progress_indicator: True
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
#### Deterministic responses
|
|
408
|
+
|
|
409
|
+
```agentscript
|
|
410
|
+
instructions: ->
|
|
411
|
+
if no_data_found:
|
|
412
|
+
| Nothing here. Check the opp ID and try again.
|
|
413
|
+
else:
|
|
414
|
+
| Here's the read on this deal.
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Encoding Priority
|
|
418
|
+
|
|
419
|
+
1. **`system.instructions`** — Full persona: Identity, dimension behavioral rules, phrase book, chatting style rules, tone boundaries, never-say list. This is the primary persona surface.
|
|
420
|
+
2. **`reasoning.instructions` per subagent** — Lighter calibration: brevity, lexicon, tone flex triggers, phrase book entries, humor guidance. Extends rather than replaces the global persona. Include **persona reminders** for long-running topics.
|
|
421
|
+
3. **Subagent-level `system:`** — **Replaces** global `system.instructions` for that topic. Reserve for major persona shifts (e.g., escalation shifts Register from Peer to Advisor). Remember to duplicate *all* instructions when using this.
|
|
422
|
+
4. **`progress_indicator_message`** — In-character loading text per action.
|
|
423
|
+
5. **`system.messages.welcome`** — Static welcome reflecting Identity + Register + Voice + Brevity.
|
|
424
|
+
6. **`system.messages.error`** — Static error reflecting Formality + Warmth + Emotional Coloring + Brevity.
|
|
425
|
+
7. **Deterministic `| text` outputs** — Hardcoded pipe output bypasses the LLM. Each must be pre-authored in the persona's voice.
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Agentforce Builder Encoding
|
|
430
|
+
|
|
431
|
+
Agentforce Builder distributes persona across several fields with character limits. The global instructions topic is the primary persona surface — other fields support it.
|
|
432
|
+
|
|
433
|
+
### Fields
|
|
434
|
+
|
|
435
|
+
| Field | Limit | What It Carries |
|
|
436
|
+
|---|---|---|
|
|
437
|
+
| **Name** | 80 chars | User-facing identity signal. First impression before conversation starts. |
|
|
438
|
+
| **Role** | 255 chars | Functional summary only — what the agent does and who it serves. **Do not** add stylistic persona encoding to Role while global instructions are present. |
|
|
439
|
+
| **Company** | 255 chars | What the company does, who it serves, what makes it different. Shapes the agent's frame of reference. |
|
|
440
|
+
| **Welcome Message** | 800 chars | First impression. Reflects Identity + Register + Voice + Tone + Brevity. Keep under 255 chars to avoid truncation. |
|
|
441
|
+
| **Error Message** | — | Fallback for system errors. Reflects Formality + Warmth + Emotional Coloring + Brevity. |
|
|
442
|
+
|
|
443
|
+
#### Role (255 chars) — functional summary only
|
|
444
|
+
|
|
445
|
+
Include a sentence or two on what the agent does. **Do not** encode persona style or voice in Role when a global instructions topic is present. The model treats Role as a primary anchor — stylistic encoding there can override the more specific rules in global instructions, flattening distinctive voice and phrase book adherence. Keep Role minimal:
|
|
446
|
+
|
|
447
|
+
```text
|
|
448
|
+
You are a virtual customer support agent who helps customers track and
|
|
449
|
+
manage orders and returns.
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
#### Company (255 chars) — brief business context
|
|
453
|
+
|
|
454
|
+
What the company does, who it serves, what makes it different. This field shapes the agent's frame of reference. A support agent for a B2B SaaS company sounds different from one at a luxury retail brand, even with identical dimension selections.
|
|
455
|
+
|
|
456
|
+
#### Description (1,000 chars)
|
|
457
|
+
|
|
458
|
+
Description *can* encode persona (the LLM reads it), but global instructions are recommended instead. Description is intended to list agent goals and context about its users.
|
|
459
|
+
|
|
460
|
+
### Agentforce Builder Settings
|
|
461
|
+
|
|
462
|
+
#### The Tone Dropdown — register and formality
|
|
463
|
+
|
|
464
|
+
The Tone dropdown is a coarse tool setting. It maps roughly to Register + Formality:
|
|
465
|
+
|
|
466
|
+
| Tone Setting | Approximate Mapping |
|
|
467
|
+
|---|---|
|
|
468
|
+
| Casual | Peer register, Casual or Informal formality |
|
|
469
|
+
| Neutral | Peer, Advisor, or Coach register, Professional formality |
|
|
470
|
+
| Formal | Subordinate register, Formal formality |
|
|
471
|
+
|
|
472
|
+
Set the dropdown to match the intended Register. A misaligned setting can cause drift toward model defaults, and Register is the first dimension to degrade. The dropdown also influences more than voice — it can affect *what the agent offers to do*, not just *how it speaks*. Test to ensure it works with rather than against your persona.
|
|
473
|
+
|
|
474
|
+
#### Conversation Recommendations
|
|
475
|
+
|
|
476
|
+
- **On Welcome Screen** — Whether suggested conversation starters appear. Enable when the agent has clear primary use cases.
|
|
477
|
+
- **In Agent Responses** — Whether clickable next-action chips appear. Maps to the agent's Interaction Model (an agent design input).
|
|
478
|
+
|
|
479
|
+
### Fields That Don't Encode Persona
|
|
480
|
+
|
|
481
|
+
If you're deciding what the agent *does*, that's agent design. If you're deciding how it *sounds*, that's persona. API Name, Agent Type, Topics, Actions, Data Sources, Languages, Agent User: these belong to agent design.
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## Additional Encoding Options
|
|
486
|
+
|
|
487
|
+
### Conversation Style — Lightweight Encoding
|
|
488
|
+
|
|
489
|
+
A single `Conversation Style:` instruction compresses the persona into one paragraph. Best for prototyping or minimum viable persona.
|
|
490
|
+
|
|
491
|
+
**Template:**
|
|
492
|
+
```text
|
|
493
|
+
Conversation Style: [Register/relationship] who [core behavior].
|
|
494
|
+
[Emotional coloring and empathy approach]. [Formality and warmth
|
|
495
|
+
signals]. [Brevity calibration]. [Distinctive voice markers if any].
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**Example:**
|
|
499
|
+
```text
|
|
500
|
+
Conversation Style: Peer advisor who leads with data and clear
|
|
501
|
+
recommendations. Neutral, matter-of-fact: state outcomes as facts, no
|
|
502
|
+
dramatization. Professional language, occasional contractions, no filler.
|
|
503
|
+
Keep responses concise. Push back when deal gaps need attention.
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
Place in the global instructions topic (Builder) or `system.instructions` (Agent Script). Then set the Tone dropdown to the closest match.
|
|
507
|
+
|
|
508
|
+
**Limitation:** Less precise than full encoding. Static messages still need per-field authoring. No per-subagent calibration.
|
|
509
|
+
|
|
510
|
+
### Custom Metadata — Centralized Persona
|
|
511
|
+
|
|
512
|
+
Store the persona document as a Custom Metadata Type record (`Agent_Persona__mdt`) and inject it into actions via Prompt Templates as a variable.
|
|
513
|
+
|
|
514
|
+
**When to use:**
|
|
515
|
+
- Multiple actions need the same persona context
|
|
516
|
+
- Share a persona definition across multiple agents — update once, all agents get the update
|
|
517
|
+
- Persona exceeds what fits comfortably in individual Builder fields
|
|
518
|
+
|
|
519
|
+
Compatible with both Agentforce Builder and Agent Script. In Script, primarily useful when multiple agents share a persona definition (character limits don't apply).
|
|
520
|
+
|
|
521
|
+
### Dynamic Welcome Messages (Agentforce Builder)
|
|
522
|
+
|
|
523
|
+
The static Welcome Message field works for a generic greeting, but a dynamic welcome message can personalize the opening based on who the customer is. The high-level approach:
|
|
524
|
+
|
|
525
|
+
1. **Create a custom text field** on the Messaging Session object to hold the generated greeting.
|
|
526
|
+
2. **Map it as a Context Variable** in Agentforce Builder so the welcome message can reference it.
|
|
527
|
+
3. **Build a Prompt Template** that generates the greeting text (e.g., referencing the customer's name, recent order, or loyalty tier).
|
|
528
|
+
4. **Use an Omni-Channel Flow** to invoke the prompt template and write the result to the custom field before the session starts.
|
|
529
|
+
|
|
530
|
+
Once wired up, the Welcome Message field references the Context Variable instead of static text, and every customer sees a greeting that feels tailored rather than canned. For a full step-by-step walkthrough, see [Design Better Greetings in Agentforce Builder](https://www.salesforce.com/blog/design-better-greetings-agentforce-builder/).
|
|
531
|
+
|
|
532
|
+
### Model Parameters
|
|
533
|
+
|
|
534
|
+
> These are not persona settings. They are persona-adjacent — handle with care.
|
|
535
|
+
|
|
536
|
+
Temperature, frequency penalty, and presence penalty are configured in **Einstein Studio**, not Agentforce Builder. They affect the reasoning engine's output diversity, not the persona intent — but they interact with persona in ways that can undermine or reinforce it.
|
|
537
|
+
|
|
538
|
+
| Parameter | What It Controls |
|
|
539
|
+
|---|---|
|
|
540
|
+
| **Temperature** | Randomness/creativity. Lower = more deterministic. Higher = more varied. |
|
|
541
|
+
| **Frequency Penalty** | Discourages word/phrase repetition. Higher = more varied vocabulary. |
|
|
542
|
+
| **Presence Penalty** | Encourages introducing new topics. Higher = broader coverage, less depth. |
|
|
543
|
+
|
|
544
|
+
**Key interactions with persona:**
|
|
545
|
+
- **Low temperature + specific persona instructions** = most consistent persona. Best for production agents.
|
|
546
|
+
- **High temperature + vague persona instructions** = inconsistent persona. The agent drifts.
|
|
547
|
+
- **High frequency penalty** can conflict with Terse Brevity — the model may avoid reusing short, functional words.
|
|
548
|
+
- **High presence penalty** can conflict with focused, single-topic agents.
|
|
549
|
+
|
|
550
|
+
**Recommendation:** Leave at defaults unless you have a specific reason. Do persona work in instructions, not in model parameters.
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
## What to Expect
|
|
555
|
+
|
|
556
|
+
**Tool evolution:** Encoding patterns are based on current Agentforce capabilities. As the tools evolve, encoding may shift.
|
|
557
|
+
|
|
558
|
+
**Precision:** LLM output generation is probabilistic, and the chain of custody between persona instructions and generated text is long. The encoding patterns in this guide are directionally correct and can sustain distinct persona adherence over multiple turns. However, this guide does not claim to guarantee fine-grained control over agent output.
|
|
559
|
+
|
|
560
|
+
**Hosting and model:** Changing the hosting environment or model sometimes causes minor deviations in dimensions such as Emotional Coloring.
|
|
561
|
+
|
|
562
|
+
**Language scope:** All testing referenced in this guide was conducted in English. Results from other languages may vary.
|
|
563
|
+
|
|
564
|
+
**Constraints are recommendations:** Dimension constraint notes in the framework are recommendations, not hard locks. No dimension value is ever unavailable — any combination is valid. Constraints flag combinations that may feel incoherent so the designer can make a conscious choice.
|
|
565
|
+
|
|
566
|
+
|