@salesforce/afv-skills 1.31.0 → 1.32.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.
Files changed (98) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-bot-upgrade/SKILL.md +217 -0
  3. package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
  4. package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
  5. package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
  6. package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
  7. package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
  8. package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
  9. package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
  10. package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
  11. package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
  12. package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
  13. package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
  14. package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
  15. package/skills/dx-org-manage/SKILL.md +8 -5
  16. package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
  17. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
  18. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -9
  19. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
  20. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
  21. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
  22. package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
  23. package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
  24. package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
  25. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
  26. package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
  27. package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
  28. package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
  29. package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
  30. package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
  31. package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
  32. package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
  33. package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
  34. package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
  35. package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
  36. package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
  37. package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
  38. package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
  39. package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
  40. package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
  41. package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
  42. package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
  43. package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
  44. package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
  45. package/skills/platform-widget-generate/SKILL.md +241 -0
  46. package/skills/platform-widget-generate/examples/conditional.json +73 -0
  47. package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
  48. package/skills/platform-widget-generate/examples/single-object.json +64 -0
  49. package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
  50. package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
  51. package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
  52. package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
  53. package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
  54. package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
  55. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
  56. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
  57. package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
  58. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
  59. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
  60. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
  61. package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
  62. package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
  63. package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
  64. package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
  65. package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
  66. package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
  67. package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
  68. package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
  69. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
  70. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
  71. package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
  72. package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
  73. package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
  74. package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
  75. package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
  76. package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
  77. package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
  78. package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
  79. package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
  80. package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
  81. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
  82. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
  83. package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
  84. package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
  85. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
  86. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
  87. package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
  88. package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
  89. package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
  90. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
  91. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
  92. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
  93. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
  94. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
  95. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
  96. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
  97. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
  98. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
@@ -0,0 +1,208 @@
1
+ # Handoff Output Format
2
+
3
+ ## Required Files
4
+
5
+ 1. `<AgentName>-AgentSpec.md`
6
+ 2. `<AgentName>-einstein-bot-handoff.json`
7
+ 3. `<AgentName>-open-questions.md`
8
+
9
+ The extraction step also persists `extraction-summary.json` in the same directory (see [Extraction Blueprint](extraction-blueprint.md)); it is carried forward as supporting context in the handoff.
10
+
11
+ Write all required files in the run-specific SFDX project directory for the selected input mode:
12
+ - Mode A: org-backed run project directory created during SF CLI setup
13
+ - Mode B: offline run project directory containing/associated with provided XML inputs
14
+ Do not write handoff artifacts in the repository root.
15
+
16
+ ## 1) Agent Spec Markdown
17
+
18
+ Create `<run_project_dir>/<AgentName>-AgentSpec.md` by copying:
19
+ `skills/agentforce-generate/assets/agent-spec-template.md`
20
+
21
+ The handoff Agent Spec MUST:
22
+
23
+ 1. retain the same section names and ordering as the template
24
+ 2. fill every section with migration-specific content derived from extraction outputs
25
+
26
+ Required section order:
27
+
28
+ 1. `## Purpose & Scope`
29
+ 2. `## Behavioral Intent`
30
+ 3. `## Subagent Posture`
31
+ 4. `## Subagent Map`
32
+ 5. `## Variables`
33
+ 6. `## Actions`
34
+ 7. `## Action Invocation Strategy`
35
+ 8. `## Deterministic Controls (When Needed)`
36
+ 9. `## Architecture Pattern`
37
+ 10. `## Agent Configuration`
38
+
39
+ ### Section-by-section generation guidance (from `extraction-summary.json`)
40
+
41
+ #### `## Purpose & Scope`
42
+
43
+ 1. Derive a meaningful purpose statement from bot description/identity and extracted intent summaries.
44
+ 2. Describe the agent's business scope using the intents the bot actually handles.
45
+ 3. Restrict scope to capabilities backed by configured actions:
46
+ - do not claim unsupported capabilities
47
+ - call out out-of-scope requests when no action support exists
48
+
49
+ #### `## Behavioral Intent`
50
+
51
+ 1. Start traversal from `Welcome` (or extracted entry dialog when `Welcome` is absent).
52
+ 2. Build each workflow using:
53
+ - `dialog_functionality_summary`
54
+ - ordered `step_functionality`
55
+ 3. Handle navigations by following target dialogs recursively, while preserving navigation semantics:
56
+ - **`Call` navigation**: 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.
57
+ - **`Redirect` navigation**: transfer control permanently to the target dialog and halt source-dialog execution immediately (no return to source flow).
58
+ 4. While reconstructing flows, track `Call` vs `Redirect` semantics internally so downstream agent design preserves return/non-return behavior.
59
+ 5. For `Call` flows, capture both:
60
+ - the delegated target workflow behavior, and
61
+ - the resumed source workflow behavior after return.
62
+ 6. For `Redirect` flows, do not append post-redirect source steps to the same path unless there is an explicit later re-entry edge.
63
+ 7. Reconstruct meaningful user conversation flows across traversed dialogs.
64
+ 8. Identify hard checkpoints by capturing strict ordering constraints, mandatory preconditions, and enforced branches/escalations.
65
+ 9. Final behavioral intent must include:
66
+ - ordered events for one or more workflows
67
+ - action invocation scope and sequencing
68
+ - variable usage scope (reads/writes and gating variables)
69
+ - escalation/routing behavior
70
+ - normalized transition behavior (return-after-delegation vs one-way transfer) expressed in agent-native terms only
71
+ - other critical bot-specific constraints that affect conversation behavior
72
+
73
+ 10. Do NOT emit raw bot navigation constructs (`Call`, `Redirect`) in the final Agent Spec text. Convert them into agent-native behavioral descriptions only.
74
+
75
+ #### `## Subagent Posture`
76
+
77
+ 1. Derive baseline subagents from dialog clusters (`1 cluster -> 1 subagent`).
78
+ 2. Ensure each subagent has coherent responsibility boundaries based on associated dialog behavior and actions.
79
+ 3. Add additional subagents when dialogs are not assigned to any cluster but represent distinct bot functionality.
80
+ 4. Ensure all dialog functionality is covered by at least one subagent.
81
+ 5. Record any uncertain assignments in open questions instead of forcing low-confidence grouping.
82
+
83
+ ### Bot-specific artifact translation rules (required)
84
+
85
+ When generating the Agent Spec, do not retain raw bot-only entities. Translate them into agent-native behavior.
86
+
87
+ 1. Do not carry forward bot-only references directly, including:
88
+ - intent names derived from dialog naming
89
+ - intent utterance lists as bot-training artifacts
90
+ - dialog identifiers/names
91
+ - menu redirection constructs
92
+ 2. Replace each with equivalent capability-level descriptions:
93
+ - user goal summaries
94
+ - behavioral routing intent
95
+ - reasoning instructions for when/how to route or invoke actions
96
+ 3. Menu redirections must be translated by:
97
+ - capturing the user intent behind each menu option
98
+ - converting each option into an equivalent reasoning-based LLM instruction
99
+ - preserving functional outcomes without reproducing rigid bot menu mechanics
100
+ 4. Evaluate every bot return message/response shown to users:
101
+ - if a message contains no actionable information and is only small talk, ignore it
102
+ - otherwise, preserve equivalent user-facing messaging in the relevant subagent behavior
103
+ - do not miss messages containing information about next steps, required actions, documentation, policy, or handoff guidance
104
+ 5. For each subagent, evaluate whether menu translation is necessary at all:
105
+ - prefer direct intent/reasoning behavior when menus are unnecessary
106
+ - retain a lightweight guided-choice pattern only when it materially improves clarity or control
107
+ 6. 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.
108
+
109
+ Then add this migration-specific appendix section at the end:
110
+
111
+ 11. `## Migration Notes (Einstein Bot -> Agentforce)`
112
+ - Source bot identity and version
113
+ - Mapping confidence summary
114
+ - Unmapped constructs
115
+ - Open decisions requiring user approval
116
+
117
+ ### Action Invocation Optimization Rules
118
+
119
+ Use this step to optimize conversation efficiency by reducing unnecessary action invocations while preserving behavior and data contracts.
120
+
121
+ #### Allowed optimization operations
122
+
123
+ 1. **Add action** — only when required to preserve an existing conversational outcome after removing/replacing bot-only behavior.
124
+ 2. **Update action** — only for invocation optimization (for example, replacing multi-hop equivalent invocations with one semantically equivalent action).
125
+ 3. **Delete action** — only when action is bot-only or redundant in the agent architecture.
126
+
127
+ #### Hard constraints
128
+
129
+ 1. Do not merge or modify unrelated actions just to reduce invocation count.
130
+ 2. Do not change action inputs/outputs in a way that causes data loss.
131
+ 3. Preserve all variable assignments needed by downstream steps/subagents.
132
+ 4. Preserve required action side effects that are part of business behavior.
133
+
134
+ #### Bot-only action handling
135
+
136
+ If an action is applicable only to Einstein Bot runtime (for example, internal bot-state bookkeeping actions):
137
+
138
+ 1. Mark the action as `candidate_for_removal`.
139
+ 2. Show the user why it is bot-only and why it is not needed in Agentforce.
140
+ 3. Do not remove it automatically.
141
+ 4. 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 deferred `candidate_for_removal` decision in open questions.
142
+
143
+ #### User review gate (required)
144
+
145
+ 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.
146
+
147
+ Before finalizing optimized actions, present a complete change summary to the user:
148
+
149
+ 1. Added actions
150
+ 2. Updated actions
151
+ 3. Candidate removals
152
+ 4. For each affected action, include:
153
+ - action description/purpose
154
+ - full input contract
155
+ - full output contract
156
+ - variable assignments (reads/writes)
157
+ - rationale for optimization
158
+
159
+ Apply changes only after user approval.
160
+
161
+ #### Persistence requirement
162
+
163
+ After user confirms, update the Agent Spec file to reflect all finalized action changes (adds/updates/deletes), including:
164
+
165
+ - action descriptions
166
+ - input/output contracts
167
+ - variable read/write assignments
168
+ - action invocation strategy updates required by the optimization
169
+
170
+ Do not treat non-confirmed changes as final.
171
+
172
+ ## 2) Open Questions Markdown
173
+
174
+ Include:
175
+
176
+ - Blocking decisions (must resolve before `/agentforce-generate` handoff)
177
+ - Non-blocking clarifications (resolve when they materially affect generated spec/actions)
178
+ - Recommended defaults for each question
179
+
180
+ Write this file as:
181
+
182
+ - `<run_project_dir>/<AgentName>-open-questions.md`
183
+
184
+ ## 3) Einstein Bot Handoff JSON
185
+
186
+ 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](mapping-rules.md).
187
+
188
+ The handoff JSON MUST:
189
+
190
+ 1. Capture the structured mapping used to build the spec:
191
+ - subagent/topic mapping
192
+ - action inventory with input/output contracts and `EXISTS`/`NEEDS_STUB`/`NEEDS_CREATION`/`CANDIDATE_FOR_REMOVAL` status
193
+ - variable mappings (`mutable`/`linked`)
194
+ - routing/transition mapping
195
+ - unmapped items
196
+ 2. 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).
197
+
198
+ ## Open Question Resolution Loop (Required)
199
+
200
+ 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.
201
+
202
+ For each resolved question:
203
+
204
+ 1. Update `<run_project_dir>/<AgentName>-AgentSpec.md` with the resolved decision.
205
+ 2. Update `<run_project_dir>/extraction-summary.json` with the same resolved finding and any downstream mapping updates.
206
+ 3. Mark the question as resolved (or remove it) in `<run_project_dir>/<AgentName>-open-questions.md`.
207
+
208
+ Do not leave ambiguous or contradictory outcomes in any artifact.
@@ -0,0 +1,101 @@
1
+ # Input Contract
2
+
3
+ ## Mode Selection
4
+
5
+ Input mode is selected from `--mode <online|offline>`:
6
+
7
+ 1. **Online (Mode A: org-backed retrieval)** — Use org alias + bot identity, then fetch metadata/dependencies via SF CLI.
8
+ 2. **Offline (Mode B: local metadata input)** — Use provided local metadata/artifacts directly without org fetch.
9
+
10
+ If `--mode` is omitted, default to **online**.
11
+ Only ask the user to clarify mode when provided inputs are insufficient or contradictory for the inferred/default mode. When `--interactive=false`, do not ask — proceed with the inferred/default mode and record the assumption; halt only if the inputs cannot support any mode.
12
+
13
+ ## Supported Input Modes
14
+
15
+ ### Mode A: Org-backed retrieval
16
+
17
+ Required inputs:
18
+
19
+ 1. `--org-alias <org-alias>` — Salesforce org alias used as source context (for discovery, validation, and traceability).
20
+ 2. `--bot <bot-name>` — Einstein Bot developer name/identifier to migrate.
21
+ 3. `--bot-version <bot-version>` — specific version to migrate (for example: `v3`).
22
+
23
+ ### Mode B: Offline metadata input (new)
24
+
25
+ Required inputs:
26
+
27
+ 1. `--offline-dir <offline-dir>` — directory containing/associated with local bot metadata inputs.
28
+
29
+ Within `--offline-dir`, `.bot-meta.xml` and `.botVersion-meta.xml` inputs are treated as authoritative bot metadata sources for extraction/mapping.
30
+
31
+ ## Offline Directory Processing Scope (Required)
32
+
33
+ When `--mode offline` is selected, process **all relevant local artifacts** in `--offline-dir` (recursively), not just bot XML:
34
+
35
+ 1. Bot metadata:
36
+ - `*.bot-meta.xml`
37
+ - `*.botVersion-meta.xml`
38
+ 2. Flow artifacts:
39
+ - files under `flows/` (for example `*.flow-meta.xml`)
40
+ 3. Apex artifacts:
41
+ - files under `classes/` (for example `*.cls`, `*.cls-meta.xml`)
42
+ 4. Misc referenced artifacts:
43
+ - any other files referenced by bot/flow/action mappings that improve extraction/mapping fidelity
44
+
45
+ Processing rules:
46
+
47
+ 1. If `flows/` exists, parse flow signatures and mappings to improve action inventory contracts.
48
+ 2. If `classes/` exists, parse invocable Apex signatures (`@InvocableMethod`, `@InvocableVariable`) to improve action I/O contracts.
49
+ 3. If both bot mapping and local implementation artifacts exist, prefer concrete local implementation signatures over inferred placeholders.
50
+ 4. If referenced artifacts are missing locally, continue with inferred signatures and mark unresolved details in `open_questions`.
51
+ 5. Never require org retrieval in offline mode.
52
+
53
+ If required inputs for the selected mode are missing, stop and ask for them before processing artifacts.
54
+
55
+ ## Identity Resolution Rules
56
+
57
+ - For Mode A, use `org-alias + bot + bot-version` as the run identity key.
58
+ - For Mode B, use `bot + bot-version` derived from provided XML metadata (or confirmed from user when not derivable).
59
+ - Do not merge artifacts from different versions in the same run.
60
+ - If source files contain a mismatched bot identity, pause and ask the user which identity is authoritative. When `--interactive=false`, do not pause — treat the identity declared in the authoritative bot metadata as the recommended default and record the assumption in `open_questions`.
61
+
62
+ ## Missing/Partial Input Handling
63
+
64
+ - If action signatures are missing: keep action in inventory with `target: NEEDS_STUB`.
65
+ - If intent training data is missing: infer intent purpose from dialog labels/descriptions and mark confidence.
66
+ - If transitions are unclear: preserve as unresolved branch in `open_questions`.
67
+
68
+ ## Post-Input Finalization Workflow (Required)
69
+
70
+ ### Mode A: Org-backed retrieval
71
+
72
+ After `--org-alias + --bot + --bot-version` are finalized, execute the SF CLI sequence in:
73
+
74
+ - [SF CLI Bot Reference](sf-cli-bot-reference.md)
75
+
76
+ This is the canonical command list for:
77
+
78
+ 1. Enforcing SF CLI and org access prerequisites
79
+ 2. Validating bot and bot version
80
+ 3. Retrieving bot metadata
81
+ 4. Retrieving required Apex/Flow/ML domain dependencies
82
+
83
+ Any unresolved dependency must be recorded in `open_questions` and mapped as `NEEDS_STUB` where applicable.
84
+
85
+ ### Mode B: Offline metadata input
86
+
87
+ When both XML files are provided (`.bot-meta.xml` + `.botVersion-meta.xml`):
88
+
89
+ 1. Create a run folder in repo root named `<bot-name>-<bot-version>-agent`.
90
+ 2. Copy the provided bot metadata files into that run folder:
91
+ - `<BotName>.bot-meta.xml`
92
+ - `<version>.botVersion-meta.xml`
93
+ 3. Use that run folder as the working directory for this offline run.
94
+ 4. Skip all SF CLI org validation/retrieval commands.
95
+ 5. Do not fetch bot/dependency metadata from org.
96
+ 6. Continue directly with extraction and mapping using all available local artifacts in `--offline-dir` as source inputs.
97
+ 7. If `flows/` and/or `classes/` are present, include them in extraction before finalizing action contracts.
98
+ 8. If referenced dependencies (Apex/Flow/MLDomain/etc.) are not available locally, record them as unresolved in `open_questions` and map as `NEEDS_STUB` where applicable.
99
+ 9. If action signatures (Apex/Flow/etc.) cannot be fully resolved in offline mode, continue execution with best-effort signature expansion and mark unresolved fields.
100
+
101
+ All generated outputs for that run (for example `extraction-summary.json`, Agent Spec handoff, and open questions) must be written inside the same run-specific SFDX project directory for the selected mode.
@@ -0,0 +1,113 @@
1
+ # Mapping Rules
2
+
3
+ ## Objective
4
+
5
+ Convert extracted Einstein Bot behavior into a high-quality Agent Spec that `/agentforce-generate` can execute.
6
+
7
+ ## Canonical Mappings
8
+
9
+ - **Dialog clusters** -> **Subagents/Topics**
10
+ - **Intent catalog** -> **Router instructions + transition actions**
11
+ - **Entity/slot collection** -> **Variables + eligibility/guard conditions**
12
+ - **Action inventory** -> **Action inventory in spec** (`NEEDS_STUB` when implementation unknown)
13
+ - **Fallback dialogs** -> **Boundary handling and recovery behavior**
14
+ - **Transfer/system handoff** -> **Built-in `@utils.escalate`** (escalation policy; never a new/standalone action)
15
+
16
+ ## Escalation Mapping Rule
17
+
18
+ Escalation/transfer behavior (Einstein Bot `SystemMessage` `Transfer`, or any "hand off to a live agent/human" handoff) MUST be mapped implicitly to the built-in `@utils.escalate` utility. Do NOT:
19
+
20
+ - create a new action for it in the action inventory (no `Transfer_To_Agent`-style action, no `NEEDS_STUB`/`NEEDS_CREATION` entry for the transfer),
21
+ - model it as a flow/apex/standard-invocable action, or
22
+ - represent it as generic "hand off to a human" prose without the explicit `@utils.escalate` control.
23
+
24
+ Instead:
25
+
26
+ - Express the escalation as an explicit `@utils.escalate` invocation in the relevant subagent's instructions (typically a terminal step of an escalation subagent).
27
+ - Exclude the transfer from the action inventory entirely (it is not an authored action).
28
+
29
+ ## Dialog Functionality Extraction Rules
30
+
31
+ Capture the functional behavior of each bot dialog before action optimization.
32
+
33
+ ### Processing steps
34
+
35
+ 1. Process each bot dialog independently.
36
+ 2. Parse the dialog's bot steps strictly in configured order.
37
+ 3. For each bot step, generate one or more meaningful functional sentences that describe what the bot does at that step.
38
+ 4. Build an ordered list per dialog (`step_functionality`) that preserves original step sequence.
39
+
40
+ ### What each step description must capture
41
+
42
+ For each step, include applicable details:
43
+
44
+ - step intent/purpose (message, collect, invoke, transition, system behavior)
45
+ - conditions/guards (for example variable comparisons and branching criteria)
46
+ - action invocations (action name and type, when invoked)
47
+ - variable updates (set/unset/collect, including affected variable names)
48
+ - transition behavior (target dialog and transition type when present)
49
+
50
+ ### Exhaustive bot-step handling
51
+
52
+ When generating `step_functionality`, handle all supported Einstein Bot step families using the rules below.
53
+
54
+ 1. **Message**
55
+ - Describe user-facing message intent and any branch context.
56
+ 2. **VariableOperation**
57
+ - **Set**: capture source -> target variable assignment.
58
+ - **Unset**: capture variable clear/reset behavior.
59
+ - **Collect**: capture which variable is collected, requiredness, and option source (static/dynamic).
60
+ - **SetConversationLanguage**: capture locale/language state update.
61
+ - **CollectAttachment**: capture file-collection requirement and resulting variable update.
62
+ 3. **Invocation**
63
+ - Capture invocation target, invocation type (`apex`, `flow`, `standardInvocableAction`, `externalService`, `quickAction`, `api`), input mappings, output mappings, and resulting variable writes.
64
+ 4. **Navigation**
65
+ - Capture transition type (`Redirect` / `Call`), target dialog, and trigger condition.
66
+ 5. **Wait**
67
+ - Capture as intent-routing pause point where control waits for user input and may route to intent-enabled dialogs.
68
+ 6. **Group**
69
+ - Process nested steps recursively in order, preserving parent conditions and emitting child step sentences in sequence.
70
+ 7. **SystemMessage**
71
+ - **Transfer**: capture escalation behavior and resolved target type/value, and map it implicitly to the built-in `@utils.escalate` (see Escalation Mapping Rule) — do not emit it as a new action.
72
+ - **EndChat**: capture terminal behavior and conversation close.
73
+ 8. **RecordLookup**
74
+ - Capture queried object/entity, filter criteria, and output variable/list assignment.
75
+ 9. **RichMessage**
76
+ - Capture rich interaction type (for example forms/payments/selectors/links) and expected follow-up behavior.
77
+ 10. **GoalStep**
78
+ - Mark as bot-specific/non-agentic telemetry unless it drives business behavior; include only if behaviorally relevant.
79
+
80
+ ### Step rendering rules
81
+
82
+ 1. Preserve original step order exactly.
83
+ 2. Emit one or more concise functional sentences per step.
84
+ 3. Include conditional prefix when step is gated (for example `If <condition> ...`).
85
+ 4. Preserve variable names and action names verbatim in step descriptions.
86
+ 5. Do not skip nested steps inside `Group`.
87
+
88
+ ### Output requirement
89
+
90
+ For every dialog, produce:
91
+
92
+ 1. `dialog_functionality_summary` (short high-level summary)
93
+ 2. `step_functionality` (ordered list of functional sentences derived step-by-step)
94
+
95
+ This output is the baseline for downstream subagent grouping and mapping decisions.
96
+
97
+ ## Risk and Safety Rules
98
+
99
+ - Explicitly capture:
100
+ - identity verification points
101
+ - sensitive action boundaries
102
+ - escalation to human support
103
+ - refusal boundaries for unsupported asks
104
+
105
+ ## Persistence Requirement
106
+
107
+ At the end of mapping, update `extraction-summary.json` with bot dialog functionality details for every dialog, including `dialog_functionality_summary` and ordered `step_functionality`.
108
+
109
+ When updating `extraction-summary.json` during mapping:
110
+
111
+ 1. Preserve the canonical schema defined in [Extraction Blueprint](extraction-blueprint.md) (do not add/remove/rename top-level keys).
112
+ 2. Update existing sections in place (`dialog_graph`, `intent_catalog`, `variables`, `action_inventory`, `dialog_clusters`, `unmapped_items`) instead of reshaping them.
113
+ 3. Keep enum/status normalization stable (`redirect/call/intent_redirect`; `EXISTS/NEEDS_STUB/NEEDS_CREATION/CANDIDATE_FOR_REMOVAL`).
@@ -0,0 +1,78 @@
1
+ # Planner Workflow Reference
2
+
3
+ Use this reference during orchestrator Step 3 when processing multiple bots in a single invocation.
4
+
5
+ ## When To Apply
6
+
7
+ - Apply only when there are more than 1 ready-for-authoring Agent Specs.
8
+ - If there is 1 or fewer specs, skip planner workflow and keep specs unchanged.
9
+
10
+ ## Inputs
11
+
12
+ Required inputs to this workflow:
13
+
14
+ 1. `spec_paths`: all ready-for-authoring Agent Spec paths
15
+ 2. `working_dir`: orchestrator working directory where planner output must be written
16
+ 3. associated artifacts for each spec when present:
17
+ - handoff JSON
18
+ - open questions
19
+
20
+ ## Required Workflow
21
+
22
+ 1. Read all specs and associated artifacts.
23
+ 2. Build a final candidate set of specs that will each map to one actual downstream agent.
24
+ 3. Identify existing subagent grouping/context in each spec.
25
+ 4. Attempt regrouping based on:
26
+ - intent
27
+ - underlying object/entity
28
+ - broad category
29
+ 5. Allowed structural operations across specs:
30
+ - merge
31
+ - split
32
+ - move
33
+ - delete
34
+ 6. Apply operations only when they improve:
35
+ - modularity
36
+ - context-awareness
37
+ - interactive user experience
38
+ 7. Never perform changes for superficial consistency only.
39
+ 8. Preserve full functional coverage:
40
+ - no input functionality may be lost
41
+ - if any functionality loss risk is detected, abandon changes and mark unchanged
42
+
43
+ ## Required Output File
44
+
45
+ Write:
46
+ - `<working_dir>/bot-upgrade-planner-output.json`
47
+
48
+ Schema:
49
+
50
+ ```json
51
+ {
52
+ "specs_changed": true,
53
+ "updated_specs": [
54
+ {
55
+ "original_spec_path": "/path/original/spec-a.md",
56
+ "updated_spec_path": "/path/updated/spec-a.md",
57
+ "run_project_dir": "/path/updated/run-project-dir",
58
+ "handoff_json_path": "/path/updated/spec-a-einstein-bot-handoff.json",
59
+ "open_questions_path": "/path/updated/spec-a-open-questions.md"
60
+ }
61
+ ]
62
+ }
63
+ ```
64
+
65
+ Rules:
66
+
67
+ 1. `specs_changed` is boolean.
68
+ 2. If `specs_changed=false`, then `updated_specs=[]`.
69
+ 3. If `specs_changed=true`, `updated_specs` must include entries for all changed specs.
70
+ 4. Every changed entry must include:
71
+ - `original_spec_path`
72
+ - `updated_spec_path`
73
+ - `run_project_dir`
74
+ - `handoff_json_path`
75
+ - `open_questions_path`
76
+ 5. If any functionality-loss risk exists, force:
77
+ - `specs_changed=false`
78
+ - `updated_specs=[]`
@@ -0,0 +1,67 @@
1
+ # Post-Conversion Enhancements Reference
2
+
3
+ Use this reference during orchestrator Step 5 after `/agentforce-generate` completes.
4
+
5
+ ## Scope
6
+
7
+ Apply per generated Agent Script artifact (`.agent`) independently.
8
+
9
+ ## Inputs
10
+
11
+ Required:
12
+
13
+ 1. `agentscript_file`: path to one generated `.agent` file
14
+ 2. `mode` (`online|offline`): the effective orchestrator run mode
15
+
16
+ Conditionally required:
17
+
18
+ 3. `org_alias`: target org alias used to redeploy in Step 9. Required when `mode=online`; omit when `mode=offline`.
19
+
20
+ ## Required Workflow
21
+
22
+ 1. Read the full `.agent` file.
23
+ 2. Enforce `start_agent` router behavior:
24
+ - ensure the subagent marked `start_agent` contains explicit instructions that
25
+ - it is only a router and should route immediately to the correct downstream agent
26
+ - it never responds directly to the user
27
+ - if this instruction is missing, add it
28
+ 3. Improve transition quality with meaningful `available when` conditions:
29
+ - add or refine conditions between subagents wherever possible
30
+ - conditions should be meaningful and correct for transition intent
31
+ - conditions should reduce routing noise and improve next-step navigation in the final agent
32
+ 4. Validate action data flow integrity:
33
+ - ensure action inputs/outputs are correctly mapped through conversation variables or LLM inputs
34
+ - where needed, persist required LLM-derived values via `setVariables`
35
+ - ensure downstream actions can consume required values deterministically
36
+ 5. Enforce numeric action I/O typing:
37
+ - when an action input/output is numeric and flows between actions (e.g. rewards points
38
+ feeding a merchandise action), use the publish-safe form: an object field with
39
+ `complex_data_type_name: lightning__numberType`, not a bare `number`, so numeric typing
40
+ survives publish across all orgs.
41
+ 6. Validate escalation mapping:
42
+ - ensure any escalation/transfer behavior (Einstein Bot `SystemMessage` `Transfer`, or any "hand off to a live agent/human") is implemented via the built-in `@utils.escalate` utility.
43
+ - confirm escalation is NOT modeled as a standalone/new action: there must be no `Transfer_To_Agent`-style action and no action-inventory entry (including `NEEDS_STUB`/`NEEDS_CREATION`) representing the transfer.
44
+ - if the escalation is present in bot and missing in spec, or was authored as an action instead of `@utils.escalate`, fix it: remove the erroneous action and invoke `@utils.escalate` in the appropriate escalation subagent (keeping any resolved transfer target as a variable/context, not an action signature).
45
+ 7. Preserve intended functionality and behavioral coverage.
46
+ 8. Write the optimized/enhanced content back to the same file path (in-place update).
47
+ 9. Validate the resulting file:
48
+ - remains readable and structurally coherent
49
+ - is a valid Agent Script
50
+ 10. If enhancements modified the Agent Script:
51
+ - when `mode=online`, deploy/publish the updated Agent Script to the org again using the provided `org_alias`
52
+ - do not activate as part of this step
53
+ - when `mode=offline`, skip deploy and keep the updated local file only
54
+
55
+ ## Output
56
+
57
+ - Enhanced Agent Script at the same input file location.
58
+
59
+ ## Capture Requirements
60
+
61
+ For each processed file, capture:
62
+
63
+ 1. `agentscript_file`
64
+ 2. status (`success` or `partial`)
65
+ 3. short enhancement summary
66
+ 4. `agentscript_modified` (`true|false`)
67
+ 5. redeploy status (online mode only): `deployed`, `skipped`, or `failed`
@@ -0,0 +1,33 @@
1
+ # Quality Checklist
2
+
3
+ Run this checklist before handing off to `/agentforce-generate`.
4
+
5
+ ## Completeness
6
+
7
+ - Input mode is explicitly recorded for the run (Mode A org-backed or Mode B offline).
8
+ - Agent Spec uses the exact section names/order from `assets/agent-spec-template.md` in `agentforce-generate`.
9
+ - Every major bot capability is represented in the Agent Spec.
10
+ - Every critical dialog/intent/action is either mapped or listed in `unmapped_items`.
11
+ - Fallback and escalation behavior is explicit.
12
+
13
+ ## Fidelity
14
+
15
+ - Action purpose and I/O are preserved from source metadata where available.
16
+ - For Mode B (offline), action signatures are inferred from bot metadata mappings and unresolved signature details are tracked in `open_questions` (non-blocking).
17
+ - Dialog-to-subagent and intent-to-subagent mappings are consistent.
18
+ - High-risk flows contain clear deterministic guidance.
19
+
20
+ ## Handoff Readiness
21
+
22
+ - Agent Spec markdown is coherent and structured for implementation.
23
+ - Handoff JSON is machine-readable and aligned with markdown.
24
+ - Open questions are specific, non-duplicative, and decision-ready.
25
+ - Open questions are resolved — one-by-one with the user in interactive mode, or auto-applied from recommended defaults when `--interactive=false` — and each resolution is reflected in both Agent Spec and `extraction-summary.json`.
26
+ - Migration appendix is present and includes confidence, gaps, and approval gates.
27
+
28
+ ## Failure Conditions (must fix before handoff)
29
+
30
+ - Missing action inventory for flows that clearly invoke actions
31
+ - Claimed parity while unresolved items are not documented
32
+ - Ambiguous routing with no fallback
33
+ - Unresolved or ambiguous open questions remain before automatic handoff to `/agentforce-generate`