10 KiB
Handoff Output Format
Required Files
<AgentName>-AgentSpec.md<AgentName>-einstein-bot-handoff.json<AgentName>-open-questions.md
The extraction step also persists extraction-summary.json in the same directory (see Extraction Blueprint); it is carried forward as supporting context in the handoff.
Write all required files in the run-specific SFDX project directory for the selected input mode:
- Mode A: org-backed run project directory created during SF CLI setup
- Mode B: offline run project directory containing/associated with provided XML inputs Do not write handoff artifacts in the repository root.
1) Agent Spec Markdown
Create <run_project_dir>/<AgentName>-AgentSpec.md by copying:
skills/agentforce-generate/assets/agent-spec-template.md
The handoff Agent Spec MUST:
- retain the same section names and ordering as the template
- fill every section with migration-specific content derived from extraction outputs
Required section order:
## Purpose & Scope## Behavioral Intent## Subagent Posture## Subagent Map## Variables## Actions## Action Invocation Strategy## Deterministic Controls (When Needed)## Architecture Pattern## Agent Configuration
Section-by-section generation guidance (from extraction-summary.json)
## Purpose & Scope
- Derive a meaningful purpose statement from bot description/identity and extracted intent summaries.
- Describe the agent's business scope using the intents the bot actually handles.
- Restrict scope to capabilities backed by configured actions:
- do not claim unsupported capabilities
- call out out-of-scope requests when no action support exists
## Behavioral Intent
-
Start traversal from
Welcome(or extracted entry dialog whenWelcomeis absent). -
Build each workflow using:
dialog_functionality_summary- ordered
step_functionality
-
Handle navigations by following target dialogs recursively, while preserving navigation semantics:
Callnavigation: transfer control to the target dialog, then return control back to the source dialog after target execution completes. Continue source-dialog remaining steps after return.Redirectnavigation: transfer control permanently to the target dialog and halt source-dialog execution immediately (no return to source flow).
-
While reconstructing flows, track
CallvsRedirectsemantics internally so downstream agent design preserves return/non-return behavior. -
For
Callflows, capture both:- the delegated target workflow behavior, and
- the resumed source workflow behavior after return.
-
For
Redirectflows, do not append post-redirect source steps to the same path unless there is an explicit later re-entry edge. -
Reconstruct meaningful user conversation flows across traversed dialogs.
-
Identify hard checkpoints by capturing strict ordering constraints, mandatory preconditions, and enforced branches/escalations.
-
Final behavioral intent must include:
- ordered events for one or more workflows
- action invocation scope and sequencing
- variable usage scope (reads/writes and gating variables)
- escalation/routing behavior
- normalized transition behavior (return-after-delegation vs one-way transfer) expressed in agent-native terms only
- other critical bot-specific constraints that affect conversation behavior
-
Do NOT emit raw bot navigation constructs (
Call,Redirect) in the final Agent Spec text. Convert them into agent-native behavioral descriptions only.
## Subagent Posture
- Derive baseline subagents from dialog clusters (
1 cluster -> 1 subagent). - Ensure each subagent has coherent responsibility boundaries based on associated dialog behavior and actions.
- Add additional subagents when dialogs are not assigned to any cluster but represent distinct bot functionality.
- Ensure all dialog functionality is covered by at least one subagent.
- Record any uncertain assignments in open questions instead of forcing low-confidence grouping.
Bot-specific artifact translation rules (required)
When generating the Agent Spec, do not retain raw bot-only entities. Translate them into agent-native behavior.
- Do not carry forward bot-only references directly, including:
- intent names derived from dialog naming
- intent utterance lists as bot-training artifacts
- dialog identifiers/names
- menu redirection constructs
- Replace each with equivalent capability-level descriptions:
- user goal summaries
- behavioral routing intent
- reasoning instructions for when/how to route or invoke actions
- Menu redirections must be translated by:
- capturing the user intent behind each menu option
- converting each option into an equivalent reasoning-based LLM instruction
- preserving functional outcomes without reproducing rigid bot menu mechanics
- Evaluate every bot return message/response shown to users:
- if a message contains no actionable information and is only small talk, ignore it
- otherwise, preserve equivalent user-facing messaging in the relevant subagent behavior
- do not miss messages containing information about next steps, required actions, documentation, policy, or handoff guidance
- For each subagent, evaluate whether menu translation is necessary at all:
- prefer direct intent/reasoning behavior when menus are unnecessary
- retain a lightweight guided-choice pattern only when it materially improves clarity or control
- If menu translation approach is ambiguous, ask the user and record the decision in open questions before finalizing. When
--interactive=false, do not ask — apply the recommended translation, record it in open questions as an auto-applied decision, and continue.
Then add this migration-specific appendix section at the end:
## Migration Notes (Einstein Bot -> Agentforce)- Source bot identity and version
- Mapping confidence summary
- Unmapped constructs
- Open decisions requiring user approval
Action Invocation Optimization Rules
Use this step to optimize conversation efficiency by reducing unnecessary action invocations while preserving behavior and data contracts.
Allowed optimization operations
- Add action — only when required to preserve an existing conversational outcome after removing/replacing bot-only behavior.
- Update action — only for invocation optimization (for example, replacing multi-hop equivalent invocations with one semantically equivalent action).
- Delete action — only when action is bot-only or redundant in the agent architecture.
Hard constraints
- Do not merge or modify unrelated actions just to reduce invocation count.
- Do not change action inputs/outputs in a way that causes data loss.
- Preserve all variable assignments needed by downstream steps/subagents.
- Preserve required action side effects that are part of business behavior.
Bot-only action handling
If an action is applicable only to Einstein Bot runtime (for example, internal bot-state bookkeeping actions):
- Mark the action as
candidate_for_removal. - Show the user why it is bot-only and why it is not needed in Agentforce.
- Do not remove it automatically.
- Remove only after explicit user confirmation. When
--interactive=false, do not remove it — keep the action in place as the safe recommended default and record it as a deferredcandidate_for_removaldecision in open questions.
User review gate (required)
When --interactive=false, skip the interactive review: apply only non-destructive recommended optimizations (adds/updates), never auto-delete actions, record every applied and deferred change in open questions, then treat those recommended changes as final without prompting.
Before finalizing optimized actions, present a complete change summary to the user:
- Added actions
- Updated actions
- Candidate removals
- For each affected action, include:
- action description/purpose
- full input contract
- full output contract
- variable assignments (reads/writes)
- rationale for optimization
Apply changes only after user approval.
Persistence requirement
After user confirms, update the Agent Spec file to reflect all finalized action changes (adds/updates/deletes), including:
- action descriptions
- input/output contracts
- variable read/write assignments
- action invocation strategy updates required by the optimization
Do not treat non-confirmed changes as final.
2) Open Questions Markdown
Include:
- Blocking decisions (must resolve before
/agentforce-generatehandoff) - Non-blocking clarifications (resolve when they materially affect generated spec/actions)
- Recommended defaults for each question
Write this file as:
<run_project_dir>/<AgentName>-open-questions.md
3) Einstein Bot Handoff JSON
Create <run_project_dir>/<AgentName>-einstein-bot-handoff.json as a machine-readable companion to the Agent Spec markdown, derived from extraction-summary.json and the mapping produced per Mapping Rules.
The handoff JSON MUST:
- Capture the structured mapping used to build the spec:
- subagent/topic mapping
- action inventory with input/output contracts and
EXISTS/NEEDS_STUB/NEEDS_CREATION/CANDIDATE_FOR_REMOVALstatus - variable mappings (
mutable/linked) - routing/transition mapping
- unmapped items
- Stay aligned with the finalized Agent Spec markdown — after the open-questions loop completes, regenerate it so it reflects the resolved spec before handoff (no contradictory mappings).
Open Question Resolution Loop (Required)
After generating initial artifacts, resolve open questions one-by-one with the user. When --interactive=false, do not prompt — auto-apply the recommended default recorded for each question and mark it resolved.
For each resolved question:
- Update
<run_project_dir>/<AgentName>-AgentSpec.mdwith the resolved decision. - Update
<run_project_dir>/extraction-summary.jsonwith the same resolved finding and any downstream mapping updates. - Mark the question as resolved (or remove it) in
<run_project_dir>/<AgentName>-open-questions.md.
Do not leave ambiguous or contradictory outcomes in any artifact.