8.8 KiB
Generate Agent Spec
What This Skill Is For
This skill implements only Phase 1 of migration:
- In scope: Einstein Bot -> normalized migration model -> Agent Spec handoff package
- Out of scope:
.agentgeneration, validation, publish, activate, or deployment
The generated handoff is explicitly designed so /agentforce-generate can consume it as the starting spec input for Agent Script authoring.
How to Use This Skill
Treat this file as the execution router. Always read the referenced files before executing each step.
Follow this fixed sequence:
- Intake and normalize source bot artifacts
- Build migration mapping model (dialogs/intents/entities/actions/transitions)
- Generate Agent Spec handoff artifacts for
/agentforce-generate - Resolve open questions with the user one-by-one (or auto-apply recommended defaults when
--interactive=false) and persist decisions - Generate handoff invocation prompt for
/agentforce-generatewhen ambiguity is cleared
Rules That Always Apply
- Do not generate
.agentin this skill. Stop at Agent Spec + handoff artifacts. - No implementation invention. If action target details are unknown, use
NEEDS_STUB. - Preserve behavioral intent, not XML shape. Convert deterministic bot flow into subagent-oriented behavioral design.
- Track uncertainty explicitly. Every ambiguous mapping must be captured in
open_questions. - Mandatory resolution loop. After artifact generation, process open questions and persist every resolved decision. In interactive mode, resolve them one-by-one with the user; when
--interactive=false, auto-apply the recommended default for each open question without prompting and record the decision. - Prompt handoff after clarity. Once all open questions are resolved without ambiguity, generate a complete invocation prompt package for
/agentforce-generate(do not invoke the skill from this skill). - Use deterministic guardrails for risky flows. Identity checks, escalation, sensitive operations, and regulated advice must be explicit in the spec.
- Input gate is a hard block. Do not read any workspace files, bot metadata, Apex classes, SFDX project contents, or existing spec files until input mode is explicitly selected and all required inputs for that mode are confirmed. Speculative reading of artifacts found in the workspace is prohibited.
Task Domains
Build Agent Spec from Einstein Bot
Use this when user provides Einstein Bot artifacts and asks to migrate/upgrade into Agentforce.
Required Steps
-
Collect mode and required inputs (HARD GATE) — Parse inputs using this contract:
--mode <online|offline>(optional; default toonlinewhen omitted)- If
mode=online, required inputs:--org-alias <org-alias>--bot <bot-name>--bot-version <bot-version>
- If
mode=offline, required input:--offline-dir <offline-dir>(directory containing/associated with bot metadata inputs)
--interactive <true|false>(optional; defaulttrue). Whenfalse, run autonomously: do not prompt at any decision point, apply the recommended default for every open question/ambiguity, and record each auto-applied decision. If required mode-specific inputs are missing, stop and ask in interactive mode; in non-interactive mode halt with an explicit error (do not prompt). Do not read files/metadata/workspace contents until mode and required inputs are confirmed.
Note: if--modeis omitted, treat mode asonlineimmediately (do not ask user to choose mode in that case).
-
Ingest source artifacts — Read Input Contract and normalize user-provided bot inputs into one canonical migration model.
- For
mode=online, run required SF CLI bot/version/dependency retrieval using SF CLI Bot Reference. Use ONLY the query patterns documented there — do NOT invent or modify field names. - For
mode=offline, skip org retrieval and process all relevant local metadata from--offline-dir:- bot and botVersion XML metadata (required)
- Flow metadata under
flows/(when present) - Apex classes under
classes/(when present) - any other local files referenced by bot artifacts that are needed for extraction/mapping fidelity
- In offline mode, do not limit ingestion to only two XML files if additional referenced artifacts are available locally.
- For
-
Extract migration structure — Read Extraction Blueprint and derive:
- bot capabilities
- dialog graph
- intent map
- variable/entity usage
- invocation/action inventory
- fallback/escalation behavior
-
Map Einstein Bot -> Agent Spec components — Read Mapping Rules and produce topic/subagent, action, routing, and state mappings.
-
Generate handoff artifacts — Read Handoff Output Format and write:
<run_project_dir>/<AgentName>-AgentSpec.md<run_project_dir>/<AgentName>-einstein-bot-handoff.json<run_project_dir>/<AgentName>-open-questions.mdUse the same run-specific SFDX project directory created in the SF CLI setup step; do not write handoff artifacts to repository root. The Agent Spec markdown MUST use the same section names/order asskills/agentforce-generate/assets/agent-spec-template.md, then append the## Migration Notes (Einstein Bot -> Agentforce)appendix defined in Handoff Output Format.
-
Validate handoff quality — Read Quality Checklist and verify all required sections and mapping completeness before presenting output.
-
Resolve open questions loop (required) — After generating artifacts, resolve all entries in
<run_project_dir>/<AgentName>-open-questions.md. In interactive mode, guide the user through them one-by-one; when--interactive=false, auto-apply the recommended default for each entry without prompting. For each resolved item, immediately update:<run_project_dir>/<AgentName>-AgentSpec.md<run_project_dir>/extraction-summary.jsonand remove/mark-resolved the corresponding open question.
-
Generate
/agentforce-generateinvocation package (no direct invoke here) — When all open questions are resolved without ambiguity, generate and persist:<run_project_dir>/agentforce-generate-invocation-prompt.md(the exact prompt to pass to/agentforce-generate)<run_project_dir>/agentforce-generate-output-contract.md(expected outputs that orchestrator must capture) The prompt must include:current_working_directory(run folder path) for all reads/writes<run_project_dir>/<AgentName>-AgentSpec.mdas source-of-truth spec<run_project_dir>/extraction-summary.jsonas supporting context<run_project_dir>/<AgentName>-einstein-bot-handoff.jsonand<run_project_dir>/<AgentName>-open-questions.mdinput_mode(onlineoroffline) explicit context Forinput_mode=offline, include these strict instructions in the prompt:- syntax/structural validation is still mandatory
- skip only org-dependent CLI operations
- use local artifacts only
- keep unresolved implementations as structurally complete
NEEDS_STUBaction definitions - do not deploy/publish/activate
Do not invoke
/agentforce-generatefrom this skill.
Reference Files
- Input Contract — accepted source types and normalization schema
- Extraction Blueprint — what to extract from Einstein Bot metadata and why
- Mapping Rules — canonical mapping from bot constructs to Agent Spec constructs
- Handoff Output Format — required output files and exact structure
- Quality Checklist — validation criteria before handoff to
/agentforce-generate - SF CLI Bot Reference — required
sfcommand sequence to validate bot/version and retrieve dependencies
Deliverables
At completion, always return:
- Agent Spec handoff file path
- Handoff JSON path
- Open questions path
/agentforce-generateinvocation package status:generatedwith prompt/output-contract paths when all open questions are resolvedblockedwhen unresolved ambiguity remains (include unresolved question IDs)
- Generated
/agentforce-generateinvocation prompt path (when status isgenerated) - Generated
/agentforce-generateoutput contract path (when status isgenerated) - Short migration-risk summary (top unresolved items)
Important Constraints
- Do not invoke deployment/publish/activate flows in this skill.
- Do not claim parity with Einstein Bot unless all dialogs/intents/actions are mapped or explicitly deferred.
- Do not collapse critical decision branches into vague LLM-only behavior; represent gates and transitions explicitly in the Agent Spec.