agentforce-bot-upgrade
forcedotcom/sf-skills
Upgrade Einstein Bots to Agentforce agents end-to-end in a single orchestrated pass.
What is agentforce-bot-upgrade?
Automates the migration of Einstein Bots to Agentforce agents by orchestrating Agent Spec generation, planner reconciliation, agent authoring, and post-conversion enhancements. Use this when you need to convert one or more Einstein Bots to Agentforce in a single workflow.
- Parses and validates bot/version pairs from online orgs or offline directories
- Generates Agent Specs per bot-version combination in parallel
- Reconciles planner configurations across multiple bots
- Generates .agent files from approved Agent Specs
- Applies post-conversion enhancements to generated agents
How to install agentforce-bot-upgrade
npx skills add https://github.com/forcedotcom/sf-skills --skill agentforce-bot-upgrade- Salesforce CLI version 2.0.0 or higher
- For online mode: authenticated org alias and access to Einstein Bot definitions
- For offline mode: offline bot metadata directory with proper structure
- Agentforce-generate skill installed for agent authoring step
How to use agentforce-bot-upgrade
- 1.Install the skill using: npx skills add https://github.com/forcedotcom/sf-skills --skill agentforce-bot-upgrade
- 2.For online mode, run: sf agentforce-bot-upgrade --mode online --org-alias <alias> --bots <bot1:v1,bot2:v2>
- 3.For offline mode, run: sf agentforce-bot-upgrade --mode offline --offline-dir <path>
- 4.Set --interactive true (default) to approve decisions interactively, or --interactive false to run autonomously
- 5.Review generated Agent Specs and .agent files in the output artifacts
Use cases
- Migrate multiple Einstein Bots to Agentforce simultaneously across an org
- Convert a single Einstein Bot with specific version to an Agentforce agent
- Upgrade service bots from Einstein Bot framework to Agentforce in batch mode
- Process offline bot metadata exports and convert them to Agentforce agents
- Orchestrate bot-to-agent conversion with interactive approval gates
- Salesforce administrators managing bot migrations
- Agentforce developers converting existing Einstein Bots
- Organizations standardizing on Agentforce for conversational AI
- Teams automating multi-bot upgrade cycles
agentforce-bot-upgrade FAQ
Use this skill when migrating existing Einstein Bots to Agentforce. Use direct .agent authoring if you already have an approved Agent Spec and only need to author, deploy, test, or observe agents.
Yes. Provide comma-separated bot:version pairs in online mode (e.g., --bots bot1:v1,bot2:v2) or let the skill discover multiple bot directories in offline mode. Upgrades run in parallel.
The skill applies documented defaults at every decision point without prompting and records auto-applied decisions in artifacts. It only halts on missing mandatory inputs or contradictions with no safe default.
Online mode connects to a Salesforce org to list and fetch bot definitions. Offline mode processes bot metadata from a local directory, useful for air-gapped environments or pre-export workflows.
Yes. This skill orchestrates the upgrade workflow and calls agentforce-generate internally to author the final .agent files.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: agentforce-bot-upgrade description: "Use this skill to Upgrade Einstein Bots into Agentforce agents end-to-end in a single pass, orchestrating per-bot Agent Spec generation, planner reconciliation across bots, agentforce-generate authoring, and post-conversion .agent enhancements. TRIGGER when: user asks to migrate, upgrade, or convert one or more Einstein Bots to Agentforce; runs a multi-bot bot-to-agent upgrade; needs Einstein Bot metadata turned into Agent Spec handoffs and generated .agent agents; convert bots to agents; upgrade my service bots; move bots to Agentforce. DO NOT TRIGGER when: user already has an approved Agent Spec and only wants direct .agent authoring, deploy, test, or observe flows; the request is unrelated to Einstein Bot migration." argument-hint: "[--mode <online|offline>] [--org-alias <org-alias> --bots bot1:v1,bot2:v2,... | --offline-dir <offline-dir> [--bots <bot1,bot2,...>]] [--interactive <true|false>]" metadata: version: "1.0" domains: ["Agentforce"] minApiVersion: "63.0" relatedSkills: - "agentforce-generate" cliTools: - tool: ["sf"] semver: ">=2.0.0"
Einstein Bot Upgrade Orchestrator
Purpose
Run a multi-bot upgrade-and-handoff cycle:
- Parse and validate bot/version pairs from
--bots - Follow Generate Agent Spec Reference per bot-version pair (parallelizable)
- Aggregation step that requires all generated Agent Specs
/agentforce-generateper Agent Spec (parallelizable)- Post-conversion enhancement pass per generated Agent Script (parallelizable)
Inputs
Inputs:
--mode <online|offline>is optional; default isonlinewhen omitted.- If
mode=online, required:--org-alias <org-alias>--bots <bot1:v1,bot2:v2,...>
- If
mode=offline, required:--offline-dir <offline-dir>
--interactive <true|false>is optional; default istruewhen omitted.
If required inputs are missing, handle per the Missing Input Handling and Interactive Mode rules below.
Interactive Mode
--interactive controls whether the skill pauses for user input during execution:
--interactive true(default): resolve ambiguities, open questions, and approval gates by asking the user, as described in this skill and its references.--interactive false: run autonomously. Do NOT prompt the user at any decision point. For every open question, ambiguity, or approval gate, apply the documented recommended default/solution and record the auto-applied decision in the run artifacts (Agent Spec, open questions, extraction summary). The only hard stops permitted without prompting are inputs that are missing or contradictory with no safe recommended default — a missing mandatory launch input (--org-alias/--botsfor online,--offline-dirfor offline), no bots discovered, or the same bot given multiple versions. In those cases, report the issue and halt without prompting.
Propagate the effective --interactive value to the per-bot Generate Agent Spec workflow (Step 2), the planner workflow (Step 3), and the post-conversion enhancement pass (Step 5).
Missing Input Handling
Resolve missing required launch inputs before Step 1:
- Online mode —
--org-aliasnot provided. Resolve this before attempting to list bots (listing requires a target org).- Interactive: list the available aliases of logged-in orgs and ask the user to select the target org. Use the SF CLI patterns in SF CLI Bot Reference.
- Non-interactive: halt with an explicit error naming the missing
--org-aliasinput (do not prompt or list).
- Online mode — bot name and version (
--bots) not available.- Interactive: using
--org-aliasas the target org, list every bot and its versions in the org, then ask the user to select the bot/version entries they want to convert to agents. Use theBotDefinitionandBotVersionquery patterns in SF CLI Bot Reference — omit the name/version filters to enumerate all bots and versions — present the results, and build the--botsworkload from the user's selection. - Non-interactive: halt with an explicit error naming the missing
--botsinput (do not prompt or list).
- Interactive: using
- Offline mode —
--offline-dirnot available.- Interactive: ask the user to provide the
--offline-dirpath, then continue. - Non-interactive: fail with an explicit error naming the missing
--offline-dirinput (do not prompt).
- Interactive: ask the user to provide the
References
Use these reference files during execution:
- SF CLI Bot Reference
- Generate Agent Spec Reference
- Planner Workflow Reference
- Post-Conversion Enhancements Reference
- Extraction Blueprint
- Input Contract
- Mapping Rules
- Handoff Output Format
- Quality Checklist
Execution Contract
Step 1: Parse and Validate --bots
Execute Step 1 in this order:
- Resolve mode:
- If
--modeomitted, useonline.
- If
- Start fresh for this invocation:
- do not discover, inspect, or reuse outputs from previously existing runs
- treat this invocation as a clean execution context
- only use artifacts produced during the current invocation flow
- Build initial workload list:
mode=online: read--botsand split by comma.mode=offline: scan<offline-dir>and collect immediate sub-directories as bot workload roots.
- Validate input shape:
mode=online: each--botstoken must match<bot-name>:<version>.mode=offline: ensure at least one bot sub-directory exists; otherwise STOP (in interactive mode ask the user to clarify; in non-interactive mode halt with an explicit error per the Interactive Mode rule).
- Normalize workload entries:
mode=online: build{bot_name, bot_version}entries.mode=offline: build{offline_bot_dir}entries (Annotate inferred bot name and version when derivable from the sub-directory structure; if not derivable, leave the entry unnamed and continue).
- Enforce one-version-per-bot rule (online mode):
- If the same
bot_nameappears with multiple versions, STOP (in interactive mode ask the user to clarify; in non-interactive mode halt with an explicit error per the Interactive Mode rule).
- If the same
- Apply offline bot filter:
- If
mode=offlineand--botsis provided, use--botsonly as a filter over discovered sub-directories; do not treat it as required offline input.
- If
- Persist Step 1 output:
- Save and carry forward a validated workload list for Step 2 parallel execution.
Step 2: Run Einstein Bot Upgrade (Per Bot-Version)
Execute the agent spec generation workflow from Generate Agent Spec Reference per bot-version combination:
--mode <online|offline>(defaultonlineif omitted)- mode-specific required inputs:
- online ->
--org-alias,--bot,--bot-version - offline ->
--offline-dir
- online ->
--interactive <true|false>(pass through the effective orchestrator value; defaulttrue)
Parallelization rule:
- In
mode=online, execute invocations in parallel because each bot-version pair is independent. - In
mode=offline, execute the Generate Agent Spec Reference workflow in parallel over every bot sub-directory discovered in Step 1.- Pass
--mode offlineand--offline-dir <bot-subdirectory-path>per invocation. Ensure each invocation (online/offline) uses isolated working directories to avoid cross-run file collisions.
- Pass
Hard rules:
- Do not skip this step.
Step 3: Aggregation + Planner Step (Conditional)
After all upgrade invocations complete:
- Always build a consolidated list of
{bot_name, bot_version, run_project_dir, agent_spec_path}. - Always build list of failed/incomplete upgrade runs (if any).
- Always build an initial ready-for-authoring list containing only valid Agent Spec entries.
- Each entry must include:
{bot_name, bot_version, run_project_dir, agent_spec_path, handoff_json_path, open_questions_path}.
- Each entry must include:
- If total bot workload count is greater than 1:
- Execute planner workflow from Planner Workflow Reference using:
- all ready-for-authoring
agent_spec_pathvalues asspec_paths - orchestrator working directory as
working_dir - the associated per-spec artifacts from each ready-for-authoring entry:
handoff_json_path(handoff JSON) andopen_questions_path(open questions)
- all ready-for-authoring
- Require output file at
<orchestrator working directory>/bot-upgrade-planner-output.json. - Read
bot-upgrade-planner-output.jsonand apply:- if
specs_changed=true: replace ready-for-authoring entries using planner fields (updated_spec_path,run_project_dir,handoff_json_path,open_questions_path) - if
specs_changed=false: keep original ready-for-authoring list unchanged
- if
- Execute planner workflow from Planner Workflow Reference using:
- If total bot workload count is 1:
- Skip planner workflow entirely.
- Keep original ready-for-authoring list unchanged.
Planner output expectations:
- boolean
specs_changed updated_specsarray with entries:original_spec_pathupdated_spec_pathrun_project_dirhandoff_json_pathopen_questions_path
updated_specsmust be empty whenspecs_changed=false
Step 4: Invoke Agentforce-Generate (Per Agent Spec)
For each entry in final ready-for-authoring list (post Step 3 planner reconciliation):
- Add this recommendation to the generated invocation context before calling
/agentforce-generate:- Do not activate Agent Script versions in this orchestrated run.
- Draft iteration is required: generating
.agent, validating, deploying, and preview testing are allowed. - Activate should be deferred unless the user explicitly asks for release.
- Resolve effective
run_project_dirfrom the final ready-for-authoring entry. - Read
<run_project_dir>/agentforce-generate-invocation-prompt.mdfully. - If Step 3 produced planner-updated spec paths/artifacts, apply path substitutions in the invocation context so spec/handoff/open-questions references point to updated files.
- If planner also changed
run_project_dir, use that updatedrun_project_dirfor resolving prompt/output-contract paths.
- If planner also changed
- Keep all non-path instructions unchanged from the original generated prompt.
- Invoke
/agentforce-generatewith this resolved invocation context. - Read
<run_project_dir>/agentforce-generate-output-contract.mdand capture outputs exactly as specified.
Parallelization rule:
- Invoke
/agentforce-generatein parallel across Agent Specs because each run is independent.
Output-contract capture rules:
- Treat the output contract as authoritative for required fields/artifacts.
- If any contract field is missing, mark status as partial and list missing fields explicitly.
- Return captured outputs with deterministic keys matching the contract names.
- Preserve output file paths and status of each required artifact.
- If expected prompt/contract files are missing for an entry, mark that entry
partial, record missing paths, and continue processing other entries.
Step 5: Post-Conversion Agent Script Enhancements (Per Generated Agent Script)
After Step 4 completes, for each generated .agent artifact:
- Resolve the generated
.agentfile path from captured/agentforce-generateoutputs. - Execute post-conversion enhancement workflow from Post-Conversion Enhancements Reference with:
agentscript_file=<generated-agent-file-path>mode=<online|offline>(the effective orchestrator run mode resolved in Step 1)- online mode only:
org_alias=<org-alias>(required so the enhanced Agent Script can be redeployed)
- Require in-place enhancement:
- optimized/enhanced output must be written to the same
.agentfile location.
- optimized/enhanced output must be written to the same
- Capture per-file enhancement status and any partial failures.
Parallelization rule:
- Execute post-conversion enhancement workflow in parallel across generated
.agentfiles because each file enhancement is independent.
Step 6: Consolidate Run Report and Conclude
After Step 5 completes for every bot in the workload:
- Write a single consolidated, human-readable run report as a non-empty Markdown file in the orchestrator working directory. Per bot, the report must state: the effective run mode, whether the planner ran (
executedorskipped), the generated Agent Spec path and generated.agentpath, the action inventory (including anyNEEDS_STUBitems), and — when--interactive=false— the auto-applied decisions. - Treat the run report as the FINAL artifact: write it only after all other artifacts (Agent Spec(s), handoff JSON, open questions, any planner output, and generated
.agentfile(s)) are already written.
Deliverable
Return:
- parsed bot/version list
- per-bot upgrade execution status
- aggregation output (full Agent Spec list + final ready-for-authoring subset)
- planner workflow status (
executedorskipped) andbot-upgrade-planner-output.jsonpath when executed - per-spec
/agentforce-generateexecution status - generated handoff artifact paths per bot/spec (including planner-updated artifacts when applicable)
- captured
/agentforce-generateoutputs per output contract - per-agent post-conversion enhancement status (including enhanced
.agentfile paths) - path to the consolidated run report written in Step 6
Related skills
More from forcedotcom/sf-skills and the wider catalog.

agentforce-d360-analyze
Reconstruct and analyze a single Agentforce session from Data Cloud in 10–30 seconds.

agentforce-generate
Build, modify, audit, repair, optimize, debug, and deploy Salesforce Agentforce agents with Agent Script.

agentforce-observe
Analyze production Agentforce agent behavior via session traces, Data Cloud, and Agent Health Monitoring alerts.

agentforce-test
Write, run, and analyze functional and security test suites for Agentforce agents.

analyzing-omnistudio-dependencies
Detect namespaces, map dependencies, and visualize impact across OmniScripts, FlexCards, Integration Procedures, and Data Mappers.

applying-cms-brand
Search, extract, and apply Salesforce CMS brand guidelines to generated content.