npx skills add ...
npx skills add forcedotcom/sf-skills --skill agentforce-bot-upgrade
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.
npx skills add forcedotcom/sf-skills --skill agentforce-bot-upgrade
Run a multi-bot upgrade-and-handoff cycle:
--bots/agentforce-generate per Agent Spec (parallelizable)Inputs:
--mode <online|offline> is optional; default is online when omitted.mode=online, required:
--org-alias <org-alias>--bots <bot1:v1,bot2:v2,...>mode=offline, required:
--offline-dir <offline-dir>--interactive <true|false> is optional; default is true when omitted.If required inputs are missing, handle per the Missing Input Handling and Interactive Mode rules below.
--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/--bots for online, --offline-dir for 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).
Resolve missing required launch inputs before Step 1:
--org-alias not provided. Resolve this before attempting to list bots (listing requires a target org).
--org-alias input (do not prompt or list).--bots) not available.
--org-alias as 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 the BotDefinition and BotVersion query patterns in SF CLI Bot Reference — omit the name/version filters to enumerate all bots and versions — present the results, and build the --bots workload from the user's selection.--bots input (do not prompt or list).--offline-dir not available.
--offline-dir path, then continue.--offline-dir input (do not prompt).Use these reference files during execution:
--botsExecute Step 1 in this order:
--mode omitted, use online.mode=online: read --bots and split by comma.mode=offline: scan <offline-dir> and collect immediate sub-directories as bot workload roots.mode=online: each --bots token 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).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).bot_name appears 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).mode=offline and --bots is provided, use --bots only as a filter over discovered sub-directories; do not treat it as required offline input.Execute the agent spec generation workflow from Generate Agent Spec Reference per bot-version combination:
--mode <online|offline> (default online if omitted)--org-alias, --bot, --bot-version--offline-dir--interactive <true|false> (pass through the effective orchestrator value; default true)Parallelization rule:
mode=online, execute invocations in parallel because each bot-version pair is independent.mode=offline, execute the Generate Agent Spec Reference workflow in parallel over every bot sub-directory discovered in Step 1.
--mode offline and --offline-dir <bot-subdirectory-path> per invocation.
Ensure each invocation (online/offline) uses isolated working directories to avoid cross-run file collisions.Hard rules:
After all upgrade invocations complete:
{bot_name, bot_version, run_project_dir, agent_spec_path}.{bot_name, bot_version, run_project_dir, agent_spec_path, handoff_json_path, open_questions_path}.agent_spec_path values as spec_pathsworking_dirhandoff_json_path (handoff JSON) and open_questions_path (open questions)<orchestrator working directory>/bot-upgrade-planner-output.json.bot-upgrade-planner-output.json and apply:
specs_changed=true: replace ready-for-authoring entries using planner fields (updated_spec_path, run_project_dir, handoff_json_path, open_questions_path)specs_changed=false: keep original ready-for-authoring list unchangedPlanner output expectations:
specs_changedupdated_specs array with entries:
original_spec_pathupdated_spec_pathrun_project_dirhandoff_json_pathopen_questions_pathupdated_specs must be empty when specs_changed=falseFor each entry in final ready-for-authoring list (post Step 3 planner reconciliation):
/agentforce-generate:
.agent, validating, deploying, and preview testing are allowed.run_project_dir from the final ready-for-authoring entry.<run_project_dir>/agentforce-generate-invocation-prompt.md fully.run_project_dir, use that updated run_project_dir for resolving prompt/output-contract paths./agentforce-generate with this resolved invocation context.<run_project_dir>/agentforce-generate-output-contract.md and capture outputs exactly as specified.Parallelization rule:
/agentforce-generate in parallel across Agent Specs because each run is independent.Output-contract capture rules:
partial, record missing paths, and continue processing other entries.After Step 4 completes, for each generated .agent artifact:
.agent file path from captured /agentforce-generate outputs.agentscript_file=<generated-agent-file-path>mode=<online|offline> (the effective orchestrator run mode resolved in Step 1)org_alias=<org-alias> (required so the enhanced Agent Script can be redeployed).agent file location.Parallelization rule:
.agent files because each file enhancement is independent.After Step 5 completes for every bot in the workload:
executed or skipped), the generated Agent Spec path and generated .agent path, the action inventory (including any NEEDS_STUB items), and — when --interactive=false — the auto-applied decisions..agent file(s)) are already written.Return:
executed or skipped) and bot-upgrade-planner-output.json path when executed/agentforce-generate execution status/agentforce-generate outputs per output contract.agent file paths)