@salesforce/afv-skills 1.37.0 → 1.38.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 (247) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-generate/README.md +20 -3
  3. package/skills/agentforce-generate/SKILL.md +253 -440
  4. package/skills/agentforce-generate/assets/agent-spec-template.md +6 -2
  5. package/skills/agentforce-generate/assets/agents/order-service.agent +16 -12
  6. package/skills/agentforce-generate/assets/agents/production-faq.agent +4 -4
  7. package/skills/agentforce-generate/assets/agents/router-first.agent +5 -5
  8. package/skills/agentforce-generate/assets/agents/template-single-subagent.agent +4 -4
  9. package/skills/agentforce-generate/assets/agents/verification-gate.agent +8 -6
  10. package/skills/agentforce-generate/assets/agents/voice-knowledge-grounded.agent +9 -9
  11. package/skills/agentforce-generate/assets/agents/voice-service-agent.agent +7 -7
  12. package/skills/agentforce-generate/assets/patterns/README.md +3 -3
  13. package/skills/agentforce-generate/assets/patterns/action-callbacks.agent +5 -5
  14. package/skills/agentforce-generate/assets/patterns/advanced-input-bindings.agent +6 -8
  15. package/skills/agentforce-generate/assets/patterns/bidirectional-routing.agent +11 -13
  16. package/skills/agentforce-generate/assets/patterns/critical-input-collection.agent +11 -16
  17. package/skills/agentforce-generate/assets/patterns/lifecycle-events.agent +2 -3
  18. package/skills/agentforce-generate/assets/patterns/llm-controlled-actions.agent +6 -7
  19. package/skills/agentforce-generate/assets/patterns/open-gate-routing.agent +3 -3
  20. package/skills/agentforce-generate/assets/patterns/prompt-template-action.agent +14 -19
  21. package/skills/agentforce-generate/assets/patterns/system-instruction-overrides.agent +11 -20
  22. package/skills/agentforce-generate/references/actions-reference.md +2 -2
  23. package/skills/agentforce-generate/references/agent-audit-and-repair.md +135 -0
  24. package/skills/agentforce-generate/references/agent-audit-candidate-verification.md +160 -0
  25. package/skills/agentforce-generate/references/agent-audit-diagnostic-catalog.md +156 -0
  26. package/skills/agentforce-generate/references/agent-audit-diagnostics-actions-state.md +176 -0
  27. package/skills/agentforce-generate/references/agent-audit-diagnostics-architecture-evaluation.md +68 -0
  28. package/skills/agentforce-generate/references/agent-audit-diagnostics-instructions-routing.md +283 -0
  29. package/skills/agentforce-generate/references/agent-audit-evaluation-loop.md +191 -0
  30. package/skills/agentforce-generate/references/agent-audit-repair-report.md +143 -0
  31. package/skills/agentforce-generate/references/agent-audit-scope-path-review.md +180 -0
  32. package/skills/agentforce-generate/references/agent-design-and-spec-creation.md +105 -59
  33. package/skills/agentforce-generate/references/agent-script-core-language.md +144 -61
  34. package/skills/agentforce-generate/references/agent-subagent-map-diagrams.md +33 -23
  35. package/skills/agentforce-generate/references/agent-validation-and-debugging.md +37 -11
  36. package/skills/agentforce-generate/references/agentscript-toolchain.md +112 -0
  37. package/skills/agentforce-generate/references/architecture-patterns.md +81 -18
  38. package/skills/agentforce-generate/references/common-control-flow-pitfalls.md +255 -0
  39. package/skills/agentforce-generate/references/control-flow-actions-sequencing.md +198 -0
  40. package/skills/agentforce-generate/references/control-flow-lifecycle-side-effects.md +87 -0
  41. package/skills/agentforce-generate/references/examples.md +22 -22
  42. package/skills/agentforce-generate/references/instruction-resolution.md +123 -83
  43. package/skills/agentforce-generate/references/known-issues.md +1 -2
  44. package/skills/agentforce-generate/references/optimization-pattern-1-data-flow.md +4 -0
  45. package/skills/agentforce-generate/references/optimization-pattern-2-deterministic-logic.md +33 -0
  46. package/skills/agentforce-generate/references/optimization-pattern-3-reference-syntax.md +32 -3
  47. package/skills/agentforce-generate/references/optimization-pattern-4-escalation.md +2 -2
  48. package/skills/agentforce-generate/references/patterns-by-requirement.md +3 -1
  49. package/skills/agentforce-generate/references/posture-and-determinism.md +103 -22
  50. package/skills/agentforce-generate/references/reference-map.md +19 -3
  51. package/skills/agentforce-generate/references/scoring-rubric.md +1 -1
  52. package/skills/agentforce-generate/references/voice-latency-heuristics.md +4 -0
  53. package/skills/agentforce-generate/references/voice-modality-reference.md +4 -4
  54. package/skills/agentforce-generate/references/zen-of-agentscript.md +139 -23
  55. package/skills/agentforce-generate/scripts/agentscript-sdk-loader.mjs +133 -0
  56. package/skills/agentforce-generate/scripts/index-agent.mjs +141 -0
  57. package/skills/agentforce-generate/scripts/setup-agentscript-sdk.mjs +337 -0
  58. package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +1 -1
  59. package/skills/automation-sandbox-post-copy-configure/SKILL.md +433 -0
  60. package/skills/automation-sandbox-post-copy-configure/assets/api_request_templates.json +89 -0
  61. package/skills/automation-sandbox-post-copy-configure/examples/sample_config_input.json +40 -0
  62. package/skills/automation-sandbox-post-copy-configure/examples/sample_execution_summary.md +79 -0
  63. package/skills/automation-sandbox-post-copy-configure/references/api_endpoints.md +273 -0
  64. package/skills/automation-sandbox-post-copy-configure/references/authentication.md +94 -0
  65. package/skills/automation-sandbox-post-copy-configure/references/execution_phasing.md +93 -0
  66. package/skills/automation-sandbox-post-copy-configure/references/rules_gotchas.md +35 -0
  67. package/skills/automation-sandbox-post-copy-configure/scripts/classify-patch-result.mjs +88 -0
  68. package/skills/automation-sandbox-post-copy-configure/scripts/map-metadata-key.mjs +98 -0
  69. package/skills/automation-sandbox-post-copy-configure/scripts/plan-phases.mjs +98 -0
  70. package/skills/automation-sandbox-post-copy-configure/scripts/resolve-target-org.mjs +56 -0
  71. package/skills/design-systems-slds-validate/SKILL.md +14 -13
  72. package/skills/dx-code-analyzer-custom-rule-create/examples/xpath-examples.md +1 -1
  73. package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-security.md +1 -1
  74. package/skills/dx-org-devhub-configure/SKILL.md +268 -0
  75. package/skills/dx-org-devhub-configure/examples/status-output.md +39 -0
  76. package/skills/dx-org-devhub-configure/scripts/devhub.sh +650 -0
  77. package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +116 -0
  78. package/skills/dx-org-manage/SKILL.md +135 -42
  79. package/skills/dx-org-manage/assets/derive-alias.sh +95 -0
  80. package/skills/dx-org-manage/assets/scratch-def.seed.json +6 -0
  81. package/skills/dx-org-manage/examples/README.md +1 -1
  82. package/skills/dx-org-manage/examples/scratch-orgs/delete_output.json +8 -0
  83. package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +23 -0
  84. package/skills/dx-org-manage/examples/scratch-orgs/list_output.json +58 -0
  85. package/skills/dx-org-manage/examples/scratch-orgs/resume_output.json +38 -0
  86. package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +1 -1
  87. package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +1 -1
  88. package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +41 -0
  89. package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +1 -1
  90. package/skills/dx-org-manage/examples/snapshots/error_output.json +3 -3
  91. package/skills/dx-org-manage/references/creating-scratch-org.md +2 -2
  92. package/skills/dx-org-manage/references/creating-snapshot.md +1 -2
  93. package/skills/dx-org-manage/references/definition_file_options.md +24 -0
  94. package/skills/dx-org-manage/references/edition_types.md +10 -8
  95. package/skills/dx-org-manage/references/opening-org.md +11 -12
  96. package/skills/dx-org-manage/references/scratch-org-create.md +303 -0
  97. package/skills/dx-org-manage/references/scratch-org-operations.md +135 -0
  98. package/skills/experience-aura-lwc-migrate/SKILL.md +120 -0
  99. package/skills/experience-aura-lwc-migrate/references/aura-api-expert.md +170 -0
  100. package/skills/experience-aura-lwc-migrate/references/aura-data-expert.md +172 -0
  101. package/skills/experience-aura-lwc-migrate/references/aura-migration-guidelines.md +299 -0
  102. package/skills/experience-aura-lwc-migrate/references/aura-prd-framework.md +79 -0
  103. package/skills/experience-aura-lwc-migrate/references/aura-redundant-code-expert.md +24 -0
  104. package/skills/experience-aura-lwc-migrate/references/aura-reference-expert.md +140 -0
  105. package/skills/experience-aura-lwc-migrate/references/aura-resolver-expert.md +115 -0
  106. package/skills/experience-aura-lwc-migrate/references/aura-slots-expert.md +67 -0
  107. package/skills/experience-aura-lwc-migrate/references/aura-style-expert.md +62 -0
  108. package/skills/experience-aura-lwc-migrate/references/aura-to-lwc-completeness-checklist.md +188 -0
  109. package/skills/experience-aura-lwc-migrate/references/aura-values-expert.md +67 -0
  110. package/skills/experience-content-media-search/SKILL.md +17 -12
  111. package/skills/experience-content-media-stock-image-search/SKILL.md +192 -0
  112. package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +102 -0
  113. package/skills/experience-lds-best-practices-apply/SKILL.md +245 -0
  114. package/skills/experience-lds-best-practices-apply/references/adapter-apis.md +1640 -0
  115. package/skills/experience-lds-best-practices-apply/references/lds-data-consistency.md +126 -0
  116. package/skills/experience-lds-best-practices-apply/references/lds-expert.md +429 -0
  117. package/skills/experience-lds-best-practices-apply/references/lds-referential-integrity.md +322 -0
  118. package/skills/experience-lds-best-practices-apply/references/wire-adapter-types.md +1511 -0
  119. package/skills/experience-lds-graphql-generate/SKILL.md +222 -0
  120. package/skills/experience-lds-graphql-generate/references/generation-guide.md +236 -0
  121. package/skills/experience-lds-graphql-generate/references/generation-mutation.md +277 -0
  122. package/skills/experience-lds-graphql-generate/references/generation-query.md +237 -0
  123. package/skills/experience-lds-graphql-generate/scripts/fetch-lds-graphql-schema.sh +230 -0
  124. package/skills/experience-lds-graphql-generate/scripts/test-lds-graphql-query.sh +128 -0
  125. package/skills/experience-lwc-accessibility-validate/SKILL.md +112 -0
  126. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-1-1-non-text-content.md +88 -0
  127. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-i-lists.md +52 -0
  128. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-ii-tables.md +106 -0
  129. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iii-form-labels.md +78 -0
  130. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iv-regions.md +26 -0
  131. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-v-groups.md +66 -0
  132. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-5-identify-input.md +70 -0
  133. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-4-3-contrast.md +115 -0
  134. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-1-1-keyboard.md +47 -0
  135. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-4-link-purpose.md +39 -0
  136. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-6-headings-labels.md +50 -0
  137. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-1-pointer-gestures.md +54 -0
  138. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-2-pointer-cancellation.md +49 -0
  139. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-3-label-in-name.md +77 -0
  140. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-7-dragging-movement.md +45 -0
  141. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-1-on-focus.md +55 -0
  142. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-2-on-input.md +51 -0
  143. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-1-error-identification.md +84 -0
  144. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-2-labels-instructions.md +50 -0
  145. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-3-error-suggestion.md +64 -0
  146. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-i-name.md +105 -0
  147. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-ii-role.md +99 -0
  148. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-iii-value.md +97 -0
  149. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-1-1-non-text-content.md +83 -0
  150. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-1-use-of-color.md +62 -0
  151. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-10-resize-reflow.md +18 -0
  152. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-11-non-text-contrast.md +43 -0
  153. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-3-contrast.md +25 -0
  154. package/skills/experience-lwc-accessibility-validate/scripts/contrast-ratio.py +153 -0
  155. package/skills/experience-lwc-design-generate/SKILL.md +261 -0
  156. package/skills/experience-lwc-design-generate/references/figma-to-prd-blueprint.md +66 -0
  157. package/skills/experience-lwc-design-generate/references/prd-analysis-template.md +17 -0
  158. package/skills/experience-lwc-design-generate/scripts/check-component-name.sh +75 -0
  159. package/skills/experience-lwc-design-generate/scripts/detect-project-tools.sh +97 -0
  160. package/skills/experience-lwc-runtime-observe/SKILL.md +244 -0
  161. package/skills/experience-lwc-runtime-observe/examples/component-preview-and-dom.md +41 -0
  162. package/skills/experience-lwc-runtime-observe/scripts/extract-dom.sh +79 -0
  163. package/skills/experience-lwc-runtime-observe/scripts/open-frontdoor.sh +46 -0
  164. package/skills/experience-lwc-runtime-observe/scripts/verify-toolchain.sh +48 -0
  165. package/skills/experience-lwc-security-validate/SKILL.md +151 -0
  166. package/skills/experience-lwc-security-validate/examples/review-report.md +6 -0
  167. package/skills/experience-lwc-security-validate/examples/score-report.sarif.json +32 -0
  168. package/skills/experience-lwc-security-validate/references/lws-security-expert.md +986 -0
  169. package/skills/experience-lwc-security-validate/references/security-analysis.md +611 -0
  170. package/skills/experience-lwc-security-validate/scripts/check-lwc-import.sh +166 -0
  171. package/skills/experience-lwc-security-validate/scripts/validate-sarif.sh +131 -0
  172. package/skills/experience-ui-bundle-2gp-deploy/SKILL.md +454 -0
  173. package/skills/experience-ui-bundle-2gp-deploy/assets/CustomApplication.app-meta.xml +12 -0
  174. package/skills/experience-ui-bundle-2gp-deploy/assets/PermissionSet.permissionset-meta.xml +9 -0
  175. package/skills/experience-ui-bundle-2gp-deploy/scripts/find-bundle-package-dir.sh +53 -0
  176. package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +104 -26
  177. package/skills/experience-ui-bundle-agentforce-client-generate/references/constraints.md +35 -24
  178. package/skills/experience-ui-bundle-agentforce-client-generate/references/examples.md +92 -1
  179. package/skills/experience-ui-bundle-agentforce-client-generate/references/style-tokens.md +2 -0
  180. package/skills/experience-ui-bundle-agentforce-client-generate/references/troubleshooting.md +14 -1
  181. package/skills/experience-ui-bundle-agentforce-client-generate/scripts/detect-framework.sh +67 -0
  182. package/skills/experience-ui-bundle-deploy/SKILL.md +83 -14
  183. package/skills/experience-ui-bundle-deploy/assets/Communities.settings-meta.xml +19 -0
  184. package/skills/experience-ui-bundle-deploy/assets/org-setup.config.template.json +5 -0
  185. package/skills/experience-ui-bundle-deploy/assets/social-login-auth-providers.apex +158 -0
  186. package/skills/experience-ui-bundle-deploy/references/config-scaffold.md +13 -1
  187. package/skills/experience-ui-bundle-deploy/references/social-login.md +179 -0
  188. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +14 -0
  189. package/skills/experience-ui-bundle-mfa-configure/SKILL.md +6 -5
  190. package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +15 -7
  191. package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +41 -5
  192. package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +10 -22
  193. package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +4 -19
  194. package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +5 -0
  195. package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +33 -150
  196. package/skills/mobile-platform-native-capabilities-integrate/references/nfc.md +35 -0
  197. package/skills/platform-apex-generate/SKILL.md +8 -7
  198. package/skills/platform-apex-test-generate/SKILL.md +3 -1
  199. package/skills/platform-apex-test-run/SKILL.md +9 -8
  200. package/skills/platform-lightning-type-widget-coordinate/SKILL.md +1 -1
  201. package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +1 -1
  202. package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +1 -1
  203. package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +3 -3
  204. package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +43 -67
  205. package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +1 -2
  206. package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +2 -3
  207. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-list-source-prompt.md +163 -0
  208. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-single-source-prompt.md +198 -0
  209. package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +0 -1
  210. package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +17 -11
  211. package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +48 -15
  212. package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +73 -10
  213. package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +48 -8
  214. package/skills/platform-policy-rule-generate/SKILL.md +22 -12
  215. package/skills/platform-policy-rule-generate/references/deploy-errors.md +1 -1
  216. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +8 -29
  217. package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
  218. package/skills/platform-sharing-owd-configure/SKILL.md +20 -8
  219. package/skills/platform-sharing-owd-configure/references/access_levels.md +14 -1
  220. package/skills/platform-sharing-rules-generate/SKILL.md +67 -35
  221. package/skills/platform-sharing-rules-generate/examples/create-cases.md +16 -17
  222. package/skills/platform-sharing-rules-generate/examples/delete-cases.md +34 -79
  223. package/skills/platform-sharing-rules-generate/examples/edit-cases.md +13 -26
  224. package/skills/platform-sharing-rules-generate/scripts/count-remaining-rules.sh +33 -0
  225. package/skills/platform-widget-generate/SKILL.md +3 -5
  226. package/skills/platform-widget-generate/examples/conditional.json +18 -13
  227. package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
  228. package/skills/platform-widget-generate/examples/single-object.json +2 -2
  229. package/skills/platform-widget-generate/references/schema-from-lightning-type.md +27 -6
  230. package/skills/platform-widget-generate/references/widget-bundle-layout.md +4 -3
  231. package/skills/service-itsm-agentic-setup-cmdb-access-assign/SKILL.md +287 -0
  232. package/skills/service-itsm-agentic-setup-cmdb-access-assign/references/mcp-invocation.md +260 -0
  233. package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/SKILL.md +252 -0
  234. package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/references/mcp-invocation.md +204 -0
  235. package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +259 -0
  236. package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +188 -0
  237. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +197 -0
  238. package/skills/service-itsm-agentic-setup-cmdb-coordinate/examples/output-templates.md +77 -0
  239. package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/SKILL.md +316 -0
  240. package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/references/mcp-invocation.md +221 -0
  241. package/skills/service-itsm-incident-priority-configure/SKILL.md +168 -0
  242. package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +200 -0
  243. package/skills/service-itsm-incident-priority-configure/examples/render-matrix.md +54 -0
  244. package/skills/service-itsm-incident-priority-configure/examples/seed-full-matrix.md +52 -0
  245. package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +264 -0
  246. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +0 -191
  247. package/skills/platform-policy-rule-generate/references/fixtures-index.md +0 -29
@@ -0,0 +1,112 @@
1
+ # AgentScript Compiler Setup and Provenance
2
+
3
+ For every authoring, repair, or audit task with an existing `.agent` file, run
4
+ the bundled compiler locally before target-org validation. This is the cheap,
5
+ repeatable first pass even when the customer has an authenticated org. The
6
+ customer should not need to clone this skills repository or modify their
7
+ project dependencies.
8
+
9
+ ## Provider order
10
+
11
+ Use the first working local provider and record it:
12
+
13
+ 1. an explicit `AGENTSCRIPT_SDK_ENTRY` override, when the user supplied one;
14
+ 2. the last successfully verified SDK in the skill-owned cache;
15
+ 3. an AgentScript SDK already installed in the customer project or skill host;
16
+ 4. the public npm package installed into the skill-owned cache;
17
+ 5. a fresh build from the public `salesforce/agentscript` source repository.
18
+
19
+ After the local pass, use target-org validation when an authenticated org is
20
+ available. The two checks are complementary: the local compiler provides fast
21
+ feedback, while the org establishes what that deployment target accepts. Use a
22
+ bounded static review only when no local compiler or org validation surface is
23
+ available.
24
+
25
+ An absent or unauthenticated org is not a reason to skip the local compiler.
26
+ Local compilation does not require org access. Do not report “no org” as the
27
+ cause of **compiler not used**; attempt the local providers below and report the
28
+ actual setup or loading failure if none works.
29
+
30
+ Compiler setup must not become an all-or-nothing gate. Try each applicable
31
+ install provider once. If installation fails, retain the error, continue with
32
+ the strongest remaining validation surface, and state **compiler not used**
33
+ with the cause rather than abandoning the authoring or audit result.
34
+
35
+ ## Install from npm
36
+
37
+ Resolve the installed `agentforce-generate` skill directory and run:
38
+
39
+ ```bash
40
+ node <skill-directory>/scripts/setup-agentscript-sdk.mjs --npm --json
41
+ ```
42
+
43
+ The setup script installs the pinned public
44
+ `@sf-agentscript/agentforce` package into the user cache, not the customer
45
+ project or global npm prefix. It then runs a compiler smoke test and records the
46
+ resolved package version and entry point.
47
+
48
+ If evidence indicates that the bundled npm pin is behind the currently
49
+ published package, retry once with an exact newer version or `latest` and retain
50
+ the resolved version:
51
+
52
+ ```bash
53
+ node <skill-directory>/scripts/setup-agentscript-sdk.mjs \
54
+ --npm --version latest --force --json
55
+ ```
56
+
57
+ Do not call a package current merely because `latest` resolved. Compare its
58
+ diagnostics with the syntax under review, the public source revision when
59
+ needed, and the deployment org before release.
60
+
61
+ ## Build from public source
62
+
63
+ Use the source fallback when the npm package is unavailable, cannot load, or
64
+ appears older than the syntax under review:
65
+
66
+ ```bash
67
+ node <skill-directory>/scripts/setup-agentscript-sdk.mjs \
68
+ --source --source-ref main --force --json
69
+ ```
70
+
71
+ This downloads `https://github.com/salesforce/agentscript.git` into the same
72
+ skill-owned cache, records the exact fetched commit, installs its pinned pnpm
73
+ dependencies, builds the Agentforce SDK and its dependencies, and runs the same
74
+ compiler smoke test. It requires Git, either pnpm or Corepack-provided pnpm, and
75
+ the operating-system build prerequisites required by the selected public
76
+ source revision. A missing native build prerequisite is an installation failure
77
+ to report and fall back from; it is not a reason to abandon the audit.
78
+
79
+ Use a tag or commit with `--source-ref` when reproducibility matters. A source
80
+ build can be newer than the deployment org; it is evidence about that source
81
+ revision, not proof that an org accepts the same syntax.
82
+
83
+ ## Use and report the compiler
84
+
85
+ Run the bundled indexer after setup:
86
+
87
+ ```bash
88
+ node <skill-directory>/scripts/index-agent.mjs <agent-file>
89
+ ```
90
+
91
+ The JSON result includes a `compiler` object. Always carry these fields into
92
+ the audit or authoring report:
93
+
94
+ - provider: ambient npm, cached npm, public source, or explicit entry;
95
+ - exact npm package and resolved version, when applicable;
96
+ - exact source commit, when applicable;
97
+ - compiler entry path;
98
+ - whether target-org validation also ran.
99
+
100
+ If the indexer was not run, say so. If it failed before loading a compiler,
101
+ report **compiler not used** and the reason. Never describe a prompt-only or
102
+ regex inspection as compiler validation.
103
+
104
+ ## Overrides and cache
105
+
106
+ - `AGENTSCRIPT_SDK_ENTRY` selects a specific built SDK entry file.
107
+ - `AGENTFORCE_GENERATE_CACHE` selects a different cache root.
108
+ - `XDG_CACHE_HOME` changes the standard cache root.
109
+
110
+ The default cache is `.cache/agentforce-generate` under the current user's home
111
+ directory. Setup writes only below the selected cache root and does not install
112
+ global packages.
@@ -14,7 +14,7 @@ independently required gate or post-action behavior.
14
14
  | Pattern | Use When |
15
15
  |---------|----------|
16
16
  | Single Scope | Default. One domain `start_agent` block, zero `subagent` blocks, and one compatible set of instructions, actions, authority, and escalation behavior |
17
- | Router-First Architecture | Multiple genuine domains require different objectives, instructions, actions, authority, or escalation behavior |
17
+ | Router-First Architecture | Multiple genuine domains require different objectives, instructions, actions, authority, or escalation behavior; use HyperClassifier when the router is transition-only and routing latency matters |
18
18
  | Verification Gate | Sensitive data, payments, or PII require identity verification first |
19
19
  | Post-Action Re-resolution | Trusted action output must drive a named follow-up instruction, gate, or action input |
20
20
 
@@ -41,10 +41,11 @@ A central `agent_router` routes to specialized subagents. Transition paths shoul
41
41
  ```agentscript
42
42
  start_agent agent_router:
43
43
  description: "Route user requests to the appropriate subagent"
44
+
45
+ model_config:
46
+ model: "model://sfdc_ai__DefaultEinsteinHyperClassifier"
47
+
44
48
  reasoning:
45
- instructions: |
46
- You are a router only. Do NOT answer questions directly.
47
- Always use a transition action to route immediately.
48
49
  actions:
49
50
  to_orders: @utils.transition to @subagent.order_support
50
51
  description: "Order questions"
@@ -67,11 +68,72 @@ subagent order_support:
67
68
 
68
69
  > **Routing lives in `start_agent`** -- put classification transitions in `start_agent agent_router:`. Do NOT create a separate routing-only subagent (e.g. `main_menu`, `central_hub`) -- that duplicates the router, adds an extra LLM hop (~3-5s latency), and confuses the platform. A transition back to router is optional and should only be added when the use case requires reclassification.
69
70
 
70
- > **`instructions: |` in a router is probabilistic.** The LLM may respond
71
- > conversationally instead of emitting a transition. This is appropriate for
72
- > unstructured current-intent classification. Use `instructions: ->` only when
73
- > a named deterministic cause, such as verified authorization, selects the
74
- > transition; do not encode ordinary dialogue stages as state.
71
+ ### Fast routing with Einstein HyperClassifier
72
+
73
+ Use HyperClassifier when the node has one job: select one transition from the
74
+ current request and conversation context. Adding this model configuration makes
75
+ the block a restricted router node rather than a general reasoning node:
76
+
77
+ ```agentscript
78
+ model_config:
79
+ model: "model://sfdc_ai__DefaultEinsteinHyperClassifier"
80
+ ```
81
+
82
+ It is a good fit when multiple genuine domains already justify a router and
83
+ classification latency matters. The router selects a destination; the target
84
+ subagent handles the request and produces the user-facing response.
85
+
86
+ The restrictions are part of the design:
87
+
88
+ - reasoning actions must be `@utils.transition`;
89
+ - `before_reasoning` and `after_reasoning` are not supported;
90
+ - it cannot classify from images;
91
+ - it cannot fill action inputs, run domain actions, set variables, escalate, or
92
+ delegate to a connected agent;
93
+ - it cannot ask a clarifying question directly. When ambiguity needs a
94
+ conversation, transition to a clarification or fallback subagent.
95
+
96
+ Use `available when` to remove routes based on trusted runtime state before
97
+ classification. Give every route a distinct description that states its
98
+ positive scope and important exclusions. Treat those descriptions as the
99
+ primary classification contract. Keep `reasoning.instructions` concise: state
100
+ the shared routing duty, such as selecting exactly one route without answering,
101
+ and put route-specific boundaries in the action descriptions. Add a fallback
102
+ route only when the agent has an intended fallback behavior.
103
+
104
+ An instruction-free router is structurally valid. It can preserve an optimized
105
+ one-step routing path in runtimes where router instructions compile into a
106
+ lifecycle hook, but use that form only when the action descriptions fully carry
107
+ the routing contract and preview traces confirm the intended optimization.
108
+ Instructions are not prohibited by HyperClassifier; this is a measured latency
109
+ tradeoff, not a language requirement.
110
+
111
+ When adding HyperClassifier to an existing compatible router, preserve its
112
+ instruction block unless changing that contract is separately required. An
113
+ `instructions: ->` block containing only `|` prompt text is valid; do not
114
+ normalize it to `instructions: |` as part of the model-config repair merely
115
+ because it has no runtime statements.
116
+
117
+ Keep an ordinary reasoning model when the entry node must answer, clarify,
118
+ collect information, manipulate state, invoke non-transition actions, inspect
119
+ images, or use lifecycle hooks. HyperClassifier is an optimization for a
120
+ compatible router, not a reason to create more subagents.
121
+
122
+ Validate structure, then validate routing behavior:
123
+
124
+ ```bash
125
+ sf agent validate authoring-bundle --json --api-name <BundleName> -o <OrgAlias>
126
+ sf agent preview start --json --use-live-actions --authoring-bundle <BundleName> -o <OrgAlias>
127
+ ```
128
+
129
+ Preview positive and negative examples for every route, ambiguous boundary
130
+ utterances, follow-up turns, unavailable-route states, and the intended
131
+ fallback. Inspect the selected transition in the trace; response text alone
132
+ does not prove routing.
133
+
134
+ Without HyperClassifier, transition actions on an ordinary reasoning node
135
+ remain model-selected and the node can respond instead. That flexibility is
136
+ useful when conversation at the entry node is intentional.
75
137
 
76
138
  ## Verification Gate
77
139
 
@@ -125,10 +187,11 @@ follow-up context.
125
187
 
126
188
  ## Post-Action Re-resolution
127
189
 
128
- The subagent re-resolves after an action completes. Persist action output only
129
- when a named later runtime consumer needs the exact value. Place the
130
- post-action check at the top of `instructions: ->` so it applies on
131
- re-resolution:
190
+ The subagent can re-resolve after an action completes. Persist action output
191
+ only when a named later runtime consumer needs the exact value. Make
192
+ post-action and first-entry duties mutually exclusive; placing the post-action
193
+ check first can make that ownership easier to review, but position alone does
194
+ not exclude another fragment:
132
195
 
133
196
  ```agentscript
134
197
  variables:
@@ -138,13 +201,13 @@ subagent retention_review:
138
201
  description: "Use a returned risk score to select retention guidance"
139
202
  reasoning:
140
203
  instructions: ->
141
- # POST-ACTION CHECK (at top on re-resolution)
204
+ # POST-ACTION CHECK (first for readability, exclusive by predicate)
142
205
  if @variables.risk_score >= 80:
143
- | The returned risk score is {!@variables.risk_score}.
144
- | Offer the approved retention options.
206
+ | Use the returned risk score {!@variables.risk_score}. Offer
207
+ the approved high-risk retention options.
145
208
  else if @variables.risk_score >= 0:
146
- | The returned risk score is {!@variables.risk_score}.
147
- | Follow the standard retention policy.
209
+ | Use the returned risk score {!@variables.risk_score}. Follow
210
+ the standard retention policy.
148
211
  else:
149
212
  | Explain that a risk assessment is needed before making an offer.
150
213
  actions:
@@ -0,0 +1,255 @@
1
+ # Common AgentScript Control-Flow Pitfalls
2
+
3
+ Use this checklist when authoring, reviewing, debugging, or optimizing an
4
+ AgentScript workflow. It focuses on mistakes that look reasonable in the source
5
+ but do not mean what their formatting suggests.
6
+
7
+ For an audit, use the contents below as a lookup after the initial artifact
8
+ scan. Read the sections that match a named observation; do not delay a ranked
9
+ finding or repair by reviewing every pitfall first.
10
+
11
+ ## Contents
12
+
13
+ - [The simple mental model](#the-simple-mental-model)
14
+ - [Variable visibility and condition ownership](#variable-visibility-and-condition-ownership)
15
+ - [Prompt text that looks like code](#prompt-text-that-looks-like-code)
16
+ - [Repeated prompt markers](#repeated-prompt-markers)
17
+ - [Step labels without runtime state](#step-labels-without-runtime-state)
18
+ - [Focused continuation references](#focused-continuation-references)
19
+ - [Review checklist](#review-checklist)
20
+
21
+ ## The simple mental model
22
+
23
+ AgentScript has three different execution surfaces:
24
+
25
+ 1. Deterministic constructs such as `if`, `run`, `set`, `transition to`, and
26
+ lifecycle hooks execute in the runtime.
27
+ 2. Text introduced by `|` becomes instructions for the model.
28
+ 3. Actions under `reasoning.actions` become tools the model may choose.
29
+
30
+ Do not rely on indentation, numbering, or imperative words inside prompt text
31
+ to behave like runtime control flow.
32
+
33
+ ## Variable visibility and condition ownership
34
+
35
+ ### Pitfall: the model is expected to read stored state
36
+
37
+ The runtime can evaluate and bind `@variables.X`. The model cannot inspect the
38
+ variable store directly. Inside `|` text, a bare variable reference contributes
39
+ only its literal name; it does not inject the stored value. The same value could
40
+ still be visible if it was separately interpolated or preserved in conversation
41
+ or tool history:
42
+
43
+ ```agentscript
44
+ # Model sees the characters "@variables.case_summary", not the summary value.
45
+ | Explain @variables.case_summary to the customer.
46
+
47
+ # Model receives the current value.
48
+ | Explain this case summary: {!@variables.case_summary}
49
+ ```
50
+
51
+ Do not add interpolation when the text merely names a parameter:
52
+
53
+ ```agentscript
54
+ | Set next_destination to "self_service".
55
+ ```
56
+
57
+ That instruction asks the model to supply a value; it does not ask the model to
58
+ read the current value.
59
+
60
+ ### Pitfall: interpolation is mistaken for deterministic control
61
+
62
+ ```agentscript
63
+ # BAD when this must be an exact branch
64
+ | If {!@variables.account_status} == "blocked":
65
+ do the blocked-account steps.
66
+ ```
67
+
68
+ The merge field reveals the value, but the model still performs the comparison
69
+ and decides whether to comply. If the runtime fact must always select the same
70
+ branch, use AgentScript control:
71
+
72
+ ```agentscript
73
+ if @variables.account_status == "blocked":
74
+ | Help the customer recover access to the blocked account.
75
+ ```
76
+
77
+ Keep situation-aware judgment with the model:
78
+
79
+ ```agentscript
80
+ | If the user wants to speak with a human, use
81
+ {!@actions.escalate_to_support}.
82
+ ```
83
+
84
+ Do not convert conditions mechanically. Ask whether the decision is an exact
85
+ trusted fact with a mandatory consequence or an interpretation of natural
86
+ language and context.
87
+
88
+ ## Prompt text that looks like code
89
+
90
+ ### Pitfall: indented prompt text appears scoped
91
+
92
+ ```agentscript
93
+ if @variables.lookup_failed == True:
94
+ | Failure path:
95
+ Call {!@actions.create_ticket}.
96
+ ```
97
+
98
+ The indentation after `|` formats model-visible prose. It does not place
99
+ `create_ticket` inside the deterministic `if`.
100
+
101
+ Fix:
102
+
103
+ - Use the `if` to select the prompt text.
104
+ - Use `available when` to select the action schema.
105
+
106
+ ```agentscript
107
+ reasoning:
108
+ instructions: ->
109
+ if @variables.lookup_failed == True:
110
+ | Explain that the lookup failed. If the customer asks to create a
111
+ ticket, use the ticket action.
112
+ actions:
113
+ create_ticket: @actions.create_ticket
114
+ available when @variables.lookup_failed == True
115
+ ```
116
+
117
+ ### Pitfall: prompt verbs are mistaken for commands
118
+
119
+ Inside a pipe block, these are ordinary words:
120
+
121
+ ```text
122
+ Show | Ask | Call | Set | Stop | Continue | Go to
123
+ ```
124
+
125
+ They may guide the model, but they do not:
126
+
127
+ - send a response deterministically;
128
+ - mutate a variable;
129
+ - execute an action;
130
+ - stop runtime resolution; or
131
+ - transition to another subagent.
132
+
133
+ Use runtime `set` and `transition to` for deterministic state-based behavior.
134
+ Expose an action when the model should judge whether to act.
135
+
136
+ ### Pitfall: stronger wording is used as enforcement
137
+
138
+ Repeating `MANDATORY`, `DO NOT SKIP`, or `IMMEDIATELY` does not create a runtime
139
+ guarantee. If ordering or eligibility matters, represent it with machine-known
140
+ state, action inputs, `available when`, deterministic action chaining, or one
141
+ purpose-built implementation that owns the sequence.
142
+
143
+ ## Repeated prompt markers
144
+
145
+ ### Pitfall: every sentence starts a new `|` fragment
146
+
147
+ Inside one contiguous prompt block, use one `|` marker and continue subsequent
148
+ lines beneath its content:
149
+
150
+ ```agentscript
151
+ reasoning:
152
+ instructions: ->
153
+ | Explain the available options.
154
+ Ask which option the user prefers.
155
+ Keep the answer concise.
156
+ ```
157
+
158
+ A same-scope run of `|`-prefixed sentences is valid syntax, but each marker
159
+ starts another prompt fragment. It does not create a stage, pause, priority, or
160
+ control boundary. Repeating the marker adds visual noise and can make the
161
+ resolved prompt harder to review.
162
+
163
+ Start another `|` after a runtime statement or branch when a new prompt
164
+ fragment is structurally required. Preserve existing structural indentation,
165
+ and compile after cleanup. Treat this as a Surface readability repair unless
166
+ prompt inspection or evaluation shows a behavioral consequence.
167
+
168
+ ## Step labels without runtime state
169
+
170
+ ### Pitfall: step numbers are treated as a workflow engine
171
+
172
+ ```agentscript
173
+ if @variables.ready == True:
174
+ | Step 4 — Submit the request.
175
+ ```
176
+
177
+ The model may see “Step 4” without Steps 1–3. AgentScript includes only the
178
+ prompt branches that resolve true during the current reasoning iteration.
179
+ Numbering does not prove that earlier work happened.
180
+
181
+ Fix:
182
+
183
+ - Remove step numbers when they are only explanatory labels.
184
+ - If earlier work is a real prerequisite, gate the later action on trusted
185
+ output from that work.
186
+
187
+ ```agentscript
188
+ submit: @actions.submit_request
189
+ available when @variables.validation_succeeded == True
190
+ ```
191
+
192
+ ### Pitfall: a prompt depends on missing context
193
+
194
+ Each resolved prompt fragment should make sense with the other fragments that
195
+ can accompany it in the same reachable state. Avoid instructions
196
+ such as “continue to the next step,” “use the result above,” or “as described
197
+ earlier” when the referenced fragment may not survive conditional resolution.
198
+
199
+ Name the actual objective and relevant state in the branch:
200
+
201
+ ```agentscript
202
+ if @variables.validation_succeeded == True:
203
+ | Validation succeeded. Submit the verified request.
204
+ ```
205
+
206
+ ### Pitfall: stored state is assumed to be model-visible
207
+
208
+ Storing an action output in `@variables` makes it available to runtime
209
+ conditions and later bindings. It does not automatically insert the value into
210
+ model-facing instructions. When the model must read a stored value, inject it
211
+ explicitly:
212
+
213
+ ```agentscript
214
+ if @variables.lookup_result != "":
215
+ | Use this lookup result: {!@variables.lookup_result}
216
+ ```
217
+
218
+ Prefer typed outputs and deterministic conditions when the value controls
219
+ authorization, eligibility, routing, or another consequential decision.
220
+
221
+ ## Focused continuation references
222
+
223
+ - [Action and Sequencing Pitfalls](control-flow-actions-sequencing.md) — action availability, same-turn sequences, state timing, stale results, missing producers, and overlapping conditions.
224
+ - [Lifecycle and Side-Effect Pitfalls](control-flow-lifecycle-side-effects.md) — per-turn resets, self-transitions, same-iteration assumptions, competing owners, and response text mistaken for proof.
225
+
226
+ ## Review checklist
227
+
228
+ For every reasoning branch:
229
+
230
+ - [ ] Does the resolved prompt make sense without hidden earlier “steps”?
231
+ - [ ] Is every stored value the model must read explicitly injected?
232
+ - [ ] Is every exact trusted comparison owned by runtime control when its
233
+ consequence must not vary?
234
+ - [ ] Are semantic intent and ambiguity left to model judgment?
235
+ - [ ] Does the branch have one next outcome?
236
+ - [ ] Are `Show`, `Ask`, `Call`, `Set`, and `STOP` being used only as prose?
237
+ - [ ] Are material actions gated independently of the prompt paragraph?
238
+ - [ ] Can any action remain available after success and repeat?
239
+ - [ ] Does prompt text request a tool call while later deterministic logic
240
+ assumes that call has already happened?
241
+ - [ ] Does the branch ask for and consume the same future answer?
242
+ - [ ] Are ordered tool calls enforced by the runtime when order matters?
243
+ - [ ] Is every completion flag backed by a complete, usable result?
244
+ - [ ] Is every condition value produced on every reachable path?
245
+ - [ ] Are typed outputs used for machine-controlled decisions?
246
+ - [ ] Are independent conditions intentionally cumulative or provably mutually
247
+ exclusive, and is first-match priority expressed with an
248
+ `if / else if / else` chain when it matters?
249
+ - [ ] Can lifecycle logic overwrite a legitimate later value?
250
+ - [ ] Does state encode durable evidence rather than duplicating history or
251
+ representing one phase with overlapping latches?
252
+ - [ ] Is the reasoning burden appropriate for the deployed target model?
253
+ - [ ] Does exactly one mechanism own each external side effect?
254
+ - [ ] Do tests inspect action availability and external results, not only final
255
+ model text?